]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
usb: gadget: Update usb_assign_descriptors for SuperSpeedPlus
authorJohn Youn <John.Youn@synopsys.com>
Sat, 6 Feb 2016 01:06:07 +0000 (17:06 -0800)
committerFelipe Balbi <balbi@kernel.org>
Fri, 4 Mar 2016 13:14:23 +0000 (15:14 +0200)
Add the 'ssp_descriptors' parameter to the usb_assign_descriptors()
function. This allows a function driver to add descriptors for
SuperSpeedPlus speeds if it supports it.

Also update all uses of this function in the gadget subsystem so that
they pass NULL for the ssp_descriptors parameters.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
19 files changed:
drivers/usb/gadget/config.c
drivers/usb/gadget/function/f_acm.c
drivers/usb/gadget/function/f_ecm.c
drivers/usb/gadget/function/f_eem.c
drivers/usb/gadget/function/f_hid.c
drivers/usb/gadget/function/f_loopback.c
drivers/usb/gadget/function/f_mass_storage.c
drivers/usb/gadget/function/f_ncm.c
drivers/usb/gadget/function/f_obex.c
drivers/usb/gadget/function/f_phonet.c
drivers/usb/gadget/function/f_printer.c
drivers/usb/gadget/function/f_rndis.c
drivers/usb/gadget/function/f_serial.c
drivers/usb/gadget/function/f_sourcesink.c
drivers/usb/gadget/function/f_subset.c
drivers/usb/gadget/function/f_tcm.c
drivers/usb/gadget/function/f_uac1.c
drivers/usb/gadget/function/f_uac2.c
include/linux/usb/gadget.h

index 0fafa7a1b6f6c38cf97e085a2cd295e450261aef..62ba4c1b69ec8033a5921987104caab82f7ff712 100644 (file)
@@ -163,7 +163,8 @@ EXPORT_SYMBOL_GPL(usb_copy_descriptors);
 int usb_assign_descriptors(struct usb_function *f,
                struct usb_descriptor_header **fs,
                struct usb_descriptor_header **hs,
-               struct usb_descriptor_header **ss)
+               struct usb_descriptor_header **ss,
+               struct usb_descriptor_header **ssp)
 {
        struct usb_gadget *g = f->config->cdev->gadget;
 
index 2fa1e80a3ce7bbdd941ddf30fb79e8860812a907..dc13b280db287745f3d98909ccbe57e31887e24e 100644 (file)
@@ -685,7 +685,7 @@ acm_bind(struct usb_configuration *c, struct usb_function *f)
        acm_ss_out_desc.bEndpointAddress = acm_fs_out_desc.bEndpointAddress;
 
        status = usb_assign_descriptors(f, acm_fs_function, acm_hs_function,
-                       acm_ss_function);
+                       acm_ss_function, NULL);
        if (status)
                goto fail;
 
index 7ad60ee419144fd89b6d109439dcacd99c6a3db7..4c488d15b6f6e082eaa6c3f16a78a8f684a38762 100644 (file)
@@ -786,7 +786,7 @@ ecm_bind(struct usb_configuration *c, struct usb_function *f)
                fs_ecm_notify_desc.bEndpointAddress;
 
        status = usb_assign_descriptors(f, ecm_fs_function, ecm_hs_function,
-                       ecm_ss_function);
+                       ecm_ss_function, NULL);
        if (status)
                goto fail;
 
index cad35a502d3f73a64759cd8eb8d541d36104cbac..d58bfc32be9ec7a20f52de5beb53b784a9475829 100644 (file)
@@ -309,7 +309,7 @@ static int eem_bind(struct usb_configuration *c, struct usb_function *f)
        eem_ss_out_desc.bEndpointAddress = eem_fs_out_desc.bEndpointAddress;
 
        status = usb_assign_descriptors(f, eem_fs_function, eem_hs_function,
-                       eem_ss_function);
+                       eem_ss_function, NULL);
        if (status)
                goto fail;
 
