sgiwd93.c (95d465fd750897ab32462a6702fbfe1b122cbbc0) sgiwd93.c (65396410af63db90d6428c678ff84aa652c3c1ec)
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
7 * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu)
8 * Copyright (C) 2001 Florian Lohoff (flo@rfc822.org)

--- 83 unchanged lines hidden (view full) ---

92 spin_lock_irqsave(host->host_lock, flags);
93 wd33c93_intr(host);
94 spin_unlock_irqrestore(host->host_lock, flags);
95
96 return IRQ_HANDLED;
97}
98
99static inline
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
7 * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu)
8 * Copyright (C) 2001 Florian Lohoff (flo@rfc822.org)

--- 83 unchanged lines hidden (view full) ---

92 spin_lock_irqsave(host->host_lock, flags);
93 wd33c93_intr(host);
94 spin_unlock_irqrestore(host->host_lock, flags);
95
96 return IRQ_HANDLED;
97}
98
99static inline
100void fill_hpc_entries(struct hpc_chunk *hcp, Scsi_Cmnd *cmd, int datainp)
100void fill_hpc_entries(struct hpc_chunk *hcp, struct scsi_cmnd *cmd, int datainp)
101{
102 unsigned long len = cmd->SCp.this_residual;
103 void *addr = cmd->SCp.ptr;
104 dma_addr_t physaddr;
105 unsigned long count;
106
107 physaddr = dma_map_single(NULL, addr, len, cmd->sc_data_direction);
108 cmd->SCp.dma_handle = physaddr;

--- 15 unchanged lines hidden (view full) ---

124 * To make sure, if we trip an HPC bug, that we transfer every single
125 * byte, we tag on an extra zero length dma descriptor at the end of
126 * the chain.
127 */
128 hcp->desc.pbuf = 0;
129 hcp->desc.cntinfo = HPCDMA_EOX;
130}
131
101{
102 unsigned long len = cmd->SCp.this_residual;
103 void *addr = cmd->SCp.ptr;
104 dma_addr_t physaddr;
105 unsigned long count;
106
107 physaddr = dma_map_single(NULL, addr, len, cmd->sc_data_direction);
108 cmd->SCp.dma_handle = physaddr;

--- 15 unchanged lines hidden (view full) ---

124 * To make sure, if we trip an HPC bug, that we transfer every single
125 * byte, we tag on an extra zero length dma descriptor at the end of
126 * the chain.
127 */
128 hcp->desc.pbuf = 0;
129 hcp->desc.cntinfo = HPCDMA_EOX;
130}
131
132static int dma_setup(Scsi_Cmnd *cmd, int datainp)
132static int dma_setup(struct scsi_cmnd *cmd, int datainp)
133{
134 struct ip22_hostdata *hdata = HDATA(cmd->device->host);
135 struct hpc3_scsiregs *hregs =
136 (struct hpc3_scsiregs *) cmd->device->host->base;
137 struct hpc_chunk *hcp = (struct hpc_chunk *) hdata->hd.cpu;
138
139 DPRINTK("dma_setup: datainp<%d> hcp<%p> ", datainp, hcp);
140

--- 17 unchanged lines hidden (view full) ---

158 if (datainp)
159 hregs->ctrl = HPC3_SCTRL_ACTIVE;
160 else
161 hregs->ctrl = HPC3_SCTRL_ACTIVE | HPC3_SCTRL_DIR;
162
163 return 0;
164}
165
133{
134 struct ip22_hostdata *hdata = HDATA(cmd->device->host);
135 struct hpc3_scsiregs *hregs =
136 (struct hpc3_scsiregs *) cmd->device->host->base;
137 struct hpc_chunk *hcp = (struct hpc_chunk *) hdata->hd.cpu;
138
139 DPRINTK("dma_setup: datainp<%d> hcp<%p> ", datainp, hcp);
140

--- 17 unchanged lines hidden (view full) ---

158 if (datainp)
159 hregs->ctrl = HPC3_SCTRL_ACTIVE;
160 else
161 hregs->ctrl = HPC3_SCTRL_ACTIVE | HPC3_SCTRL_DIR;
162
163 return 0;
164}
165
166static void dma_stop(struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
166static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
167 int status)
168{
169 struct ip22_hostdata *hdata = HDATA(instance);
170 struct hpc3_scsiregs *hregs;
171
172 if (!SCpnt)
173 return;
174

--- 125 unchanged lines hidden (view full) ---

300
301 free_irq(irq, sgiwd93_intr);
302 dma_free_coherent(NULL, PAGE_SIZE, hdata->hd.cpu, hdata->hd.dma);
303 wd33c93_release();
304
305 return 1;
306}
307
167 int status)
168{
169 struct ip22_hostdata *hdata = HDATA(instance);
170 struct hpc3_scsiregs *hregs;
171
172 if (!SCpnt)
173 return;
174

--- 125 unchanged lines hidden (view full) ---

300
301 free_irq(irq, sgiwd93_intr);
302 dma_free_coherent(NULL, PAGE_SIZE, hdata->hd.cpu, hdata->hd.dma);
303 wd33c93_release();
304
305 return 1;
306}
307
308static int sgiwd93_bus_reset(Scsi_Cmnd *cmd)
308static int sgiwd93_bus_reset(struct scsi_cmnd *cmd)
309{
310 /* FIXME perform bus-specific reset */
311
312 /* FIXME 2: kill this function, and let midlayer fallback
313 to the same result, calling wd33c93_host_reset() */
314
315 spin_lock_irq(cmd->device->host->host_lock);
316 wd33c93_host_reset(cmd);

--- 26 unchanged lines hidden ---
309{
310 /* FIXME perform bus-specific reset */
311
312 /* FIXME 2: kill this function, and let midlayer fallback
313 to the same result, calling wd33c93_host_reset() */
314
315 spin_lock_irq(cmd->device->host->host_lock);
316 wd33c93_host_reset(cmd);

--- 26 unchanged lines hidden ---