diff options
author | Brian Niebuhr <bniebuhr3@gmail.com> | 2010-01-25 21:45:40 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-02-17 00:11:10 +0100 |
commit | 31e5d4abceaa3d11ff583ddf76ec292e90eacb7d (patch) | |
tree | b5a8132979a4fb5bcfc07f9f2409828e6081cc16 /drivers | |
parent | USB: otg Kconfig: let USB_OTG_UTILS select USB_ULPI option (diff) | |
download | linux-31e5d4abceaa3d11ff583ddf76ec292e90eacb7d.tar.xz linux-31e5d4abceaa3d11ff583ddf76ec292e90eacb7d.zip |
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 <stevel@netspectrum.com>
Acked-by: Brian Niebuhr <bniebuhr@efjohnson.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/f_eem.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c index 0a577d5694fd..d4f0db58a8ad 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); |