X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Firda%2Fw83977af_ir.c;h=64d8d3fc9568b384b6171d2c3491b130743cd10a;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=1d4382b3fa620204d590c2b78f6fd6ed221d0b35;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index 1d4382b3f..64d8d3fc9 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -207,8 +208,9 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq, self->tx_buff.truesize = 4000; /* Allocate memory if needed */ - self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->rx_buff.head = + dma_alloc_coherent(NULL, self->rx_buff.truesize, + &self->rx_buff_dma, GFP_KERNEL); if (self->rx_buff.head == NULL) { err = -ENOMEM; goto err_out1; @@ -216,8 +218,9 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq, memset(self->rx_buff.head, 0, self->rx_buff.truesize); - self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->tx_buff.head = + dma_alloc_coherent(NULL, self->tx_buff.truesize, + &self->tx_buff_dma, GFP_KERNEL); if (self->tx_buff.head == NULL) { err = -ENOMEM; goto err_out2; @@ -252,9 +255,11 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq, return 0; err_out3: - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); err_out2: - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); err_out1: free_netdev(dev); err_out: @@ -297,10 +302,12 @@ static int w83977af_close(struct w83977af_ir *self) release_region(self->io.fir_base, self->io.fir_ext); if (self->tx_buff.head) - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); if (self->rx_buff.head) - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); free_netdev(self->netdev); @@ -606,10 +613,10 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase) disable_dma(self->io.dma); clear_dma_ff(self->io.dma); set_dma_mode(self->io.dma, DMA_MODE_READ); - set_dma_addr(self->io.dma, isa_virt_to_bus(self->tx_buff.data)); + set_dma_addr(self->io.dma, self->tx_buff_dma); set_dma_count(self->io.dma, self->tx_buff.len); #else - irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len, + irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len, DMA_MODE_WRITE); #endif self->io.direction = IO_XMIT; @@ -763,10 +770,10 @@ int w83977af_dma_receive(struct w83977af_ir *self) disable_dma(self->io.dma); clear_dma_ff(self->io.dma); set_dma_mode(self->io.dma, DMA_MODE_READ); - set_dma_addr(self->io.dma, isa_virt_to_bus(self->rx_buff.data)); + set_dma_addr(self->io.dma, self->rx_buff_dma); set_dma_count(self->io.dma, self->rx_buff.truesize); #else - irda_setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize, + irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, DMA_MODE_READ); #endif /*