index 99285b416308f84917a6500aad64daff34c2ce05..51980c50546d5b1061eb289b8825604cf8b031bc 100644 (file)
@@ -646,7 +646,7 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)
                hidg_fs_out_ep_desc.bEndpointAddress;
 
        status = usb_assign_descriptors(f, hidg_fs_descriptors,
-                       hidg_hs_descriptors, NULL);
+                       hidg_hs_descriptors, NULL, NULL);
        if (status)
                goto fail;
 
index ddc3aad886b7457dd0ab4c79587104b474889ca0..3a9f8f9c77bde8d972cdd188b4c6e3cce862471d 100644 (file)
@@ -211,7 +211,7 @@ autoconf_fail:
        ss_loop_sink_desc.bEndpointAddress = fs_loop_sink_desc.bEndpointAddress;
 
        ret = usb_assign_descriptors(f, fs_loopback_descs, hs_loopback_descs,
-                       ss_loopback_descs);
+                       ss_loopback_descs, NULL);
        if (ret)
                return ret;
 
index 223ccf89d2263fb6483a1a22116a3743c9d7ed8e..321a6315c696d6a54276e7de394118d9cf2bcdb5 100644 (file)
@@ -3093,7 +3093,7 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f)
        fsg_ss_bulk_out_comp_desc.bMaxBurst = max_burst;
 
        ret = usb_assign_descriptors(f, fsg_fs_function, fsg_hs_function,
-                       fsg_ss_function);
+                       fsg_ss_function, NULL);
        if (ret)
                goto autoconf_fail;
 
index 7ad798ace1e5b5d60c15712510fcf6b09ac81c86..97f0a9bc84df23bf39fe4b6b1b21a55965907ec1 100644 (file)
@@ -1432,7 +1432,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
                fs_ncm_notify_desc.bEndpointAddress;
 
        status = usb_assign_descriptors(f, ncm_fs_function, ncm_hs_function,
-                       NULL);
+                       NULL, NULL);
        if (status)
                goto fail;
 
index d6396e0909eeb45898541094cb2347b4d38bde24..d43e86cea74f34253c4f7bbbaa73e8f42cf7ffae 100644 (file)
@@ -364,7 +364,8 @@ static int obex_bind(struct usb_configuration *c, struct usb_function *f)
        obex_hs_ep_out_desc.bEndpointAddress =
                obex_fs_ep_out_desc.bEndpointAddress;
 
-       status = usb_assign_descriptors(f, fs_function, hs_function, NULL);
+       status = usb_assign_descriptors(f, fs_function, hs_function, NULL,
+                                       NULL);
        if (status)
                goto fail;
 
index 157441dbfeba861d4d877f8009dca6fb44acd740..0473d619d5bf64d23154527ee597cc62706ada7c 100644 (file)
@@ -541,7 +541,7 @@ static int pn_bind(struct usb_configuration *c, struct usb_function *f)
 
        /* Do not try to bind Phonet twice... */
        status = usb_assign_descriptors(f, fs_pn_function, hs_pn_function,
-                       NULL);
+                       NULL, NULL);
        if (status)
                goto err;
 
index 26ccad5d8680a3a1b5c75b4bf89018340eeb1846..c45104e3a64bfe147e93b4055ef7ad7d21b1cd2a 100644 (file)
@@ -1051,7 +1051,7 @@ autoconf_fail:
        ss_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress;
 
        ret = usb_assign_descriptors(f, fs_printer_function,
-                       hs_printer_function, ss_printer_function);
+                       hs_printer_function, ss_printer_function, NULL);
        if (ret)
                return ret;
 
index e587767e374cbc2fbae3b02879b5358c38d48e69..d99dd954204811d40ef67838344e0877f8080a57 100644 (file)
@@ -783,7 +783,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
        ss_notify_desc.bEndpointAddress = fs_notify_desc.bEndpointAddress;
 
        status = usb_assign_descriptors(f, eth_fs_function, eth_hs_function,
-                       eth_ss_function);
+                       eth_ss_function, NULL);
        if (status)
                goto fail;
 
