• 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:ahc

262 ahc_print_path(struct ahc_softc *ahc, struct scb *scb)
265 ahc->platform_data->host->host_no,
266 scb != NULL ? SCB_GET_CHANNEL(ahc, scb) : 'X',
267 scb != NULL ? SCB_GET_TARGET(ahc, scb) : -1,
368 static void ahc_linux_queue_cmd_complete(struct ahc_softc *ahc,
370 static void ahc_linux_freeze_simq(struct ahc_softc *ahc);
371 static void ahc_linux_release_simq(struct ahc_softc *ahc);
373 static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc);
374 static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc,
389 static __inline int ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
394 ahc_linux_unmap_scb(struct ahc_softc *ahc, struct scb *scb)
399 ahc_sync_sglist(ahc, scb, BUS_DMASYNC_POSTWRITE);
404 pci_unmap_sg(ahc->dev_softc, sg, cmd->use_sg,
407 pci_unmap_single(ahc->dev_softc,
415 ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
429 && (ahc->flags & AHC_39BIT_ADDRESSING) != 0)
445 struct ahc_softc *ahc;
448 ahc = *(struct ahc_softc **)host->hostdata;
454 strcat(bp, ahc->description);
457 ahc_controller_info(ahc, ahc_info);
470 struct ahc_softc *ahc;
475 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
477 ahc_lock(ahc, &flags);
478 if (ahc->platform_data->qfrozen == 0) {
481 rtn = ahc_linux_run_command(ahc, dev, cmd);
483 ahc_unlock(ahc, &flags);
491 struct ahc_softc *ahc =
499 return &ahc->platform_data->starget[target_offset];
505 struct ahc_softc *ahc =
507 struct seeprom_config *sc = ahc->seep_config;
515 unsigned int our_id = ahc->our_id;
523 our_id = ahc->our_id_b;
525 ahc_lock(ahc, &flags);
536 if (ahc->flags & AHC_NEWEEPROM_FMT) {
548 if ((ahc->features & AHC_ULTRA2) != 0) {
559 ahc_find_period(ahc, scsirate, maxsync);
561 tinfo = ahc_fetch_transinfo(ahc, channel, ahc->our_id,
567 ahc_set_syncrate(ahc, &devinfo, NULL, 0, 0, 0,
569 ahc_set_width(ahc, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
571 ahc_unlock(ahc, &flags);
587 struct ahc_softc *ahc =
593 printf("%s: Slave Alloc %d\n", ahc_name(ahc), sdev->id);
619 struct ahc_softc *ahc;
621 ahc = *((struct ahc_softc **)sdev->host->hostdata);
649 struct ahc_softc *ahc;
652 ahc = *((struct ahc_softc **)sdev->host->hostdata);
670 extended = (ahc->flags & AHC_EXTENDED_TRANS_A) != 0;
672 extended = (ahc->flags & AHC_EXTENDED_TRANS_B) != 0;
719 struct ahc_softc *ahc;
723 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
725 ahc_lock(ahc, &flags);
726 found = ahc_reset_channel(ahc, scmd_channel(cmd) + 'A',
728 ahc_unlock(ahc, &flags);
732 "%d SCBs aborted.\n", ahc_name(ahc), found);
764 #define BUILD_SCSIID(ahc, cmd) \
766 | (((cmd)->device->channel == 0) ? (ahc)->our_id : (ahc)->our_id_b) \
771 ahc_dma_tag_create(struct ahc_softc *ahc, bus_dma_tag_t parent,
799 ahc_dma_tag_destroy(struct ahc_softc *ahc, bus_dma_tag_t dmat)
805 ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr,
808 *vaddr = pci_alloc_consistent(ahc->dev_softc,
816 ahc_dmamem_free(struct ahc_softc *ahc, bus_dma_tag_t dmat,
819 pci_free_consistent(ahc->dev_softc, dmat->maxsize,
824 ahc_dmamap_load(struct ahc_softc *ahc, bus_dma_tag_t dmat, bus_dmamap_t map,
841 ahc_dmamap_destroy(struct ahc_softc *ahc, bus_dma_tag_t dmat, bus_dmamap_t map)
846 ahc_dmamap_unload(struct ahc_softc *ahc, bus_dma_tag_t dmat, bus_dmamap_t map)
1028 ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *template)
1036 template->name = ahc->description;
1041 *((struct ahc_softc **)host->hostdata) = ahc;
1042 ahc->platform_data->host = host;
1045 host->this_id = ahc->our_id;
1046 host->irq = ahc->platform_data->irq;
1047 host->max_id = (ahc->features & AHC_WIDE) ? 16 : 8;
1049 host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0;
1051 ahc_lock(ahc, &s);
1052 ahc_set_unit(ahc, ahc_linux_unit++);
1053 ahc_unlock(ahc, &s);
1058 ahc_set_name(ahc, new_name);
1060 host->unique_id = ahc->unit;
1061 ahc_linux_initialize_scsi_bus(ahc);
1062 ahc_intr_enable(ahc, TRUE);
1067 (ahc->dev_softc ? &ahc->dev_softc->dev : NULL));
1084 ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc)
1093 ahc_lock(ahc, &s);
1096 ahc->flags &= ~(AHC_RESET_BUS_A|AHC_RESET_BUS_B);
1098 if ((ahc->flags & AHC_RESET_BUS_A) != 0)
1099 ahc_reset_channel(ahc, 'A', /*initiate_reset*/TRUE);
1101 numtarg = (ahc->features & AHC_WIDE) ? 16 : 8;
1103 if ((ahc->features & AHC_TWIN) != 0) {
1105 if ((ahc->flags & AHC_RESET_BUS_B) != 0) {
1106 ahc_reset_channel(ahc, 'B', /*initiate_reset*/TRUE);
1127 our_id = ahc->our_id;
1129 if (i > 7 && (ahc->features & AHC_TWIN) != 0) {
1131 our_id = ahc->our_id_b;
1134 tinfo = ahc_fetch_transinfo(ahc, channel, our_id,
1138 ahc_update_neg_request(ahc, &devinfo, tstate,
1141 ahc_unlock(ahc, &s);
1143 if ((ahc->flags & (AHC_RESET_BUS_A|AHC_RESET_BUS_B)) != 0) {
1144 ahc_linux_freeze_simq(ahc);
1146 ahc_linux_release_simq(ahc);
1151 ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg)
1154 ahc->platform_data =
1156 if (ahc->platform_data == NULL)
1158 memset(ahc->platform_data, 0, sizeof(struct ahc_platform_data));
1159 ahc->platform_data->irq = AHC_LINUX_NOIRQ;
1160 ahc_lockinit(ahc);
1161 ahc->seltime = (aic7xxx_seltime & 0x3) << 4;
1162 ahc->seltime_b = (aic7xxx_seltime & 0x3) << 4;
1164 ahc->flags |= AHC_DISABLE_PCI_PERR;
1170 ahc_platform_free(struct ahc_softc *ahc)
1175 if (ahc->platform_data != NULL) {
1178 starget = ahc->platform_data->starget[i];
1180 ahc->platform_data->starget[i] = NULL;
1184 if (ahc->platform_data->irq != AHC_LINUX_NOIRQ)
1185 free_irq(ahc->platform_data->irq, ahc);
1186 if (ahc->tag == BUS_SPACE_PIO
1187 && ahc->bsh.ioport != 0)
1188 release_region(ahc->bsh.ioport, 256);
1189 if (ahc->tag == BUS_SPACE_MEMIO
1190 && ahc->bsh.maddr != NULL) {
1191 iounmap(ahc->bsh.maddr);
1192 release_mem_region(ahc->platform_data->mem_busaddr,
1196 if (ahc->platform_data->host)
1197 scsi_host_put(ahc->platform_data->host);
1199 free(ahc->platform_data, M_DEVBUF);
1204 ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb)
1206 ahc_platform_abort_scbs(ahc, SCB_GET_TARGET(ahc, scb),
1207 SCB_GET_CHANNEL(ahc, scb),
1213 ahc_platform_set_tags(struct ahc_softc *ahc, struct scsi_device *sdev,
1248 usertags = ahc_linux_user_tagdepth(ahc, devinfo);
1296 ahc_platform_abort_scbs(struct ahc_softc *ahc, int target, char channel,
1303 ahc_linux_user_tagdepth(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
1309 if ((ahc->user_discenable & devinfo->target_mask) != 0) {
1310 if (ahc->unit >= ARRAY_SIZE(aic7xxx_tag_info)) {
1324 tag_info = &aic7xxx_tag_info[ahc->unit];
1341 struct ahc_softc *ahc = *((struct ahc_softc **)sdev->host->hostdata);
1345 ? ahc->our_id : ahc->our_id_b,
1349 tags = ahc_linux_user_tagdepth(ahc, &devinfo);
1352 ahc_platform_set_tags(ahc, sdev, &devinfo, AHC_QUEUE_TAGGED);
1353 ahc_send_async(ahc, devinfo.channel, devinfo.target,
1355 ahc_print_devinfo(ahc, &devinfo);
1358 ahc_platform_set_tags(ahc, sdev, &devinfo, AHC_QUEUE_NONE);
1359 ahc_send_async(ahc, devinfo.channel, devinfo.target,
1365 ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev,
1379 if (ahc->platform_data->qfrozen != 0)
1389 && (ahc->features & AHC_SCB_BTT) == 0) {
1393 untagged_q = &(ahc->untagged_queues[target_offset]);
1403 scb = ahc_get_scb(ahc);
1416 hscb->scsiid = BUILD_SCSIID(ahc, cmd);
1418 mask = SCB_GET_TARGET_MASK(ahc, scb);
1419 tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb),
1421 SCB_GET_TARGET(ahc, scb), &tstate);
1427 if ((ahc->user_discenable & mask) != 0)
1472 nseg = pci_map_sg(ahc->dev_softc, cur_seg, cmd->use_sg,
1488 consumed = ahc_linux_map_seg(ahc, scb,
1514 addr = pci_map_single(ahc->dev_softc,
1519 scb->sg_count = ahc_linux_map_seg(ahc, scb,
1543 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links);
1555 ahc_queue_scb(ahc, scb);
1565 struct ahc_softc *ahc;
1569 ahc = (struct ahc_softc *) dev_id;
1570 ahc_lock(ahc, &flags);
1571 ours = ahc_intr(ahc);
1572 ahc_unlock(ahc, &flags);
1577 ahc_platform_flushwork(struct ahc_softc *ahc)
1583 ahc_send_async(struct ahc_softc *ahc, char channel,
1604 tinfo = ahc_fetch_transinfo(ahc, channel,
1605 channel == 'A' ? ahc->our_id
1606 : ahc->our_id_b,
1627 starget = ahc->platform_data->starget[target_offset];
1656 scsi_report_device_reset(ahc->platform_data->host,
1661 if (ahc->platform_data->host != NULL) {
1662 scsi_report_bus_reset(ahc->platform_data->host,
1675 ahc_done(struct ahc_softc *ahc, struct scb *scb)
1685 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
1686 untagged_q = &(ahc->untagged_queues[target_offset]);
1693 ahc_dump_card_state(ahc);
1704 ahc_linux_unmap_scb(ahc, scb);
1721 ahc_print_path(ahc, scb);
1739 ahc_print_path(ahc, scb);
1744 ahc_print_path(ahc, scb);
1755 ahc_linux_handle_scsi_status(ahc, cmd->device, scb);
1783 if (ahc->platform_data->eh_done)
1784 complete(ahc->platform_data->eh_done);
1787 ahc_free_scb(ahc, scb);
1788 ahc_linux_queue_cmd_complete(ahc, cmd);
1792 ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
1799 ahc->our_id,
1834 ahc_get_sense_buf(ahc, scb), sense_size);
1874 ahc_print_path(ahc, scb);
1891 ahc_print_path(ahc, scb);
1901 ahc_platform_set_tags(ahc, sdev, &devinfo,
1912 ahc_platform_set_tags(ahc, sdev, &devinfo,
1921 ahc_linux_queue_cmd_complete(struct ahc_softc *ahc, struct scsi_cmnd *cmd)
1991 ahc_linux_freeze_simq(struct ahc_softc *ahc)
1995 ahc_lock(ahc, &s);
1996 ahc->platform_data->qfrozen++;
1997 if (ahc->platform_data->qfrozen == 1) {
1998 scsi_block_requests(ahc->platform_data->host);
2000 ahc_platform_abort_scbs(ahc, CAM_TARGET_WILDCARD, ALL_CHANNELS,
2004 ahc_unlock(ahc, &s);
2008 ahc_linux_release_simq(struct ahc_softc *ahc)
2014 ahc_lock(ahc, &s);
2015 if (ahc->platform_data->qfrozen > 0)
2016 ahc->platform_data->qfrozen--;
2017 if (ahc->platform_data->qfrozen == 0)
2019 ahc_unlock(ahc, &s);
2027 scsi_unblock_requests(ahc->platform_data->host);
2033 struct ahc_softc *ahc;
2051 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
2061 ahc_lock(ahc, &flags);
2078 ahc_name(ahc), cmd->device->channel, cmd->device->id,
2085 && ahc_search_untagged_queues(ahc, cmd, cmd->device->id,
2090 ahc_name(ahc), cmd->device->channel, cmd->device->id,
2099 LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) {
2107 LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) {
2108 if (ahc_match_scb(ahc, pending_scb, scmd_id(cmd),
2134 was_paused = ahc_is_paused(ahc);
2135 ahc_pause_and_flushwork(ahc);
2144 ahc_name(ahc), was_paused ? "" : "not ");
2145 ahc_dump_card_state(ahc);
2149 if (ahc_search_qinfifo(ahc, cmd->device->id,
2156 ahc_name(ahc), cmd->device->channel,
2161 } else if (ahc_search_qinfifo(ahc, cmd->device->id,
2169 if (disconnected && (ahc_inb(ahc, SEQ_FLAGS) & NOT_IDENTIFIED) == 0) {
2172 bus_scb = ahc_lookup_scb(ahc, ahc_inb(ahc, SCB_TAG));
2176 && ahc_inb(ahc, SAVED_SCSIID) == pending_scb->hscb->scsiid
2177 && ahc_inb(ahc, SAVED_LUN) == SCB_GET_LUN(pending_scb))
2189 last_phase = ahc_inb(ahc, LASTPHASE);
2190 saved_scbptr = ahc_inb(ahc, SCBPTR);
2191 active_scb_index = ahc_inb(ahc, SCB_TAG);
2192 saved_scsiid = ahc_inb(ahc, SAVED_SCSIID);
2196 && SCSIID_TARGET(ahc, saved_scsiid) == scmd_id(cmd)))) {
2202 pending_scb = ahc_lookup_scb(ahc, active_scb_index);
2204 ahc_outb(ahc, MSG_OUT, HOST_MSG);
2205 ahc_outb(ahc, SCSISIGO, last_phase|ATNO);
2236 ahc_search_disc_list(ahc, cmd->device->id,
2250 if ((ahc->flags & AHC_PAGESCBS) == 0) {
2251 ahc_outb(ahc, SCBPTR, pending_scb->hscb->tag);
2252 ahc_outb(ahc, SCB_CONTROL,
2253 ahc_inb(ahc, SCB_CONTROL)|MK_MESSAGE);
2261 ahc_search_qinfifo(ahc, cmd->device->id,
2266 ahc_qinfifo_requeue_tail(ahc, pending_scb);
2267 ahc_outb(ahc, SCBPTR, saved_scbptr);
2268 ahc_print_path(ahc, pending_scb);
2287 ahc_unpause(ahc);
2291 ahc->platform_data->eh_done = &done;
2292 ahc_unlock(ahc, &flags);
2296 ahc_lock(ahc, &flags);
2297 ahc->platform_data->eh_done = NULL;
2298 ahc_unlock(ahc, &flags);
2305 ahc_unlock(ahc, &flags);
2310 ahc_platform_dump_card_state(struct ahc_softc *ahc)
2317 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2323 ahc_lock(ahc, &flags);
2324 ahc_set_width(ahc, &devinfo, width, AHC_TRANS_GOAL, FALSE);
2325 ahc_unlock(ahc, &flags);
2331 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2334 = ahc_fetch_transinfo(ahc,
2360 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options, AHC_SYNCRATE_DT);
2361 ahc_lock(ahc, &flags);
2362 ahc_set_syncrate(ahc, &devinfo, syncrate, period, offset,
2364 ahc_unlock(ahc, &flags);
2370 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2373 = ahc_fetch_transinfo(ahc,
2385 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options, AHC_SYNCRATE_DT);
2389 ahc_lock(ahc, &flags);
2390 ahc_set_syncrate(ahc, &devinfo, syncrate, period, offset,
2392 ahc_unlock(ahc, &flags);
2398 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2401 = ahc_fetch_transinfo(ahc,
2421 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options,AHC_SYNCRATE_DT);
2422 ahc_lock(ahc, &flags);
2423 ahc_set_syncrate(ahc, &devinfo, syncrate, period, tinfo->goal.offset,
2425 ahc_unlock(ahc, &flags);
2431 struct ahc_softc *ahc = *(struct ahc_softc **)shost->hostdata;
2435 if (!(ahc->features & AHC_ULTRA2)) {
2438 ahc->features & AHC_HVD ?
2444 ahc_lock(ahc, &flags);
2445 ahc_pause(ahc);
2446 mode = ahc_inb(ahc, SBLKCTL);
2447 ahc_unpause(ahc);
2448 ahc_unlock(ahc, &flags);