Lines Matching +full:dma +full:- +full:info

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 1997-2005 Russell King
16 #include <linux/dma-mapping.h>
19 #include <asm/dma.h>
61 FAS216_Info info; member
70 * Params : ec - expansion card structure
71 * : irqnr - interrupt number
76 struct powertec_info *info = ec->irq_data; in powertecscsi_irqenable() local
77 writeb(POWERTEC_INTR_ENABLE, info->base + POWERTEC_INTR_CONTROL); in powertecscsi_irqenable()
82 * Params : ec - expansion card structure
83 * : irqnr - interrupt number
88 struct powertec_info *info = ec->irq_data; in powertecscsi_irqdisable() local
89 writeb(POWERTEC_INTR_DISABLE, info->base + POWERTEC_INTR_CONTROL); in powertecscsi_irqdisable()
99 * Params : host - card to turn on/off
100 * : on_off - !0 to turn on, 0 to turn off
105 struct powertec_info *info = (struct powertec_info *)host->hostdata; in powertecscsi_terminator_ctl() local
107 info->term_ctl = on_off ? POWERTEC_TERM_ENABLE : 0; in powertecscsi_terminator_ctl()
108 writeb(info->term_ctl, info->base + POWERTEC_TERM_CONTROL); in powertecscsi_terminator_ctl()
113 * Params : irq - interrupt number
114 * dev_id - user-defined (Scsi_Host structure)
118 struct powertec_info *info = dev_id; in powertecscsi_intr() local
120 return fas216_intr(&info->info); in powertecscsi_intr()
124 * Purpose : initialises DMA/PIO
125 * Params : host - host
126 * SCpnt - command
127 * direction - DMA on to/off of card
128 * min_type - minimum DMA support that we must have for this transfer
135 struct powertec_info *info = (struct powertec_info *)host->hostdata; in powertecscsi_dma_setup() local
137 int dmach = info->info.scsi.dma; in powertecscsi_dma_setup()
139 if (info->info.ifcfg.capabilities & FASCAP_DMA && in powertecscsi_dma_setup()
143 bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG); in powertecscsi_dma_setup()
153 dma_map_sg(dev, info->sg, bufs, map_dir); in powertecscsi_dma_setup()
156 set_dma_sg(dmach, info->sg, bufs); in powertecscsi_dma_setup()
163 * If we're not doing DMA, in powertecscsi_dma_setup()
170 * Purpose : stops DMA/PIO
171 * Params : host - host
172 * SCpnt - command
177 struct powertec_info *info = (struct powertec_info *)host->hostdata; in powertecscsi_dma_stop() local
178 if (info->info.scsi.dma != NO_DMA) in powertecscsi_dma_stop()
179 disable_dma(info->info.scsi.dma); in powertecscsi_dma_stop()
184 * Params : host - driver host structure to return info for.
189 struct powertec_info *info = (struct powertec_info *)host->hostdata; in powertecscsi_info() local
193 host->hostt->name, info->info.scsi.type, info->ec->slot_no, in powertecscsi_info()
194 VERSION, info->term_ctl ? "n" : "ff"); in powertecscsi_info()
201 * Params : host - host to setup
202 * : buffer - buffer containing string describing operation
203 * : length - length of string
204 * Returns : -EINVAL, or 0
213 length -= 12; in powertecscsi_set_proc_info()
221 ret = -EINVAL; in powertecscsi_set_proc_info()
223 ret = -EINVAL; in powertecscsi_set_proc_info()
225 ret = -EINVAL; in powertecscsi_set_proc_info()
234 * Params : buffer - a buffer to write information to
235 * start - a pointer into this buffer set by this routine to the start
237 * offset - offset into information that we have read up to.
238 * length - length of buffer
239 * inout - 0 for reading, 1 for writing.
244 struct powertec_info *info; in powertecscsi_show_info() local
246 info = (struct powertec_info *)host->hostdata; in powertecscsi_show_info()
249 fas216_print_host(&info->info, m); in powertecscsi_show_info()
251 info->term_ctl ? "n" : "ff"); in powertecscsi_show_info()
253 fas216_print_stats(&info->info, m); in powertecscsi_show_info()
254 fas216_print_devices(&info->info, m); in powertecscsi_show_info()
262 struct powertec_info *info = (struct powertec_info *)host->hostdata; in powertecscsi_show_term() local
264 return sprintf(buf, "%d\n", info->term_ctl ? 1 : 0); in powertecscsi_show_term()
287 .info = powertecscsi_info,
306 struct powertec_info *info; in powertecscsi_probe() local
316 ret = -ENOMEM; in powertecscsi_probe()
323 ret = -ENOMEM; in powertecscsi_probe()
329 info = (struct powertec_info *)host->hostdata; in powertecscsi_probe()
330 info->base = base; in powertecscsi_probe()
331 powertecscsi_terminator_ctl(host, term[ec->slot_no]); in powertecscsi_probe()
333 info->ec = ec; in powertecscsi_probe()
334 info->info.scsi.io_base = base + POWERTEC_FAS216_OFFSET; in powertecscsi_probe()
335 info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT; in powertecscsi_probe()
336 info->info.scsi.irq = ec->irq; in powertecscsi_probe()
337 info->info.scsi.dma = ec->dma; in powertecscsi_probe()
338 info->info.ifcfg.clockrate = 40; /* MHz */ in powertecscsi_probe()
339 info->info.ifcfg.select_timeout = 255; in powertecscsi_probe()
340 info->info.ifcfg.asyncperiod = 200; /* ns */ in powertecscsi_probe()
341 info->info.ifcfg.sync_max_depth = 7; in powertecscsi_probe()
342 info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK; in powertecscsi_probe()
343 info->info.ifcfg.disconnect_ok = 1; in powertecscsi_probe()
344 info->info.ifcfg.wide_max_size = 0; in powertecscsi_probe()
345 info->info.ifcfg.capabilities = 0; in powertecscsi_probe()
346 info->info.dma.setup = powertecscsi_dma_setup; in powertecscsi_probe()
347 info->info.dma.pseudo = NULL; in powertecscsi_probe()
348 info->info.dma.stop = powertecscsi_dma_stop; in powertecscsi_probe()
350 ec->irqaddr = base + POWERTEC_INTR_STATUS; in powertecscsi_probe()
351 ec->irqmask = POWERTEC_INTR_BIT; in powertecscsi_probe()
353 ecard_setirq(ec, &powertecscsi_ops, info); in powertecscsi_probe()
355 device_create_file(&ec->dev, &dev_attr_bus_term); in powertecscsi_probe()
361 ret = request_irq(ec->irq, powertecscsi_intr, in powertecscsi_probe()
362 0, "powertec", info); in powertecscsi_probe()
365 host->host_no, ec->irq, ret); in powertecscsi_probe()
369 if (info->info.scsi.dma != NO_DMA) { in powertecscsi_probe()
370 if (request_dma(info->info.scsi.dma, "powertec")) { in powertecscsi_probe()
371 printk("scsi%d: DMA%d not free, using PIO\n", in powertecscsi_probe()
372 host->host_no, info->info.scsi.dma); in powertecscsi_probe()
373 info->info.scsi.dma = NO_DMA; in powertecscsi_probe()
375 set_dma_speed(info->info.scsi.dma, 180); in powertecscsi_probe()
376 info->info.ifcfg.capabilities |= FASCAP_DMA; in powertecscsi_probe()
380 ret = fas216_add(host, &ec->dev); in powertecscsi_probe()
384 if (info->info.scsi.dma != NO_DMA) in powertecscsi_probe()
385 free_dma(info->info.scsi.dma); in powertecscsi_probe()
386 free_irq(ec->irq, info); in powertecscsi_probe()
392 device_remove_file(&ec->dev, &dev_attr_bus_term); in powertecscsi_probe()
405 struct powertec_info *info = (struct powertec_info *)host->hostdata; in powertecscsi_remove() local
410 device_remove_file(&ec->dev, &dev_attr_bus_term); in powertecscsi_remove()
412 if (info->info.scsi.dma != NO_DMA) in powertecscsi_remove()
413 free_dma(info->info.scsi.dma); in powertecscsi_remove()
414 free_irq(ec->irq, info); in powertecscsi_remove()