index 6bb44d613baba28106d31023d337edf6367b9333..cb00ada21d9c2505fa0a04af3a1624dcc99722eb 100644 (file)
@@ -236,7 +236,7 @@ static int gser_bind(struct usb_configuration *c, struct usb_function *f)
        gser_ss_out_desc.bEndpointAddress = gser_fs_out_desc.bEndpointAddress;
 
        status = usb_assign_descriptors(f, gser_fs_function, gser_hs_function,
-                       gser_ss_function);
+                       gser_ss_function, NULL);
        if (status)
                goto fail;
        dev_dbg(&cdev->gadget->dev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n",
index 242ba5caffe5898a2f4922c848d8ae1f2e264cad..df0189ddfdd5fef4248c1528d29835a7b95c5ca0 100644 (file)
@@ -437,7 +437,7 @@ no_iso:
        ss_iso_sink_desc.bEndpointAddress = fs_iso_sink_desc.bEndpointAddress;
 
        ret = usb_assign_descriptors(f, fs_source_sink_descs,
-                       hs_source_sink_descs, ss_source_sink_descs);
+                       hs_source_sink_descs, ss_source_sink_descs, NULL);
        if (ret)
                return ret;
 
index 829c78de9ebac728919784951b89d05d7d942361..434b983f3b4c244f538cf6f12e90015c3ac4f78e 100644 (file)
@@ -362,7 +362,7 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
                fs_subset_out_desc.bEndpointAddress;
 
        status = usb_assign_descriptors(f, fs_eth_function, hs_eth_function,
-                       ss_eth_function);
+                       ss_eth_function, NULL);
        if (status)
                goto fail;
 
index bad007b5a190c1193439870bc8993b28f0bc1f56..dfb733047a4c87b1b9de38a4fd2ec615e75fd508 100644 (file)
@@ -2098,7 +2098,7 @@ static int tcm_bind(struct usb_configuration *c, struct usb_function *f)
        uasp_fs_cmd_desc.bEndpointAddress = uasp_ss_cmd_desc.bEndpointAddress;
 
        ret = usb_assign_descriptors(f, uasp_fs_function_desc,
-                       uasp_hs_function_desc, uasp_ss_function_desc);
+                       uasp_hs_function_desc, uasp_ss_function_desc, NULL);
        if (ret)
                goto ep_fail;
 
index 6a2346b99f5591911f92200d68e880ff3b2e5d18..f2ac0cbc29a425e3a14f8f5f273ac345cd39d1fa 100644 (file)
@@ -721,7 +721,8 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f)
        status = -ENOMEM;
 
        /* copy descriptors, and track endpoint copies */
-       status = usb_assign_descriptors(f, f_audio_desc, f_audio_desc, NULL);
+       status = usb_assign_descriptors(f, f_audio_desc, f_audio_desc, NULL,
+                                       NULL);
        if (status)
                goto fail;
        return 0;
index 044ca79d3cb5d3b8a4764e27c1a1749caa43c971..186d4b1625248462ec51e099ef9677d2dacc788d 100644 (file)
@@ -1100,7 +1100,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
        hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress;
        hs_epin_desc.bEndpointAddress = fs_epin_desc.bEndpointAddress;
 
-       ret = usb_assign_descriptors(fn, fs_audio_desc, hs_audio_desc, NULL);
+       ret = usb_assign_descriptors(fn, fs_audio_desc, hs_audio_desc, NULL,
+                                    NULL);
        if (ret)
                goto err;
 
index d6a1bdaf11c1c7cb31fc996130a5964b2aa8cf35..42527297f2183e9ccda5a8d37368486072409d72 100644 (file)
@@ -1204,7 +1204,8 @@ struct usb_function;
 int usb_assign_descriptors(struct usb_function *f,
                struct usb_descriptor_header **fs,
                struct usb_descriptor_header **hs,
-               struct usb_descriptor_header **ss);
+               struct usb_descriptor_header **ss,
+               struct usb_descriptor_header **ssp);
 void usb_free_all_descriptors(struct usb_function *f);
 
 struct usb_descriptor_header *usb_otg_descriptor_alloc(