aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-10-20 17:47:57 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-10-25 18:14:21 -0400
commit289fe5b1f99c5e61ed32796cbed0a1ecc3589041 (patch)
treeca2b01a48263c817ea9c190f7218c48e7c7eb9cb /drivers/scsi/aic7xxx
parent6d07cb71fdacc710fd9816cddb5c2df0f7bd96b4 (diff)
[SCSI] aic7xxx: cleanups
- make needlessly global code static - #if 0 the following unused global functions: - aic79xx_core.c: ahd_print_scb - aic79xx_core.c: ahd_suspend - aic79xx_core.c: ahd_resume - aic79xx_core.c: ahd_dump_scbs - aic79xx_osm.c: ahd_softc_comp Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic7xxx')
-rw-r--r--drivers/scsi/aic7xxx/aic79xx.h53
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_core.c260
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_inline.h30
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c2
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.h5
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm_pci.c2
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_pci.c7
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_proc.c2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx.h2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.h2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm_pci.c2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_pci.c4
13 files changed, 175 insertions, 198 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h
index c58ac6a87306..b19a07cb2ab2 100644
--- a/drivers/scsi/aic7xxx/aic79xx.h
+++ b/drivers/scsi/aic7xxx/aic79xx.h
@@ -964,8 +964,6 @@ int ahd_read_seeprom(struct ahd_softc *ahd, uint16_t *buf,
964 964
965int ahd_write_seeprom(struct ahd_softc *ahd, uint16_t *buf, 965int ahd_write_seeprom(struct ahd_softc *ahd, uint16_t *buf,
966 u_int start_addr, u_int count); 966 u_int start_addr, u_int count);
967int ahd_wait_seeprom(struct ahd_softc *ahd);
968int ahd_verify_vpd_cksum(struct vpd_config *vpd);
969int ahd_verify_cksum(struct seeprom_config *sc); 967int ahd_verify_cksum(struct seeprom_config *sc);
970int ahd_acquire_seeprom(struct ahd_softc *ahd); 968int ahd_acquire_seeprom(struct ahd_softc *ahd);
971void ahd_release_seeprom(struct ahd_softc *ahd); 969void ahd_release_seeprom(struct ahd_softc *ahd);
@@ -1312,8 +1310,6 @@ struct ahd_pci_identity {
1312 char *name; 1310 char *name;
1313 ahd_device_setup_t *setup; 1311 ahd_device_setup_t *setup;
1314}; 1312};
1315extern struct ahd_pci_identity ahd_pci_ident_table [];
1316extern const u_int ahd_num_pci_devs;
1317 1313
1318/***************************** VL/EISA Declarations ***************************/ 1314/***************************** VL/EISA Declarations ***************************/
1319struct aic7770_identity { 1315struct aic7770_identity {
@@ -1331,15 +1327,6 @@ extern const int ahd_num_aic7770_devs;
1331/*************************** Function Declarations ****************************/ 1327/*************************** Function Declarations ****************************/
1332/******************************************************************************/ 1328/******************************************************************************/
1333void ahd_reset_cmds_pending(struct ahd_softc *ahd); 1329void ahd_reset_cmds_pending(struct ahd_softc *ahd);
1334u_int ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl);
1335void ahd_busy_tcl(struct ahd_softc *ahd,
1336 u_int tcl, u_int busyid);
1337static __inline void ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl);
1338static __inline void
1339ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl)
1340{
1341 ahd_busy_tcl(ahd, tcl, SCB_LIST_NULL);
1342}
1343 1330
1344/***************************** PCI Front End *********************************/ 1331/***************************** PCI Front End *********************************/
1345struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t); 1332struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t);
@@ -1348,7 +1335,6 @@ int ahd_pci_config(struct ahd_softc *,
1348int ahd_pci_test_register_access(struct ahd_softc *); 1335int ahd_pci_test_register_access(struct ahd_softc *);
1349 1336
1350/************************** SCB and SCB queue management **********************/ 1337/************************** SCB and SCB queue management **********************/
1351int ahd_probe_scbs(struct ahd_softc *);
1352void ahd_qinfifo_requeue_tail(struct ahd_softc *ahd, 1338void ahd_qinfifo_requeue_tail(struct ahd_softc *ahd,
1353 struct scb *scb); 1339 struct scb *scb);
1354int ahd_match_scb(struct ahd_softc *ahd, struct scb *scb, 1340int ahd_match_scb(struct ahd_softc *ahd, struct scb *scb,
@@ -1366,33 +1352,20 @@ int ahd_parse_vpddata(struct ahd_softc *ahd,
1366int ahd_parse_cfgdata(struct ahd_softc *ahd, 1352int ahd_parse_cfgdata(struct ahd_softc *ahd,
1367 struct seeprom_config *sc); 1353 struct seeprom_config *sc);
1368void ahd_intr_enable(struct ahd_softc *ahd, int enable); 1354void ahd_intr_enable(struct ahd_softc *ahd, int enable);
1369void ahd_update_coalescing_values(struct ahd_softc *ahd,
1370 u_int timer,
1371 u_int maxcmds,
1372 u_int mincmds);
1373void ahd_enable_coalescing(struct ahd_softc *ahd,
1374 int enable);
1375void ahd_pause_and_flushwork(struct ahd_softc *ahd); 1355void ahd_pause_and_flushwork(struct ahd_softc *ahd);
1376int ahd_suspend(struct ahd_softc *ahd); 1356int ahd_suspend(struct ahd_softc *ahd);
1377int ahd_resume(struct ahd_softc *ahd);
1378void ahd_set_unit(struct ahd_softc *, int); 1357void ahd_set_unit(struct ahd_softc *, int);
1379void ahd_set_name(struct ahd_softc *, char *); 1358void ahd_set_name(struct ahd_softc *, char *);
1380struct scb *ahd_get_scb(struct ahd_softc *ahd, u_int col_idx); 1359struct scb *ahd_get_scb(struct ahd_softc *ahd, u_int col_idx);
1381void ahd_free_scb(struct ahd_softc *ahd, struct scb *scb); 1360void ahd_free_scb(struct ahd_softc *ahd, struct scb *scb);
1382void ahd_alloc_scbs(struct ahd_softc *ahd);
1383void ahd_free(struct ahd_softc *ahd); 1361void ahd_free(struct ahd_softc *ahd);
1384int ahd_reset(struct ahd_softc *ahd, int reinit); 1362int ahd_reset(struct ahd_softc *ahd, int reinit);
1385void ahd_shutdown(void *arg);
1386int ahd_write_flexport(struct ahd_softc *ahd, 1363int ahd_write_flexport(struct ahd_softc *ahd,
1387 u_int addr, u_int value); 1364 u_int addr, u_int value);
1388int ahd_read_flexport(struct ahd_softc *ahd, u_int addr, 1365int ahd_read_flexport(struct ahd_softc *ahd, u_int addr,
1389 uint8_t *value); 1366 uint8_t *value);
1390int ahd_wait_flexport(struct ahd_softc *ahd);
1391 1367
1392/*************************** Interrupt Services *******************************/ 1368/*************************** Interrupt Services *******************************/
1393void ahd_pci_intr(struct ahd_softc *ahd);
1394void ahd_clear_intstat(struct ahd_softc *ahd);
1395void ahd_flush_qoutfifo(struct ahd_softc *ahd);
1396void ahd_run_qoutfifo(struct ahd_softc *ahd); 1369void ahd_run_qoutfifo(struct ahd_softc *ahd);
1397#ifdef AHD_TARGET_MODE 1370#ifdef AHD_TARGET_MODE
1398void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused); 1371void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused);
@@ -1401,7 +1374,6 @@ void ahd_handle_hwerrint(struct ahd_softc *ahd);
1401void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat); 1374void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat);
1402void ahd_handle_scsiint(struct ahd_softc *ahd, 1375void ahd_handle_scsiint(struct ahd_softc *ahd,
1403 u_int intstat); 1376 u_int intstat);
1404void ahd_clear_critical_section(struct ahd_softc *ahd);
1405 1377
1406/***************************** Error Recovery *********************************/ 1378/***************************** Error Recovery *********************************/
1407typedef enum { 1379typedef enum {
@@ -1418,23 +1390,9 @@ int ahd_search_disc_list(struct ahd_softc *ahd, int target,
1418 char channel, int lun, u_int tag, 1390 char channel, int lun, u_int tag,
1419 int stop_on_first, int remove, 1391 int stop_on_first, int remove,
1420 int save_state); 1392 int save_state);
1421void ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb);
1422int ahd_reset_channel(struct ahd_softc *ahd, char channel, 1393int ahd_reset_channel(struct ahd_softc *ahd, char channel,
1423 int initiate_reset); 1394 int initiate_reset);
1424int ahd_abort_scbs(struct ahd_softc *ahd, int target,
1425 char channel, int lun, u_int tag,
1426 role_t role, uint32_t status);
1427void ahd_restart(struct ahd_softc *ahd);
1428void ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo);
1429void ahd_handle_scb_status(struct ahd_softc *ahd,
1430 struct scb *scb);
1431void ahd_handle_scsi_status(struct ahd_softc *ahd,
1432 struct scb *scb);
1433void ahd_calc_residual(struct ahd_softc *ahd,
1434 struct scb *scb);
1435/*************************** Utility Functions ********************************/ 1395/*************************** Utility Functions ********************************/
1436struct ahd_phase_table_entry*
1437 ahd_lookup_phase_entry(int phase);
1438void ahd_compile_devinfo(struct ahd_devinfo *devinfo, 1396void ahd_compile_devinfo(struct ahd_devinfo *devinfo,
1439 u_int our_id, u_int target, 1397 u_int our_id, u_int target,
1440 u_int lun, char channel, 1398 u_int lun, char channel,
@@ -1442,14 +1400,6 @@ void ahd_compile_devinfo(struct ahd_devinfo *devinfo,
1442/************************** Transfer Negotiation ******************************/ 1400/************************** Transfer Negotiation ******************************/
1443void ahd_find_syncrate(struct ahd_softc *ahd, u_int *period, 1401void ahd_find_syncrate(struct ahd_softc *ahd, u_int *period,
1444 u_int *ppr_options, u_int maxsync); 1402 u_int *ppr_options, u_int maxsync);
1445void ahd_validate_offset(struct ahd_softc *ahd,
1446 struct ahd_initiator_tinfo *tinfo,
1447 u_int period, u_int *offset,
1448 int wide, role_t role);
1449void ahd_validate_width(struct ahd_softc *ahd,
1450 struct ahd_initiator_tinfo *tinfo,
1451 u_int *bus_width,
1452 role_t role);
1453/* 1403/*
1454 * Negotiation types. These are used to qualify if we should renegotiate 1404 * Negotiation types. These are used to qualify if we should renegotiate
1455 * even if our goal and current transport parameters are identical. 1405 * even if our goal and current transport parameters are identical.
@@ -1520,10 +1470,8 @@ extern uint32_t ahd_debug;
1520#define AHD_SHOW_INT_COALESCING 0x10000 1470#define AHD_SHOW_INT_COALESCING 0x10000
1521#define AHD_DEBUG_SEQUENCER 0x20000 1471#define AHD_DEBUG_SEQUENCER 0x20000
1522#endif 1472#endif
1523void ahd_print_scb(struct scb *scb);
1524void ahd_print_devinfo(struct ahd_softc *ahd, 1473void ahd_print_devinfo(struct ahd_softc *ahd,
1525 struct ahd_devinfo *devinfo); 1474 struct ahd_devinfo *devinfo);
1526void ahd_dump_sglist(struct scb *scb);
1527void ahd_dump_card_state(struct ahd_softc *ahd); 1475void ahd_dump_card_state(struct ahd_softc *ahd);
1528int ahd_print_register(ahd_reg_parse_entry_t *table, 1476int ahd_print_register(ahd_reg_parse_entry_t *table,
1529 u_int num_entries, 1477 u_int num_entries,
@@ -1532,5 +1480,4 @@ int ahd_print_register(ahd_reg_parse_entry_t *table,
1532 u_int value, 1480 u_int value,
1533 u_int *cur_column, 1481 u_int *cur_column,
1534 u_int wrap_point); 1482 u_int wrap_point);
1535void ahd_dump_scbs(struct ahd_softc *ahd);
1536#endif /* _AIC79XX_H_ */ 1483#endif /* _AIC79XX_H_ */
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 6adcf7989ce7..7d53c6456d04 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -52,7 +52,7 @@
52 52
53 53
54/***************************** Lookup Tables **********************************/ 54/***************************** Lookup Tables **********************************/
55char *ahd_chip_names[] = 55static char *ahd_chip_names[] =
56{ 56{
57 "NONE", 57 "NONE",
58 "aic7901", 58 "aic7901",
@@ -237,10 +237,33 @@ static int ahd_handle_target_cmd(struct ahd_softc *ahd,
237 struct target_cmd *cmd); 237 struct target_cmd *cmd);
238#endif 238#endif
239 239
240static int ahd_abort_scbs(struct ahd_softc *ahd, int target,
241 char channel, int lun, u_int tag,
242 role_t role, uint32_t status);
243static void ahd_alloc_scbs(struct ahd_softc *ahd);
244static void ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl,
245 u_int scbid);
246static void ahd_calc_residual(struct ahd_softc *ahd,
247 struct scb *scb);
248static void ahd_clear_critical_section(struct ahd_softc *ahd);
249static void ahd_clear_intstat(struct ahd_softc *ahd);
250static void ahd_enable_coalescing(struct ahd_softc *ahd,
251 int enable);
252static u_int ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl);
253static void ahd_freeze_devq(struct ahd_softc *ahd,
254 struct scb *scb);
255static void ahd_handle_scb_status(struct ahd_softc *ahd,
256 struct scb *scb);
257static struct ahd_phase_table_entry* ahd_lookup_phase_entry(int phase);
258static void ahd_shutdown(void *arg);
259static void ahd_update_coalescing_values(struct ahd_softc *ahd,
260 u_int timer,
261 u_int maxcmds,
262 u_int mincmds);
263static int ahd_verify_vpd_cksum(struct vpd_config *vpd);
264static int ahd_wait_seeprom(struct ahd_softc *ahd);
265
240/******************************** Private Inlines *****************************/ 266/******************************** Private Inlines *****************************/
241static __inline void ahd_assert_atn(struct ahd_softc *ahd);
242static __inline int ahd_currently_packetized(struct ahd_softc *ahd);
243static __inline int ahd_set_active_fifo(struct ahd_softc *ahd);
244 267
245static __inline void 268static __inline void
246ahd_assert_atn(struct ahd_softc *ahd) 269ahd_assert_atn(struct ahd_softc *ahd)
@@ -294,11 +317,44 @@ ahd_set_active_fifo(struct ahd_softc *ahd)
294 } 317 }
295} 318}
296 319
320static __inline void
321ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl)
322{
323 ahd_busy_tcl(ahd, tcl, SCB_LIST_NULL);
324}
325
326/*
327 * Determine whether the sequencer reported a residual
328 * for this SCB/transaction.
329 */
330static __inline void
331ahd_update_residual(struct ahd_softc *ahd, struct scb *scb)
332{
333 uint32_t sgptr;
334
335 sgptr = ahd_le32toh(scb->hscb->sgptr);
336 if ((sgptr & SG_STATUS_VALID) != 0)
337 ahd_calc_residual(ahd, scb);
338}
339
340static __inline void
341ahd_complete_scb(struct ahd_softc *ahd, struct scb *scb)
342{
343 uint32_t sgptr;
344
345 sgptr = ahd_le32toh(scb->hscb->sgptr);
346 if ((sgptr & SG_STATUS_VALID) != 0)
347 ahd_handle_scb_status(ahd, scb);
348 else
349 ahd_done(ahd, scb);
350}
351
352
297/************************* Sequencer Execution Control ************************/ 353/************************* Sequencer Execution Control ************************/
298/* 354/*
299 * Restart the sequencer program from address zero 355 * Restart the sequencer program from address zero
300 */ 356 */
301void 357static void
302ahd_restart(struct ahd_softc *ahd) 358ahd_restart(struct ahd_softc *ahd)
303{ 359{
304 360
@@ -342,7 +398,7 @@ ahd_restart(struct ahd_softc *ahd)
342 ahd_unpause(ahd); 398 ahd_unpause(ahd);
343} 399}
344 400
345void 401static void
346ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo) 402ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo)
347{ 403{
348 ahd_mode_state saved_modes; 404 ahd_mode_state saved_modes;
@@ -366,7 +422,7 @@ ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo)
366 * Flush and completed commands that are sitting in the command 422 * Flush and completed commands that are sitting in the command
367 * complete queues down on the chip but have yet to be dma'ed back up. 423 * complete queues down on the chip but have yet to be dma'ed back up.
368 */ 424 */
369void 425static void
370ahd_flush_qoutfifo(struct ahd_softc *ahd) 426ahd_flush_qoutfifo(struct ahd_softc *ahd)
371{ 427{
372 struct scb *scb; 428 struct scb *scb;
@@ -905,6 +961,51 @@ ahd_handle_hwerrint(struct ahd_softc *ahd)
905 ahd_free(ahd); 961 ahd_free(ahd);
906} 962}
907 963
964#ifdef AHD_DEBUG
965static void
966ahd_dump_sglist(struct scb *scb)
967{
968 int i;
969
970 if (scb->sg_count > 0) {
971 if ((scb->ahd_softc->flags & AHD_64BIT_ADDRESSING) != 0) {
972 struct ahd_dma64_seg *sg_list;
973
974 sg_list = (struct ahd_dma64_seg*)scb->sg_list;
975 for (i = 0; i < scb->sg_count; i++) {
976 uint64_t addr;
977 uint32_t len;
978
979 addr = ahd_le64toh(sg_list[i].addr);
980 len = ahd_le32toh(sg_list[i].len);
981 printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
982 i,
983 (uint32_t)((addr >> 32) & 0xFFFFFFFF),
984 (uint32_t)(addr & 0xFFFFFFFF),
985 sg_list[i].len & AHD_SG_LEN_MASK,
986 (sg_list[i].len & AHD_DMA_LAST_SEG)
987 ? " Last" : "");
988 }
989 } else {
990 struct ahd_dma_seg *sg_list;
991
992 sg_list = (struct ahd_dma_seg*)scb->sg_list;
993 for (i = 0; i < scb->sg_count; i++) {
994 uint32_t len;
995
996 len = ahd_le32toh(sg_list[i].len);
997 printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
998 i,
999 (len & AHD_SG_HIGH_ADDR_MASK) >> 24,
1000 ahd_le32toh(sg_list[i].addr),
1001 len & AHD_SG_LEN_MASK,
1002 len & AHD_DMA_LAST_SEG ? " Last" : "");
1003 }
1004 }
1005 }
1006}
1007#endif /* AHD_DEBUG */
1008
908void 1009void
909ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) 1010ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
910{ 1011{
@@ -2523,7 +2624,7 @@ ahd_force_renegotiation(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
2523} 2624}
2524 2625
2525#define AHD_MAX_STEPS 2000 2626#define AHD_MAX_STEPS 2000
2526void 2627static void
2527ahd_clear_critical_section(struct ahd_softc *ahd) 2628ahd_clear_critical_section(struct ahd_softc *ahd)
2528{ 2629{
2529 ahd_mode_state saved_modes; 2630 ahd_mode_state saved_modes;
@@ -2646,7 +2747,7 @@ ahd_clear_critical_section(struct ahd_softc *ahd)
2646/* 2747/*
2647 * Clear any pending interrupt status. 2748 * Clear any pending interrupt status.
2648 */ 2749 */
2649void 2750static void
2650ahd_clear_intstat(struct ahd_softc *ahd) 2751ahd_clear_intstat(struct ahd_softc *ahd)
2651{ 2752{
2652 AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK), 2753 AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
@@ -2677,6 +2778,8 @@ ahd_clear_intstat(struct ahd_softc *ahd)
2677#ifdef AHD_DEBUG 2778#ifdef AHD_DEBUG
2678uint32_t ahd_debug = AHD_DEBUG_OPTS; 2779uint32_t ahd_debug = AHD_DEBUG_OPTS;
2679#endif 2780#endif
2781
2782#if 0
2680void 2783void
2681ahd_print_scb(struct scb *scb) 2784ahd_print_scb(struct scb *scb)
2682{ 2785{
@@ -2701,49 +2804,7 @@ ahd_print_scb(struct scb *scb)
2701 SCB_GET_TAG(scb)); 2804 SCB_GET_TAG(scb));
2702 ahd_dump_sglist(scb); 2805 ahd_dump_sglist(scb);
2703} 2806}
2704 2807#endif /* 0 */
2705void
2706ahd_dump_sglist(struct scb *scb)
2707{
2708 int i;
2709
2710 if (scb->sg_count > 0) {
2711 if ((scb->ahd_softc->flags & AHD_64BIT_ADDRESSING) != 0) {
2712 struct ahd_dma64_seg *sg_list;
2713
2714 sg_list = (struct ahd_dma64_seg*)scb->sg_list;
2715 for (i = 0; i < scb->sg_count; i++) {
2716 uint64_t addr;
2717 uint32_t len;
2718
2719 addr = ahd_le64toh(sg_list[i].addr);
2720 len = ahd_le32toh(sg_list[i].len);
2721 printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
2722 i,
2723 (uint32_t)((addr >> 32) & 0xFFFFFFFF),
2724 (uint32_t)(addr & 0xFFFFFFFF),
2725 sg_list[i].len & AHD_SG_LEN_MASK,
2726 (sg_list[i].len & AHD_DMA_LAST_SEG)
2727 ? " Last" : "");
2728 }
2729 } else {
2730 struct ahd_dma_seg *sg_list;
2731
2732 sg_list = (struct ahd_dma_seg*)scb->sg_list;
2733 for (i = 0; i < scb->sg_count; i++) {
2734 uint32_t len;
2735
2736 len = ahd_le32toh(sg_list[i].len);
2737 printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
2738 i,
2739 (len & AHD_SG_HIGH_ADDR_MASK) >> 24,
2740 ahd_le32toh(sg_list[i].addr),
2741 len & AHD_SG_LEN_MASK,
2742 len & AHD_DMA_LAST_SEG ? " Last" : "");
2743 }
2744 }
2745 }
2746}
2747 2808
2748/************************* Transfer Negotiation *******************************/ 2809/************************* Transfer Negotiation *******************************/
2749/* 2810/*
@@ -2906,7 +2967,7 @@ ahd_find_syncrate(struct ahd_softc *ahd, u_int *period,
2906 * Truncate the given synchronous offset to a value the 2967 * Truncate the given synchronous offset to a value the
2907 * current adapter type and syncrate are capable of. 2968 * current adapter type and syncrate are capable of.
2908 */ 2969 */
2909void 2970static void
2910ahd_validate_offset(struct ahd_softc *ahd, 2971ahd_validate_offset(struct ahd_softc *ahd,
2911 struct ahd_initiator_tinfo *tinfo, 2972 struct ahd_initiator_tinfo *tinfo,
2912 u_int period, u_int *offset, int wide, 2973 u_int period, u_int *offset, int wide,
@@ -2937,7 +2998,7 @@ ahd_validate_offset(struct ahd_softc *ahd,
2937 * Truncate the given transfer width parameter to a value the 2998 * Truncate the given transfer width parameter to a value the
2938 * current adapter type is capable of. 2999 * current adapter type is capable of.
2939 */ 3000 */
2940void 3001static void
2941ahd_validate_width(struct ahd_softc *ahd, struct ahd_initiator_tinfo *tinfo, 3002ahd_validate_width(struct ahd_softc *ahd, struct ahd_initiator_tinfo *tinfo,
2942 u_int *bus_width, role_t role) 3003 u_int *bus_width, role_t role)
2943{ 3004{
@@ -3466,7 +3527,7 @@ ahd_print_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
3466 devinfo->target, devinfo->lun); 3527 devinfo->target, devinfo->lun);
3467} 3528}
3468 3529
3469struct ahd_phase_table_entry* 3530static struct ahd_phase_table_entry*
3470ahd_lookup_phase_entry(int phase) 3531ahd_lookup_phase_entry(int phase)
3471{ 3532{
3472 struct ahd_phase_table_entry *entry; 3533 struct ahd_phase_table_entry *entry;
@@ -5351,7 +5412,7 @@ ahd_free(struct ahd_softc *ahd)
5351 return; 5412 return;
5352} 5413}
5353 5414
5354void 5415static void
5355ahd_shutdown(void *arg) 5416ahd_shutdown(void *arg)
5356{ 5417{
5357 struct ahd_softc *ahd; 5418 struct ahd_softc *ahd;
@@ -5480,7 +5541,7 @@ ahd_reset(struct ahd_softc *ahd, int reinit)
5480/* 5541/*
5481 * Determine the number of SCBs available on the controller 5542 * Determine the number of SCBs available on the controller
5482 */ 5543 */
5483int 5544static int
5484ahd_probe_scbs(struct ahd_softc *ahd) { 5545ahd_probe_scbs(struct ahd_softc *ahd) {
5485 int i; 5546 int i;
5486 5547
@@ -5929,7 +5990,7 @@ ahd_free_scb(struct ahd_softc *ahd, struct scb *scb)
5929 ahd_platform_scb_free(ahd, scb); 5990 ahd_platform_scb_free(ahd, scb);
5930} 5991}
5931 5992
5932void 5993static void
5933ahd_alloc_scbs(struct ahd_softc *ahd) 5994ahd_alloc_scbs(struct ahd_softc *ahd)
5934{ 5995{
5935 struct scb_data *scb_data; 5996 struct scb_data *scb_data;
@@ -6982,7 +7043,7 @@ ahd_intr_enable(struct ahd_softc *ahd, int enable)
6982 ahd_outb(ahd, HCNTRL, hcntrl); 7043 ahd_outb(ahd, HCNTRL, hcntrl);
6983} 7044}
6984 7045
6985void 7046static void
6986ahd_update_coalescing_values(struct ahd_softc *ahd, u_int timer, u_int maxcmds, 7047ahd_update_coalescing_values(struct ahd_softc *ahd, u_int timer, u_int maxcmds,
6987 u_int mincmds) 7048 u_int mincmds)
6988{ 7049{
@@ -7000,7 +7061,7 @@ ahd_update_coalescing_values(struct ahd_softc *ahd, u_int timer, u_int maxcmds,
7000 ahd_outb(ahd, INT_COALESCING_MINCMDS, -mincmds); 7061 ahd_outb(ahd, INT_COALESCING_MINCMDS, -mincmds);
7001} 7062}
7002 7063
7003void 7064static void
7004ahd_enable_coalescing(struct ahd_softc *ahd, int enable) 7065ahd_enable_coalescing(struct ahd_softc *ahd, int enable)
7005{ 7066{
7006 7067
@@ -7070,6 +7131,7 @@ ahd_pause_and_flushwork(struct ahd_softc *ahd)
7070 ahd->flags &= ~AHD_ALL_INTERRUPTS; 7131 ahd->flags &= ~AHD_ALL_INTERRUPTS;
7071} 7132}
7072 7133
7134#if 0
7073int 7135int
7074ahd_suspend(struct ahd_softc *ahd) 7136ahd_suspend(struct ahd_softc *ahd)
7075{ 7137{
@@ -7083,7 +7145,9 @@ ahd_suspend(struct ahd_softc *ahd)
7083 ahd_shutdown(ahd); 7145 ahd_shutdown(ahd);
7084 return (0); 7146 return (0);
7085} 7147}
7148#endif /* 0 */
7086 7149
7150#if 0
7087int 7151int
7088ahd_resume(struct ahd_softc *ahd) 7152ahd_resume(struct ahd_softc *ahd)
7089{ 7153{
@@ -7093,6 +7157,7 @@ ahd_resume(struct ahd_softc *ahd)
7093 ahd_restart(ahd); 7157 ahd_restart(ahd);
7094 return (0); 7158 return (0);
7095} 7159}
7160#endif /* 0 */
7096 7161
7097/************************** Busy Target Table *********************************/ 7162/************************** Busy Target Table *********************************/
7098/* 7163/*
@@ -7125,7 +7190,7 @@ ahd_index_busy_tcl(struct ahd_softc *ahd, u_int *saved_scbid, u_int tcl)
7125/* 7190/*
7126 * Return the untagged transaction id for a given target/channel lun. 7191 * Return the untagged transaction id for a given target/channel lun.
7127 */ 7192 */
7128u_int 7193static u_int
7129ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl) 7194ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl)
7130{ 7195{
7131 u_int scbid; 7196 u_int scbid;
@@ -7138,7 +7203,7 @@ ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl)
7138 return (scbid); 7203 return (scbid);
7139} 7204}
7140 7205
7141void 7206static void
7142ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl, u_int scbid) 7207ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl, u_int scbid)
7143{ 7208{
7144 u_int scb_offset; 7209 u_int scb_offset;
@@ -7186,7 +7251,7 @@ ahd_match_scb(struct ahd_softc *ahd, struct scb *scb, int target,
7186 return match; 7251 return match;
7187} 7252}
7188 7253
7189void 7254static void
7190ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb) 7255ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
7191{ 7256{
7192 int target; 7257 int target;
@@ -7690,7 +7755,7 @@ ahd_add_scb_to_free_list(struct ahd_softc *ahd, u_int scbid)
7690 * been modified from CAM_REQ_INPROG. This routine assumes that the sequencer 7755 * been modified from CAM_REQ_INPROG. This routine assumes that the sequencer
7691 * is paused before it is called. 7756 * is paused before it is called.
7692 */ 7757 */
7693int 7758static int
7694ahd_abort_scbs(struct ahd_softc *ahd, int target, char channel, 7759ahd_abort_scbs(struct ahd_softc *ahd, int target, char channel,
7695 int lun, u_int tag, role_t role, uint32_t status) 7760 int lun, u_int tag, role_t role, uint32_t status)
7696{ 7761{
@@ -8019,18 +8084,8 @@ ahd_stat_timer(void *arg)
8019} 8084}
8020 8085
8021/****************************** Status Processing *****************************/ 8086/****************************** Status Processing *****************************/
8022void
8023ahd_handle_scb_status(struct ahd_softc *ahd, struct scb *scb)
8024{
8025 if (scb->hscb->shared_data.istatus.scsi_status != 0) {
8026 ahd_handle_scsi_status(ahd, scb);
8027 } else {
8028 ahd_calc_residual(ahd, scb);
8029 ahd_done(ahd, scb);
8030 }
8031}
8032 8087
8033void 8088static void
8034ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) 8089ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
8035{ 8090{
8036 struct hardware_scb *hscb; 8091 struct hardware_scb *hscb;
@@ -8238,10 +8293,21 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
8238 } 8293 }
8239} 8294}
8240 8295
8296static void
8297ahd_handle_scb_status(struct ahd_softc *ahd, struct scb *scb)
8298{
8299 if (scb->hscb->shared_data.istatus.scsi_status != 0) {
8300 ahd_handle_scsi_status(ahd, scb);
8301 } else {
8302 ahd_calc_residual(ahd, scb);
8303 ahd_done(ahd, scb);
8304 }
8305}
8306
8241/* 8307/*
8242 * Calculate the residual for a just completed SCB. 8308 * Calculate the residual for a just completed SCB.
8243 */ 8309 */
8244void 8310static void
8245ahd_calc_residual(struct ahd_softc *ahd, struct scb *scb) 8311ahd_calc_residual(struct ahd_softc *ahd, struct scb *scb)
8246{ 8312{
8247 struct hardware_scb *hscb; 8313 struct hardware_scb *hscb;
@@ -9092,6 +9158,7 @@ ahd_dump_card_state(struct ahd_softc *ahd)
9092 ahd_unpause(ahd); 9158 ahd_unpause(ahd);
9093} 9159}
9094 9160
9161#if 0
9095void 9162void
9096ahd_dump_scbs(struct ahd_softc *ahd) 9163ahd_dump_scbs(struct ahd_softc *ahd)
9097{ 9164{
@@ -9117,6 +9184,7 @@ ahd_dump_scbs(struct ahd_softc *ahd)
9117 ahd_set_scbptr(ahd, saved_scb_index); 9184 ahd_set_scbptr(ahd, saved_scb_index);
9118 ahd_restore_modes(ahd, saved_modes); 9185 ahd_restore_modes(ahd, saved_modes);
9119} 9186}
9187#endif /* 0 */
9120 9188
9121/**************************** Flexport Logic **********************************/ 9189/**************************** Flexport Logic **********************************/
9122/* 9190/*
@@ -9219,7 +9287,7 @@ ahd_write_seeprom(struct ahd_softc *ahd, uint16_t *buf,
9219/* 9287/*
9220 * Wait ~100us for the serial eeprom to satisfy our request. 9288 * Wait ~100us for the serial eeprom to satisfy our request.
9221 */ 9289 */
9222int 9290static int
9223ahd_wait_seeprom(struct ahd_softc *ahd) 9291ahd_wait_seeprom(struct ahd_softc *ahd)
9224{ 9292{
9225 int cnt; 9293 int cnt;
@@ -9237,7 +9305,7 @@ ahd_wait_seeprom(struct ahd_softc *ahd)
9237 * Validate the two checksums in the per_channel 9305 * Validate the two checksums in the per_channel
9238 * vital product data struct. 9306 * vital product data struct.
9239 */ 9307 */
9240int 9308static int
9241ahd_verify_vpd_cksum(struct vpd_config *vpd) 9309ahd_verify_vpd_cksum(struct vpd_config *vpd)
9242{ 9310{
9243 int i; 9311 int i;
@@ -9316,6 +9384,24 @@ ahd_release_seeprom(struct ahd_softc *ahd)
9316 /* Currently a no-op */ 9384 /* Currently a no-op */
9317} 9385}
9318 9386
9387/*
9388 * Wait at most 2 seconds for flexport arbitration to succeed.
9389 */
9390static int
9391ahd_wait_flexport(struct ahd_softc *ahd)
9392{
9393 int cnt;
9394
9395 AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
9396 cnt = 1000000 * 2 / 5;
9397 while ((ahd_inb(ahd, BRDCTL) & FLXARBACK) == 0 && --cnt)
9398 ahd_delay(5);
9399
9400 if (cnt == 0)
9401 return (ETIMEDOUT);
9402 return (0);
9403}
9404
9319int 9405int
9320ahd_write_flexport(struct ahd_softc *ahd, u_int addr, u_int value) 9406ahd_write_flexport(struct ahd_softc *ahd, u_int addr, u_int value)
9321{ 9407{
@@ -9357,24 +9443,6 @@ ahd_read_flexport(struct ahd_softc *ahd, u_int addr, uint8_t *value)
9357 return (0); 9443 return (0);
9358} 9444}
9359 9445
9360/*
9361 * Wait at most 2 seconds for flexport arbitration to succeed.
9362 */
9363int
9364ahd_wait_flexport(struct ahd_softc *ahd)
9365{
9366 int cnt;
9367
9368 AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
9369 cnt = 1000000 * 2 / 5;
9370 while ((ahd_inb(ahd, BRDCTL) & FLXARBACK) == 0 && --cnt)
9371 ahd_delay(5);
9372
9373 if (cnt == 0)
9374 return (ETIMEDOUT);
9375 return (0);
9376}
9377
9378/************************* Target Mode ****************************************/ 9446/************************* Target Mode ****************************************/
9379#ifdef AHD_TARGET_MODE 9447#ifdef AHD_TARGET_MODE
9380cam_status 9448cam_status
diff --git a/drivers/scsi/aic7xxx/aic79xx_inline.h b/drivers/scsi/aic7xxx/aic79xx_inline.h
index a3266e066c00..2ceb67f4af2a 100644
--- a/drivers/scsi/aic7xxx/aic79xx_inline.h
+++ b/drivers/scsi/aic7xxx/aic79xx_inline.h
@@ -418,10 +418,6 @@ ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index)
418} 418}
419 419
420/*********************** Miscelaneous Support Functions ***********************/ 420/*********************** Miscelaneous Support Functions ***********************/
421static __inline void ahd_complete_scb(struct ahd_softc *ahd,
422 struct scb *scb);
423static __inline void ahd_update_residual(struct ahd_softc *ahd,
424 struct scb *scb);
425static __inline struct ahd_initiator_tinfo * 421static __inline struct ahd_initiator_tinfo *
426 ahd_fetch_transinfo(struct ahd_softc *ahd, 422 ahd_fetch_transinfo(struct ahd_softc *ahd,
427 char channel, u_int our_id, 423 char channel, u_int our_id,
@@ -467,32 +463,6 @@ static __inline uint32_t
467 ahd_get_sense_bufaddr(struct ahd_softc *ahd, 463 ahd_get_sense_bufaddr(struct ahd_softc *ahd,
468 struct scb *scb); 464 struct scb *scb);
469 465
470static __inline void
471ahd_complete_scb(struct ahd_softc *ahd, struct scb *scb)
472{
473 uint32_t sgptr;
474
475 sgptr = ahd_le32toh(scb->hscb->sgptr);
476 if ((sgptr & SG_STATUS_VALID) != 0)
477 ahd_handle_scb_status(ahd, scb);
478 else
479 ahd_done(ahd, scb);
480}
481
482/*
483 * Determine whether the sequencer reported a residual
484 * for this SCB/transaction.
485 */
486static __inline void
487ahd_update_residual(struct ahd_softc *ahd, struct scb *scb)
488{
489 uint32_t sgptr;
490
491 sgptr = ahd_le32toh(scb->hscb->sgptr);
492 if ((sgptr & SG_STATUS_VALID) != 0)
493 ahd_calc_residual(ahd, scb);
494}
495
496/* 466/*
497 * Return pointers to the transfer negotiation information 467 * Return pointers to the transfer negotiation information
498 * for the specified our_id/remote_id pair. 468 * for the specified our_id/remote_id pair.
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 77ef4d9b0e5f..5e13046d845b 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -293,7 +293,7 @@ static uint32_t aic79xx_seltime;
293 * force all outstanding transactions to be serviced prior to a new 293 * force all outstanding transactions to be serviced prior to a new
294 * transaction. 294 * transaction.
295 */ 295 */
296uint32_t aic79xx_periodic_otag; 296static uint32_t aic79xx_periodic_otag;
297 297
298/* Some storage boxes are using an LSI chip which has a bug making it 298/* Some storage boxes are using an LSI chip which has a bug making it
299 * impossible to use aic79xx Rev B chip in 320 speeds. The following 299 * impossible to use aic79xx Rev B chip in 320 speeds. The following
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index fb3d4dd54413..3a67fc578d78 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -506,9 +506,6 @@ struct info_str {
506 int pos; 506 int pos;
507}; 507};
508 508
509void ahd_format_transinfo(struct info_str *info,
510 struct ahd_transinfo *tinfo);
511
512/******************************** Locking *************************************/ 509/******************************** Locking *************************************/
513static __inline void 510static __inline void
514ahd_lockinit(struct ahd_softc *ahd) 511ahd_lockinit(struct ahd_softc *ahd)
@@ -582,8 +579,6 @@ ahd_unlock(struct ahd_softc *ahd, unsigned long *flags)
582#define PCIXM_STATUS_MAXCRDS 0x1C00 /* Maximum Cumulative Read Size */ 579#define PCIXM_STATUS_MAXCRDS 0x1C00 /* Maximum Cumulative Read Size */
583#define PCIXM_STATUS_RCVDSCEM 0x2000 /* Received a Split Comp w/Error msg */ 580#define PCIXM_STATUS_RCVDSCEM 0x2000 /* Received a Split Comp w/Error msg */
584 581
585extern struct pci_driver aic79xx_pci_driver;
586
587typedef enum 582typedef enum
588{ 583{
589 AHD_POWER_STATE_D0, 584 AHD_POWER_STATE_D0,
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
index 4b5354201807..2001fe890e71 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
@@ -82,7 +82,7 @@ static struct pci_device_id ahd_linux_pci_id_table[] = {
82 82
83MODULE_DEVICE_TABLE(pci, ahd_linux_pci_id_table); 83MODULE_DEVICE_TABLE(pci, ahd_linux_pci_id_table);
84 84
85struct pci_driver aic79xx_pci_driver = { 85static struct pci_driver aic79xx_pci_driver = {
86 .name = "aic79xx", 86 .name = "aic79xx",
87 .probe = ahd_linux_pci_dev_probe, 87 .probe = ahd_linux_pci_dev_probe,
88 .remove = ahd_linux_pci_dev_remove, 88 .remove = ahd_linux_pci_dev_remove,
diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c
index 14850f31aafa..c07735819cd1 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;
97static ahd_device_setup_t ahd_aic7902_setup; 97static ahd_device_setup_t ahd_aic7902_setup;
98static ahd_device_setup_t ahd_aic790X_setup; 98static ahd_device_setup_t ahd_aic790X_setup;
99 99
100struct ahd_pci_identity ahd_pci_ident_table [] = 100static struct ahd_pci_identity ahd_pci_ident_table [] =
101{ 101{
102 /* aic7901 based controllers */ 102 /* aic7901 based controllers */
103 { 103 {
@@ -201,7 +201,7 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
201 } 201 }
202}; 202};
203 203
204const u_int ahd_num_pci_devs = ARRAY_SIZE(ahd_pci_ident_table); 204static const u_int ahd_num_pci_devs = ARRAY_SIZE(ahd_pci_ident_table);
205 205
206#define DEVCONFIG 0x40 206#define DEVCONFIG 0x40
207#define PCIXINITPAT 0x0000E000ul 207#define PCIXINITPAT 0x0000E000ul
@@ -245,6 +245,7 @@ static int ahd_check_extport(struct ahd_softc *ahd);
245static void ahd_configure_termination(struct ahd_softc *ahd, 245static void ahd_configure_termination(struct ahd_softc *ahd,
246 u_int adapter_control); 246 u_int adapter_control);
247static void ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat); 247static void ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat);
248static void ahd_pci_intr(struct ahd_softc *ahd);
248 249
249struct ahd_pci_identity * 250struct ahd_pci_identity *
250ahd_find_pci_device(ahd_dev_softc_t pci) 251ahd_find_pci_device(ahd_dev_softc_t pci)
@@ -757,7 +758,7 @@ static const char *pci_status_strings[] =
757 "%s: Address or Write Phase Parity Error Detected in %s.\n" 758 "%s: Address or Write Phase Parity Error Detected in %s.\n"
758}; 759};
759 760
760void 761static void
761ahd_pci_intr(struct ahd_softc *ahd) 762ahd_pci_intr(struct ahd_softc *ahd)
762{ 763{
763 uint8_t pci_status[8]; 764 uint8_t pci_status[8];
diff --git a/drivers/scsi/aic7xxx/aic79xx_proc.c b/drivers/scsi/aic7xxx/aic79xx_proc.c
index c5f0ee591509..6b28bebcbca0 100644
--- a/drivers/scsi/aic7xxx/aic79xx_proc.c
+++ b/drivers/scsi/aic7xxx/aic79xx_proc.c
@@ -136,7 +136,7 @@ copy_info(struct info_str *info, char *fmt, ...)
136 return (len); 136 return (len);
137} 137}
138 138
139void 139static void
140ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo) 140ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo)
141{ 141{
142 u_int speed; 142 u_int speed;
diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h
index 4850820816e0..5802f33324ce 100644
--- a/drivers/scsi/aic7xxx/aic7xxx.h
+++ b/drivers/scsi/aic7xxx/aic7xxx.h
@@ -1127,8 +1127,6 @@ struct ahc_pci_identity {
1127 char *name; 1127 char *name;
1128 ahc_device_setup_t *setup; 1128 ahc_device_setup_t *setup;
1129}; 1129};
1130extern struct ahc_pci_identity ahc_pci_ident_table[];
1131extern const u_int ahc_num_pci_devs;
1132 1130
1133/***************************** VL/EISA Declarations ***************************/ 1131/***************************** VL/EISA Declarations ***************************/
1134struct aic7770_identity { 1132struct aic7770_identity {
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 8eb1211a7888..ed85057152d5 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -328,7 +328,7 @@ static uint32_t aic7xxx_seltime;
328 * force all outstanding transactions to be serviced prior to a new 328 * force all outstanding transactions to be serviced prior to a new
329 * transaction. 329 * transaction.
330 */ 330 */
331uint32_t aic7xxx_periodic_otag; 331static uint32_t aic7xxx_periodic_otag;
332 332
333/* 333/*
334 * Module information and settable options. 334 * Module information and settable options.
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index a87a4ce090df..a36b33868e0e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -533,8 +533,6 @@ ahc_unlock(struct ahc_softc *ahc, unsigned long *flags)
533#define PCIR_SUBVEND_0 0x2c 533#define PCIR_SUBVEND_0 0x2c
534#define PCIR_SUBDEV_0 0x2e 534#define PCIR_SUBDEV_0 0x2e
535 535
536extern struct pci_driver aic7xxx_pci_driver;
537
538typedef enum 536typedef enum
539{ 537{
540 AHC_POWER_STATE_D0, 538 AHC_POWER_STATE_D0,
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index d20ca514e9f3..ea5687df732d 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -130,7 +130,7 @@ static struct pci_device_id ahc_linux_pci_id_table[] = {
130 130
131MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table); 131MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table);
132 132
133struct pci_driver aic7xxx_pci_driver = { 133static struct pci_driver aic7xxx_pci_driver = {
134 .name = "aic7xxx", 134 .name = "aic7xxx",
135 .probe = ahc_linux_pci_dev_probe, 135 .probe = ahc_linux_pci_dev_probe,
136 .remove = ahc_linux_pci_dev_remove, 136 .remove = ahc_linux_pci_dev_remove,
diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c
index 63cab2d74552..09c8172c9e5e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c
@@ -168,7 +168,7 @@ static ahc_device_setup_t ahc_aha394XX_setup;
168static ahc_device_setup_t ahc_aha494XX_setup; 168static ahc_device_setup_t ahc_aha494XX_setup;
169static ahc_device_setup_t ahc_aha398XX_setup; 169static ahc_device_setup_t ahc_aha398XX_setup;
170 170
171struct ahc_pci_identity ahc_pci_ident_table [] = 171static struct ahc_pci_identity ahc_pci_ident_table [] =
172{ 172{
173 /* aic7850 based controllers */ 173 /* aic7850 based controllers */
174 { 174 {
@@ -559,7 +559,7 @@ struct ahc_pci_identity ahc_pci_ident_table [] =
559 } 559 }
560}; 560};
561 561
562const u_int ahc_num_pci_devs = ARRAY_SIZE(ahc_pci_ident_table); 562static const u_int ahc_num_pci_devs = ARRAY_SIZE(ahc_pci_ident_table);
563 563
564#define AHC_394X_SLOT_CHANNEL_A 4 564#define AHC_394X_SLOT_CHANNEL_A 4
565#define AHC_394X_SLOT_CHANNEL_B 5 565#define AHC_394X_SLOT_CHANNEL_B 5