Lines Matching refs:np

140 void sym_xpt_done(struct sym_hcb *np, struct scsi_cmnd *cmd)  in sym_xpt_done()  argument
155 void sym_xpt_async_bus_reset(struct sym_hcb *np) in sym_xpt_async_bus_reset() argument
157 printf_notice("%s: SCSI BUS has been reset.\n", sym_name(np)); in sym_xpt_async_bus_reset()
158 np->s.settle_time = jiffies + sym_driver_setup.settle_delay * HZ; in sym_xpt_async_bus_reset()
159 np->s.settle_time_valid = 1; in sym_xpt_async_bus_reset()
162 sym_name(np), sym_driver_setup.settle_delay); in sym_xpt_async_bus_reset()
187 void sym_set_cam_result_error(struct sym_hcb *np, struct sym_ccb *cp, int resid) in sym_set_cam_result_error() argument
223 sym_clear_tasks(np, DID_ABORT, in sym_set_cam_result_error()
234 sym_reset_scsi_target(np, cmd->device->id); in sym_set_cam_result_error()
258 static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd *cmd) in sym_scatter() argument
268 struct sym_tcb *tp = &np->target[cp->target]; in sym_scatter()
287 sym_build_sge(np, &data[segment], baddr, len); in sym_scatter()
300 static int sym_queue_command(struct sym_hcb *np, struct scsi_cmnd *cmd) in sym_queue_command() argument
311 tp = &np->target[sdev->id]; in sym_queue_command()
322 cp = sym_get_ccb(np, cmd, order); in sym_queue_command()
325 sym_queue_scsiio(np, cmd, cp); in sym_queue_command()
332 static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp) in sym_setup_cdb() argument
345 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
353 if (sym_setup_cdb(np, cmd, cp)) in sym_setup_data_and_start()
361 cp->segments = sym_scatter(np, cp, cmd); in sym_setup_data_and_start()
386 goalp = SCRIPTA_BA(np, data_out2) + 8; in sym_setup_data_and_start()
391 goalp = SCRIPTA_BA(np, data_in2) + 8; in sym_setup_data_and_start()
396 lastp = goalp = SCRIPTB_BA(np, no_data); in sym_setup_data_and_start()
427 sym_put_start_queue(np, cp); in sym_setup_data_and_start()
431 sym_free_ccb(np, cp); in sym_setup_data_and_start()
432 sym_xpt_done(np, cmd); in sym_setup_data_and_start()
443 static void sym_timer(struct sym_hcb *np) in sym_timer() argument
450 np->s.timer.expires = thistime + SYM_CONF_TIMER_INTERVAL; in sym_timer()
451 add_timer(&np->s.timer); in sym_timer()
457 if (np->s.settle_time_valid) { in sym_timer()
458 if (time_before_eq(np->s.settle_time, thistime)) { in sym_timer()
461 sym_name(np)); in sym_timer()
462 np->s.settle_time_valid = 0; in sym_timer()
470 if (np->s.lasttime + 4*HZ < thistime) { in sym_timer()
471 np->s.lasttime = thistime; in sym_timer()
483 sym_wakeup_done(np); in sym_timer()
511 struct sym_hcb *np = SYM_SOFTC_PTR(cmd); in sym53c8xx_queue_command_lck() local
522 if (np->s.settle_time_valid && cmd->request->timeout) { in sym53c8xx_queue_command_lck()
525 if (time_after(np->s.settle_time, tlimit)) { in sym53c8xx_queue_command_lck()
526 np->s.settle_time = tlimit; in sym53c8xx_queue_command_lck()
530 if (np->s.settle_time_valid) in sym53c8xx_queue_command_lck()
533 sts = sym_queue_command(np, cmd); in sym53c8xx_queue_command_lck()
570 struct sym_hcb *np = (struct sym_hcb *)npref; in sym53c8xx_timer() local
573 spin_lock_irqsave(np->s.host->host_lock, flags); in sym53c8xx_timer()
574 sym_timer(np); in sym53c8xx_timer()
575 spin_unlock_irqrestore(np->s.host->host_lock, flags); in sym53c8xx_timer()
597 struct sym_hcb *np = sym_data->ncb; in sym_eh_handler() local
637 FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { in sym_eh_handler()
649 sts = sym_abort_scsiio(np, cmd, 1); in sym_eh_handler()
652 sts = sym_reset_scsi_target(np, cmd->device->id); in sym_eh_handler()
655 sym_reset_scsi_bus(np, 1); in sym_eh_handler()
659 sym_reset_scsi_bus(np, 0); in sym_eh_handler()
739 struct sym_hcb *np = sym_get_hcb(sdev->host); in sym53c8xx_slave_alloc() local
740 struct sym_tcb *tp = &np->target[sdev->id]; in sym53c8xx_slave_alloc()
748 spin_lock_irqsave(np->s.host->host_lock, flags); in sym53c8xx_slave_alloc()
776 lp = sym_alloc_lcb(np, sdev->id, sdev->lun); in sym53c8xx_slave_alloc()
789 spin_unlock_irqrestore(np->s.host->host_lock, flags); in sym53c8xx_slave_alloc()
799 struct sym_hcb *np = sym_get_hcb(sdev->host); in sym53c8xx_slave_configure() local
800 struct sym_tcb *tp = &np->target[sdev->id]; in sym53c8xx_slave_configure()
835 struct sym_hcb *np = sym_get_hcb(sdev->host); in sym53c8xx_slave_destroy() local
836 struct sym_tcb *tp = &np->target[sdev->id]; in sym53c8xx_slave_destroy()
844 spin_lock_irqsave(np->s.host->host_lock, flags); in sym53c8xx_slave_destroy()
853 sym_reset_scsi_bus(np, 1); in sym53c8xx_slave_destroy()
856 if (sym_free_lcb(np, sdev->id, sdev->lun) == 0) { in sym53c8xx_slave_destroy()
861 tp->head.wval = np->rv_scntl3; in sym53c8xx_slave_destroy()
867 spin_unlock_irqrestore(np->s.host->host_lock, flags); in sym53c8xx_slave_destroy()
907 static void sym_exec_user_command (struct sym_hcb *np, struct sym_usrcmd *uc) in sym_exec_user_command() argument
921 np->verbose = uc->data; in sym_exec_user_command()
932 tp = &np->target[t]; in sym_exec_user_command()
943 } else if (uc->data <= 9 && np->minsync_dt) { in sym_exec_user_command()
944 if (uc->data < np->minsync_dt) in sym_exec_user_command()
945 uc->data = np->minsync_dt; in sym_exec_user_command()
950 tp->tgoal.offset = np->maxoffs_dt; in sym_exec_user_command()
952 if (uc->data < np->minsync) in sym_exec_user_command()
953 uc->data = np->minsync; in sym_exec_user_command()
957 tp->tgoal.offset = np->maxoffs; in sym_exec_user_command()
971 np->istat_sem = SEM; in sym_exec_user_command()
972 OUTB(np, nc_istat, SIGP|SEM); in sym_exec_user_command()
979 np->istat_sem = SEM; in sym_exec_user_command()
980 OUTB(np, nc_istat, SIGP|SEM); in sym_exec_user_command()
1035 struct sym_hcb *np = sym_get_hcb(shost); in sym_user_command() local
1163 sym_exec_user_command(np, uc); in sym_user_command()
1180 struct sym_hcb *np = sym_data->ncb; in sym_show_info() local
1183 "revision id 0x%x\n", np->s.chip_name, in sym_show_info()
1188 (int) (np->minsync_dt ? np->minsync_dt : np->minsync), in sym_show_info()
1189 np->maxwide ? "Wide" : "Narrow", in sym_show_info()
1190 np->minsync_dt ? ", DT capable" : ""); in sym_show_info()
1220 static void sym_free_resources(struct sym_hcb *np, struct pci_dev *pdev, in sym_free_resources() argument
1227 free_irq(pdev->irq, np->s.host); in sym_free_resources()
1228 if (np->s.ioaddr) in sym_free_resources()
1229 pci_iounmap(pdev, np->s.ioaddr); in sym_free_resources()
1230 if (np->s.ramaddr) in sym_free_resources()
1231 pci_iounmap(pdev, np->s.ramaddr); in sym_free_resources()
1235 sym_hcb_free(np); in sym_free_resources()
1237 sym_mfree_dma(np, sizeof(*np), "HCB"); in sym_free_resources()
1253 struct sym_hcb *np = NULL; in sym_attach() local
1282 np = __sym_calloc_dma(&pdev->dev, sizeof(*np), "HCB"); in sym_attach()
1283 if (!np) in sym_attach()
1285 np->bus_dmat = &pdev->dev; /* Result in 1 DMA pool per HBA */ in sym_attach()
1286 sym_data->ncb = np; in sym_attach()
1288 np->s.host = shost; in sym_attach()
1295 np->hcb_ba = vtobus(np); in sym_attach()
1296 np->verbose = sym_driver_setup.verbose; in sym_attach()
1297 np->s.unit = unit; in sym_attach()
1298 np->features = dev->chip.features; in sym_attach()
1299 np->clock_divn = dev->chip.nr_divisor; in sym_attach()
1300 np->maxoffs = dev->chip.offset_max; in sym_attach()
1301 np->maxburst = dev->chip.burst_max; in sym_attach()
1302 np->myaddr = dev->host_id; in sym_attach()
1303 np->mmio_ba = (u32)dev->mmio_base; in sym_attach()
1304 np->ram_ba = (u32)dev->ram_base; in sym_attach()
1305 np->s.ioaddr = dev->s.ioaddr; in sym_attach()
1306 np->s.ramaddr = dev->s.ramaddr; in sym_attach()
1311 strlcpy(np->s.chip_name, dev->chip.name, sizeof(np->s.chip_name)); in sym_attach()
1312 sprintf(np->s.inst_name, "sym%d", np->s.unit); in sym_attach()
1314 if ((SYM_CONF_DMA_ADDRESSING_MODE > 0) && (np->features & FE_DAC) && in sym_attach()
1316 set_dac(np); in sym_attach()
1318 printf_warning("%s: No suitable DMA available\n", sym_name(np)); in sym_attach()
1333 sym_name(np), pdev->irq); in sym_attach()
1343 if (sym_reset_scsi_bus(np, 0)) in sym_attach()
1354 init_timer(&np->s.timer); in sym_attach()
1355 np->s.timer.data = (unsigned long) np; in sym_attach()
1356 np->s.timer.function = sym53c8xx_timer; in sym_attach()
1357 np->s.lasttime=0; in sym_attach()
1358 sym_timer (np); in sym_attach()
1365 shost->this_id = np->myaddr; in sym_attach()
1366 shost->max_id = np->maxwide ? 16 : 8; in sym_attach()
1386 "TERMINATION, DEVICE POWER etc.!\n", sym_name(np)); in sym_attach()
1390 if (np) in sym_attach()
1391 sym_free_resources(np, pdev, do_free_irq); in sym_attach()
1627 struct sym_hcb *np = sym_get_hcb(shost); in sym_detach() local
1628 printk("%s: detaching ...\n", sym_name(np)); in sym_detach()
1630 del_timer_sync(&np->s.timer); in sym_detach()
1637 printk("%s: resetting chip\n", sym_name(np)); in sym_detach()
1638 OUTB(np, nc_istat, SRST); in sym_detach()
1639 INB(np, nc_mbox1); in sym_detach()
1641 OUTB(np, nc_istat, 0); in sym_detach()
1643 sym_free_resources(np, pdev, 1); in sym_detach()
1826 struct sym_hcb *np = sym_get_hcb(shost); in sym2_io_slot_reset() local
1829 sym_name(np)); in sym2_io_slot_reset()
1833 sym_name(np)); in sym2_io_slot_reset()
1841 if (np->features & FE_WRIE) { in sym2_io_slot_reset()
1851 if (sym_reset_scsi_bus(np, 0)) { in sym2_io_slot_reset()
1853 sym_name(np)); in sym2_io_slot_reset()
1883 struct sym_hcb *np = sym_get_hcb(shost); in sym2_get_signalling() local
1886 switch (np->scsi_mode) { in sym2_get_signalling()
1906 struct sym_hcb *np = sym_get_hcb(shost); in sym2_set_offset() local
1907 struct sym_tcb *tp = &np->target[starget->id]; in sym2_set_offset()
1916 struct sym_hcb *np = sym_get_hcb(shost); in sym2_set_period() local
1917 struct sym_tcb *tp = &np->target[starget->id]; in sym2_set_period()
1921 if (period <= np->minsync && spi_width(starget)) in sym2_set_period()
1931 struct sym_hcb *np = sym_get_hcb(shost); in sym2_set_width() local
1932 struct sym_tcb *tp = &np->target[starget->id]; in sym2_set_width()
1946 struct sym_hcb *np = sym_get_hcb(shost); in sym2_set_dt() local
1947 struct sym_tcb *tp = &np->target[starget->id]; in sym2_set_dt()
1961 struct sym_hcb *np = sym_get_hcb(shost);
1962 struct sym_tcb *tp = &np->target[starget->id];
1974 struct sym_hcb *np = sym_get_hcb(shost);
1975 struct sym_tcb *tp = &np->target[starget->id];