linux-xiaomi-chiron/include/linux/usb
Pawel Laszczak 5d363120aa usb: gadget: Fix issue with config_ep_by_speed function
This patch adds new config_ep_by_speed_and_alt function which
extends the config_ep_by_speed about alt parameter.
This additional parameter allows to find proper usb_ss_ep_comp_descriptor.

Problem has appeared during testing f_tcm (BOT/UAS) driver function.

f_tcm function for SS use array of headers for both  BOT/UAS alternate
setting:

static struct usb_descriptor_header *uasp_ss_function_desc[] = {
        (struct usb_descriptor_header *) &bot_intf_desc,
        (struct usb_descriptor_header *) &uasp_ss_bi_desc,
        (struct usb_descriptor_header *) &bot_bi_ep_comp_desc,
        (struct usb_descriptor_header *) &uasp_ss_bo_desc,
        (struct usb_descriptor_header *) &bot_bo_ep_comp_desc,

        (struct usb_descriptor_header *) &uasp_intf_desc,
        (struct usb_descriptor_header *) &uasp_ss_bi_desc,
        (struct usb_descriptor_header *) &uasp_bi_ep_comp_desc,
        (struct usb_descriptor_header *) &uasp_bi_pipe_desc,
        (struct usb_descriptor_header *) &uasp_ss_bo_desc,
        (struct usb_descriptor_header *) &uasp_bo_ep_comp_desc,
        (struct usb_descriptor_header *) &uasp_bo_pipe_desc,
        (struct usb_descriptor_header *) &uasp_ss_status_desc,
        (struct usb_descriptor_header *) &uasp_status_in_ep_comp_desc,
        (struct usb_descriptor_header *) &uasp_status_pipe_desc,
        (struct usb_descriptor_header *) &uasp_ss_cmd_desc,
        (struct usb_descriptor_header *) &uasp_cmd_comp_desc,
        (struct usb_descriptor_header *) &uasp_cmd_pipe_desc,
        NULL,
};

The first 5 descriptors are associated with BOT alternate setting,
and others are associated with UAS.

During handling UAS alternate setting f_tcm driver invokes
config_ep_by_speed and this function sets incorrect companion endpoint
descriptor in usb_ep object.

Instead setting ep->comp_desc to uasp_bi_ep_comp_desc function in this
case set ep->comp_desc to uasp_ss_bi_desc.

This is due to the fact that it searches endpoint based on endpoint
address:

        for_each_ep_desc(speed_desc, d_spd) {
                chosen_desc = (struct usb_endpoint_descriptor *)*d_spd;
                if (chosen_desc->bEndpoitAddress == _ep->address)
                        goto ep_found;
        }

And in result it uses the descriptor from BOT alternate setting
instead UAS.

Finally, it causes that controller driver during enabling endpoints
detect that just enabled endpoint for bot.

Signed-off-by: Jayshri Pawar <jpawar@cadence.com>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
2020-05-25 11:09:44 +03:00
..
audio-v2.h sound updates for 5.7-rc1 2020-04-02 15:50:04 -07:00
audio-v3.h USB: Replace zero-length array with flexible-array member 2020-02-23 19:24:51 +01:00
audio.h
c67x00.h
ccid.h
cdc-wdm.h
cdc.h
cdc_ncm.h cdc_ncm: Implement the 32-bit version of NCM Transfer Block 2020-03-11 22:59:31 -07:00
ch9.h
chipidea.h
composite.h usb: gadget: Fix issue with config_ep_by_speed function 2020-05-25 11:09:44 +03:00
ehci-dbgp.h
ehci_def.h usb: host: ehci-platform: add a quirk to avoid stuck 2020-02-10 11:15:27 -08:00
ehci_pdriver.h
ezusb.h
functionfs.h
g_hid.h
gadget.h usb: gadget: core: sync interrupt before unbind the udc 2020-05-25 11:09:43 +03:00
gadget_configfs.h
hcd.h USB: Replace zero-length array with flexible-array member 2020-02-23 19:24:51 +01:00
input.h
iowarrior.h
irda.h USB: serial: ir-usb: fix link-speed handling 2020-01-23 09:11:16 +01:00
isp116x.h
isp1301.h
isp1362.h
isp1760.h
m66592.h
musb-ux500.h
musb.h
net2280.h
of.h
ohci_pdriver.h
otg-fsm.h
otg.h
pd.h usb: pd: Add definitions for the Enter_USB message 2020-01-09 10:48:55 +01:00
pd_ado.h
pd_bdo.h
pd_ext_sdb.h
pd_vdo.h usb: pd: Add definition for DFP and UFP1 VDOs 2020-01-09 10:48:55 +01:00
phy.h
phy_companion.h
quirks.h USB: core: add endpoint-blacklist quirk 2020-02-10 11:14:22 -08:00
r8a66597.h
renesas_usbhs.h usb: renesas_usbhs: Switch to GPIO descriptor 2019-12-30 20:37:42 +01:00
rndis_host.h
role.h usb: roles: Allow the role switches to be named 2020-03-04 11:12:50 +01:00
serial.h
sl811.h
storage.h
tcpm.h usb: typec: tcpm: Remove tcpc_config configuration mechanism 2019-11-16 14:45:31 +01:00
tegra_usb_phy.h usb: phy: tegra: Use device-tree notion of reset-GPIO's active-state 2020-01-09 16:21:58 +01:00
typec.h usb: typec: Add sysfs node to show cc orientation 2020-03-04 10:51:21 +01:00
typec_altmode.h usb: typec: altmode: Remove the notification chain 2020-02-12 10:51:21 -08:00
typec_dp.h
typec_mux.h usb: typec: mux: Allow the mux handles to be requested with fwnode 2020-03-04 11:12:49 +01:00
typec_tbt.h usb: typec: Add definitions for Thunderbolt 3 Alternate Mode 2020-03-04 11:13:30 +01:00
uas.h
ulpi.h usb: ulpi: Add resource-managed variant of otg_ulpi_create() 2020-01-09 16:21:57 +01:00
usb338x.h
usb_phy_generic.h usb: phy-generic: Delete unused platform data 2020-01-15 10:39:20 +01:00
usbnet.h netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
xhci-dbgp.h