> Am Donnerstag, 23. November 2006 13:34 schrieben Sie:
> > > > I'm forced to work with a vendor kernel based on some old 2.6
> > > > (probably 2.6.10), and I'm trying to backport the driver.
> > > >
> > > > Is 2.6.19-rc6 a better source for backporting than vanilla 2.6.18
> > > > ?
> > >
> > > OK. There was a major update to the asix driver in the 2.6.19
> > > development cycle. I strongly suggest you start from the newest
> > > driver particularly if you are unsure your device works on a little
> > > endian system.
> >
> > I've already made something working (after locating one more missed
> > endian conversion). So it's already not 'starting'.
>
> Very good. Could you point me to it? I'd make a patch for inclusion.
> If you are making progress stay with your current code.
This code is no longer there in 2.6.19-pre6.
As I see, ax88172_bind() got much smaller in that kernel.
> > I guess you have modified something in newest code based on this mail
> > thread? Could you please point me to the latest driver code so I could
> > look through it?
> > Or it is just what was released as 2.6.19-pre6 ?
>
> Yes. 2.6.19-rc6 has the newest code. I've sent in a patch to fix the
> up the conversions already in 2.6.18 and I would like to have a full fix
> in 2.6.19 final.
Ok, attached is the overall patch against 2.6.19-rc6 that fixes several
issues discussed today.
However, I've located one more problem which I don't know yet how to fix
correctly.
AFAIR, device may pass several incoming frames in one urb, and second and
later frames are 2-byte-aligned.
This may cause situations when IP layer gets IP packet not aligned at
32-bit word boundary and occasionally crash because of unligned access
(hardware and/or codebase I'm working with really dislikes unaligned
accesses from kernel).
Looks the only way to fix that is to detect such cases, and copy data? But
this will hurt performance on systems that can handle unaligned
accesses ...
Nikita
--- asix.c.orig 2006-11-23 18:07:37.000000000 +0300
+++ asix.c 2006-11-23 18:19:47.000000000 +0300
@@ -249,9 +249,9 @@
req->bRequestType = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE;
req->bRequest = cmd;
- req->wValue = value;
- req->wIndex = index;
- req->wLength = size;
+ req->wValue = cpu_to_le16(value);
+ req->wIndex = cpu_to_le16(index);
+ req->wLength = cpu_to_le16(size);
usb_fill_control_urb(urb, dev->udev,
usb_sndctrlpipe(dev->udev, 0),
@@ -352,9 +352,11 @@
skb_push(skb, 4);
packet_len = (((skb->len - 4) ^ 0x0000ffff) << 16) + (skb->len - 4);
+ cpu_to_le32s(&packet_len);
memcpy(skb->data, &packet_len, sizeof(packet_len));
if ((skb->len % 512) == 0) {
+ cpu_to_le32s(&padbytes);
memcpy( skb->tail, &padbytes, sizeof(padbytes));
skb_put(skb, sizeof(padbytes));
}
@@ -415,7 +417,7 @@
deverr(dev, "Error reading PHYID register: %02x", ret);
goto out2;
}
- devdbg(dev, "asix_get_phy_addr() returning 0x%04x", *((u16 *)buf));
+ devdbg(dev, "asix_get_phy_addr() returning 0x%04x", le16_to_cpu(*((u16 *)buf)));
ret = *((u8 *)buf + 1);
out2:
kfree(buf);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel