a2091.c (c1f3ee120bb61045b1c0a3ead620d1d65af47130) a2091.c (7b892806b09dca77db8ef6acbb6c51271578d34d)
1#include <linux/types.h>
2#include <linux/mm.h>
3#include <linux/blkdev.h>
4#include <linux/init.h>
5#include <linux/interrupt.h>
6
7#include <asm/setup.h>
8#include <asm/page.h>

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

41
42static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
43{
44 unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
45 unsigned long addr = virt_to_bus(cmd->SCp.ptr);
46 struct Scsi_Host *instance = cmd->device->host;
47
48 /* don't allow DMA if the physical address is bad */
1#include <linux/types.h>
2#include <linux/mm.h>
3#include <linux/blkdev.h>
4#include <linux/init.h>
5#include <linux/interrupt.h>
6
7#include <asm/setup.h>
8#include <asm/page.h>

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

41
42static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
43{
44 unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
45 unsigned long addr = virt_to_bus(cmd->SCp.ptr);
46 struct Scsi_Host *instance = cmd->device->host;
47
48 /* don't allow DMA if the physical address is bad */
49 if (addr & A2091_XFER_MASK ||
50 (!dir_in && mm_end_of_chunk (addr, cmd->SCp.this_residual)))
49 if (addr & A2091_XFER_MASK)
51 {
52 HDATA(instance)->dma_bounce_len = (cmd->SCp.this_residual + 511)
53 & ~0x1ff;
54 HDATA(instance)->dma_bounce_buffer =
55 kmalloc (HDATA(instance)->dma_bounce_len, GFP_KERNEL);
56
57 /* can't allocate memory; use PIO */
58 if (!HDATA(instance)->dma_bounce_buffer) {

--- 181 unchanged lines hidden ---
50 {
51 HDATA(instance)->dma_bounce_len = (cmd->SCp.this_residual + 511)
52 & ~0x1ff;
53 HDATA(instance)->dma_bounce_buffer =
54 kmalloc (HDATA(instance)->dma_bounce_len, GFP_KERNEL);
55
56 /* can't allocate memory; use PIO */
57 if (!HDATA(instance)->dma_bounce_buffer) {

--- 181 unchanged lines hidden ---