diff options
| author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-12-03 09:15:29 -0500 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2013-12-12 14:43:38 -0500 |
| commit | 9c2b85f4f99cb5c5f4b8e29ef15e344f93ec5be1 (patch) | |
| tree | 2bf23fc517695312880e0b61a9744703a91ac87d | |
| parent | 31f89db1b81ea1c54ca7d186a0c0ebab0d4988f0 (diff) | |
usb: gadget: rndis: merge u_rndis.ko with usb_f_rndis.ko
The rndis function's users use only the new interface, so the two modules
can be merged.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
| -rw-r--r-- | drivers/usb/gadget/Kconfig | 7 | ||||
| -rw-r--r-- | drivers/usb/gadget/Makefile | 4 | ||||
| -rw-r--r-- | drivers/usb/gadget/f_rndis.c | 22 | ||||
| -rw-r--r-- | drivers/usb/gadget/rndis.c | 7 | ||||
| -rw-r--r-- | drivers/usb/gadget/u_rndis.h | 2 |
5 files changed, 26 insertions, 16 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 8cea14f3d590..aa3610ea9d9f 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
| @@ -512,9 +512,6 @@ config USB_U_SERIAL | |||
| 512 | config USB_U_ETHER | 512 | config USB_U_ETHER |
| 513 | tristate | 513 | tristate |
| 514 | 514 | ||
| 515 | config USB_U_RNDIS | ||
| 516 | tristate | ||
| 517 | |||
| 518 | config USB_F_SERIAL | 515 | config USB_F_SERIAL |
| 519 | tristate | 516 | tristate |
| 520 | 517 | ||
| @@ -642,7 +639,6 @@ config USB_CONFIGFS_RNDIS | |||
| 642 | depends on USB_CONFIGFS | 639 | depends on USB_CONFIGFS |
| 643 | depends on NET | 640 | depends on NET |
| 644 | select USB_U_ETHER | 641 | select USB_U_ETHER |
| 645 | select USB_U_RNDIS | ||
| 646 | select USB_F_RNDIS | 642 | select USB_F_RNDIS |
| 647 | help | 643 | help |
| 648 | Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, | 644 | Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, |
| @@ -772,7 +768,6 @@ config USB_ETH | |||
| 772 | depends on NET | 768 | depends on NET |
| 773 | select USB_LIBCOMPOSITE | 769 | select USB_LIBCOMPOSITE |
| 774 | select USB_U_ETHER | 770 | select USB_U_ETHER |
| 775 | select USB_U_RNDIS | ||
| 776 | select USB_F_ECM | 771 | select USB_F_ECM |
| 777 | select USB_F_SUBSET | 772 | select USB_F_SUBSET |
| 778 | select CRC32 | 773 | select CRC32 |
| @@ -905,7 +900,6 @@ config USB_FUNCTIONFS_RNDIS | |||
| 905 | bool "Include configuration with RNDIS (Ethernet)" | 900 | bool "Include configuration with RNDIS (Ethernet)" |
| 906 | depends on USB_FUNCTIONFS && NET | 901 | depends on USB_FUNCTIONFS && NET |
| 907 | select USB_U_ETHER | 902 | select USB_U_ETHER |
| 908 | select USB_U_RNDIS | ||
| 909 | select USB_F_RNDIS | 903 | select USB_F_RNDIS |
| 910 | help | 904 | help |
| 911 | Include a configuration with RNDIS function (Ethernet) and the Filesystem. | 905 | Include a configuration with RNDIS function (Ethernet) and the Filesystem. |
| @@ -1080,7 +1074,6 @@ config USB_G_MULTI | |||
| 1080 | config USB_G_MULTI_RNDIS | 1074 | config USB_G_MULTI_RNDIS |
| 1081 | bool "RNDIS + CDC Serial + Storage configuration" | 1075 | bool "RNDIS + CDC Serial + Storage configuration" |
| 1082 | depends on USB_G_MULTI | 1076 | depends on USB_G_MULTI |
| 1083 | select USB_U_RNDIS | ||
| 1084 | select USB_F_RNDIS | 1077 | select USB_F_RNDIS |
| 1085 | default y | 1078 | default y |
| 1086 | help | 1079 | help |
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index 40bd0f80b5ad..0c40277931f4 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile | |||
| @@ -47,8 +47,6 @@ obj-$(CONFIG_USB_F_SERIAL) += usb_f_serial.o | |||
| 47 | usb_f_obex-y := f_obex.o | 47 | usb_f_obex-y := f_obex.o |
| 48 | obj-$(CONFIG_USB_F_OBEX) += usb_f_obex.o | 48 | obj-$(CONFIG_USB_F_OBEX) += usb_f_obex.o |
| 49 | obj-$(CONFIG_USB_U_ETHER) += u_ether.o | 49 | obj-$(CONFIG_USB_U_ETHER) += u_ether.o |
| 50 | u_rndis-y := rndis.o | ||
| 51 | obj-$(CONFIG_USB_U_RNDIS) += u_rndis.o | ||
| 52 | usb_f_ncm-y := f_ncm.o | 50 | usb_f_ncm-y := f_ncm.o |
| 53 | obj-$(CONFIG_USB_F_NCM) += usb_f_ncm.o | 51 | obj-$(CONFIG_USB_F_NCM) += usb_f_ncm.o |
| 54 | usb_f_ecm-y := f_ecm.o | 52 | usb_f_ecm-y := f_ecm.o |
| @@ -59,7 +57,7 @@ usb_f_eem-y := f_eem.o | |||
| 59 | obj-$(CONFIG_USB_F_EEM) += usb_f_eem.o | 57 | obj-$(CONFIG_USB_F_EEM) += usb_f_eem.o |
| 60 | usb_f_ecm_subset-y := f_subset.o | 58 | usb_f_ecm_subset-y := f_subset.o |
| 61 | obj-$(CONFIG_USB_F_SUBSET) += usb_f_ecm_subset.o | 59 | obj-$(CONFIG_USB_F_SUBSET) += usb_f_ecm_subset.o |
| 62 | usb_f_rndis-y := f_rndis.o | 60 | usb_f_rndis-y := f_rndis.o rndis.o |
| 63 | obj-$(CONFIG_USB_F_RNDIS) += usb_f_rndis.o | 61 | obj-$(CONFIG_USB_F_RNDIS) += usb_f_rndis.o |
| 64 | usb_f_mass_storage-y := f_mass_storage.o storage_common.o | 62 | usb_f_mass_storage-y := f_mass_storage.o storage_common.o |
| 65 | obj-$(CONFIG_USB_F_MASS_STORAGE)+= usb_f_mass_storage.o | 63 | obj-$(CONFIG_USB_F_MASS_STORAGE)+= usb_f_mass_storage.o |
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 9d7c99526dda..c11761ce5113 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
| @@ -979,6 +979,26 @@ static struct usb_function *rndis_alloc(struct usb_function_instance *fi) | |||
| 979 | return &rndis->port.func; | 979 | return &rndis->port.func; |
| 980 | } | 980 | } |
| 981 | 981 | ||
| 982 | DECLARE_USB_FUNCTION_INIT(rndis, rndis_alloc_inst, rndis_alloc); | 982 | DECLARE_USB_FUNCTION(rndis, rndis_alloc_inst, rndis_alloc); |
| 983 | |||
| 984 | static int __init rndis_mod_init(void) | ||
| 985 | { | ||
| 986 | int ret; | ||
| 987 | |||
| 988 | ret = rndis_init(); | ||
| 989 | if (ret) | ||
| 990 | return ret; | ||
| 991 | |||
| 992 | return usb_function_register(&rndisusb_func); | ||
| 993 | } | ||
| 994 | module_init(rndis_mod_init); | ||
| 995 | |||
| 996 | static void __exit rndis_mod_exit(void) | ||
| 997 | { | ||
| 998 | usb_function_unregister(&rndisusb_func); | ||
| 999 | rndis_exit(); | ||
| 1000 | } | ||
| 1001 | module_exit(rndis_mod_exit); | ||
| 1002 | |||
| 983 | MODULE_LICENSE("GPL"); | 1003 | MODULE_LICENSE("GPL"); |
| 984 | MODULE_AUTHOR("David Brownell"); | 1004 | MODULE_AUTHOR("David Brownell"); |
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index a3ad732bc812..1ffbdb4659f2 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
| @@ -1142,7 +1142,7 @@ static struct proc_dir_entry *rndis_connect_state [RNDIS_MAX_CONFIGS]; | |||
| 1142 | #endif /* CONFIG_USB_GADGET_DEBUG_FILES */ | 1142 | #endif /* CONFIG_USB_GADGET_DEBUG_FILES */ |
| 1143 | 1143 | ||
| 1144 | 1144 | ||
| 1145 | static int rndis_init(void) | 1145 | int rndis_init(void) |
| 1146 | { | 1146 | { |
| 1147 | u8 i; | 1147 | u8 i; |
| 1148 | 1148 | ||
| @@ -1174,9 +1174,8 @@ static int rndis_init(void) | |||
| 1174 | 1174 | ||
| 1175 | return 0; | 1175 | return 0; |
| 1176 | } | 1176 | } |
| 1177 | module_init(rndis_init); | ||
| 1178 | 1177 | ||
| 1179 | static void rndis_exit(void) | 1178 | void rndis_exit(void) |
| 1180 | { | 1179 | { |
| 1181 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES | 1180 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES |
| 1182 | u8 i; | 1181 | u8 i; |
| @@ -1188,6 +1187,4 @@ static void rndis_exit(void) | |||
| 1188 | } | 1187 | } |
| 1189 | #endif | 1188 | #endif |
| 1190 | } | 1189 | } |
| 1191 | module_exit(rndis_exit); | ||
| 1192 | 1190 | ||
| 1193 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/usb/gadget/u_rndis.h b/drivers/usb/gadget/u_rndis.h index c62ba82e9600..7291b15c9dce 100644 --- a/drivers/usb/gadget/u_rndis.h +++ b/drivers/usb/gadget/u_rndis.h | |||
| @@ -36,6 +36,8 @@ struct f_rndis_opts { | |||
| 36 | int refcnt; | 36 | int refcnt; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | int rndis_init(void); | ||
| 40 | void rndis_exit(void); | ||
| 39 | void rndis_borrow_net(struct usb_function_instance *f, struct net_device *net); | 41 | void rndis_borrow_net(struct usb_function_instance *f, struct net_device *net); |
| 40 | 42 | ||
| 41 | #endif /* U_RNDIS_H */ | 43 | #endif /* U_RNDIS_H */ |
