This is due to a bug in the driver affecting kernel versions from <3.4.
In case anyone wants a working driver here is the patch for version 1.6.0 of
ax88179_178a -
https://launchpad.net/~qji/+archive/ax88179/+files/ax88179_1.9.0-0.tar.gz has
the 1.6.0 driver
---
ax88179_178a1.9/ax88179-1.9.0-0/content/usr/share/ax88179/src/AX88179_178A_LINUX_DRIVER_v1.6.0_SOURCE/ax88179_178a.c
2013-09-10 00:33:30.0 +0100
+++ ax88179_178a/ax88179_178a.c 2014-04-08 15:01:53.0 +0100
@@ -20,7 +20,8 @@
*/
/* debug messages, extra info */
-/* #define DEBUG */
+#defineDEBUG
+#define VERBOSE
#include
/*#include */
@@ -74,6 +75,8 @@
u16 size, void *data, int in_pm)
{
int ret;
+ void *buf = kmalloc(size, GFP_ATOMIC);
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
@@ -85,7 +88,7 @@
fn = usbnet_read_cmd_nopm;
ret = fn(dev, cmd, USB_DIR_IN | USB_TYPE_VENDOR |
-USB_RECIP_DEVICE, value, index, data, size);
+USB_RECIP_DEVICE, value, index, buf, size);
if (unlikely(ret < 0))
netdev_warn(dev->net, "Failed to read reg index 0x%04x: %d\n",
@@ -98,17 +101,27 @@
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value,
index,
- data,
+ buf,
size,
USB_CTRL_GET_TIMEOUT);
#endif
+
+ memcpy(data, buf, size);
+
+ kfree(buf);
+
return ret;
}
static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16
index,
u16 size, void *data, int in_pm)
{
+ //printk(KERN_DEBUG "Here I am: %s:%i\n", __FILE__, __LINE__);
+ //printk(KERN_DEBUG "&data : %p, misalignment: %x, size: %x \n", data,
((uintptr_t)data & 3), size);
+
int ret;
+ void *buf = kmemdup(data, size, GFP_ATOMIC);
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
@@ -120,7 +133,7 @@
fn = usbnet_write_cmd_nopm;
ret = fn(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR |
-USB_RECIP_DEVICE, value, index, data, size);
+USB_RECIP_DEVICE, value, index, buf, size);
if (unlikely(ret < 0))
netdev_warn(dev->net, "Failed to write reg index 0x%04x: %d\n",
@@ -133,17 +146,20 @@
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value,
index,
- data,
+ buf,
size,
USB_CTRL_SET_TIMEOUT);
#endif
+ kfree(buf);
return ret;
}
static int ax88179_read_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
u16 index, u16 size, void *data, int eflag)
{
+ //printk(KERN_DEBUG "Here I am: %s:%i\n", __FILE__, __LINE__);
+
int ret;
if (eflag && (2 == size)) {
@@ -166,17 +182,17 @@
static int ax88179_write_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value,
u16 index, u16 size, void *data)
{
+ //printk(KERN_DEBUG "Here I am: %s:%i\n", __FILE__, __LINE__);
+
int ret;
if (2 == size) {
u16 buf;
buf = *((u16 *)data);
cpu_to_le16s(&buf);
- ret = __ax88179_write_cmd(dev, cmd, value, index,
- size, &buf, 1);
+ ret = __ax88179_write_cmd(dev, cmd, value, index, size, &buf,
1);
} else {
- ret = __ax88179_write_cmd(dev, cmd, value, index,
- size, data, 1);
+ ret = __ax88179_write_cmd(dev, cmd, value, index, size, data,
1);
}
return ret;
@@ -185,19 +201,21 @@
static int ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
u16 size, void *data, int eflag)
{
+ //printk(KERN_DEBUG "Here I am: %s:%i\n", __FILE__, __LINE__);
+
int ret;
if (eflag && (2 == size)) {
- u16 buf;
- ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
- le16_to_cpus(&buf);
- *((u16 *)data) = buf;
+ u16 buf_le;
+ ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf_le,
0);
+ le16_to_cpus(&buf_le);
+ *((u16 *)data) = buf_le;
} else if (eflag && (4 == size)) {
- u32 buf;
- ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
- le32_to_cpus(&buf);
- *((u32 *)data) = buf;
+ u32 buf_le;
+ ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf_le,
0);
+ le32_to_cpus(&buf_le);
+ *((u3