2 * Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * Compatibility file for Linux wireless for kernels 2.6.29.
11 #include <linux/compat.h>
13 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
15 #include <linux/usb.h>
16 #include <linux/etherdevice.h>
18 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
19 #if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
21 * usb_unpoison_anchored_urbs - let an anchor be used successfully again
22 * @anchor: anchor the requests are bound to
24 * Reverses the effect of usb_poison_anchored_urbs
25 * the anchor can be used normally after it returns
27 void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
32 spin_lock_irqsave(&anchor->lock, flags);
33 list_for_each_entry(lazarus, &anchor->urb_list, anchor_list) {
34 usb_unpoison_urb(lazarus);
36 //anchor->poisoned = 0; /* XXX: cannot backport */
37 spin_unlock_irqrestore(&anchor->lock, flags);
39 EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
40 #endif /* CONFIG_USB */
44 * eth_mac_addr - set new Ethernet hardware address
45 * @dev: network device
47 * Change hardware address of device.
49 * This doesn't change hardware matching, so needs to be overridden
50 * for most real devices.
52 int eth_mac_addr(struct net_device *dev, void *p)
54 struct sockaddr *addr = p;
56 if (netif_running(dev))
58 if (!is_valid_ether_addr(addr->sa_data))
59 return -EADDRNOTAVAIL;
60 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
63 EXPORT_SYMBOL(eth_mac_addr);
64 /* Source: net/ethernet/eth.c */
67 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */