• Home
  • Raw
  • Download

Lines Matching +full:long +full:- +full:term

4  *  Copyright (C) 1997-2005 Russell King
15 * 01-10-1997 RMK Created, READONLY version
16 * 15-02-1998 RMK READ/WRITE version
18 * 14-03-1998 RMK Updated DMA support
20 * 15-04-1998 RMK Only do PIO if FAS216 will allow it.
21 * 27-06-1998 RMK Changed asm/delay.h to linux/delay.h
22 * 02-04-2000 RMK 0.0.3 Fixed NO_IRQ/NO_DMA problem, updated for new
34 #include <linux/dma-mapping.h>
65 * Use term=0,1,0,0,0 to turn terminators on/off
67 static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }; variable
82 * Params : ec - expansion card structure
83 * : irqnr - interrupt number
88 struct eesoxscsi_info *info = (struct eesoxscsi_info *)ec->irq_data; in eesoxscsi_irqenable()
90 info->control |= EESOX_INTR_ENABLE; in eesoxscsi_irqenable()
92 writeb(info->control, info->ctl_port); in eesoxscsi_irqenable()
97 * Params : ec - expansion card structure
98 * : irqnr - interrupt number
103 struct eesoxscsi_info *info = (struct eesoxscsi_info *)ec->irq_data; in eesoxscsi_irqdisable()
105 info->control &= ~EESOX_INTR_ENABLE; in eesoxscsi_irqdisable()
107 writeb(info->control, info->ctl_port); in eesoxscsi_irqdisable()
117 * Params : host - card to turn on/off
118 * : on_off - !0 to turn on, 0 to turn off
123 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_terminator_ctl()
124 unsigned long flags; in eesoxscsi_terminator_ctl()
126 spin_lock_irqsave(host->host_lock, flags); in eesoxscsi_terminator_ctl()
128 info->control |= EESOX_TERM_ENABLE; in eesoxscsi_terminator_ctl()
130 info->control &= ~EESOX_TERM_ENABLE; in eesoxscsi_terminator_ctl()
132 writeb(info->control, info->ctl_port); in eesoxscsi_terminator_ctl()
133 spin_unlock_irqrestore(host->host_lock, flags); in eesoxscsi_terminator_ctl()
138 * Params : irq - interrupt number
139 * dev_id - user-defined (Scsi_Host structure)
146 return fas216_intr(&info->info); in eesoxscsi_intr()
151 * Params : host - host
152 * SCpnt - command
153 * direction - DMA on to/off of card
154 * min_type - minimum DMA support that we must have for this transfer
161 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_dma_setup()
163 int dmach = info->info.scsi.dma; in eesoxscsi_dma_setup()
166 (min_type == fasdma_real_all || SCp->this_residual >= 512)) { in eesoxscsi_dma_setup()
169 bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG); in eesoxscsi_dma_setup()
178 dma_map_sg(dev, info->sg, bufs, map_dir); in eesoxscsi_dma_setup()
181 set_dma_sg(dmach, info->sg, bufs); in eesoxscsi_dma_setup()
199 register const unsigned long mask = 0xffff; in eesoxscsi_buffer_in()
233 status -= 2; in eesoxscsi_buffer_in()
234 length -= 2; in eesoxscsi_buffer_in()
238 unsigned long l1, l2; in eesoxscsi_buffer_in()
248 length -= 8; in eesoxscsi_buffer_in()
253 unsigned long l1; in eesoxscsi_buffer_in()
260 length -= 4; in eesoxscsi_buffer_in()
267 length -= 2; in eesoxscsi_buffer_in()
301 status = 16 - status; in eesoxscsi_buffer_out()
312 status -= 2; in eesoxscsi_buffer_out()
313 length -= 2; in eesoxscsi_buffer_out()
317 unsigned long l1, l2; in eesoxscsi_buffer_out()
328 length -= 8; in eesoxscsi_buffer_out()
333 unsigned long l1; in eesoxscsi_buffer_out()
340 length -= 4; in eesoxscsi_buffer_out()
347 length -= 2; in eesoxscsi_buffer_out()
356 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_dma_pseudo()
358 eesoxscsi_buffer_in(SCp->ptr, SCp->this_residual, info->base); in eesoxscsi_dma_pseudo()
360 eesoxscsi_buffer_out(SCp->ptr, SCp->this_residual, info->base); in eesoxscsi_dma_pseudo()
366 * Params : host - host
367 * SCpnt - command
372 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_dma_stop()
373 if (info->info.scsi.dma != NO_DMA) in eesoxscsi_dma_stop()
374 disable_dma(info->info.scsi.dma); in eesoxscsi_dma_stop()
379 * Params : host - driver host structure to return info for.
384 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_info()
388 host->hostt->name, info->info.scsi.type, info->ec->slot_no, in eesoxscsi_info()
389 VERSION, info->control & EESOX_TERM_ENABLE ? "n" : "ff"); in eesoxscsi_info()
396 * Params : host - host to setup
397 * : buffer - buffer containing string describing operation
398 * : length - length of string
399 * Returns : -EINVAL, or 0
408 length -= 9; in eesoxscsi_set_proc_info()
410 if (length >= 5 && strncmp(buffer, "term=", 5) == 0) { in eesoxscsi_set_proc_info()
416 ret = -EINVAL; in eesoxscsi_set_proc_info()
418 ret = -EINVAL; in eesoxscsi_set_proc_info()
420 ret = -EINVAL; in eesoxscsi_set_proc_info()
429 info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_show_info()
432 fas216_print_host(&info->info, m); in eesoxscsi_show_info()
433 seq_printf(m, "Term : o%s\n", in eesoxscsi_show_info()
434 info->control & EESOX_TERM_ENABLE ? "n" : "ff"); in eesoxscsi_show_info()
436 fas216_print_stats(&info->info, m); in eesoxscsi_show_info()
437 fas216_print_devices(&info->info, m); in eesoxscsi_show_info()
445 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_show_term()
447 return sprintf(buf, "%d\n", info->control & EESOX_TERM_ENABLE ? 1 : 0); in eesoxscsi_show_term()
454 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_store_term()
455 unsigned long flags; in eesoxscsi_store_term()
458 spin_lock_irqsave(host->host_lock, flags); in eesoxscsi_store_term()
460 info->control |= EESOX_TERM_ENABLE; in eesoxscsi_store_term()
462 info->control &= ~EESOX_TERM_ENABLE; in eesoxscsi_store_term()
464 writeb(info->control, info->ctl_port); in eesoxscsi_store_term()
465 spin_unlock_irqrestore(host->host_lock, flags); in eesoxscsi_store_term()
506 ret = -ENOMEM; in eesoxscsi_probe()
513 ret = -ENOMEM; in eesoxscsi_probe()
519 info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_probe()
520 info->ec = ec; in eesoxscsi_probe()
521 info->base = base; in eesoxscsi_probe()
522 info->ctl_port = base + EESOX_CONTROL; in eesoxscsi_probe()
523 info->control = term[ec->slot_no] ? EESOX_TERM_ENABLE : 0; in eesoxscsi_probe()
524 writeb(info->control, info->ctl_port); in eesoxscsi_probe()
526 info->info.scsi.io_base = base + EESOX_FAS216_OFFSET; in eesoxscsi_probe()
527 info->info.scsi.io_shift = EESOX_FAS216_SHIFT; in eesoxscsi_probe()
528 info->info.scsi.irq = ec->irq; in eesoxscsi_probe()
529 info->info.scsi.dma = ec->dma; in eesoxscsi_probe()
530 info->info.ifcfg.clockrate = 40; /* MHz */ in eesoxscsi_probe()
531 info->info.ifcfg.select_timeout = 255; in eesoxscsi_probe()
532 info->info.ifcfg.asyncperiod = 200; /* ns */ in eesoxscsi_probe()
533 info->info.ifcfg.sync_max_depth = 7; in eesoxscsi_probe()
534 info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK; in eesoxscsi_probe()
535 info->info.ifcfg.disconnect_ok = 1; in eesoxscsi_probe()
536 info->info.ifcfg.wide_max_size = 0; in eesoxscsi_probe()
537 info->info.ifcfg.capabilities = FASCAP_PSEUDODMA; in eesoxscsi_probe()
538 info->info.dma.setup = eesoxscsi_dma_setup; in eesoxscsi_probe()
539 info->info.dma.pseudo = eesoxscsi_dma_pseudo; in eesoxscsi_probe()
540 info->info.dma.stop = eesoxscsi_dma_stop; in eesoxscsi_probe()
542 ec->irqaddr = base + EESOX_DMASTAT; in eesoxscsi_probe()
543 ec->irqmask = EESOX_STAT_INTR; in eesoxscsi_probe()
547 device_create_file(&ec->dev, &dev_attr_bus_term); in eesoxscsi_probe()
553 ret = request_irq(ec->irq, eesoxscsi_intr, 0, "eesoxscsi", info); in eesoxscsi_probe()
556 host->host_no, ec->irq, ret); in eesoxscsi_probe()
560 if (info->info.scsi.dma != NO_DMA) { in eesoxscsi_probe()
561 if (request_dma(info->info.scsi.dma, "eesox")) { in eesoxscsi_probe()
563 host->host_no, info->info.scsi.dma); in eesoxscsi_probe()
564 info->info.scsi.dma = NO_DMA; in eesoxscsi_probe()
566 set_dma_speed(info->info.scsi.dma, 180); in eesoxscsi_probe()
567 info->info.ifcfg.capabilities |= FASCAP_DMA; in eesoxscsi_probe()
568 info->info.ifcfg.cntl3 |= CNTL3_BS8; in eesoxscsi_probe()
572 ret = fas216_add(host, &ec->dev); in eesoxscsi_probe()
576 if (info->info.scsi.dma != NO_DMA) in eesoxscsi_probe()
577 free_dma(info->info.scsi.dma); in eesoxscsi_probe()
578 free_irq(ec->irq, info); in eesoxscsi_probe()
584 device_remove_file(&ec->dev, &dev_attr_bus_term); in eesoxscsi_probe()
597 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; in eesoxscsi_remove()
602 if (info->info.scsi.dma != NO_DMA) in eesoxscsi_remove()
603 free_dma(info->info.scsi.dma); in eesoxscsi_remove()
604 free_irq(ec->irq, info); in eesoxscsi_remove()
606 device_remove_file(&ec->dev, &dev_attr_bus_term); in eesoxscsi_remove()
642 module_param_array(term, int, NULL, 0);
643 MODULE_PARM_DESC(term, "SCSI bus termination");