diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx.h | 53 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_core.c | 260 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_inline.h | 30 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.h | 5 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm_pci.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_pci.c | 7 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_proc.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx.h | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.h | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_pci.c | 4 |
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 | ||
965 | int ahd_write_seeprom(struct ahd_softc *ahd, uint16_t *buf, | 965 | int 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); |
967 | int ahd_wait_seeprom(struct ahd_softc *ahd); | ||
968 | int ahd_verify_vpd_cksum(struct vpd_config *vpd); | ||
969 | int ahd_verify_cksum(struct seeprom_config *sc); | 967 | int ahd_verify_cksum(struct seeprom_config *sc); |
970 | int ahd_acquire_seeprom(struct ahd_softc *ahd); | 968 | int ahd_acquire_seeprom(struct ahd_softc *ahd); |
971 | void ahd_release_seeprom(struct ahd_softc *ahd); | 969 | void 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 | }; |
1315 | extern struct ahd_pci_identity ahd_pci_ident_table []; | ||
1316 | extern const u_int ahd_num_pci_devs; | ||
1317 | 1313 | ||
1318 | /***************************** VL/EISA Declarations ***************************/ | 1314 | /***************************** VL/EISA Declarations ***************************/ |
1319 | struct aic7770_identity { | 1315 | struct aic7770_identity { |
@@ -1331,15 +1327,6 @@ extern const int ahd_num_aic7770_devs; | |||
1331 | /*************************** Function Declarations ****************************/ | 1327 | /*************************** Function Declarations ****************************/ |
1332 | /******************************************************************************/ | 1328 | /******************************************************************************/ |
1333 | void ahd_reset_cmds_pending(struct ahd_softc *ahd); | 1329 | void ahd_reset_cmds_pending(struct ahd_softc *ahd); |
1334 | u_int ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl); | ||
1335 | void ahd_busy_tcl(struct ahd_softc *ahd, | ||
1336 | u_int tcl, u_int busyid); | ||
1337 | static __inline void ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl); | ||
1338 | static __inline void | ||
1339 | ahd_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 *********************************/ |
1345 | struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t); | 1332 | struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t); |
@@ -1348,7 +1335,6 @@ int ahd_pci_config(struct ahd_softc *, | |||
1348 | int ahd_pci_test_register_access(struct ahd_softc *); | 1335 | int ahd_pci_test_register_access(struct ahd_softc *); |
1349 | 1336 | ||
1350 | /************************** SCB and SCB queue management **********************/ | 1337 | /************************** SCB and SCB queue management **********************/ |
1351 | int ahd_probe_scbs(struct ahd_softc *); | ||
1352 | void ahd_qinfifo_requeue_tail(struct ahd_softc *ahd, | 1338 | void ahd_qinfifo_requeue_tail(struct ahd_softc *ahd, |
1353 | struct scb *scb); | 1339 | struct scb *scb); |
1354 | int ahd_match_scb(struct ahd_softc *ahd, struct scb *scb, | 1340 | int ahd_match_scb(struct ahd_softc *ahd, struct scb *scb, |
@@ -1366,33 +1352,20 @@ int ahd_parse_vpddata(struct ahd_softc *ahd, | |||
1366 | int ahd_parse_cfgdata(struct ahd_softc *ahd, | 1352 | int ahd_parse_cfgdata(struct ahd_softc *ahd, |
1367 | struct seeprom_config *sc); | 1353 | struct seeprom_config *sc); |
1368 | void ahd_intr_enable(struct ahd_softc *ahd, int enable); | 1354 | void ahd_intr_enable(struct ahd_softc *ahd, int enable); |
1369 | void ahd_update_coalescing_values(struct ahd_softc *ahd, | ||
1370 | u_int timer, | ||
1371 | u_int maxcmds, | ||
1372 | u_int mincmds); | ||
1373 | void ahd_enable_coalescing(struct ahd_softc *ahd, | ||
1374 | int enable); | ||
1375 | void ahd_pause_and_flushwork(struct ahd_softc *ahd); | 1355 | void ahd_pause_and_flushwork(struct ahd_softc *ahd); |
1376 | int ahd_suspend(struct ahd_softc *ahd); | 1356 | int ahd_suspend(struct ahd_softc *ahd); |
1377 | int ahd_resume(struct ahd_softc *ahd); | ||
1378 | void ahd_set_unit(struct ahd_softc *, int); | 1357 | void ahd_set_unit(struct ahd_softc *, int); |
1379 | void ahd_set_name(struct ahd_softc *, char *); | 1358 | void ahd_set_name(struct ahd_softc *, char *); |
1380 | struct scb *ahd_get_scb(struct ahd_softc *ahd, u_int col_idx); | 1359 | struct scb *ahd_get_scb(struct ahd_softc *ahd, u_int col_idx); |
1381 | void ahd_free_scb(struct ahd_softc *ahd, struct scb *scb); | 1360 | void ahd_free_scb(struct ahd_softc *ahd, struct scb *scb); |
1382 | void ahd_alloc_scbs(struct ahd_softc *ahd); | ||
1383 | void ahd_free(struct ahd_softc *ahd); | 1361 | void ahd_free(struct ahd_softc *ahd); |
1384 | int ahd_reset(struct ahd_softc *ahd, int reinit); | 1362 | int ahd_reset(struct ahd_softc *ahd, int reinit); |
1385 | void ahd_shutdown(void *arg); | ||
1386 | int ahd_write_flexport(struct ahd_softc *ahd, | 1363 | int ahd_write_flexport(struct ahd_softc *ahd, |
1387 | u_int addr, u_int value); | 1364 | u_int addr, u_int value); |
1388 | int ahd_read_flexport(struct ahd_softc *ahd, u_int addr, | 1365 | int ahd_read_flexport(struct ahd_softc *ahd, u_int addr, |
1389 | uint8_t *value); | 1366 | uint8_t *value); |
1390 | int ahd_wait_flexport(struct ahd_softc *ahd); | ||
1391 | 1367 | ||
1392 | /*************************** Interrupt Services *******************************/ | 1368 | /*************************** Interrupt Services *******************************/ |
1393 | void ahd_pci_intr(struct ahd_softc *ahd); | ||
1394 | void ahd_clear_intstat(struct ahd_softc *ahd); | ||
1395 | void ahd_flush_qoutfifo(struct ahd_softc *ahd); | ||
1396 | void ahd_run_qoutfifo(struct ahd_softc *ahd); | 1369 | void ahd_run_qoutfifo(struct ahd_softc *ahd); |
1397 | #ifdef AHD_TARGET_MODE | 1370 | #ifdef AHD_TARGET_MODE |
1398 | void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused); | 1371 | void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused); |
@@ -1401,7 +1374,6 @@ void ahd_handle_hwerrint(struct ahd_softc *ahd); | |||
1401 | void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat); | 1374 | void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat); |
1402 | void ahd_handle_scsiint(struct ahd_softc *ahd, | 1375 | void ahd_handle_scsiint(struct ahd_softc *ahd, |
1403 | u_int intstat); | 1376 | u_int intstat); |
1404 | void ahd_clear_critical_section(struct ahd_softc *ahd); | ||
1405 | 1377 | ||
1406 | /***************************** Error Recovery *********************************/ | 1378 | /***************************** Error Recovery *********************************/ |
1407 | typedef enum { | 1379 | typedef 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); |
1421 | void ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb); | ||
1422 | int ahd_reset_channel(struct ahd_softc *ahd, char channel, | 1393 | int ahd_reset_channel(struct ahd_softc *ahd, char channel, |
1423 | int initiate_reset); | 1394 | int initiate_reset); |
1424 | int ahd_abort_scbs(struct ahd_softc *ahd, int target, | ||
1425 | char channel, int lun, u_int tag, | ||
1426 | role_t role, uint32_t status); | ||
1427 | void ahd_restart(struct ahd_softc *ahd); | ||
1428 | void ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo); | ||
1429 | void ahd_handle_scb_status(struct ahd_softc *ahd, | ||
1430 | struct scb *scb); | ||
1431 | void ahd_handle_scsi_status(struct ahd_softc *ahd, | ||
1432 | struct scb *scb); | ||
1433 | void ahd_calc_residual(struct ahd_softc *ahd, | ||
1434 | struct scb *scb); | ||
1435 | /*************************** Utility Functions ********************************/ | 1395 | /*************************** Utility Functions ********************************/ |
1436 | struct ahd_phase_table_entry* | ||
1437 | ahd_lookup_phase_entry(int phase); | ||
1438 | void ahd_compile_devinfo(struct ahd_devinfo *devinfo, | 1396 | void 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 ******************************/ |
1443 | void ahd_find_syncrate(struct ahd_softc *ahd, u_int *period, | 1401 | void 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); |
1445 | void 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); | ||
1449 | void 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 |
1523 | void ahd_print_scb(struct scb *scb); | ||
1524 | void ahd_print_devinfo(struct ahd_softc *ahd, | 1473 | void ahd_print_devinfo(struct ahd_softc *ahd, |
1525 | struct ahd_devinfo *devinfo); | 1474 | struct ahd_devinfo *devinfo); |
1526 | void ahd_dump_sglist(struct scb *scb); | ||
1527 | void ahd_dump_card_state(struct ahd_softc *ahd); | 1475 | void ahd_dump_card_state(struct ahd_softc *ahd); |
1528 | int ahd_print_register(ahd_reg_parse_entry_t *table, | 1476 | int 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); |
1535 | void 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 **********************************/ |
55 | char *ahd_chip_names[] = | 55 | static 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 | ||
240 | static 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); | ||
243 | static void ahd_alloc_scbs(struct ahd_softc *ahd); | ||
244 | static void ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl, | ||
245 | u_int scbid); | ||
246 | static void ahd_calc_residual(struct ahd_softc *ahd, | ||
247 | struct scb *scb); | ||
248 | static void ahd_clear_critical_section(struct ahd_softc *ahd); | ||
249 | static void ahd_clear_intstat(struct ahd_softc *ahd); | ||
250 | static void ahd_enable_coalescing(struct ahd_softc *ahd, | ||
251 | int enable); | ||
252 | static u_int ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl); | ||
253 | static void ahd_freeze_devq(struct ahd_softc *ahd, | ||
254 | struct scb *scb); | ||
255 | static void ahd_handle_scb_status(struct ahd_softc *ahd, | ||
256 | struct scb *scb); | ||
257 | static struct ahd_phase_table_entry* ahd_lookup_phase_entry(int phase); | ||
258 | static void ahd_shutdown(void *arg); | ||
259 | static void ahd_update_coalescing_values(struct ahd_softc *ahd, | ||
260 | u_int timer, | ||
261 | u_int maxcmds, | ||
262 | u_int mincmds); | ||
263 | static int ahd_verify_vpd_cksum(struct vpd_config *vpd); | ||
264 | static int ahd_wait_seeprom(struct ahd_softc *ahd); | ||
265 | |||
240 | /******************************** Private Inlines *****************************/ | 266 | /******************************** Private Inlines *****************************/ |
241 | static __inline void ahd_assert_atn(struct ahd_softc *ahd); | ||
242 | static __inline int ahd_currently_packetized(struct ahd_softc *ahd); | ||
243 | static __inline int ahd_set_active_fifo(struct ahd_softc *ahd); | ||
244 | 267 | ||
245 | static __inline void | 268 | static __inline void |
246 | ahd_assert_atn(struct ahd_softc *ahd) | 269 | ahd_assert_atn(struct ahd_softc *ahd) |
@@ -294,11 +317,44 @@ ahd_set_active_fifo(struct ahd_softc *ahd) | |||
294 | } | 317 | } |
295 | } | 318 | } |
296 | 319 | ||
320 | static __inline void | ||
321 | ahd_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 | */ | ||
330 | static __inline void | ||
331 | ahd_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 | |||
340 | static __inline void | ||
341 | ahd_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 | */ |
301 | void | 357 | static void |
302 | ahd_restart(struct ahd_softc *ahd) | 358 | ahd_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 | ||
345 | void | 401 | static void |
346 | ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo) | 402 | ahd_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 | */ |
369 | void | 425 | static void |
370 | ahd_flush_qoutfifo(struct ahd_softc *ahd) | 426 | ahd_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 | ||
965 | static void | ||
966 | ahd_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 | |||
908 | void | 1009 | void |
909 | ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | 1010 | ahd_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 |
2526 | void | 2627 | static void |
2527 | ahd_clear_critical_section(struct ahd_softc *ahd) | 2628 | ahd_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 | */ |
2649 | void | 2750 | static void |
2650 | ahd_clear_intstat(struct ahd_softc *ahd) | 2751 | ahd_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 |
2678 | uint32_t ahd_debug = AHD_DEBUG_OPTS; | 2779 | uint32_t ahd_debug = AHD_DEBUG_OPTS; |
2679 | #endif | 2780 | #endif |
2781 | |||
2782 | #if 0 | ||
2680 | void | 2783 | void |
2681 | ahd_print_scb(struct scb *scb) | 2784 | ahd_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 */ | |
2705 | void | ||
2706 | ahd_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 | */ |
2909 | void | 2970 | static void |
2910 | ahd_validate_offset(struct ahd_softc *ahd, | 2971 | ahd_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 | */ |
2940 | void | 3001 | static void |
2941 | ahd_validate_width(struct ahd_softc *ahd, struct ahd_initiator_tinfo *tinfo, | 3002 | ahd_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 | ||
3469 | struct ahd_phase_table_entry* | 3530 | static struct ahd_phase_table_entry* |
3470 | ahd_lookup_phase_entry(int phase) | 3531 | ahd_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 | ||
5354 | void | 5415 | static void |
5355 | ahd_shutdown(void *arg) | 5416 | ahd_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 | */ |
5483 | int | 5544 | static int |
5484 | ahd_probe_scbs(struct ahd_softc *ahd) { | 5545 | ahd_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 | ||
5932 | void | 5993 | static void |
5933 | ahd_alloc_scbs(struct ahd_softc *ahd) | 5994 | ahd_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 | ||
6985 | void | 7046 | static void |
6986 | ahd_update_coalescing_values(struct ahd_softc *ahd, u_int timer, u_int maxcmds, | 7047 | ahd_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 | ||
7003 | void | 7064 | static void |
7004 | ahd_enable_coalescing(struct ahd_softc *ahd, int enable) | 7065 | ahd_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 | ||
7073 | int | 7135 | int |
7074 | ahd_suspend(struct ahd_softc *ahd) | 7136 | ahd_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 | ||
7087 | int | 7151 | int |
7088 | ahd_resume(struct ahd_softc *ahd) | 7152 | ahd_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 | */ |
7128 | u_int | 7193 | static u_int |
7129 | ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl) | 7194 | ahd_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 | ||
7141 | void | 7206 | static void |
7142 | ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl, u_int scbid) | 7207 | ahd_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 | ||
7189 | void | 7254 | static void |
7190 | ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb) | 7255 | ahd_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 | */ |
7693 | int | 7758 | static int |
7694 | ahd_abort_scbs(struct ahd_softc *ahd, int target, char channel, | 7759 | ahd_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 *****************************/ |
8022 | void | ||
8023 | ahd_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 | ||
8033 | void | 8088 | static void |
8034 | ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) | 8089 | ahd_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 | ||
8296 | static void | ||
8297 | ahd_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 | */ |
8244 | void | 8310 | static void |
8245 | ahd_calc_residual(struct ahd_softc *ahd, struct scb *scb) | 8311 | ahd_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 | ||
9095 | void | 9162 | void |
9096 | ahd_dump_scbs(struct ahd_softc *ahd) | 9163 | ahd_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 | */ |
9222 | int | 9290 | static int |
9223 | ahd_wait_seeprom(struct ahd_softc *ahd) | 9291 | ahd_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 | */ |
9240 | int | 9308 | static int |
9241 | ahd_verify_vpd_cksum(struct vpd_config *vpd) | 9309 | ahd_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 | */ | ||
9390 | static int | ||
9391 | ahd_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 | |||
9319 | int | 9405 | int |
9320 | ahd_write_flexport(struct ahd_softc *ahd, u_int addr, u_int value) | 9406 | ahd_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 | */ | ||
9363 | int | ||
9364 | ahd_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 |
9380 | cam_status | 9448 | cam_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 ***********************/ |
421 | static __inline void ahd_complete_scb(struct ahd_softc *ahd, | ||
422 | struct scb *scb); | ||
423 | static __inline void ahd_update_residual(struct ahd_softc *ahd, | ||
424 | struct scb *scb); | ||
425 | static __inline struct ahd_initiator_tinfo * | 421 | static __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 | ||
470 | static __inline void | ||
471 | ahd_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 | */ | ||
486 | static __inline void | ||
487 | ahd_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 | */ |
296 | uint32_t aic79xx_periodic_otag; | 296 | static 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 | ||
509 | void ahd_format_transinfo(struct info_str *info, | ||
510 | struct ahd_transinfo *tinfo); | ||
511 | |||
512 | /******************************** Locking *************************************/ | 509 | /******************************** Locking *************************************/ |
513 | static __inline void | 510 | static __inline void |
514 | ahd_lockinit(struct ahd_softc *ahd) | 511 | ahd_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 | ||
585 | extern struct pci_driver aic79xx_pci_driver; | ||
586 | |||
587 | typedef enum | 582 | typedef 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 | ||
83 | MODULE_DEVICE_TABLE(pci, ahd_linux_pci_id_table); | 83 | MODULE_DEVICE_TABLE(pci, ahd_linux_pci_id_table); |
84 | 84 | ||
85 | struct pci_driver aic79xx_pci_driver = { | 85 | static 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; | |||
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 | 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 | { |
@@ -201,7 +201,7 @@ struct ahd_pci_identity ahd_pci_ident_table [] = | |||
201 | } | 201 | } |
202 | }; | 202 | }; |
203 | 203 | ||
204 | const u_int ahd_num_pci_devs = ARRAY_SIZE(ahd_pci_ident_table); | 204 | static 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); | |||
245 | static void ahd_configure_termination(struct ahd_softc *ahd, | 245 | static void ahd_configure_termination(struct ahd_softc *ahd, |
246 | u_int adapter_control); | 246 | u_int adapter_control); |
247 | static void ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat); | 247 | static void ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat); |
248 | static void ahd_pci_intr(struct ahd_softc *ahd); | ||
248 | 249 | ||
249 | struct ahd_pci_identity * | 250 | struct ahd_pci_identity * |
250 | ahd_find_pci_device(ahd_dev_softc_t pci) | 251 | ahd_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 | ||
760 | void | 761 | static void |
761 | ahd_pci_intr(struct ahd_softc *ahd) | 762 | ahd_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 | ||
139 | void | 139 | static void |
140 | ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo) | 140 | ahd_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 | }; |
1130 | extern struct ahc_pci_identity ahc_pci_ident_table[]; | ||
1131 | extern const u_int ahc_num_pci_devs; | ||
1132 | 1130 | ||
1133 | /***************************** VL/EISA Declarations ***************************/ | 1131 | /***************************** VL/EISA Declarations ***************************/ |
1134 | struct aic7770_identity { | 1132 | struct 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 | */ |
331 | uint32_t aic7xxx_periodic_otag; | 331 | static 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 | ||
536 | extern struct pci_driver aic7xxx_pci_driver; | ||
537 | |||
538 | typedef enum | 536 | typedef 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 | ||
131 | MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table); | 131 | MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table); |
132 | 132 | ||
133 | struct pci_driver aic7xxx_pci_driver = { | 133 | static 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; | |||
168 | static ahc_device_setup_t ahc_aha494XX_setup; | 168 | static ahc_device_setup_t ahc_aha494XX_setup; |
169 | static ahc_device_setup_t ahc_aha398XX_setup; | 169 | static ahc_device_setup_t ahc_aha398XX_setup; |
170 | 170 | ||
171 | struct ahc_pci_identity ahc_pci_ident_table [] = | 171 | static 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 | ||
562 | const u_int ahc_num_pci_devs = ARRAY_SIZE(ahc_pci_ident_table); | 562 | static 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 |