• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/scsi/aic7xxx/

Lines Matching defs:ahd

223 ahd_print_path(struct ahd_softc *ahd, struct scb *scb)
226 ahd->platform_data->host->host_no,
227 scb != NULL ? SCB_GET_CHANNEL(ahd, scb) : 'X',
228 scb != NULL ? SCB_GET_TARGET(ahd, scb) : -1,
349 static void ahd_linux_queue_cmd_complete(struct ahd_softc *ahd,
352 static void ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd);
353 static u_int ahd_linux_user_tagdepth(struct ahd_softc *ahd,
361 static void ahd_freeze_simq(struct ahd_softc *ahd);
362 static void ahd_release_simq(struct ahd_softc *ahd);
371 ahd_linux_unmap_scb(struct ahd_softc *ahd, struct scb *scb)
378 ahd_sync_sglist(ahd, scb, BUS_DMASYNC_POSTWRITE);
383 pci_unmap_sg(ahd->dev_softc, sg, cmd->use_sg, direction);
385 pci_unmap_single(ahd->dev_softc,
392 #define BUILD_SCSIID(ahd, cmd) \
393 (((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)
404 struct ahd_softc *ahd;
407 ahd = *(struct ahd_softc **)host->hostdata;
413 strcat(bp, ahd->description);
416 ahd_controller_info(ahd, ahd_info);
428 struct ahd_softc *ahd;
432 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
436 rtn = ahd_linux_run_command(ahd, dev, cmd);
444 struct ahd_softc *ahd =
452 return &ahd->platform_data->starget[target_offset];
458 struct ahd_softc *ahd =
460 struct seeprom_config *sc = ahd->seep_config;
468 ahd_lock(ahd, &flags);
477 tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
488 if ((ahd->features & AHD_RTI) == 0)
501 tinfo = ahd_fetch_transinfo(ahd, channel, ahd->our_id,
503 ahd_compile_devinfo(&devinfo, ahd->our_id, starget->id,
506 ahd_set_syncrate(ahd, &devinfo, 0, 0, 0,
508 ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
510 ahd_unlock(ahd, &flags);
526 struct ahd_softc *ahd =
531 printf("%s: Slave Alloc %d\n", ahd_name(ahd), sdev->id);
555 struct ahd_softc *ahd;
557 ahd = *((struct ahd_softc **)sdev->host->hostdata);
584 struct ahd_softc *ahd;
586 ahd = *((struct ahd_softc **)sdev->host->hostdata);
603 extended = (ahd->flags & AHD_EXTENDED_TRANS_A) != 0;
635 struct ahd_softc *ahd;
650 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
677 reset_scb = ahd_get_scb(ahd, AHD_NEVER_COL_IDX);
683 tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
692 reset_scb->hscb->scsiid = BUILD_SCSIID(ahd,cmd);
706 ahd_lock(ahd, &flags);
708 LIST_INSERT_HEAD(&ahd->pending_scbs, reset_scb, pending_links);
709 ahd_queue_scb(ahd, reset_scb);
711 ahd->platform_data->eh_done = &done;
712 ahd_unlock(ahd, &flags);
714 printf("%s: Device reset code sleeping\n", ahd_name(ahd));
716 ahd_lock(ahd, &flags);
717 ahd->platform_data->eh_done = NULL;
718 ahd_unlock(ahd, &flags);
720 ahd_name(ahd), dev->active);
723 printf("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval);
734 struct ahd_softc *ahd;
738 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
742 ahd_name(ahd), cmd);
744 ahd_lock(ahd, &flags);
746 found = ahd_reset_channel(ahd, scmd_channel(cmd) + 'A',
748 ahd_unlock(ahd, &flags);
752 "%d SCBs aborted.\n", ahd_name(ahd), found);
783 ahd_dma_tag_create(struct ahd_softc *ahd, bus_dma_tag_t parent,
811 ahd_dma_tag_destroy(struct ahd_softc *ahd, bus_dma_tag_t dmat)
817 ahd_dmamem_alloc(struct ahd_softc *ahd, bus_dma_tag_t dmat, void** vaddr,
820 *vaddr = pci_alloc_consistent(ahd->dev_softc,
828 ahd_dmamem_free(struct ahd_softc *ahd, bus_dma_tag_t dmat,
831 pci_free_consistent(ahd->dev_softc, dmat->maxsize,
836 ahd_dmamap_load(struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map,
853 ahd_dmamap_destroy(struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map)
858 ahd_dmamap_unload(struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map)
1071 ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *template)
1079 template->name = ahd->description;
1084 *((struct ahd_softc **)host->hostdata) = ahd;
1085 ahd->platform_data->host = host;
1089 host->this_id = ahd->our_id;
1090 host->irq = ahd->platform_data->irq;
1091 host->max_id = (ahd->features & AHD_WIDE) ? 16 : 8;
1095 ahd_lock(ahd, &s);
1096 ahd_set_unit(ahd, ahd_linux_unit++);
1097 ahd_unlock(ahd, &s);
1102 ahd_set_name(ahd, new_name);
1104 host->unique_id = ahd->unit;
1105 ahd_linux_initialize_scsi_bus(ahd);
1106 ahd_intr_enable(ahd, TRUE);
1110 retval = scsi_add_host(host, &ahd->dev_softc->dev);
1127 ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd)
1137 ahd->flags &= ~AHD_RESET_BUS_A;
1139 if ((ahd->flags & AHD_RESET_BUS_A) != 0)
1140 ahd_reset_channel(ahd, 'A', /*initiate_reset*/TRUE);
1142 numtarg = (ahd->features & AHD_WIDE) ? 16 : 8;
1144 ahd_lock(ahd, &s);
1155 tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
1157 ahd_compile_devinfo(&devinfo, ahd->our_id, target_id,
1159 ahd_update_neg_request(ahd, &devinfo, tstate,
1162 ahd_unlock(ahd, &s);
1164 if ((ahd->flags & AHD_RESET_BUS_A) != 0) {
1165 ahd_freeze_simq(ahd);
1167 ahd_release_simq(ahd);
1172 ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg)
1174 ahd->platform_data =
1176 if (ahd->platform_data == NULL)
1178 memset(ahd->platform_data, 0, sizeof(struct ahd_platform_data));
1179 ahd->platform_data->irq = AHD_LINUX_NOIRQ;
1180 ahd_lockinit(ahd);
1181 ahd->seltime = (aic79xx_seltime & 0x3) << 4;
1186 ahd_platform_free(struct ahd_softc *ahd)
1191 if (ahd->platform_data != NULL) {
1194 starget = ahd->platform_data->starget[i];
1196 ahd->platform_data->starget[i] = NULL;
1200 if (ahd->platform_data->irq != AHD_LINUX_NOIRQ)
1201 free_irq(ahd->platform_data->irq, ahd);
1202 if (ahd->tags[0] == BUS_SPACE_PIO
1203 && ahd->bshs[0].ioport != 0)
1204 release_region(ahd->bshs[0].ioport, 256);
1205 if (ahd->tags[1] == BUS_SPACE_PIO
1206 && ahd->bshs[1].ioport != 0)
1207 release_region(ahd->bshs[1].ioport, 256);
1208 if (ahd->tags[0] == BUS_SPACE_MEMIO
1209 && ahd->bshs[0].maddr != NULL) {
1210 iounmap(ahd->bshs[0].maddr);
1211 release_mem_region(ahd->platform_data->mem_busaddr,
1214 if (ahd->platform_data->host)
1215 scsi_host_put(ahd->platform_data->host);
1217 free(ahd->platform_data, M_DEVBUF);
1222 ahd_platform_init(struct ahd_softc *ahd)
1227 if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
1230 iocell_opts = &aic79xx_iocell_info[ahd->unit];
1232 AHD_SET_PRECOMP(ahd, iocell_opts->precomp);
1234 AHD_SET_SLEWRATE(ahd, iocell_opts->slewrate);
1236 AHD_SET_AMPLITUDE(ahd, iocell_opts->amplitude);
1242 ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
1244 ahd_platform_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb),
1245 SCB_GET_CHANNEL(ahd, scb),
1251 ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev,
1289 usertags = ahd_linux_user_tagdepth(ahd, devinfo);
1338 ahd_platform_abort_scbs(struct ahd_softc *ahd, int target, char channel,
1345 ahd_linux_user_tagdepth(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
1351 if ((ahd->user_discenable & devinfo->target_mask) != 0) {
1352 if (ahd->unit >= ARRAY_SIZE(aic79xx_tag_info)) {
1366 tag_info = &aic79xx_tag_info[ahd->unit];
1383 struct ahd_softc *ahd = *((struct ahd_softc **)sdev->host->hostdata);
1386 ahd->our_id,
1390 tags = ahd_linux_user_tagdepth(ahd, &devinfo);
1393 ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_TAGGED);
1394 ahd_send_async(ahd, devinfo.channel, devinfo.target,
1396 ahd_print_devinfo(ahd, &devinfo);
1399 ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_NONE);
1400 ahd_send_async(ahd, devinfo.channel, devinfo.target,
1406 ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
1417 ahd_lock(ahd, &flags);
1422 tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
1431 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
1432 ahd->flags |= AHD_RESOURCE_SHORTAGE;
1433 ahd_unlock(ahd, &flags);
1446 hscb->scsiid = BUILD_SCSIID(ahd, cmd);
1449 mask = SCB_GET_TARGET_MASK(ahd, scb);
1451 if ((ahd->user_discenable & mask) != 0)
1496 nseg = pci_map_sg(ahd->dev_softc, cur_seg,
1506 sg = ahd_sg_setup(ahd, scb, sg, addr, len,
1516 addr = pci_map_single(ahd->dev_softc,
1521 sg = ahd_sg_setup(ahd, scb, sg, addr,
1525 LIST_INSERT_HEAD(&ahd->pending_scbs, scb, pending_links);
1533 ahd_queue_scb(ahd, scb);
1535 ahd_unlock(ahd, &flags);
1546 struct ahd_softc *ahd;
1550 ahd = (struct ahd_softc *) dev_id;
1551 ahd_lock(ahd, &flags);
1552 ours = ahd_intr(ahd);
1553 ahd_unlock(ahd, &flags);
1558 ahd_send_async(struct ahd_softc *ahd, char channel,
1577 tinfo = ahd_fetch_transinfo(ahd, channel, ahd->our_id,
1595 starget = ahd->platform_data->starget[target];
1633 scsi_report_device_reset(ahd->platform_data->host,
1638 if (ahd->platform_data->host != NULL) {
1639 scsi_report_bus_reset(ahd->platform_data->host,
1652 ahd_done(struct ahd_softc *ahd, struct scb *scb)
1659 ahd_dump_card_state(ahd);
1671 ahd_linux_unmap_scb(ahd, scb);
1688 ahd_print_path(ahd, scb);
1706 ahd_print_path(ahd, scb);
1711 ahd_print_path(ahd, scb);
1722 ahd_linux_handle_scsi_status(ahd, cmd->device, scb);
1750 if (ahd->platform_data->eh_done)
1751 complete(ahd->platform_data->eh_done);
1754 ahd_free_scb(ahd, scb);
1755 ahd_linux_queue_cmd_complete(ahd, cmd);
1759 ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
1766 ahd->our_id,
1819 ahd_get_sense_buf(ahd, scb)
1858 ahd_print_path(ahd, scb);
1877 ahd_print_path(ahd, scb);
1887 ahd_platform_set_tags(ahd, sdev, &devinfo,
1897 ahd_platform_set_tags(ahd, sdev, &devinfo,
1905 ahd_linux_queue_cmd_complete(struct ahd_softc *ahd, struct scsi_cmnd *cmd)
2003 ahd_name(ahd), status, cmd->device->channel,
2013 ahd_freeze_simq(struct ahd_softc *ahd)
2015 scsi_block_requests(ahd->platform_data->host);
2019 ahd_release_simq(struct ahd_softc *ahd)
2021 scsi_unblock_requests(ahd->platform_data->host);
2027 struct ahd_softc *ahd;
2046 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
2056 ahd_lock(ahd, &flags);
2080 LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
2104 was_paused = ahd_is_paused(ahd);
2105 ahd_pause_and_flushwork(ahd);
2114 ahd_name(ahd), was_paused ? "" : "not ");
2115 ahd_dump_card_state(ahd);
2118 if (ahd_search_qinfifo(ahd, cmd->device->id,
2125 ahd_name(ahd), cmd->device->channel,
2131 saved_modes = ahd_save_modes(ahd);
2132 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
2133 last_phase = ahd_inb(ahd, LASTPHASE);
2134 saved_scbptr = ahd_get_scbptr(ahd);
2136 if (disconnected && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) == 0) {
2139 bus_scb = ahd_lookup_scb(ahd, active_scbptr);
2149 saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
2157 pending_scb = ahd_lookup_scb(ahd, active_scbptr);
2159 ahd_outb(ahd, MSG_OUT, HOST_MSG);
2160 ahd_outb(ahd, SCSISIGO, last_phase|ATNO);
2170 ahd_set_scbptr(ahd, SCB_GET_TAG(pending_scb));
2183 ahd_outb(ahd, SCB_TASK_MANAGEMENT,
2203 ahd_outb(ahd, SCB_CONTROL,
2204 ahd_inb(ahd, SCB_CONTROL)|MK_MESSAGE);
2212 ahd_search_qinfifo(ahd, cmd->device->id,
2216 ahd_qinfifo_requeue_tail(ahd, pending_scb);
2217 ahd_set_scbptr(ahd, saved_scbptr);
2218 ahd_print_path(ahd, pending_scb);
2237 ahd_unpause(ahd);
2241 ahd->platform_data->eh_done = &done;
2242 ahd_unlock(ahd, &flags);
2244 printf("%s: Recovery code sleeping\n", ahd_name(ahd));
2246 ahd_lock(ahd, &flags);
2247 ahd->platform_data->eh_done = NULL;
2248 ahd_unlock(ahd, &flags);
2250 ahd_name(ahd), dev->active);
2255 ahd_unlock(ahd, &flags);
2259 ahd_name(ahd), retval);
2267 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2273 ahd_lock(ahd, &flags);
2274 ahd_set_width(ahd, &devinfo, width, AHD_TRANS_GOAL, FALSE);
2275 ahd_unlock(ahd, &flags);
2281 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2284 = ahd_fetch_transinfo(ahd,
2295 printf("%s: set period to %d\n", ahd_name(ahd), period);
2319 ahd_find_syncrate(ahd, &period, &ppr_options,
2322 ahd_lock(ahd, &flags);
2323 ahd_set_syncrate(ahd, &devinfo, period, offset,
2325 ahd_unlock(ahd, &flags);
2331 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2334 = ahd_fetch_transinfo(ahd,
2345 printf("%s: set offset to %d\n", ahd_name(ahd), offset);
2353 ahd_find_syncrate(ahd, &period, &ppr_options,
2357 ahd_lock(ahd, &flags);
2358 ahd_set_syncrate(ahd, &devinfo, period, offset, ppr_options,
2360 ahd_unlock(ahd, &flags);
2366 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2369 = ahd_fetch_transinfo(ahd,
2381 printf("%s: %s DT\n", ahd_name(ahd),
2396 ahd_find_syncrate(ahd, &period, &ppr_options,
2399 ahd_lock(ahd, &flags);
2400 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2402 ahd_unlock(ahd, &flags);
2408 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2411 = ahd_fetch_transinfo(ahd,
2423 printf("%s: %s QAS\n", ahd_name(ahd),
2435 ahd_find_syncrate(ahd, &period, &ppr_options,
2438 ahd_lock(ahd, &flags);
2439 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2441 ahd_unlock(ahd, &flags);
2447 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2450 = ahd_fetch_transinfo(ahd,
2462 printf("%s: %s IU\n", ahd_name(ahd),
2475 ahd_find_syncrate(ahd, &period, &ppr_options,
2478 ahd_lock(ahd, &flags);
2479 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2481 ahd_unlock(ahd, &flags);
2487 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2490 = ahd_fetch_transinfo(ahd,
2502 printf("%s: %s Read Streaming\n", ahd_name(ahd),
2511 ahd_find_syncrate(ahd, &period, &ppr_options,
2514 ahd_lock(ahd, &flags);
2515 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2517 ahd_unlock(ahd, &flags);
2523 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2526 = ahd_fetch_transinfo(ahd,
2538 printf("%s: %s Write Flow Control\n", ahd_name(ahd),
2547 ahd_find_syncrate(ahd, &period, &ppr_options,
2550 ahd_lock(ahd, &flags);
2551 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2553 ahd_unlock(ahd, &flags);
2559 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2562 = ahd_fetch_transinfo(ahd,
2572 if ((ahd->features & AHD_RTI) == 0) {
2575 printf("%s: RTI not available\n", ahd_name(ahd));
2582 printf("%s: %s RTI\n", ahd_name(ahd),
2591 ahd_find_syncrate(ahd, &period, &ppr_options,
2594 ahd_lock(ahd, &flags);
2595 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2597 ahd_unlock(ahd, &flags);
2603 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2606 = ahd_fetch_transinfo(ahd,
2618 printf("%s: %s Precompensation\n", ahd_name(ahd),
2625 if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
2628 iocell_opts = &aic79xx_iocell_info[ahd->unit];
2634 AHD_SET_PRECOMP(ahd, precomp);
2636 AHD_SET_PRECOMP(ahd, 0);
2641 ahd_find_syncrate(ahd, &period, &ppr_options,
2644 ahd_lock(ahd, &flags);
2645 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2647 ahd_unlock(ahd, &flags);
2653 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2656 = ahd_fetch_transinfo(ahd,
2671 ahd_find_syncrate(ahd, &period, &ppr_options,
2674 ahd_lock(ahd, &flags);
2675 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2677 ahd_unlock(ahd, &flags);
2682 struct ahd_softc *ahd = *(struct ahd_softc **)shost->hostdata;
2686 ahd_lock(ahd, &flags);
2687 ahd_pause(ahd);
2688 mode = ahd_inb(ahd, SBLKCTL);
2689 ahd_unpause(ahd);
2690 ahd_unlock(ahd, &flags);