aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2008-01-25 17:51:17 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:26:57 -0500
commit5665998cd75bbaaa9361471921e3a0d4c665bf00 (patch)
treef1a20a1f08f7186da6fe1c52692d25cddb01e727 /drivers/net/usb
parent7517579af8f32ecf9ddff4ead52bc801e4898efe (diff)
rndis_host: export functions
Export rndis_host functions and also rename rndis_bind() to generic_rndis_bind() for modules using rndis_host as base. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/rndis_host.c20
-rw-r--r--drivers/net/usb/rndis_host.h9
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 */
63static void rndis_status(struct usbnet *dev, struct urb *urb) 63void 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}
70EXPORT_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 */
81static int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf) 82int 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}
191EXPORT_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
256static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) 258int 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}
382EXPORT_SYMBOL_GPL(generic_rndis_bind);
380 383
381static void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) 384void 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}
399EXPORT_SYMBOL_GPL(rndis_unbind);
396 400
397/* 401/*
398 * DATA -- host must not write zlps 402 * DATA -- host must not write zlps
399 */ 403 */
400static int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) 404int 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}
446EXPORT_SYMBOL_GPL(rndis_rx_fixup);
442 447
443static struct sk_buff * 448struct sk_buff *
444rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) 449rndis_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}
493EXPORT_SYMBOL_GPL(rndis_tx_fixup);
488 494
489 495
490static const struct driver_info rndis_info = { 496static 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
248extern void rndis_status(struct usbnet *dev, struct urb *urb);
249extern int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf);
250extern int generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf);
251extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf);
252extern int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb);
253extern struct sk_buff *
254rndis_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