diff options
| author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-12-03 09:15:28 -0500 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2013-12-12 14:43:37 -0500 |
| commit | 31f89db1b81ea1c54ca7d186a0c0ebab0d4988f0 (patch) | |
| tree | d2e40afb1ae4f0e02562f689ab294c2a04520f0c | |
| parent | 6e257b14218d0d963058a96736da6c6e2abb08f3 (diff) | |
usb: gadget: f_rndis: remove compatibility layer
There are no old function interface users left, so the old interface
can be removed.
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/f_rndis.c | 72 | ||||
| -rw-r--r-- | drivers/usb/gadget/u_ether.h | 36 |
2 files changed, 1 insertions, 107 deletions
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 717ed7f95639..9d7c99526dda 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
| @@ -675,7 +675,6 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) | |||
| 675 | int status; | 675 | int status; |
| 676 | struct usb_ep *ep; | 676 | struct usb_ep *ep; |
| 677 | 677 | ||
| 678 | #ifndef USB_FRNDIS_INCLUDED | ||
| 679 | struct f_rndis_opts *rndis_opts; | 678 | struct f_rndis_opts *rndis_opts; |
| 680 | 679 | ||
| 681 | if (!can_support_rndis(c)) | 680 | if (!can_support_rndis(c)) |
| @@ -697,7 +696,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) | |||
| 697 | return status; | 696 | return status; |
| 698 | rndis_opts->bound = true; | 697 | rndis_opts->bound = true; |
| 699 | } | 698 | } |
| 700 | #endif | 699 | |
| 701 | us = usb_gstrings_attach(cdev, rndis_strings, | 700 | us = usb_gstrings_attach(cdev, rndis_strings, |
| 702 | ARRAY_SIZE(rndis_string_defs)); | 701 | ARRAY_SIZE(rndis_string_defs)); |
| 703 | if (IS_ERR(us)) | 702 | if (IS_ERR(us)) |
| @@ -782,13 +781,6 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) | |||
| 782 | rndis->port.open = rndis_open; | 781 | rndis->port.open = rndis_open; |
| 783 | rndis->port.close = rndis_close; | 782 | rndis->port.close = rndis_close; |
| 784 | 783 | ||
| 785 | #ifdef USB_FRNDIS_INCLUDED | ||
| 786 | status = rndis_register(rndis_response_available, rndis); | ||
| 787 | if (status < 0) | ||
| 788 | goto fail; | ||
| 789 | rndis->config = status; | ||
| 790 | #endif | ||
| 791 | |||
| 792 | rndis_set_param_medium(rndis->config, RNDIS_MEDIUM_802_3, 0); | 784 | rndis_set_param_medium(rndis->config, RNDIS_MEDIUM_802_3, 0); |
| 793 | rndis_set_host_mac(rndis->config, rndis->ethaddr); | 785 | rndis_set_host_mac(rndis->config, rndis->ethaddr); |
| 794 | 786 | ||
| @@ -830,66 +822,6 @@ fail: | |||
| 830 | return status; | 822 | return status; |
| 831 | } | 823 | } |
| 832 | 824 | ||
| 833 | #ifdef USB_FRNDIS_INCLUDED | ||
| 834 | |||
| 835 | static void | ||
| 836 | rndis_old_unbind(struct usb_configuration *c, struct usb_function *f) | ||
| 837 | { | ||
| 838 | struct f_rndis *rndis = func_to_rndis(f); | ||
| 839 | |||
| 840 | rndis_deregister(rndis->config); | ||
| 841 | |||
| 842 | usb_free_all_descriptors(f); | ||
| 843 | |||
| 844 | kfree(rndis->notify_req->buf); | ||
| 845 | usb_ep_free_request(rndis->notify, rndis->notify_req); | ||
| 846 | |||
| 847 | kfree(rndis); | ||
| 848 | } | ||
| 849 | |||
| 850 | int | ||
| 851 | rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], | ||
| 852 | u32 vendorID, const char *manufacturer, struct eth_dev *dev) | ||
| 853 | { | ||
| 854 | struct f_rndis *rndis; | ||
| 855 | int status; | ||
| 856 | |||
| 857 | /* allocate and initialize one new instance */ | ||
| 858 | status = -ENOMEM; | ||
| 859 | rndis = kzalloc(sizeof *rndis, GFP_KERNEL); | ||
| 860 | if (!rndis) | ||
| 861 | goto fail; | ||
| 862 | |||
| 863 | memcpy(rndis->ethaddr, ethaddr, ETH_ALEN); | ||
| 864 | rndis->vendorID = vendorID; | ||
| 865 | rndis->manufacturer = manufacturer; | ||
| 866 | |||
| 867 | rndis->port.ioport = dev; | ||
| 868 | /* RNDIS activates when the host changes this filter */ | ||
| 869 | rndis->port.cdc_filter = 0; | ||
| 870 | |||
| 871 | /* RNDIS has special (and complex) framing */ | ||
| 872 | rndis->port.header_len = sizeof(struct rndis_packet_msg_type); | ||
| 873 | rndis->port.wrap = rndis_add_header; | ||
| 874 | rndis->port.unwrap = rndis_rm_hdr; | ||
| 875 | |||
| 876 | rndis->port.func.name = "rndis"; | ||
| 877 | /* descriptors are per-instance copies */ | ||
| 878 | rndis->port.func.bind = rndis_bind; | ||
| 879 | rndis->port.func.unbind = rndis_old_unbind; | ||
| 880 | rndis->port.func.set_alt = rndis_set_alt; | ||
| 881 | rndis->port.func.setup = rndis_setup; | ||
| 882 | rndis->port.func.disable = rndis_disable; | ||
| 883 | |||
| 884 | status = usb_add_function(c, &rndis->port.func); | ||
| 885 | if (status) | ||
| 886 | kfree(rndis); | ||
| 887 | fail: | ||
| 888 | return status; | ||
| 889 | } | ||
| 890 | |||
| 891 | #else | ||
| 892 | |||
| 893 | void rndis_borrow_net(struct usb_function_instance *f, struct net_device *net) | 825 | void rndis_borrow_net(struct usb_function_instance *f, struct net_device *net) |
| 894 | { | 826 | { |
| 895 | struct f_rndis_opts *opts; | 827 | struct f_rndis_opts *opts; |
| @@ -1050,5 +982,3 @@ static struct usb_function *rndis_alloc(struct usb_function_instance *fi) | |||
| 1050 | DECLARE_USB_FUNCTION_INIT(rndis, rndis_alloc_inst, rndis_alloc); | 982 | DECLARE_USB_FUNCTION_INIT(rndis, rndis_alloc_inst, rndis_alloc); |
| 1051 | MODULE_LICENSE("GPL"); | 983 | MODULE_LICENSE("GPL"); |
| 1052 | MODULE_AUTHOR("David Brownell"); | 984 | MODULE_AUTHOR("David Brownell"); |
| 1053 | |||
| 1054 | #endif | ||
diff --git a/drivers/usb/gadget/u_ether.h b/drivers/usb/gadget/u_ether.h index 72b6facde40d..0f0290acea7e 100644 --- a/drivers/usb/gadget/u_ether.h +++ b/drivers/usb/gadget/u_ether.h | |||
| @@ -267,40 +267,4 @@ static inline bool can_support_ecm(struct usb_gadget *gadget) | |||
| 267 | return true; | 267 | return true; |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | /* each configuration may bind one instance of an ethernet link */ | ||
| 271 | #ifdef USB_ETH_RNDIS | ||
| 272 | |||
| 273 | int rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], | ||
| 274 | u32 vendorID, const char *manufacturer, struct eth_dev *dev); | ||
| 275 | |||
| 276 | #else | ||
| 277 | |||
| 278 | static inline int | ||
| 279 | rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], | ||
| 280 | u32 vendorID, const char *manufacturer, struct eth_dev *dev) | ||
| 281 | { | ||
| 282 | return 0; | ||
| 283 | } | ||
| 284 | |||
| 285 | #endif | ||
| 286 | |||
| 287 | /** | ||
| 288 | * rndis_bind_config - add RNDIS network link to a configuration | ||
| 289 | * @c: the configuration to support the network link | ||
| 290 | * @ethaddr: a buffer in which the ethernet address of the host side | ||
| 291 | * side of the link was recorded | ||
| 292 | * Context: single threaded during gadget setup | ||
| 293 | * | ||
| 294 | * Returns zero on success, else negative errno. | ||
| 295 | * | ||
| 296 | * Caller must have called @gether_setup(). Caller is also responsible | ||
| 297 | * for calling @gether_cleanup() before module unload. | ||
| 298 | */ | ||
| 299 | static inline int rndis_bind_config(struct usb_configuration *c, | ||
| 300 | u8 ethaddr[ETH_ALEN], struct eth_dev *dev) | ||
| 301 | { | ||
| 302 | return rndis_bind_config_vendor(c, ethaddr, 0, NULL, dev); | ||
| 303 | } | ||
| 304 | |||
| 305 | |||
| 306 | #endif /* __U_ETHER_H */ | 270 | #endif /* __U_ETHER_H */ |
