Search Linux Wireless

[PATCH 1/2] compat-wireless: backport kfifo for libertas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First part of the kfifo backport.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 patches/19-kfifo.patch |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 patches/19-kfifo.patch

diff --git a/patches/19-kfifo.patch b/patches/19-kfifo.patch
new file mode 100644
index 0000000..d59f76e
--- /dev/null
+++ b/patches/19-kfifo.patch
@@ -0,0 +1,47 @@
+These parts of the new generic kernel FIFO implementation (kfifo) can
+not be backported easily with defines in the compat module.
+
+--- a/drivers/net/wireless/libertas/dev.h
++++ b/drivers/net/wireless/libertas/dev.h
+@@ -119,7 +119,11 @@ struct lbs_private {
+ 	u32 resp_len[2];
+ 
+ 	/* Events sent from hardware to driver */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
+ 	struct kfifo event_fifo;
++#else
++	struct kfifo *event_fifo;
++#endif
+ 
+ 	/** thread to service interrupts */
+ 	struct task_struct *main_thread;
+--- a/drivers/net/wireless/libertas/main.c
++++ b/drivers/net/wireless/libertas/main.c
+@@ -872,8 +872,14 @@ static int lbs_init_adapter(struct lbs_private *priv)
+ 	priv->resp_len[0] = priv->resp_len[1] = 0;
+ 
+ 	/* Create the event FIFO */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
+ 	ret = kfifo_alloc(&priv->event_fifo, sizeof(u32) * 16, GFP_KERNEL);
+ 	if (ret) {
++#else
++	priv->event_fifo = kfifo_alloc(sizeof(u32) * 16, GFP_KERNEL, NULL);
++	if (IS_ERR(priv->event_fifo)) {
++		ret = -ENOMEM;
++#endif
+ 		lbs_pr_err("Out of memory allocating event FIFO buffer\n");
+ 		goto out;
+ 	}
+@@ -889,7 +895,12 @@ static void lbs_free_adapter(struct lbs_private *priv)
+ 	lbs_deb_enter(LBS_DEB_MAIN);
+ 
+ 	lbs_free_cmd_buffer(priv);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
+ 	kfifo_free(&priv->event_fifo);
++#else
++	if (priv->event_fifo)
++		kfifo_free(priv->event_fifo);
++#endif
+ 	del_timer(&priv->command_timer);
+ 	del_timer(&priv->auto_deepsleep_timer);
+ 	kfree(priv->networks);
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux