aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/Kconfig6
-rw-r--r--drivers/usb/gadget/Makefile2
-rw-r--r--drivers/usb/gadget/ether.c4
-rw-r--r--drivers/usb/gadget/g_ffs.c2
-rw-r--r--drivers/usb/gadget/multi.c2
-rw-r--r--drivers/usb/gadget/rndis.c18
-rw-r--r--drivers/usb/gadget/rndis.h1
7 files changed, 32 insertions, 3 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index d5ae4dff3b90..5345b6895220 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -502,6 +502,9 @@ config USB_U_SERIAL
502config USB_U_ETHER 502config USB_U_ETHER
503 tristate 503 tristate
504 504
505config USB_U_RNDIS
506 tristate
507
505config USB_F_SERIAL 508config USB_F_SERIAL
506 tristate 509 tristate
507 510
@@ -599,6 +602,7 @@ config USB_ETH
599 depends on NET 602 depends on NET
600 select USB_LIBCOMPOSITE 603 select USB_LIBCOMPOSITE
601 select USB_U_ETHER 604 select USB_U_ETHER
605 select USB_U_RNDIS
602 select CRC32 606 select CRC32
603 help 607 help
604 This driver implements Ethernet style communication, in one of 608 This driver implements Ethernet style communication, in one of
@@ -724,6 +728,7 @@ config USB_FUNCTIONFS_RNDIS
724 bool "Include configuration with RNDIS (Ethernet)" 728 bool "Include configuration with RNDIS (Ethernet)"
725 depends on USB_FUNCTIONFS && NET 729 depends on USB_FUNCTIONFS && NET
726 select USB_U_ETHER 730 select USB_U_ETHER
731 select USB_U_RNDIS
727 help 732 help
728 Include a configuration with RNDIS function (Ethernet) and the Filesystem. 733 Include a configuration with RNDIS function (Ethernet) and the Filesystem.
729 734
@@ -871,6 +876,7 @@ config USB_G_MULTI
871 select USB_LIBCOMPOSITE 876 select USB_LIBCOMPOSITE
872 select USB_U_SERIAL 877 select USB_U_SERIAL
873 select USB_U_ETHER 878 select USB_U_ETHER
879 select USB_U_RNDIS
874 select USB_F_ACM 880 select USB_F_ACM
875 help 881 help
876 The Multifunction Composite Gadget provides Ethernet (RNDIS 882 The Multifunction Composite Gadget provides Ethernet (RNDIS
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index b6c2bf7a3c2d..7a0463ef3684 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -46,6 +46,8 @@ obj-$(CONFIG_USB_F_SERIAL) += usb_f_serial.o
46usb_f_obex-y := f_obex.o 46usb_f_obex-y := f_obex.o
47obj-$(CONFIG_USB_F_OBEX) += usb_f_obex.o 47obj-$(CONFIG_USB_F_OBEX) += usb_f_obex.o
48obj-$(CONFIG_USB_U_ETHER) += u_ether.o 48obj-$(CONFIG_USB_U_ETHER) += u_ether.o
49u_rndis-y := rndis.o
50obj-$(CONFIG_USB_U_RNDIS) += u_rndis.o
49 51
50# 52#
51# USB gadget drivers 53# USB gadget drivers
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 75418c7050fb..6bff24f193a2 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -91,6 +91,8 @@ static inline bool has_rndis(void)
91#endif 91#endif
92} 92}
93 93
94#include <linux/module.h>
95
94/*-------------------------------------------------------------------------*/ 96/*-------------------------------------------------------------------------*/
95 97
96/* 98/*
@@ -104,7 +106,7 @@ static inline bool has_rndis(void)
104#include "f_subset.c" 106#include "f_subset.c"
105#ifdef USB_ETH_RNDIS 107#ifdef USB_ETH_RNDIS
106#include "f_rndis.c" 108#include "f_rndis.c"
107#include "rndis.c" 109#include "rndis.h"
108#endif 110#endif
109#include "f_eem.c" 111#include "f_eem.c"
110 112
diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
index 45f26be640de..fbfdb53a2db5 100644
--- a/drivers/usb/gadget/g_ffs.c
+++ b/drivers/usb/gadget/g_ffs.c
@@ -32,7 +32,7 @@
32# include "f_subset.c" 32# include "f_subset.c"
33# ifdef USB_ETH_RNDIS 33# ifdef USB_ETH_RNDIS
34# include "f_rndis.c" 34# include "f_rndis.c"
35# include "rndis.c" 35# include "rndis.h"
36# endif 36# endif
37# include "u_ether.h" 37# include "u_ether.h"
38 38
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index cdb8dbf34c8d..ce21e9f8203e 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -47,7 +47,7 @@ MODULE_LICENSE("GPL");
47#include "f_subset.c" 47#include "f_subset.c"
48#ifdef USB_ETH_RNDIS 48#ifdef USB_ETH_RNDIS
49# include "f_rndis.c" 49# include "f_rndis.c"
50# include "rndis.c" 50# include "rndis.h"
51#endif 51#endif
52#include "u_ether.h" 52#include "u_ether.h"
53 53
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 1e4cfb05f70b..8c5e95762e59 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -761,6 +761,7 @@ int rndis_signal_connect(int configNr)
761 return rndis_indicate_status_msg(configNr, 761 return rndis_indicate_status_msg(configNr,
762 RNDIS_STATUS_MEDIA_CONNECT); 762 RNDIS_STATUS_MEDIA_CONNECT);
763} 763}
764EXPORT_SYMBOL(rndis_signal_connect);
764 765
765int rndis_signal_disconnect(int configNr) 766int rndis_signal_disconnect(int configNr)
766{ 767{
@@ -769,6 +770,7 @@ int rndis_signal_disconnect(int configNr)
769 return rndis_indicate_status_msg(configNr, 770 return rndis_indicate_status_msg(configNr,
770 RNDIS_STATUS_MEDIA_DISCONNECT); 771 RNDIS_STATUS_MEDIA_DISCONNECT);
771} 772}
773EXPORT_SYMBOL(rndis_signal_disconnect);
772 774
773void rndis_uninit(int configNr) 775void rndis_uninit(int configNr)
774{ 776{
@@ -783,11 +785,13 @@ void rndis_uninit(int configNr)
783 while ((buf = rndis_get_next_response(configNr, &length))) 785 while ((buf = rndis_get_next_response(configNr, &length)))
784 rndis_free_response(configNr, buf); 786 rndis_free_response(configNr, buf);
785} 787}
788EXPORT_SYMBOL(rndis_uninit);
786 789
787void rndis_set_host_mac(int configNr, const u8 *addr) 790void rndis_set_host_mac(int configNr, const u8 *addr)
788{ 791{
789 rndis_per_dev_params[configNr].host_mac = addr; 792 rndis_per_dev_params[configNr].host_mac = addr;
790} 793}
794EXPORT_SYMBOL(rndis_set_host_mac);
791 795
792/* 796/*
793 * Message Parser 797 * Message Parser
@@ -870,6 +874,7 @@ int rndis_msg_parser(u8 configNr, u8 *buf)
870 874
871 return -ENOTSUPP; 875 return -ENOTSUPP;
872} 876}
877EXPORT_SYMBOL(rndis_msg_parser);
873 878
874int rndis_register(void (*resp_avail)(void *v), void *v) 879int rndis_register(void (*resp_avail)(void *v), void *v)
875{ 880{
@@ -891,6 +896,7 @@ int rndis_register(void (*resp_avail)(void *v), void *v)
891 896
892 return -ENODEV; 897 return -ENODEV;
893} 898}
899EXPORT_SYMBOL(rndis_register);
894 900
895void rndis_deregister(int configNr) 901void rndis_deregister(int configNr)
896{ 902{
@@ -899,6 +905,7 @@ void rndis_deregister(int configNr)
899 if (configNr >= RNDIS_MAX_CONFIGS) return; 905 if (configNr >= RNDIS_MAX_CONFIGS) return;
900 rndis_per_dev_params[configNr].used = 0; 906 rndis_per_dev_params[configNr].used = 0;
901} 907}
908EXPORT_SYMBOL(rndis_deregister);
902 909
903int rndis_set_param_dev(u8 configNr, struct net_device *dev, u16 *cdc_filter) 910int rndis_set_param_dev(u8 configNr, struct net_device *dev, u16 *cdc_filter)
904{ 911{
@@ -912,6 +919,7 @@ int rndis_set_param_dev(u8 configNr, struct net_device *dev, u16 *cdc_filter)
912 919
913 return 0; 920 return 0;
914} 921}
922EXPORT_SYMBOL(rndis_set_param_dev);
915 923
916int rndis_set_param_vendor(u8 configNr, u32 vendorID, const char *vendorDescr) 924int rndis_set_param_vendor(u8 configNr, u32 vendorID, const char *vendorDescr)
917{ 925{
@@ -924,6 +932,7 @@ int rndis_set_param_vendor(u8 configNr, u32 vendorID, const char *vendorDescr)
924 932
925 return 0; 933 return 0;
926} 934}
935EXPORT_SYMBOL(rndis_set_param_vendor);
927 936
928int rndis_set_param_medium(u8 configNr, u32 medium, u32 speed) 937int rndis_set_param_medium(u8 configNr, u32 medium, u32 speed)
929{ 938{
@@ -935,6 +944,7 @@ int rndis_set_param_medium(u8 configNr, u32 medium, u32 speed)
935 944
936 return 0; 945 return 0;
937} 946}
947EXPORT_SYMBOL(rndis_set_param_medium);
938 948
939void rndis_add_hdr(struct sk_buff *skb) 949void rndis_add_hdr(struct sk_buff *skb)
940{ 950{
@@ -949,6 +959,7 @@ void rndis_add_hdr(struct sk_buff *skb)
949 header->DataOffset = cpu_to_le32(36); 959 header->DataOffset = cpu_to_le32(36);
950 header->DataLength = cpu_to_le32(skb->len - sizeof(*header)); 960 header->DataLength = cpu_to_le32(skb->len - sizeof(*header));
951} 961}
962EXPORT_SYMBOL(rndis_add_hdr);
952 963
953void rndis_free_response(int configNr, u8 *buf) 964void rndis_free_response(int configNr, u8 *buf)
954{ 965{
@@ -965,6 +976,7 @@ void rndis_free_response(int configNr, u8 *buf)
965 } 976 }
966 } 977 }
967} 978}
979EXPORT_SYMBOL(rndis_free_response);
968 980
969u8 *rndis_get_next_response(int configNr, u32 *length) 981u8 *rndis_get_next_response(int configNr, u32 *length)
970{ 982{
@@ -986,6 +998,7 @@ u8 *rndis_get_next_response(int configNr, u32 *length)
986 998
987 return NULL; 999 return NULL;
988} 1000}
1001EXPORT_SYMBOL(rndis_get_next_response);
989 1002
990static rndis_resp_t *rndis_add_response(int configNr, u32 length) 1003static rndis_resp_t *rndis_add_response(int configNr, u32 length)
991{ 1004{
@@ -1029,6 +1042,7 @@ int rndis_rm_hdr(struct gether *port,
1029 skb_queue_tail(list, skb); 1042 skb_queue_tail(list, skb);
1030 return 0; 1043 return 0;
1031} 1044}
1045EXPORT_SYMBOL(rndis_rm_hdr);
1032 1046
1033#ifdef CONFIG_USB_GADGET_DEBUG_FILES 1047#ifdef CONFIG_USB_GADGET_DEBUG_FILES
1034 1048
@@ -1160,6 +1174,7 @@ int rndis_init(void)
1160 1174
1161 return 0; 1175 return 0;
1162} 1176}
1177EXPORT_SYMBOL(rndis_init);
1163 1178
1164void rndis_exit(void) 1179void rndis_exit(void)
1165{ 1180{
@@ -1173,3 +1188,6 @@ void rndis_exit(void)
1173 } 1188 }
1174#endif 1189#endif
1175} 1190}
1191EXPORT_SYMBOL(rndis_exit);
1192
1193MODULE_LICENSE("GPL");
diff --git a/drivers/usb/gadget/rndis.h b/drivers/usb/gadget/rndis.h
index 0647f2f34e89..6e796152a7b2 100644
--- a/drivers/usb/gadget/rndis.h
+++ b/drivers/usb/gadget/rndis.h
@@ -16,6 +16,7 @@
16#define _LINUX_RNDIS_H 16#define _LINUX_RNDIS_H
17 17
18#include <linux/rndis.h> 18#include <linux/rndis.h>
19#include "u_ether.h"
19#include "ndis.h" 20#include "ndis.h"
20 21
21#define RNDIS_MAXIMUM_FRAME_SIZE 1518 22#define RNDIS_MAXIMUM_FRAME_SIZE 1518