- TLAN pad buffer virt_to_bus -> pci_map_single conversion.
--- linux-2.5.24/drivers/net/tlan.c Sat Jun 29 22:06:32 2002
+++ linux-2.5.24/drivers/net/tlan.c Sat Jun 29 22:12:10 2002
@@ -215,6 +215,7 @@ MODULE_PARM_DESC(bbuf, "ThunderLAN use b
static int debug;
static int bbuf;
+static dma_addr_t TLanPadBuffer_dma;
static u8 *TLanPadBuffer;
static char TLanSignature[] = "TLAN";
static const char tlan_banner[] = "ThunderLAN driver v1.15\n";
@@ -441,6 +442,9 @@ static int __init tlan_probe(void)
printk(KERN_ERR "TLAN: Could not allocate memory for pad buffer.\n");
return -ENOMEM;
}
+ TLanPadBuffer_dma = pci_map_single(NULL, TLanPadBuffer,
+ TLAN_MIN_FRAME_SIZE, PCI_DMA_TODEVICE);
+
memset(TLanPadBuffer, 0, TLAN_MIN_FRAME_SIZE);
pad_allocated = 1;
@@ -647,6 +651,8 @@ static void __exit tlan_exit(void)
if (tlan_have_eisa)
TLan_Eisa_Cleanup();
+ pci_unmap_single(NULL, TLanPadBuffer_dma, TLAN_MIN_FRAME_SIZE,
+ PCI_DMA_TODEVICE);
kfree( TLanPadBuffer );
@@ -1026,7 +1032,7 @@ static int TLan_StartTx( struct sk_buff
tail_list->frameSize = (u16) skb->len + pad;
tail_list->buffer[0].count = (u32) skb->len;
tail_list->buffer[1].count = TLAN_LAST_BUFFER | (u32) pad;
- tail_list->buffer[1].address = virt_to_bus( TLanPadBuffer );
+ tail_list->buffer[1].address = TLanPadBuffer_dma;
} else {
tail_list->frameSize = (u16) skb->len;
tail_list->buffer[0].count = TLAN_LAST_BUFFER | (u32) skb->len;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sun Jun 30 2002 - 22:00:15 EST