Second part of the kfifo backport.
Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/linux/compat-2.6.33.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h
index 9bb0dbb..8123914 100644
--- a/include/linux/compat-2.6.33.h
+++ b/include/linux/compat-2.6.33.h
@@ -9,6 +9,7 @@
#include <pcmcia/cs_types.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
+#include <linux/kfifo.h>
#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
/* source: include/linux/if.h */
@@ -47,6 +48,13 @@ int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
cisparse_t *parse,
void *priv_data));
+/* Backport for kfifo
+ * kfifo_alloc and kfifo_free must be backported manually
+ */
+#define kfifo_in(a, b, c) __kfifo_put(*a, b, c)
+#define kfifo_out(a, b, c) __kfifo_get(*a, b, c)
+#define kfifo_len(a) __kfifo_len(*a)
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
#endif /* LINUX_26_33_COMPAT_H */
--
1.6.3.3
eth_mac_addr is needed by net/mac80211/iface.c
Signed-off-by: Hauke Mehrtens <[email protected]>
---
compat/compat-2.6.29.c | 24 ++++++++++++++++++++++++
include/linux/compat-2.6.29.h | 2 ++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/compat/compat-2.6.29.c b/compat/compat-2.6.29.c
index 669ad35..ea2a991 100644
--- a/compat/compat-2.6.29.c
+++ b/compat/compat-2.6.29.c
@@ -13,6 +13,7 @@
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
#include <linux/usb.h>
+#include <linux/etherdevice.h>
/**
* usb_unpoison_anchored_urbs - let an anchor be used successfully again
@@ -35,6 +36,29 @@ void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
}
EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
+/**
+ * eth_mac_addr - set new Ethernet hardware address
+ * @dev: network device
+ * @p: socket address
+ * Change hardware address of device.
+ *
+ * This doesn't change hardware matching, so needs to be overridden
+ * for most real devices.
+ */
+int eth_mac_addr(struct net_device *dev, void *p)
+{
+ struct sockaddr *addr = p;
+
+ if (netif_running(dev))
+ return -EBUSY;
+ if (!is_valid_ether_addr(addr->sa_data))
+ return -EADDRNOTAVAIL;
+ memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
+ return 0;
+}
+EXPORT_SYMBOL(eth_mac_addr);
+/* Source: net/ethernet/eth.c */
+
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */
diff --git a/include/linux/compat-2.6.29.h b/include/linux/compat-2.6.29.h
index 8a968fa..690fb93 100644
--- a/include/linux/compat-2.6.29.h
+++ b/include/linux/compat-2.6.29.h
@@ -55,6 +55,8 @@ extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
} \
)
+extern int eth_mac_addr(struct net_device *dev, void *p);
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
#endif /* LINUX_26_29_COMPAT_H */
--
1.6.3.3
On Sat, Dec 26, 2009 at 10:44:34PM +0100, Hauke Mehrtens wrote:
> Second part of the kfifo backport.
>
> Signed-off-by: Hauke Mehrtens <[email protected]>
Applied, thanks.
Luis