wl1251: add reset handling
[pandora-wifi.git] / compat / compat-2.6.29.c
1 /*
2  * Copyright 2007       Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
3  *
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.
7  *
8  * Compatibility file for Linux wireless for kernels 2.6.29.
9  */
10
11 #include <linux/compat.h>
12
13 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
14
15 #include <linux/usb.h>
16 #include <linux/etherdevice.h>
17
18 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
19 #if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
20 /**
21  * usb_unpoison_anchored_urbs - let an anchor be used successfully again
22  * @anchor: anchor the requests are bound to
23  *
24  * Reverses the effect of usb_poison_anchored_urbs
25  * the anchor can be used normally after it returns
26  */
27 void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
28 {
29         unsigned long flags;
30         struct urb *lazarus;
31
32         spin_lock_irqsave(&anchor->lock, flags);
33         list_for_each_entry(lazarus, &anchor->urb_list, anchor_list) {
34                 usb_unpoison_urb(lazarus);
35         }
36         //anchor->poisoned = 0; /* XXX: cannot backport */
37         spin_unlock_irqrestore(&anchor->lock, flags);
38 }
39 EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
40 #endif /* CONFIG_USB */
41 #endif
42
43 /**
44  * eth_mac_addr - set new Ethernet hardware address
45  * @dev: network device
46  * @p: socket address
47  * Change hardware address of device.
48  *
49  * This doesn't change hardware matching, so needs to be overridden
50  * for most real devices.
51  */
52 int eth_mac_addr(struct net_device *dev, void *p)
53 {
54         struct sockaddr *addr = p;
55
56         if (netif_running(dev))
57                 return -EBUSY;
58         if (!is_valid_ether_addr(addr->sa_data))
59                 return -EADDRNOTAVAIL;
60         memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
61         return 0;
62 }
63 EXPORT_SYMBOL(eth_mac_addr);
64 /* Source: net/ethernet/eth.c */
65
66
67 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */
68