aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x/rtl8187_dev.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2009-05-06 13:57:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-11 15:07:01 -0400
commit9be6f0d40d9191e6fe7e45551c7d1c1614472b53 (patch)
tree6964774b8c66d97723204c7f6c290a3c835a7712 /drivers/net/wireless/rtl818x/rtl8187_dev.c
parent621ad7c96aa138cfeab53cd4debc5a4e08b2189b (diff)
rtl8187: use DMA-aware buffers with usb_control_msg
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x/rtl8187_dev.c')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index fd81884b9c7..bac6cfba6ab 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -1329,6 +1329,14 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
1329 priv = dev->priv; 1329 priv = dev->priv;
1330 priv->is_rtl8187b = (id->driver_info == DEVICE_RTL8187B); 1330 priv->is_rtl8187b = (id->driver_info == DEVICE_RTL8187B);
1331 1331
1332 /* allocate "DMA aware" buffer for register accesses */
1333 priv->io_dmabuf = kmalloc(sizeof(*priv->io_dmabuf), GFP_KERNEL);
1334 if (!priv->io_dmabuf) {
1335 err = -ENOMEM;
1336 goto err_free_dev;
1337 }
1338 mutex_init(&priv->io_mutex);
1339
1332 SET_IEEE80211_DEV(dev, &intf->dev); 1340 SET_IEEE80211_DEV(dev, &intf->dev);
1333 usb_set_intfdata(intf, dev); 1341 usb_set_intfdata(intf, dev);
1334 priv->udev = udev; 1342 priv->udev = udev;
@@ -1495,7 +1503,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
1495 err = ieee80211_register_hw(dev); 1503 err = ieee80211_register_hw(dev);
1496 if (err) { 1504 if (err) {
1497 printk(KERN_ERR "rtl8187: Cannot register device\n"); 1505 printk(KERN_ERR "rtl8187: Cannot register device\n");
1498 goto err_free_dev; 1506 goto err_free_dmabuf;
1499 } 1507 }
1500 mutex_init(&priv->conf_mutex); 1508 mutex_init(&priv->conf_mutex);
1501 skb_queue_head_init(&priv->b_tx_status.queue); 1509 skb_queue_head_init(&priv->b_tx_status.queue);
@@ -1506,6 +1514,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
1506 1514
1507 return 0; 1515 return 0;
1508 1516
1517 err_free_dmabuf:
1518 kfree(priv->io_dmabuf);
1509 err_free_dev: 1519 err_free_dev:
1510 ieee80211_free_hw(dev); 1520 ieee80211_free_hw(dev);
1511 usb_set_intfdata(intf, NULL); 1521 usb_set_intfdata(intf, NULL);
@@ -1526,6 +1536,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf)
1526 priv = dev->priv; 1536 priv = dev->priv;
1527 usb_reset_device(priv->udev); 1537 usb_reset_device(priv->udev);
1528 usb_put_dev(interface_to_usbdev(intf)); 1538 usb_put_dev(interface_to_usbdev(intf));
1539 kfree(priv->io_dmabuf);
1529 ieee80211_free_hw(dev); 1540 ieee80211_free_hw(dev);
1530} 1541}
1531 1542