• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/aic7xxx/

Lines Matching refs:ahd

224 ahd_print_path(struct ahd_softc *ahd, struct scb *scb)
227 ahd->platform_data->host->host_no,
228 scb != NULL ? SCB_GET_CHANNEL(ahd, scb) : 'X',
229 scb != NULL ? SCB_GET_TARGET(ahd, scb) : -1,
350 static void ahd_linux_queue_cmd_complete(struct ahd_softc *ahd,
353 static void ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd);
354 static u_int ahd_linux_user_tagdepth(struct ahd_softc *ahd,
362 static void ahd_freeze_simq(struct ahd_softc *ahd);
363 static void ahd_release_simq(struct ahd_softc *ahd);
386 uint8_t ahd_inb(struct ahd_softc * ahd, long port);
387 void ahd_outb(struct ahd_softc * ahd, long port, uint8_t val);
388 void ahd_outw_atomic(struct ahd_softc * ahd,
390 void ahd_outsb(struct ahd_softc * ahd, long port,
392 void ahd_insb(struct ahd_softc * ahd, long port,
396 ahd_inb(struct ahd_softc * ahd, long port)
400 if (ahd->tags[0] == BUS_SPACE_MEMIO) {
401 x = readb(ahd->bshs[0].maddr + port);
403 x = inb(ahd->bshs[(port) >> 8].ioport + ((port) & 0xFF));
411 ahd_outb(struct ahd_softc * ahd, long port, uint8_t val)
413 if (ahd->tags[0] == BUS_SPACE_MEMIO) {
414 writeb(val, ahd->bshs[0].maddr + port);
416 outb(val, ahd->bshs[(port) >> 8].ioport + (port & 0xFF));
422 ahd_outw_atomic(struct ahd_softc * ahd, long port, uint16_t val)
424 if (ahd->tags[0] == BUS_SPACE_MEMIO) {
425 writew(val, ahd->bshs[0].maddr + port);
427 outw(val, ahd->bshs[(port) >> 8].ioport + (port & 0xFF));
433 ahd_outsb(struct ahd_softc * ahd, long port, uint8_t *array, int count)
443 ahd_outb(ahd, port, *array++);
447 ahd_insb(struct ahd_softc * ahd, long port, uint8_t *array, int count)
457 *array++ = ahd_inb(ahd, port);
514 ahd_linux_unmap_scb(struct ahd_softc *ahd, struct scb *scb)
519 ahd_sync_sglist(ahd, scb, BUS_DMASYNC_POSTWRITE);
524 #define BUILD_SCSIID(ahd, cmd) \
525 (((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)
536 struct ahd_softc *ahd;
539 ahd = *(struct ahd_softc **)host->hostdata;
543 strcat(bp, ahd->description);
546 ahd_controller_info(ahd, ahd_info);
558 struct ahd_softc *ahd;
562 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
566 rtn = ahd_linux_run_command(ahd, dev, cmd);
574 struct ahd_softc *ahd =
582 return &ahd->platform_data->starget[target_offset];
588 struct ahd_softc *ahd =
590 struct seeprom_config *sc = ahd->seep_config;
598 ahd_lock(ahd, &flags);
607 tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
614 if ((ahd->features & AHD_RTI) == 0)
627 tinfo = ahd_fetch_transinfo(ahd, channel, ahd->our_id,
629 ahd_compile_devinfo(&devinfo, ahd->our_id, starget->id,
632 ahd_set_syncrate(ahd, &devinfo, 0, 0, 0,
634 ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
636 ahd_unlock(ahd, &flags);
652 struct ahd_softc *ahd =
657 printk("%s: Slave Alloc %d\n", ahd_name(ahd), sdev->id);
681 struct ahd_softc *ahd;
683 ahd = *((struct ahd_softc **)sdev->host->hostdata);
710 struct ahd_softc *ahd;
712 ahd = *((struct ahd_softc **)sdev->host->hostdata);
729 extended = (ahd->flags & AHD_EXTENDED_TRANS_A) != 0;
761 struct ahd_softc *ahd;
776 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
803 reset_scb = ahd_get_scb(ahd, AHD_NEVER_COL_IDX);
809 tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
818 reset_scb->hscb->scsiid = BUILD_SCSIID(ahd,cmd);
832 ahd_lock(ahd, &flags);
834 LIST_INSERT_HEAD(&ahd->pending_scbs, reset_scb, pending_links);
835 ahd_queue_scb(ahd, reset_scb);
837 ahd->platform_data->eh_done = &done;
838 ahd_unlock(ahd, &flags);
840 printk("%s: Device reset code sleeping\n", ahd_name(ahd));
842 ahd_lock(ahd, &flags);
843 ahd->platform_data->eh_done = NULL;
844 ahd_unlock(ahd, &flags);
846 ahd_name(ahd), dev->active);
849 printk("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval);
860 struct ahd_softc *ahd;
864 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
868 ahd_name(ahd), cmd);
870 ahd_lock(ahd, &flags);
872 found = ahd_reset_channel(ahd, scmd_channel(cmd) + 'A',
874 ahd_unlock(ahd, &flags);
878 "%d SCBs aborted.\n", ahd_name(ahd), found);
909 ahd_dma_tag_create(struct ahd_softc *ahd, bus_dma_tag_t parent,
937 ahd_dma_tag_destroy(struct ahd_softc *ahd, bus_dma_tag_t dmat)
943 ahd_dmamem_alloc(struct ahd_softc *ahd, bus_dma_tag_t dmat, void** vaddr,
946 *vaddr = pci_alloc_consistent(ahd->dev_softc,
954 ahd_dmamem_free(struct ahd_softc *ahd, bus_dma_tag_t dmat,
957 pci_free_consistent(ahd->dev_softc, dmat->maxsize,
962 ahd_dmamap_load(struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map,
979 ahd_dmamap_destroy(struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map)
984 ahd_dmamap_unload(struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map)
1197 ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *template)
1205 template->name = ahd->description;
1210 *((struct ahd_softc **)host->hostdata) = ahd;
1211 ahd->platform_data->host = host;
1215 host->this_id = ahd->our_id;
1216 host->irq = ahd->platform_data->irq;
1217 host->max_id = (ahd->features & AHD_WIDE) ? 16 : 8;
1221 ahd_lock(ahd, &s);
1222 ahd_set_unit(ahd, ahd_linux_unit++);
1223 ahd_unlock(ahd, &s);
1228 ahd_set_name(ahd, new_name);
1230 host->unique_id = ahd->unit;
1231 ahd_linux_initialize_scsi_bus(ahd);
1232 ahd_intr_enable(ahd, TRUE);
1236 retval = scsi_add_host(host, &ahd->dev_softc->dev);
1253 ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd)
1263 ahd->flags &= ~AHD_RESET_BUS_A;
1265 if ((ahd->flags & AHD_RESET_BUS_A) != 0)
1266 ahd_reset_channel(ahd, 'A', /*initiate_reset*/TRUE);
1268 numtarg = (ahd->features & AHD_WIDE) ? 16 : 8;
1270 ahd_lock(ahd, &s);
1281 tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
1283 ahd_compile_devinfo(&devinfo, ahd->our_id, target_id,
1285 ahd_update_neg_request(ahd, &devinfo, tstate,
1288 ahd_unlock(ahd, &s);
1290 if ((ahd->flags & AHD_RESET_BUS_A) != 0) {
1291 ahd_freeze_simq(ahd);
1293 ahd_release_simq(ahd);
1298 ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg)
1300 ahd->platform_data =
1302 if (ahd->platform_data == NULL)
1304 memset(ahd->platform_data, 0, sizeof(struct ahd_platform_data));
1305 ahd->platform_data->irq = AHD_LINUX_NOIRQ;
1306 ahd_lockinit(ahd);
1307 ahd->seltime = (aic79xx_seltime & 0x3) << 4;
1312 ahd_platform_free(struct ahd_softc *ahd)
1317 if (ahd->platform_data != NULL) {
1320 starget = ahd->platform_data->starget[i];
1322 ahd->platform_data->starget[i] = NULL;
1326 if (ahd->platform_data->irq != AHD_LINUX_NOIRQ)
1327 free_irq(ahd->platform_data->irq, ahd);
1328 if (ahd->tags[0] == BUS_SPACE_PIO
1329 && ahd->bshs[0].ioport != 0)
1330 release_region(ahd->bshs[0].ioport, 256);
1331 if (ahd->tags[1] == BUS_SPACE_PIO
1332 && ahd->bshs[1].ioport != 0)
1333 release_region(ahd->bshs[1].ioport, 256);
1334 if (ahd->tags[0] == BUS_SPACE_MEMIO
1335 && ahd->bshs[0].maddr != NULL) {
1336 iounmap(ahd->bshs[0].maddr);
1337 release_mem_region(ahd->platform_data->mem_busaddr,
1340 if (ahd->platform_data->host)
1341 scsi_host_put(ahd->platform_data->host);
1343 kfree(ahd->platform_data);
1348 ahd_platform_init(struct ahd_softc *ahd)
1353 if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
1356 iocell_opts = &aic79xx_iocell_info[ahd->unit];
1358 AHD_SET_PRECOMP(ahd, iocell_opts->precomp);
1360 AHD_SET_SLEWRATE(ahd, iocell_opts->slewrate);
1362 AHD_SET_AMPLITUDE(ahd, iocell_opts->amplitude);
1368 ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
1370 ahd_platform_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb),
1371 SCB_GET_CHANNEL(ahd, scb),
1377 ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev,
1415 usertags = ahd_linux_user_tagdepth(ahd, devinfo);
1464 ahd_platform_abort_scbs(struct ahd_softc *ahd, int target, char channel,
1471 ahd_linux_user_tagdepth(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
1477 if ((ahd->user_discenable & devinfo->target_mask) != 0) {
1478 if (ahd->unit >= ARRAY_SIZE(aic79xx_tag_info)) {
1492 tag_info = &aic79xx_tag_info[ahd->unit];
1509 struct ahd_softc *ahd = *((struct ahd_softc **)sdev->host->hostdata);
1512 ahd->our_id,
1516 tags = ahd_linux_user_tagdepth(ahd, &devinfo);
1519 ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_TAGGED);
1520 ahd_send_async(ahd, devinfo.channel, devinfo.target,
1522 ahd_print_devinfo(ahd, &devinfo);
1525 ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_NONE);
1526 ahd_send_async(ahd, devinfo.channel, devinfo.target,
1532 ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
1548 ahd_lock(ahd, &flags);
1553 tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
1562 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
1563 ahd->flags |= AHD_RESOURCE_SHORTAGE;
1564 ahd_unlock(ahd, &flags);
1578 hscb->scsiid = BUILD_SCSIID(ahd, cmd);
1581 mask = SCB_GET_TARGET_MASK(ahd, scb);
1583 if ((ahd->user_discenable & mask) != 0)
1635 sg = ahd_sg_setup(ahd, scb, sg, addr, len,
1640 LIST_INSERT_HEAD(&ahd->pending_scbs, scb, pending_links);
1648 ahd_queue_scb(ahd, scb);
1650 ahd_unlock(ahd, &flags);
1661 struct ahd_softc *ahd;
1665 ahd = (struct ahd_softc *) dev_id;
1666 ahd_lock(ahd, &flags);
1667 ours = ahd_intr(ahd);
1668 ahd_unlock(ahd, &flags);
1673 ahd_send_async(struct ahd_softc *ahd, char channel,
1692 tinfo = ahd_fetch_transinfo(ahd, channel, ahd->our_id,
1710 starget = ahd->platform_data->starget[target];
1748 scsi_report_device_reset(ahd->platform_data->host,
1753 if (ahd->platform_data->host != NULL) {
1754 scsi_report_bus_reset(ahd->platform_data->host,
1767 ahd_done(struct ahd_softc *ahd, struct scb *scb)
1774 ahd_dump_card_state(ahd);
1786 ahd_linux_unmap_scb(ahd, scb);
1803 ahd_print_path(ahd, scb);
1821 ahd_print_path(ahd, scb);
1826 ahd_print_path(ahd, scb);
1837 ahd_linux_handle_scsi_status(ahd, cmd->device, scb);
1865 if (ahd->platform_data->eh_done)
1866 complete(ahd->platform_data->eh_done);
1869 ahd_free_scb(ahd, scb);
1870 ahd_linux_queue_cmd_complete(ahd, cmd);
1874 ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
1881 ahd->our_id,
1934 ahd_get_sense_buf(ahd, scb)
1973 ahd_print_path(ahd, scb);
1992 ahd_print_path(ahd, scb);
2002 ahd_platform_set_tags(ahd, sdev, &devinfo,
2012 ahd_platform_set_tags(ahd, sdev, &devinfo,
2020 ahd_linux_queue_cmd_complete(struct ahd_softc *ahd, struct scsi_cmnd *cmd)
2118 ahd_name(ahd), status, cmd->device->channel,
2128 ahd_freeze_simq(struct ahd_softc *ahd)
2130 scsi_block_requests(ahd->platform_data->host);
2134 ahd_release_simq(struct ahd_softc *ahd)
2136 scsi_unblock_requests(ahd->platform_data->host);
2142 struct ahd_softc *ahd;
2161 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
2171 ahd_lock(ahd, &flags);
2195 LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
2219 was_paused = ahd_is_paused(ahd);
2220 ahd_pause_and_flushwork(ahd);
2229 ahd_name(ahd), was_paused ? "" : "not ");
2230 ahd_dump_card_state(ahd);
2233 if (ahd_search_qinfifo(ahd, cmd->device->id,
2240 ahd_name(ahd), cmd->device->channel,
2246 saved_modes = ahd_save_modes(ahd);
2247 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
2248 last_phase = ahd_inb(ahd, LASTPHASE);
2249 saved_scbptr = ahd_get_scbptr(ahd);
2251 if (disconnected && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) == 0) {
2254 bus_scb = ahd_lookup_scb(ahd, active_scbptr);
2264 saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
2272 pending_scb = ahd_lookup_scb(ahd, active_scbptr);
2274 ahd_outb(ahd, MSG_OUT, HOST_MSG);
2275 ahd_outb(ahd, SCSISIGO, last_phase|ATNO);
2285 ahd_set_scbptr(ahd, SCB_GET_TAG(pending_scb));
2298 ahd_outb(ahd, SCB_TASK_MANAGEMENT,
2318 ahd_outb(ahd, SCB_CONTROL,
2319 ahd_inb(ahd, SCB_CONTROL)|MK_MESSAGE);
2327 ahd_search_qinfifo(ahd, cmd->device->id,
2331 ahd_qinfifo_requeue_tail(ahd, pending_scb);
2332 ahd_set_scbptr(ahd, saved_scbptr);
2333 ahd_print_path(ahd, pending_scb);
2352 ahd_unpause(ahd);
2356 ahd->platform_data->eh_done = &done;
2357 ahd_unlock(ahd, &flags);
2359 printk("%s: Recovery code sleeping\n", ahd_name(ahd));
2361 ahd_lock(ahd, &flags);
2362 ahd->platform_data->eh_done = NULL;
2363 ahd_unlock(ahd, &flags);
2365 ahd_name(ahd), dev->active);
2370 ahd_unlock(ahd, &flags);
2374 ahd_name(ahd), retval);
2382 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2388 ahd_lock(ahd, &flags);
2389 ahd_set_width(ahd, &devinfo, width, AHD_TRANS_GOAL, FALSE);
2390 ahd_unlock(ahd, &flags);
2396 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2399 = ahd_fetch_transinfo(ahd,
2410 printk("%s: set period to %d\n", ahd_name(ahd), period);
2437 ahd_find_syncrate(ahd, &period, &ppr_options,
2440 ahd_lock(ahd, &flags);
2441 ahd_set_syncrate(ahd, &devinfo, period, offset,
2443 ahd_unlock(ahd, &flags);
2449 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2452 = ahd_fetch_transinfo(ahd,
2463 printk("%s: set offset to %d\n", ahd_name(ahd), offset);
2471 ahd_find_syncrate(ahd, &period, &ppr_options,
2475 ahd_lock(ahd, &flags);
2476 ahd_set_syncrate(ahd, &devinfo, period, offset, ppr_options,
2478 ahd_unlock(ahd, &flags);
2484 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2487 = ahd_fetch_transinfo(ahd,
2499 printk("%s: %s DT\n", ahd_name(ahd),
2514 ahd_find_syncrate(ahd, &period, &ppr_options,
2517 ahd_lock(ahd, &flags);
2518 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2520 ahd_unlock(ahd, &flags);
2526 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2529 = ahd_fetch_transinfo(ahd,
2541 printk("%s: %s QAS\n", ahd_name(ahd),
2553 ahd_find_syncrate(ahd, &period, &ppr_options,
2556 ahd_lock(ahd, &flags);
2557 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2559 ahd_unlock(ahd, &flags);
2565 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2568 = ahd_fetch_transinfo(ahd,
2580 printk("%s: %s IU\n", ahd_name(ahd),
2593 ahd_find_syncrate(ahd, &period, &ppr_options,
2596 ahd_lock(ahd, &flags);
2597 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2599 ahd_unlock(ahd, &flags);
2605 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2608 = ahd_fetch_transinfo(ahd,
2620 printk("%s: %s Read Streaming\n", ahd_name(ahd),
2629 ahd_find_syncrate(ahd, &period, &ppr_options,
2632 ahd_lock(ahd, &flags);
2633 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2635 ahd_unlock(ahd, &flags);
2641 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2644 = ahd_fetch_transinfo(ahd,
2656 printk("%s: %s Write Flow Control\n", ahd_name(ahd),
2665 ahd_find_syncrate(ahd, &period, &ppr_options,
2668 ahd_lock(ahd, &flags);
2669 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2671 ahd_unlock(ahd, &flags);
2677 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2680 = ahd_fetch_transinfo(ahd,
2690 if ((ahd->features & AHD_RTI) == 0) {
2693 printk("%s: RTI not available\n", ahd_name(ahd));
2700 printk("%s: %s RTI\n", ahd_name(ahd),
2709 ahd_find_syncrate(ahd, &period, &ppr_options,
2712 ahd_lock(ahd, &flags);
2713 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2715 ahd_unlock(ahd, &flags);
2721 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2724 = ahd_fetch_transinfo(ahd,
2736 printk("%s: %s Precompensation\n", ahd_name(ahd),
2743 if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
2746 iocell_opts = &aic79xx_iocell_info[ahd->unit];
2752 AHD_SET_PRECOMP(ahd, precomp);
2754 AHD_SET_PRECOMP(ahd, 0);
2759 ahd_find_syncrate(ahd, &period, &ppr_options,
2762 ahd_lock(ahd, &flags);
2763 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2765 ahd_unlock(ahd, &flags);
2771 struct ahd_softc *ahd = *((struct ahd_softc **)shost->hostdata);
2774 = ahd_fetch_transinfo(ahd,
2789 ahd_find_syncrate(ahd, &period, &ppr_options,
2792 ahd_lock(ahd, &flags);
2793 ahd_set_syncrate(ahd, &devinfo, period, tinfo->goal.offset,
2795 ahd_unlock(ahd, &flags);
2800 struct ahd_softc *ahd = *(struct ahd_softc **)shost->hostdata;
2804 ahd_lock(ahd, &flags);
2805 ahd_pause(ahd);
2806 mode = ahd_inb(ahd, SBLKCTL);
2807 ahd_unpause(ahd);
2808 ahd_unlock(ahd, &flags);