diff options
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/rndis_host.c | 20 | ||||
-rw-r--r-- | drivers/net/usb/rndis_host.h | 9 |
2 files changed, 22 insertions, 7 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 29d7e3b166f5..1d6bf0a28cec 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -60,13 +60,14 @@ | |||
60 | * RNDIS notifications from device: command completion; "reverse" | 60 | * RNDIS notifications from device: command completion; "reverse" |
61 | * keepalives; etc | 61 | * keepalives; etc |
62 | */ | 62 | */ |
63 | static void rndis_status(struct usbnet *dev, struct urb *urb) | 63 | void rndis_status(struct usbnet *dev, struct urb *urb) |
64 | { | 64 | { |
65 | devdbg(dev, "rndis status urb, len %d stat %d", | 65 | devdbg(dev, "rndis status urb, len %d stat %d", |
66 | urb->actual_length, urb->status); | 66 | urb->actual_length, urb->status); |
67 | // FIXME for keepalives, respond immediately (asynchronously) | 67 | // FIXME for keepalives, respond immediately (asynchronously) |
68 | // if not an RNDIS status, do like cdc_status(dev,urb) does | 68 | // if not an RNDIS status, do like cdc_status(dev,urb) does |
69 | } | 69 | } |
70 | EXPORT_SYMBOL_GPL(rndis_status); | ||
70 | 71 | ||
71 | /* | 72 | /* |
72 | * RPC done RNDIS-style. Caller guarantees: | 73 | * RPC done RNDIS-style. Caller guarantees: |
@@ -78,7 +79,7 @@ static void rndis_status(struct usbnet *dev, struct urb *urb) | |||
78 | * Call context is likely probe(), before interface name is known, | 79 | * Call context is likely probe(), before interface name is known, |
79 | * which is why we won't try to use it in the diagnostics. | 80 | * which is why we won't try to use it in the diagnostics. |
80 | */ | 81 | */ |
81 | static int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf) | 82 | int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf) |
82 | { | 83 | { |
83 | struct cdc_state *info = (void *) &dev->data; | 84 | struct cdc_state *info = (void *) &dev->data; |
84 | int master_ifnum; | 85 | int master_ifnum; |
@@ -187,6 +188,7 @@ static int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf) | |||
187 | dev_dbg(&info->control->dev, "rndis response timeout\n"); | 188 | dev_dbg(&info->control->dev, "rndis response timeout\n"); |
188 | return -ETIMEDOUT; | 189 | return -ETIMEDOUT; |
189 | } | 190 | } |
191 | EXPORT_SYMBOL_GPL(rndis_command); | ||
190 | 192 | ||
191 | /* | 193 | /* |
192 | * rndis_query: | 194 | * rndis_query: |
@@ -253,7 +255,7 @@ response_error: | |||
253 | return -EDOM; | 255 | return -EDOM; |
254 | } | 256 | } |
255 | 257 | ||
256 | static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) | 258 | int generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf) |
257 | { | 259 | { |
258 | int retval; | 260 | int retval; |
259 | struct net_device *net = dev->net; | 261 | struct net_device *net = dev->net; |
@@ -377,8 +379,9 @@ fail: | |||
377 | kfree(u.buf); | 379 | kfree(u.buf); |
378 | return retval; | 380 | return retval; |
379 | } | 381 | } |
382 | EXPORT_SYMBOL_GPL(generic_rndis_bind); | ||
380 | 383 | ||
381 | static void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) | 384 | void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) |
382 | { | 385 | { |
383 | struct rndis_halt *halt; | 386 | struct rndis_halt *halt; |
384 | 387 | ||
@@ -393,11 +396,12 @@ static void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) | |||
393 | 396 | ||
394 | usbnet_cdc_unbind(dev, intf); | 397 | usbnet_cdc_unbind(dev, intf); |
395 | } | 398 | } |
399 | EXPORT_SYMBOL_GPL(rndis_unbind); | ||
396 | 400 | ||
397 | /* | 401 | /* |
398 | * DATA -- host must not write zlps | 402 | * DATA -- host must not write zlps |
399 | */ | 403 | */ |
400 | static int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | 404 | int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) |
401 | { | 405 | { |
402 | /* peripheral may have batched packets to us... */ | 406 | /* peripheral may have batched packets to us... */ |
403 | while (likely(skb->len)) { | 407 | while (likely(skb->len)) { |
@@ -439,8 +443,9 @@ static int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
439 | /* caller will usbnet_skb_return the remaining packet */ | 443 | /* caller will usbnet_skb_return the remaining packet */ |
440 | return 1; | 444 | return 1; |
441 | } | 445 | } |
446 | EXPORT_SYMBOL_GPL(rndis_rx_fixup); | ||
442 | 447 | ||
443 | static struct sk_buff * | 448 | struct sk_buff * |
444 | rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | 449 | rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) |
445 | { | 450 | { |
446 | struct rndis_data_hdr *hdr; | 451 | struct rndis_data_hdr *hdr; |
@@ -485,12 +490,13 @@ fill: | |||
485 | /* FIXME make the last packet always be short ... */ | 490 | /* FIXME make the last packet always be short ... */ |
486 | return skb; | 491 | return skb; |
487 | } | 492 | } |
493 | EXPORT_SYMBOL_GPL(rndis_tx_fixup); | ||
488 | 494 | ||
489 | 495 | ||
490 | static const struct driver_info rndis_info = { | 496 | static const struct driver_info rndis_info = { |
491 | .description = "RNDIS device", | 497 | .description = "RNDIS device", |
492 | .flags = FLAG_ETHER | FLAG_FRAMING_RN | FLAG_NO_SETINT, | 498 | .flags = FLAG_ETHER | FLAG_FRAMING_RN | FLAG_NO_SETINT, |
493 | .bind = rndis_bind, | 499 | .bind = generic_rndis_bind, |
494 | .unbind = rndis_unbind, | 500 | .unbind = rndis_unbind, |
495 | .status = rndis_status, | 501 | .status = rndis_status, |
496 | .rx_fixup = rndis_rx_fixup, | 502 | .rx_fixup = rndis_rx_fixup, |
diff --git a/drivers/net/usb/rndis_host.h b/drivers/net/usb/rndis_host.h index 1386a1791659..61f1fd8f5ff6 100644 --- a/drivers/net/usb/rndis_host.h +++ b/drivers/net/usb/rndis_host.h | |||
@@ -244,5 +244,14 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */ | |||
244 | RNDIS_PACKET_TYPE_ALL_MULTICAST | \ | 244 | RNDIS_PACKET_TYPE_ALL_MULTICAST | \ |
245 | RNDIS_PACKET_TYPE_PROMISCUOUS) | 245 | RNDIS_PACKET_TYPE_PROMISCUOUS) |
246 | 246 | ||
247 | |||
248 | extern void rndis_status(struct usbnet *dev, struct urb *urb); | ||
249 | extern int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf); | ||
250 | extern int generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf); | ||
251 | extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf); | ||
252 | extern int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb); | ||
253 | extern struct sk_buff * | ||
254 | rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); | ||
255 | |||
247 | #endif /* __RNDIS_HOST_H */ | 256 | #endif /* __RNDIS_HOST_H */ |
248 | 257 | ||