aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_rndis.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 18:50:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 18:50:46 -0400
commita481991467d38afb43c3921d5b5b59ccb61b04ba (patch)
treea4b0b9a14da6fd5ef7b9b512bb32dbfcfcf2cd71 /drivers/usb/gadget/f_rndis.c
parentf6a26ae7699416d86bea8cb68ce413571e9cab3c (diff)
parentcda4db53e9c28061c100400e1a4d273ea61dfba9 (diff)
Merge tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB 3.5-rc1 changes from Greg Kroah-Hartman: "Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window. It's touches a lot of different parts of the kernel, all USB drivers, due to some API cleanups (getting rid of the ancient err() macro) and some changes that are needed for USB 3.0 power management updates. There are also lots of new drivers, pimarily gadget, but others as well. We deleted a staging driver, which was nice, and finally dropped the obsolete usbfs code, which will make Al happy to never have to touch that again. There were some build errors in the tree that linux-next found a few days ago, but those were fixed by the most recent changes (all were due to us not building with CONFIG_PM disabled.) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (477 commits) xhci: Fix DIV_ROUND_UP compile error. xhci: Fix compile with CONFIG_USB_SUSPEND=n USB: Fix core compile with CONFIG_USB_SUSPEND=n brcm80211: Fix compile error for .disable_hub_initiated_lpm. Revert "USB: EHCI: work around bug in the Philips ISP1562 controller" MAINTAINERS: Add myself as maintainer to the USB PHY Layer USB: EHCI: fix command register configuration lost problem USB: Remove races in devio.c USB: ehci-platform: remove update_device USB: Disable hub-initiated LPM for comms devices. xhci: Add Intel U1/U2 timeout policy. xhci: Add infrastructure for host-specific LPM policies. USB: Add macros for interrupt endpoint types. xhci: Reserve one command for USB3 LPM disable. xhci: Some Evaluate Context commands must succeed. USB: Disable USB 3.0 LPM in critical sections. USB: Add support to enable/disable USB3 link states. USB: Allow drivers to disable hub-initiated LPM. USB: Calculate USB 3.0 exit latencies for LPM. USB: Refactor code to set LPM support flag. ... Conflicts: arch/arm/mach-exynos/mach-nuri.c arch/arm/mach-exynos/mach-universal_c210.c drivers/net/wireless/ath/ath6kl/usb.c
Diffstat (limited to 'drivers/usb/gadget/f_rndis.c')
-rw-r--r--drivers/usb/gadget/f_rndis.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index d4f823f463e9..b1681e45aca7 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -71,6 +71,8 @@ struct f_rndis {
71 struct gether port; 71 struct gether port;
72 u8 ctrl_id, data_id; 72 u8 ctrl_id, data_id;
73 u8 ethaddr[ETH_ALEN]; 73 u8 ethaddr[ETH_ALEN];
74 u32 vendorID;
75 const char *manufacturer;
74 int config; 76 int config;
75 77
76 struct usb_ep *notify; 78 struct usb_ep *notify;
@@ -768,12 +770,10 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
768 rndis_set_param_medium(rndis->config, RNDIS_MEDIUM_802_3, 0); 770 rndis_set_param_medium(rndis->config, RNDIS_MEDIUM_802_3, 0);
769 rndis_set_host_mac(rndis->config, rndis->ethaddr); 771 rndis_set_host_mac(rndis->config, rndis->ethaddr);
770 772
771#if 0 773 if (rndis->manufacturer && rndis->vendorID &&
772// FIXME 774 rndis_set_param_vendor(rndis->config, rndis->vendorID,
773 if (rndis_set_param_vendor(rndis->config, vendorID, 775 rndis->manufacturer))
774 manufacturer)) 776 goto fail;
775 goto fail0;
776#endif
777 777
778 /* NOTE: all that is done without knowing or caring about 778 /* NOTE: all that is done without knowing or caring about
779 * the network link ... which is unavailable to this code 779 * the network link ... which is unavailable to this code
@@ -820,6 +820,7 @@ rndis_unbind(struct usb_configuration *c, struct usb_function *f)
820 820
821 rndis_deregister(rndis->config); 821 rndis_deregister(rndis->config);
822 rndis_exit(); 822 rndis_exit();
823 rndis_string_defs[0].id = 0;
823 824
824 if (gadget_is_superspeed(c->cdev->gadget)) 825 if (gadget_is_superspeed(c->cdev->gadget))
825 usb_free_descriptors(f->ss_descriptors); 826 usb_free_descriptors(f->ss_descriptors);
@@ -840,20 +841,9 @@ static inline bool can_support_rndis(struct usb_configuration *c)
840 return true; 841 return true;
841} 842}
842 843
843/**
844 * rndis_bind_config - add RNDIS network link to a configuration
845 * @c: the configuration to support the network link
846 * @ethaddr: a buffer in which the ethernet address of the host side
847 * side of the link was recorded
848 * Context: single threaded during gadget setup
849 *
850 * Returns zero on success, else negative errno.
851 *
852 * Caller must have called @gether_setup(). Caller is also responsible
853 * for calling @gether_cleanup() before module unload.
854 */
855int 844int
856rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]) 845rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
846 u32 vendorID, const char *manufacturer)
857{ 847{
858 struct f_rndis *rndis; 848 struct f_rndis *rndis;
859 int status; 849 int status;
@@ -898,6 +888,8 @@ rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
898 goto fail; 888 goto fail;
899 889
900 memcpy(rndis->ethaddr, ethaddr, ETH_ALEN); 890 memcpy(rndis->ethaddr, ethaddr, ETH_ALEN);
891 rndis->vendorID = vendorID;
892 rndis->manufacturer = manufacturer;
901 893
902 /* RNDIS activates when the host changes this filter */ 894 /* RNDIS activates when the host changes this filter */
903 rndis->port.cdc_filter = 0; 895 rndis->port.cdc_filter = 0;