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 <johny...@synopsys.com>
---
 drivers/usb/gadget/config.c                  | 3 ++-
 drivers/usb/gadget/function/f_acm.c          | 2 +-
 drivers/usb/gadget/function/f_ecm.c          | 2 +-
 drivers/usb/gadget/function/f_eem.c          | 2 +-
 drivers/usb/gadget/function/f_hid.c          | 2 +-
 drivers/usb/gadget/function/f_loopback.c     | 2 +-
 drivers/usb/gadget/function/f_mass_storage.c | 2 +-
 drivers/usb/gadget/function/f_ncm.c          | 2 +-
 drivers/usb/gadget/function/f_obex.c         | 3 ++-
 drivers/usb/gadget/function/f_phonet.c       | 2 +-
 drivers/usb/gadget/function/f_printer.c      | 2 +-
 drivers/usb/gadget/function/f_rndis.c        | 2 +-
 drivers/usb/gadget/function/f_serial.c       | 2 +-
 drivers/usb/gadget/function/f_sourcesink.c   | 2 +-
 drivers/usb/gadget/function/f_subset.c       | 2 +-
 drivers/usb/gadget/function/f_tcm.c          | 2 +-
 drivers/usb/gadget/function/f_uac1.c         | 3 ++-
 drivers/usb/gadget/function/f_uac2.c         | 3 ++-
 include/linux/usb/gadget.h                   | 3 ++-
 19 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c
index 0fafa7a..62ba4c1 100644
--- a/drivers/usb/gadget/config.c
+++ b/drivers/usb/gadget/config.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_acm.c 
b/drivers/usb/gadget/function/f_acm.c
index 2fa1e80..dc13b28 100644
--- a/drivers/usb/gadget/function/f_acm.c
+++ b/drivers/usb/gadget/function/f_acm.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_ecm.c 
b/drivers/usb/gadget/function/f_ecm.c
index 7ad60ee..4c488d1 100644
--- a/drivers/usb/gadget/function/f_ecm.c
+++ b/drivers/usb/gadget/function/f_ecm.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_eem.c 
b/drivers/usb/gadget/function/f_eem.c
index cad35a5..d58bfc3 100644
--- a/drivers/usb/gadget/function/f_eem.c
+++ b/drivers/usb/gadget/function/f_eem.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_hid.c 
b/drivers/usb/gadget/function/f_hid.c
index 99285b4..51980c5 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_loopback.c 
b/drivers/usb/gadget/function/f_loopback.c
index ddc3aad..3a9f8f9 100644
--- a/drivers/usb/gadget/function/f_loopback.c
+++ b/drivers/usb/gadget/function/f_loopback.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_mass_storage.c 
b/drivers/usb/gadget/function/f_mass_storage.c
index 223ccf8..321a631 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_ncm.c 
b/drivers/usb/gadget/function/f_ncm.c
index 7ad798a..97f0a9b 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_obex.c 
b/drivers/usb/gadget/function/f_obex.c
index d6396e0..d43e86c 100644
--- a/drivers/usb/gadget/function/f_obex.c
+++ b/drivers/usb/gadget/function/f_obex.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_phonet.c 
b/drivers/usb/gadget/function/f_phonet.c
index 157441d..0473d61 100644
--- a/drivers/usb/gadget/function/f_phonet.c
+++ b/drivers/usb/gadget/function/f_phonet.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_printer.c 
b/drivers/usb/gadget/function/f_printer.c
index 26ccad5..c45104e 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_rndis.c 
b/drivers/usb/gadget/function/f_rndis.c
index e587767..d99dd95 100644
--- a/drivers/usb/gadget/function/f_rndis.c
+++ b/drivers/usb/gadget/function/f_rndis.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_serial.c 
b/drivers/usb/gadget/function/f_serial.c
index 6bb44d61..cb00ada 100644
--- a/drivers/usb/gadget/function/f_serial.c
+++ b/drivers/usb/gadget/function/f_serial.c
@@ -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",
diff --git a/drivers/usb/gadget/function/f_sourcesink.c 
b/drivers/usb/gadget/function/f_sourcesink.c
index 242ba5c..df0189d 100644
--- a/drivers/usb/gadget/function/f_sourcesink.c
+++ b/drivers/usb/gadget/function/f_sourcesink.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_subset.c 
b/drivers/usb/gadget/function/f_subset.c
index 829c78d..434b983 100644
--- a/drivers/usb/gadget/function/f_subset.c
+++ b/drivers/usb/gadget/function/f_subset.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_tcm.c 
b/drivers/usb/gadget/function/f_tcm.c
index bad007b5..dfb7330 100644
--- a/drivers/usb/gadget/function/f_tcm.c
+++ b/drivers/usb/gadget/function/f_tcm.c
@@ -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;
 
diff --git a/drivers/usb/gadget/function/f_uac1.c 
b/drivers/usb/gadget/function/f_uac1.c
index 6a2346b..f2ac0cb 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -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;
diff --git a/drivers/usb/gadget/function/f_uac2.c 
b/drivers/usb/gadget/function/f_uac2.c
index 044ca79..186d4b1 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -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;
 
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index d6a1bda..4252729 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -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(
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to