diff options
author | Brian Niebuhr <bniebuhr@efjohnson.com> | 2009-08-14 11:04:22 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-23 09:46:35 -0400 |
commit | 9b39e9ddedeef48569f8aac60a7b4c1fbb127c7d (patch) | |
tree | d2cc583190e18fa03298e84093c3346e1646007c /drivers/usb/gadget/rndis.c | |
parent | 877accca79b706afe5d78b9a92cf4f22919fb2b0 (diff) |
USB: gadget: Add EEM gadget driver
This patch adds a CDC EEM ethernet gadget driver. CDC EEM is a newer
USB ethernet specification that uses a simpler interface than the older
CDC ECM. This makes CDC EEM usable by a wider set of USB hardware.
By default the ethernet gadget will still use CDC ECM/Subset, but kernel
configuration and/or a module parameter will allow alternative use of
the CDC EEM protocol.
Changes since last version:
- Brought in missing RNDIS changes that caused compile error
- Modified 'sentinel CRC' checking to match EEM host driver
Signed-off-by: Brian Niebuhr <bniebuhr@efjohnson.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/rndis.c')
-rw-r--r-- | drivers/usb/gadget/rndis.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index ca41b0b5afb3..48267bc0b2e0 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
@@ -1022,22 +1022,29 @@ static rndis_resp_t *rndis_add_response (int configNr, u32 length) | |||
1022 | return r; | 1022 | return r; |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | int rndis_rm_hdr(struct sk_buff *skb) | 1025 | int rndis_rm_hdr(struct gether *port, |
1026 | struct sk_buff *skb, | ||
1027 | struct sk_buff_head *list) | ||
1026 | { | 1028 | { |
1027 | /* tmp points to a struct rndis_packet_msg_type */ | 1029 | /* tmp points to a struct rndis_packet_msg_type */ |
1028 | __le32 *tmp = (void *) skb->data; | 1030 | __le32 *tmp = (void *) skb->data; |
1029 | 1031 | ||
1030 | /* MessageType, MessageLength */ | 1032 | /* MessageType, MessageLength */ |
1031 | if (cpu_to_le32(REMOTE_NDIS_PACKET_MSG) | 1033 | if (cpu_to_le32(REMOTE_NDIS_PACKET_MSG) |
1032 | != get_unaligned(tmp++)) | 1034 | != get_unaligned(tmp++)) { |
1035 | dev_kfree_skb_any(skb); | ||
1033 | return -EINVAL; | 1036 | return -EINVAL; |
1037 | } | ||
1034 | tmp++; | 1038 | tmp++; |
1035 | 1039 | ||
1036 | /* DataOffset, DataLength */ | 1040 | /* DataOffset, DataLength */ |
1037 | if (!skb_pull(skb, get_unaligned_le32(tmp++) + 8)) | 1041 | if (!skb_pull(skb, get_unaligned_le32(tmp++) + 8)) { |
1042 | dev_kfree_skb_any(skb); | ||
1038 | return -EOVERFLOW; | 1043 | return -EOVERFLOW; |
1044 | } | ||
1039 | skb_trim(skb, get_unaligned_le32(tmp++)); | 1045 | skb_trim(skb, get_unaligned_le32(tmp++)); |
1040 | 1046 | ||
1047 | skb_queue_tail(list, skb); | ||
1041 | return 0; | 1048 | return 0; |
1042 | } | 1049 | } |
1043 | 1050 | ||