From: Brian Niebuhr Date: Mon, 25 Jan 2010 20:45:40 +0000 (-0600) Subject: USB: gadget: fix EEM gadget CRC usage X-Git-Tag: v2.6.33~36^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31e5d4abceaa3d11ff583ddf76ec292e90eacb7d;p=platform%2Fkernel%2Flinux-3.10.git USB: gadget: fix EEM gadget CRC usage eem_wrap() is sending a sentinel CRC, but it didn't indicate that to the host, it should zero bit 14 (bmCRC) in the EEM packet header, instead of setting it. Also remove a redundant crc calculation in eem_unwrap(). Signed-off-by: Steve Longerbeam Acked-by: Brian Niebuhr Acked-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c index 0a577d5..d4f0db5 100644 --- a/drivers/usb/gadget/f_eem.c +++ b/drivers/usb/gadget/f_eem.c @@ -358,7 +358,7 @@ done: * b15: bmType (0 == data) */ len = skb->len; - put_unaligned_le16((len & 0x3FFF) | BIT(14), skb_push(skb, 2)); + put_unaligned_le16(len & 0x3FFF, skb_push(skb, 2)); /* add a zero-length EEM packet, if needed */ if (padlen) @@ -464,7 +464,6 @@ static int eem_unwrap(struct gether *port, } /* validate CRC */ - crc = get_unaligned_le32(skb->data + len - ETH_FCS_LEN); if (header & BIT(14)) { crc = get_unaligned_le32(skb->data + len - ETH_FCS_LEN);