genode/dde_linux/patches/asix.patch
2013-03-20 10:06:16 +01:00

56 lines
1.7 KiB
Diff

--- download/linux-3.2.2/drivers/net/usb/asix.c 2012-01-26 01:39:32.000000000 +0100
+++ contrib/drivers/net/usb/asix.c 2013-03-18 15:36:10.106168580 +0100
@@ -191,7 +191,7 @@
netdev_dbg(dev->net, "asix_read_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d\n",
cmd, value, index, size);
- buf = kmalloc(size, GFP_KERNEL);
+ buf = kmalloc(size, GFP_NOIO);
if (!buf)
goto out;
@@ -225,7 +225,7 @@
cmd, value, index, size);
if (data) {
- buf = kmemdup(data, size, GFP_KERNEL);
+ buf = kmemdup(data, size, GFP_NOIO);
if (!buf)
goto out;
}
@@ -270,13 +270,13 @@
netdev_dbg(dev->net, "asix_write_cmd_async() cmd=0x%02x value=0x%04x index=0x%04x size=%d\n",
cmd, value, index, size);
- urb = usb_alloc_urb(0, GFP_ATOMIC);
+ urb = usb_alloc_urb(0, GFP_NOIO);
if (!urb) {
netdev_err(dev->net, "Error allocating URB in write_cmd_async!\n");
return;
}
- req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
+ req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
if (!req) {
netdev_err(dev->net, "Failed to allocate memory for control request\n");
usb_free_urb(urb);
@@ -294,7 +294,7 @@
(void *)req, data, size,
asix_async_cmd_callback, req);
- status = usb_submit_urb(urb, GFP_ATOMIC);
+ status = usb_submit_urb(urb, GFP_NOIO);
if (status < 0) {
netdev_err(dev->net, "Error submitting the control message: status=%d\n",
status);
@@ -1051,6 +1051,9 @@
dbg("Write IPG,IPG1,IPG2 failed: %d", ret);
goto out;
}
+
+ if (!is_valid_ether_addr(dev->net->dev_addr))
+ random_ether_addr(dev->net->dev_addr);
/* Rewrite MAC address */
memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);