Package: ipheth-dkms
Version: 1.0-1
Severity: important

usb_buffer_free/alloc are renamed in 2.6.34 and the compatibility functions
dropped in 2.6.35 causing the module to fail to build on 2.6.35. Attached is a
patch that allows for this.



-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ipheth-dkms depends on:
ii  dkms                          2.1.1.2-5  Dynamic Kernel Module Support Fram

ipheth-dkms recommends no packages.

ipheth-dkms suggests no packages.

-- no debconf information
Author: Niall Creech <niallcre...@gmail.com>
Description: Rename calls to usb_buffer_free and usb_buffer_alloc to
usb_free_coherent and usb_alloc_coherent for >= 2.6.35 kernels
Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/ipheth/+bug/605740
Index: ipheth-1.0/ipheth-driver/ipheth.c
===================================================================
--- ipheth-1.0.orig/ipheth-driver/ipheth.c	2010-09-17 07:21:58.392165306 +0100
+++ ipheth-1.0/ipheth-driver/ipheth.c	2010-09-17 07:36:04.331050774 +0100
@@ -54,6 +54,14 @@
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 #include <linux/workqueue.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
+#  define usb_alloc_coherent(dev, size, mem_flags, dma) \
+       usb_buffer_alloc(dev, size, mem_flags, dma)
+#  define usb_free_coherent(dev, size, addr, dma) \
+       usb_buffer_free(dev, size, addr, dma)
+#endif
 
 #define USB_VENDOR_APPLE        0x05ac
 #define USB_PRODUCT_IPHETH     0x1290
@@ -120,14 +128,14 @@
 	if (rx_urb == NULL)
 		goto error;
 
-	tx_buf = usb_buffer_alloc(iphone->udev,
+	tx_buf = usb_alloc_coherent(iphone->udev,
 				  IPHETH_BUF_SIZE,
 				  GFP_KERNEL,
 				  &tx_urb->transfer_dma);
 	if (tx_buf == NULL)
 		goto error;
 
-	rx_buf = usb_buffer_alloc(iphone->udev,
+	rx_buf = usb_alloc_coherent(iphone->udev,
 				  IPHETH_BUF_SIZE,
 				  GFP_KERNEL,
 				  &rx_urb->transfer_dma);
@@ -142,9 +150,9 @@
 	return 0;
 
 error:
-	usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, rx_buf,
+	usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, rx_buf,
 			rx_urb->transfer_dma);
-	usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
+	usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
 			tx_urb->transfer_dma);
 	usb_free_urb(rx_urb);
 	usb_free_urb(tx_urb);
@@ -153,9 +161,9 @@
 
 static void ipheth_free_urbs (struct ipheth_device *iphone)
 {
-	usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
+	usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
 			iphone->rx_urb->transfer_dma);
-	usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
+	usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
 			iphone->tx_urb->transfer_dma);
 	usb_free_urb(iphone->rx_urb);
 	usb_free_urb(iphone->tx_urb);
Author: Niall Creech <niallcre...@gmail.com>
Description: Rename calls to usb_buffer_free and usb_buffer_alloc to
usb_free_coherent and usb_alloc_coherent for >= 2.6.35 kernels
Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/ipheth/+bug/605740
Index: ipheth-1.0/ipheth-driver/ipheth.c
===================================================================
--- ipheth-1.0.orig/ipheth-driver/ipheth.c	2010-09-17 07:21:58.392165306 +0100
+++ ipheth-1.0/ipheth-driver/ipheth.c	2010-09-17 07:36:04.331050774 +0100
@@ -54,6 +54,14 @@
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 #include <linux/workqueue.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
+#  define usb_alloc_coherent(dev, size, mem_flags, dma) \
+       usb_buffer_alloc(dev, size, mem_flags, dma)
+#  define usb_free_coherent(dev, size, addr, dma) \
+       usb_buffer_free(dev, size, addr, dma)
+#endif
 
 #define USB_VENDOR_APPLE        0x05ac
 #define USB_PRODUCT_IPHETH     0x1290
@@ -120,14 +128,14 @@
 	if (rx_urb == NULL)
 		goto error;
 
-	tx_buf = usb_buffer_alloc(iphone->udev,
+	tx_buf = usb_alloc_coherent(iphone->udev,
 				  IPHETH_BUF_SIZE,
 				  GFP_KERNEL,
 				  &tx_urb->transfer_dma);
 	if (tx_buf == NULL)
 		goto error;
 
-	rx_buf = usb_buffer_alloc(iphone->udev,
+	rx_buf = usb_alloc_coherent(iphone->udev,
 				  IPHETH_BUF_SIZE,
 				  GFP_KERNEL,
 				  &rx_urb->transfer_dma);
@@ -142,9 +150,9 @@
 	return 0;
 
 error:
-	usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, rx_buf,
+	usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, rx_buf,
 			rx_urb->transfer_dma);
-	usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
+	usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
 			tx_urb->transfer_dma);
 	usb_free_urb(rx_urb);
 	usb_free_urb(tx_urb);
@@ -153,9 +161,9 @@
 
 static void ipheth_free_urbs (struct ipheth_device *iphone)
 {
-	usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
+	usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
 			iphone->rx_urb->transfer_dma);
-	usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
+	usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
 			iphone->tx_urb->transfer_dma);
 	usb_free_urb(iphone->rx_urb);
 	usb_free_urb(iphone->tx_urb);

Reply via email to