Lines Matching full:np

127 void sym_xpt_done(struct sym_hcb *np, struct scsi_cmnd *cmd)  in sym_xpt_done()  argument
141 void sym_xpt_async_bus_reset(struct sym_hcb *np) in sym_xpt_async_bus_reset() argument
143 printf_notice("%s: SCSI BUS has been reset.\n", sym_name(np)); in sym_xpt_async_bus_reset()
144 np->s.settle_time = jiffies + sym_driver_setup.settle_delay * HZ; in sym_xpt_async_bus_reset()
145 np->s.settle_time_valid = 1; in sym_xpt_async_bus_reset()
148 sym_name(np), sym_driver_setup.settle_delay); in sym_xpt_async_bus_reset()
169 void sym_set_cam_result_error(struct sym_hcb *np, struct sym_ccb *cp, int resid) in sym_set_cam_result_error() argument
203 sym_clear_tasks(np, DID_ABORT, in sym_set_cam_result_error()
214 sym_reset_scsi_target(np, cmd->device->id); in sym_set_cam_result_error()
238 static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd *cmd) in sym_scatter() argument
248 struct sym_tcb *tp = &np->target[cp->target]; in sym_scatter()
267 sym_build_sge(np, &data[segment], baddr, len); in sym_scatter()
280 static int sym_queue_command(struct sym_hcb *np, struct scsi_cmnd *cmd) in sym_queue_command() argument
291 tp = &np->target[sdev->id]; in sym_queue_command()
302 cp = sym_get_ccb(np, cmd, order); in sym_queue_command()
305 sym_queue_scsiio(np, cmd, cp); in sym_queue_command()
312 static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp) in sym_setup_cdb() argument
325 int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp) in sym_setup_data_and_start() argument
333 if (sym_setup_cdb(np, cmd, cp)) in sym_setup_data_and_start()
341 cp->segments = sym_scatter(np, cp, cmd); in sym_setup_data_and_start()
366 goalp = SCRIPTA_BA(np, data_out2) + 8; in sym_setup_data_and_start()
371 goalp = SCRIPTA_BA(np, data_in2) + 8; in sym_setup_data_and_start()
376 lastp = goalp = SCRIPTB_BA(np, no_data); in sym_setup_data_and_start()
407 sym_put_start_queue(np, cp); in sym_setup_data_and_start()
411 sym_free_ccb(np, cp); in sym_setup_data_and_start()
412 sym_xpt_done(np, cmd); in sym_setup_data_and_start()
423 static void sym_timer(struct sym_hcb *np) in sym_timer() argument
430 np->s.timer.expires = thistime + SYM_CONF_TIMER_INTERVAL; in sym_timer()
431 add_timer(&np->s.timer); in sym_timer()
437 if (np->s.settle_time_valid) { in sym_timer()
438 if (time_before_eq(np->s.settle_time, thistime)) { in sym_timer()
441 sym_name(np)); in sym_timer()
442 np->s.settle_time_valid = 0; in sym_timer()
450 if (np->s.lasttime + 4*HZ < thistime) { in sym_timer()
451 np->s.lasttime = thistime; in sym_timer()
463 sym_wakeup_done(np); in sym_timer()
490 struct sym_hcb *np = SYM_SOFTC_PTR(cmd); in sym53c8xx_queue_command_lck() local
500 if (np->s.settle_time_valid && scsi_cmd_to_rq(cmd)->timeout) { in sym53c8xx_queue_command_lck()
503 if (time_after(np->s.settle_time, tlimit)) { in sym53c8xx_queue_command_lck()
504 np->s.settle_time = tlimit; in sym53c8xx_queue_command_lck()
508 if (np->s.settle_time_valid) in sym53c8xx_queue_command_lck()
511 sts = sym_queue_command(np, cmd); in sym53c8xx_queue_command_lck()
548 struct sym_hcb *np = from_timer(np, t, s.timer); in sym53c8xx_timer() local
551 spin_lock_irqsave(np->s.host->host_lock, flags); in sym53c8xx_timer()
552 sym_timer(np); in sym53c8xx_timer()
553 spin_unlock_irqrestore(np->s.host->host_lock, flags); in sym53c8xx_timer()
576 struct sym_hcb *np = sym_data->ncb; in sym53c8xx_eh_abort_handler() local
592 FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { in sym53c8xx_eh_abort_handler()
600 sts = sym_abort_scsiio(np, cmd, 1); in sym53c8xx_eh_abort_handler()
628 struct sym_hcb *np = sym_data->ncb; in sym53c8xx_eh_target_reset_handler() local
643 sts = sym_reset_scsi_target(np, starget->id); in sym53c8xx_eh_target_reset_handler()
645 FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { in sym53c8xx_eh_target_reset_handler()
678 struct sym_hcb *np = sym_data->ncb; in sym53c8xx_eh_bus_reset_handler() local
689 sym_reset_scsi_bus(np, 1); in sym53c8xx_eh_bus_reset_handler()
701 struct sym_hcb *np = sym_data->ncb; in sym53c8xx_eh_host_reset_handler() local
734 sym_reset_scsi_bus(np, 0); in sym53c8xx_eh_host_reset_handler()
770 struct sym_hcb *np = sym_get_hcb(sdev->host); in sym53c8xx_sdev_init() local
771 struct sym_tcb *tp = &np->target[sdev->id]; in sym53c8xx_sdev_init()
779 spin_lock_irqsave(np->s.host->host_lock, flags); in sym53c8xx_sdev_init()
807 lp = sym_alloc_lcb(np, sdev->id, sdev->lun); in sym53c8xx_sdev_init()
820 spin_unlock_irqrestore(np->s.host->host_lock, flags); in sym53c8xx_sdev_init()
831 struct sym_hcb *np = sym_get_hcb(sdev->host); in sym53c8xx_sdev_configure() local
832 struct sym_tcb *tp = &np->target[sdev->id]; in sym53c8xx_sdev_configure()
867 struct sym_hcb *np = sym_get_hcb(sdev->host); in sym53c8xx_sdev_destroy() local
868 struct sym_tcb *tp = &np->target[sdev->id]; in sym53c8xx_sdev_destroy()
876 spin_lock_irqsave(np->s.host->host_lock, flags); in sym53c8xx_sdev_destroy()
885 sym_reset_scsi_bus(np, 1); in sym53c8xx_sdev_destroy()
888 if (sym_free_lcb(np, sdev->id, sdev->lun) == 0) { in sym53c8xx_sdev_destroy()
893 tp->head.wval = np->rv_scntl3; in sym53c8xx_sdev_destroy()
899 spin_unlock_irqrestore(np->s.host->host_lock, flags); in sym53c8xx_sdev_destroy()
939 static void sym_exec_user_command (struct sym_hcb *np, struct sym_usrcmd *uc) in sym_exec_user_command() argument
953 np->verbose = uc->data; in sym_exec_user_command()
964 tp = &np->target[t]; in sym_exec_user_command()
975 } else if (uc->data <= 9 && np->minsync_dt) { in sym_exec_user_command()
976 if (uc->data < np->minsync_dt) in sym_exec_user_command()
977 uc->data = np->minsync_dt; in sym_exec_user_command()
982 tp->tgoal.offset = np->maxoffs_dt; in sym_exec_user_command()
984 if (uc->data < np->minsync) in sym_exec_user_command()
985 uc->data = np->minsync; in sym_exec_user_command()
989 tp->tgoal.offset = np->maxoffs; in sym_exec_user_command()
1003 np->istat_sem = SEM; in sym_exec_user_command()
1004 OUTB(np, nc_istat, SIGP|SEM); in sym_exec_user_command()
1011 np->istat_sem = SEM; in sym_exec_user_command()
1012 OUTB(np, nc_istat, SIGP|SEM); in sym_exec_user_command()
1067 struct sym_hcb *np = sym_get_hcb(shost); in sym_user_command() local
1195 sym_exec_user_command(np, uc); in sym_user_command()
1212 struct sym_hcb *np = sym_data->ncb; in sym_show_info() local
1215 "revision id 0x%x\n", np->s.chip_name, in sym_show_info()
1220 (int) (np->minsync_dt ? np->minsync_dt : np->minsync), in sym_show_info()
1221 np->maxwide ? "Wide" : "Narrow", in sym_show_info()
1222 np->minsync_dt ? ", DT capable" : ""); in sym_show_info()
1252 static void sym_free_resources(struct sym_hcb *np, struct pci_dev *pdev, in sym_free_resources() argument
1259 free_irq(pdev->irq, np->s.host); in sym_free_resources()
1260 if (np->s.ioaddr) in sym_free_resources()
1261 pci_iounmap(pdev, np->s.ioaddr); in sym_free_resources()
1262 if (np->s.ramaddr) in sym_free_resources()
1263 pci_iounmap(pdev, np->s.ramaddr); in sym_free_resources()
1267 sym_hcb_free(np); in sym_free_resources()
1269 sym_mfree_dma(np, sizeof(*np), "HCB"); in sym_free_resources()
1285 struct sym_hcb *np = NULL; in sym_attach() local
1314 np = __sym_calloc_dma(&pdev->dev, sizeof(*np), "HCB"); in sym_attach()
1315 if (!np) in sym_attach()
1317 np->bus_dmat = &pdev->dev; /* Result in 1 DMA pool per HBA */ in sym_attach()
1318 sym_data->ncb = np; in sym_attach()
1320 np->s.host = shost; in sym_attach()
1327 np->hcb_ba = vtobus(np); in sym_attach()
1328 np->verbose = sym_driver_setup.verbose; in sym_attach()
1329 np->s.unit = unit; in sym_attach()
1330 np->features = dev->chip.features; in sym_attach()
1331 np->clock_divn = dev->chip.nr_divisor; in sym_attach()
1332 np->maxoffs = dev->chip.offset_max; in sym_attach()
1333 np->maxburst = dev->chip.burst_max; in sym_attach()
1334 np->myaddr = dev->host_id; in sym_attach()
1335 np->mmio_ba = (u32)dev->mmio_base; in sym_attach()
1336 np->ram_ba = (u32)dev->ram_base; in sym_attach()
1337 np->s.ioaddr = dev->s.ioaddr; in sym_attach()
1338 np->s.ramaddr = dev->s.ramaddr; in sym_attach()
1343 strscpy(np->s.chip_name, dev->chip.name, sizeof(np->s.chip_name)); in sym_attach()
1344 sprintf(np->s.inst_name, "sym%d", np->s.unit); in sym_attach()
1346 if ((SYM_CONF_DMA_ADDRESSING_MODE > 0) && (np->features & FE_DAC) && in sym_attach()
1348 set_dac(np); in sym_attach()
1350 printf_warning("%s: No suitable DMA available\n", sym_name(np)); in sym_attach()
1365 sym_name(np), pdev->irq); in sym_attach()
1375 if (sym_reset_scsi_bus(np, 0)) in sym_attach()
1386 timer_setup(&np->s.timer, sym53c8xx_timer, 0); in sym_attach()
1387 np->s.lasttime=0; in sym_attach()
1388 sym_timer (np); in sym_attach()
1395 shost->this_id = np->myaddr; in sym_attach()
1396 shost->max_id = np->maxwide ? 16 : 8; in sym_attach()
1416 "TERMINATION, DEVICE POWER etc.!\n", sym_name(np)); in sym_attach()
1420 if (np) in sym_attach()
1421 sym_free_resources(np, pdev, do_free_irq); in sym_attach()
1657 struct sym_hcb *np = sym_get_hcb(shost); in sym_detach() local
1658 printk("%s: detaching ...\n", sym_name(np)); in sym_detach()
1660 del_timer_sync(&np->s.timer); in sym_detach()
1667 printk("%s: resetting chip\n", sym_name(np)); in sym_detach()
1668 OUTB(np, nc_istat, SRST); in sym_detach()
1669 INB(np, nc_mbox1); in sym_detach()
1671 OUTB(np, nc_istat, 0); in sym_detach()
1673 sym_free_resources(np, pdev, 1); in sym_detach()
1857 struct sym_hcb *np = sym_get_hcb(shost); in sym2_io_slot_reset() local
1860 sym_name(np)); in sym2_io_slot_reset()
1864 sym_name(np)); in sym2_io_slot_reset()
1872 if (np->features & FE_WRIE) { in sym2_io_slot_reset()
1882 if (sym_reset_scsi_bus(np, 0)) { in sym2_io_slot_reset()
1884 sym_name(np)); in sym2_io_slot_reset()
1914 struct sym_hcb *np = sym_get_hcb(shost); in sym2_get_signalling() local
1917 switch (np->scsi_mode) { in sym2_get_signalling()
1937 struct sym_hcb *np = sym_get_hcb(shost); in sym2_set_offset() local
1938 struct sym_tcb *tp = &np->target[starget->id]; in sym2_set_offset()
1947 struct sym_hcb *np = sym_get_hcb(shost); in sym2_set_period() local
1948 struct sym_tcb *tp = &np->target[starget->id]; in sym2_set_period()
1952 if (period <= np->minsync && spi_width(starget)) in sym2_set_period()
1962 struct sym_hcb *np = sym_get_hcb(shost); in sym2_set_width() local
1963 struct sym_tcb *tp = &np->target[starget->id]; in sym2_set_width()
1977 struct sym_hcb *np = sym_get_hcb(shost); in sym2_set_dt() local
1978 struct sym_tcb *tp = &np->target[starget->id]; in sym2_set_dt()
1992 struct sym_hcb *np = sym_get_hcb(shost);
1993 struct sym_tcb *tp = &np->target[starget->id];
2005 struct sym_hcb *np = sym_get_hcb(shost);
2006 struct sym_tcb *tp = &np->target[starget->id];