History log of /openbmc/linux/drivers/usb/gadget/composite.c (Results 76 – 100 of 378)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v4.4.24, v4.7.7, v4.8, v4.4.23, v4.7.6
# 9ad58771 28-Sep-2016 Felipe Balbi <felipe.balbi@linux.intel.com>

usb: gadget: composite: remove unnecessary & operation

Now that usb_endpoint_maxp() only returns the lowest
11 bits from wMaxPacketSize, we can remove the &
operation from this driver.

Signed-off-b

usb: gadget: composite: remove unnecessary & operation

Now that usb_endpoint_maxp() only returns the lowest
11 bits from wMaxPacketSize, we can remove the &
operation from this driver.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


# eaa496ff 28-Sep-2016 Felipe Balbi <felipe.balbi@linux.intel.com>

usb: gadget: composite: always set ep->mult to a sensible value

ep->mult is supposed to be set to Isochronous and
Interrupt Endapoint's multiplier value. This value
is computed from different places

usb: gadget: composite: always set ep->mult to a sensible value

ep->mult is supposed to be set to Isochronous and
Interrupt Endapoint's multiplier value. This value
is computed from different places depending on the
link speed.

If we're dealing with HighSpeed, then it's part of
bits [12:11] of wMaxPacketSize. This case wasn't
taken into consideration before.

While at that, also make sure the ep->mult defaults
to one so drivers can use it unconditionally and
assume they'll never multiply ep->maxpacket to zero.

Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


# e8f29bb7 28-Sep-2016 Felipe Balbi <felipe.balbi@linux.intel.com>

usb: gadget: composite: correctly initialize ep->maxpacket

usb_endpoint_maxp() returns wMaxPacketSize in its
raw form. Without taking into consideration that it
also contains other bits reserved for

usb: gadget: composite: correctly initialize ep->maxpacket

usb_endpoint_maxp() returns wMaxPacketSize in its
raw form. Without taking into consideration that it
also contains other bits reserved for isochronous
endpoints.

This patch fixes one occasion where this is a
problem by making sure that we initialize
ep->maxpacket only with lower 10 bits of the value
returned by usb_endpoint_maxp(). Note that seperate
patches will be necessary to audit all call sites of
usb_endpoint_maxp() and make sure that
usb_endpoint_maxp() only returns lower 10 bits of
wMaxPacketSize.

Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


Revision tags: v4.7.5, v4.4.22, v4.4.21, v4.7.4, v4.7.3, v4.4.20, v4.7.2, v4.4.19, openbmc-4.4-20160819-1, v4.7.1, v4.4.18, v4.4.17, openbmc-4.4-20160804-1, v4.4.16, v4.7, openbmc-4.4-20160722-1, openbmc-20160722-1, openbmc-20160713-1, v4.4.15, v4.6.4, v4.6.3, v4.4.14
# 1a00b457 21-Jun-2016 Felix Hädicke <felixhaedicke@web.de>

usb: gadget: composite: let USB functions process ctrl reqs in cfg0

It can sometimes be necessary for gadget drivers to process non-standard
control requests, which host devices can send without hav

usb: gadget: composite: let USB functions process ctrl reqs in cfg0

It can sometimes be necessary for gadget drivers to process non-standard
control requests, which host devices can send without having sent
USB_REQ_SET_CONFIGURATION.

Therefore, the req_match() usb_function method is enhanced with the new
parameter "config0". When a USB configuration is active, this parameter
is false. When a non-core control request is processed in
composite_setup(), without an active configuration, req_match() of the
USB functions of all available configurations which implement this
function, is called with config0=true. Then the control request gets
processed by the first usb_function instance whose req_match() returns
true.

Signed-off-by: Felix Hädicke <felixhaedicke@web.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


# 3887db5c 16-Jul-2016 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

usb: gadget: composite: Fix return value in case of error

In 'composite_os_desc_req_prepare', if one of the memory allocations fail,
0 will be returned, which means success.
We should return -ENOMEM

usb: gadget: composite: Fix return value in case of error

In 'composite_os_desc_req_prepare', if one of the memory allocations fail,
0 will be returned, which means success.
We should return -ENOMEM instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


# c526c62d 01-Jul-2016 Peter Chen <peter.chen@nxp.com>

usb: gadget: composite: fix dereference after null check coverify warning

cdev->config is checked for null pointer at above code, so cdev->config
might be null, fix it by adding null pointer check.

usb: gadget: composite: fix dereference after null check coverify warning

cdev->config is checked for null pointer at above code, so cdev->config
might be null, fix it by adding null pointer check.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


Revision tags: v4.6.2, v4.4.13, openbmc-20160606-1, v4.6.1, v4.4.12, openbmc-20160521-1, v4.4.11, openbmc-20160518-1, v4.6
# 7e14f47a 13-May-2016 William Wu <william.wu@rock-chips.com>

usb: gadget: composite: don't queue OS desc req if length is invalid

In OS descriptors handling, if ctrl->bRequestType is
USB_RECIP_DEVICE and w_index != 0x4 or (w_value >> 8)
is true, it will not a

usb: gadget: composite: don't queue OS desc req if length is invalid

In OS descriptors handling, if ctrl->bRequestType is
USB_RECIP_DEVICE and w_index != 0x4 or (w_value >> 8)
is true, it will not assign a valid value to req->length,
but use the default value(-EOPNOTSUPP), and queue an
OS desc request with the invalid req->length. It always
happens on the platforms which use os_desc (for example:
rk3366, rk3399), and cause kernel panic as follows
(use dwc3 driver):

Unable to handle kernel paging request at virtual address ffffffc0f7e00000
Internal error: Oops: 96000146 [#1] PREEMPT SMP
PC is at __dma_clean_range+0x18/0x30
LR is at __swiotlb_map_page+0x50/0x64
Call trace:
[<ffffffc0000930f8>] __dma_clean_range+0x18/0x30
[<ffffffc00062214c>] usb_gadget_map_request+0x134/0x1b0
[<ffffffc0005c289c>] __dwc3_ep0_do_control_data+0x110/0x14c
[<ffffffc0005c2d38>] __dwc3_gadget_ep0_queue+0x198/0x1b8
[<ffffffc0005c2e18>] dwc3_gadget_ep0_queue+0xc0/0xe8
[<ffffffc00061cfec>] composite_ep0_queue.constprop.14+0x34/0x98
[<ffffffc00061dfb0>] composite_setup+0xf60/0x100c
[<ffffffc0006204dc>] android_setup+0xd8/0x138
[<ffffffc0005c29a4>] dwc3_ep0_delegate_req+0x34/0x50
[<ffffffc0005c3534>] dwc3_ep0_interrupt+0x5dc/0xb58
[<ffffffc0005c0c3c>] dwc3_thread_interrupt+0x15c/0xa24

With this patch, the gadget driver will not queue
a request and return immediately if req->length is
invalid. And the usb controller driver can handle
the unsupport request correctly.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


Revision tags: v4.4.10, openbmc-20160511-1, openbmc-20160505-1, v4.4.9
# 0878263b 22-Apr-2016 Felipe Balbi <felipe.balbi@linux.intel.com>

usb: gadget: composite: avoid kernel oops with bad gadgets

If a gadget driver loaded to a Superspeed-capable
peripheral controller, using a Superspeed cable,
doesn't provide Superspeed descriptors,

usb: gadget: composite: avoid kernel oops with bad gadgets

If a gadget driver loaded to a Superspeed-capable
peripheral controller, using a Superspeed cable,
doesn't provide Superspeed descriptors, we will get
a NULL pointer dereference.

In order to avoid that situation, we will try to
find any valid descriptors we can. If no set of
descriptors is passed in, then we'll let that gadget
oops anyhow.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


Revision tags: v4.4.8, v4.4.7
# 138b8638 08-Apr-2016 John Youn <johnyoun@synopsys.com>

usb: gadget: composite: Clear reserved fields of SSP Dev Cap

Set the reserved fields of the SuperSpeed Plus Device Capability
descriptor to 0. Otherwise there might be stale data there which will
ca

usb: gadget: composite: Clear reserved fields of SSP Dev Cap

Set the reserved fields of the SuperSpeed Plus Device Capability
descriptor to 0. Otherwise there might be stale data there which will
cause USB CV to fail.

Fixes: f228a8de242a ("usb: gadget: composite: Return SSP Dev Cap descriptor")
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


Revision tags: openbmc-20160329-2, openbmc-20160329-1
# 08f8cabf 28-Mar-2016 John Youn <johnyoun@synopsys.com>

usb: gadget: composite: Access SSP Dev Cap fields properly

Access multi-byte fields of the SSP Dev Cap descriptor using the correct
endianness.

Fixes: f228a8de242a ("usb: gadget: composite: Return

usb: gadget: composite: Access SSP Dev Cap fields properly

Access multi-byte fields of the SSP Dev Cap descriptor using the correct
endianness.

Fixes: f228a8de242a ("usb: gadget: composite: Return SSP Dev Cap descriptor")
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

show more ...


Revision tags: openbmc-20160321-1, v4.4.6, v4.5, v4.4.5, v4.4.4, v4.4.3, openbmc-20160222-1
# c5348b62 18-Feb-2016 Li Jun <jun.li@nxp.com>

usb: gadget: composite: handle otg status selector request from OTG host

If gadget with HNP polling support receives GetStatus request of otg
status selector, it feedback to host with host request f

usb: gadget: composite: handle otg status selector request from OTG host

If gadget with HNP polling support receives GetStatus request of otg
status selector, it feedback to host with host request flag to indicate
if it wants to take host role.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


Revision tags: v4.4.2, openbmc-20160212-1, openbmc-20160210-1
# cd69cbeb 05-Feb-2016 John Youn <John.Youn@synopsys.com>

usb: gadget: composite: Update debug message for SuperSpeedPlus

Update the debug message reporting the speeds that a configuration
supports for SuperSpeedPlus.

Signed-off-by: John Youn <johnyoun@sy

usb: gadget: composite: Update debug message for SuperSpeedPlus

Update the debug message reporting the speeds that a configuration
supports for SuperSpeedPlus.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


# 4eb8e32d 05-Feb-2016 John Youn <John.Youn@synopsys.com>

usb: gadget: composite: Configure the usb_ep for SuperSpeedPlus

Configure the usb_ep using the SuperSpeedPlus descriptors if connected
in SuperSpeedPlus.

Signed-off-by: John Youn <johnyoun@synopsys

usb: gadget: composite: Configure the usb_ep for SuperSpeedPlus

Configure the usb_ep using the SuperSpeedPlus descriptors if connected
in SuperSpeedPlus.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


# eae5820b 05-Feb-2016 John Youn <John.Youn@synopsys.com>

usb: gadget: composite: Write SuperSpeedPlus config descriptors

Enable writing of SuperSpeedPlus descriptors for any SuperSpeedPlus
capable configuration when connected in SuperSpeedPlus.

Signed-of

usb: gadget: composite: Write SuperSpeedPlus config descriptors

Enable writing of SuperSpeedPlus descriptors for any SuperSpeedPlus
capable configuration when connected in SuperSpeedPlus.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


# f3bdbe36 05-Feb-2016 John Youn <John.Youn@synopsys.com>

usb: gadget: composite: Add function to get descriptors

There are a couple places in the code that get the function descriptors
based on the speed. Move this lookup into a function call and add
supp

usb: gadget: composite: Add function to get descriptors

There are a couple places in the code that get the function descriptors
based on the speed. Move this lookup into a function call and add
support to handle the SuperSpeedPlus descriptors as well.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


# a4afd012 05-Feb-2016 John Youn <John.Youn@synopsys.com>

usb: gadget: composite: Count configs for SuperSpeedPlus

If enumerated in SuperSpeedPlus, count the configurations that support
it.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: F

usb: gadget: composite: Count configs for SuperSpeedPlus

If enumerated in SuperSpeedPlus, count the configurations that support
it.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


# 554eead5 05-Feb-2016 John Youn <John.Youn@synopsys.com>

usb: gadget: Update config for SuperSpeedPlus

When a function is added to a configuration with usb_add_function(), the
configuration speed flags are updated. These flags indicate for which
speeds th

usb: gadget: Update config for SuperSpeedPlus

When a function is added to a configuration with usb_add_function(), the
configuration speed flags are updated. These flags indicate for which
speeds the configuration is valid for.

This patch adds a flag in the configuration for SuperSpeedPlus and
also updates this based on the existence of ssp_descriptors.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


# f228a8de 05-Feb-2016 John Youn <John.Youn@synopsys.com>

usb: gadget: composite: Return SSP Dev Cap descriptor

If a gadget supports SuperSpeedPlus or higher speeds, return a
SuperSpeedPlus USB Device Capability descriptor.

Currently this implementation r

usb: gadget: composite: Return SSP Dev Cap descriptor

If a gadget supports SuperSpeedPlus or higher speeds, return a
SuperSpeedPlus USB Device Capability descriptor.

Currently this implementation returns a fixed descriptor with typical
values set.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


# 1a853291 05-Feb-2016 John Youn <John.Youn@synopsys.com>

usb: gadget: composite: Return bcdUSB 0x0310

The USB 3.1 specification replaces the USB 3.0 specification and all new
devices that are running at SuperSpeed or higher speeds must report a
bcdUSB of

usb: gadget: composite: Return bcdUSB 0x0310

The USB 3.1 specification replaces the USB 3.0 specification and all new
devices that are running at SuperSpeed or higher speeds must report a
bcdUSB of 0x0310.

Refer to USB 3.1 Specification, Revision 1.0, Section 9.6.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

show more ...


Revision tags: openbmc-20160202-2, openbmc-20160202-1, v4.4.1, openbmc-20160127-1, openbmc-20160120-1, v4.4, openbmc-20151217-1, openbmc-20151210-1, openbmc-20151202-1, openbmc-20151123-1, openbmc-20151118-1, openbmc-20151104-1, v4.3, openbmc-20151102-1, openbmc-20151028-1, v4.3-rc1, v4.2, v4.2-rc8
# 5527e733 20-Aug-2015 Igor Kotrasinski <i.kotrasinsk@samsung.com>

usb: gadget: composite: fill bcdUSB for any gadget max speed

When handling device GET_DESCRIPTOR, composite gadget driver fills
the bcdUSB field only if the gadget supports USB 3.0. Otherwise
the fi

usb: gadget: composite: fill bcdUSB for any gadget max speed

When handling device GET_DESCRIPTOR, composite gadget driver fills
the bcdUSB field only if the gadget supports USB 3.0. Otherwise
the field is left unfilled.

For consistency, set bcdUSB to 0x0200 for gadgets that don't
support superspeed.

It's correct to use 0x0200 for any setting that doesn't use
superspeed, since USB 2.0 devices can restrict themselves to
full speed only. It is NOT correct to use 0x0210, since BOS
descriptors are handled only if gadget_is_superspeed() is
satisfied, otherwise it results in a stall.

Signed-off-by: Igor Kotrasinski <i.kotrasinsk@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

show more ...


# f871cb9b 16-Sep-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: fix few outdated comments

Fix comments in code to make them up to date.

composite: claiming endpoint is now done by setting ep->claimed flag,
not ep->driver_data.

epautoconf: usb_ep_a

usb: gadget: fix few outdated comments

Fix comments in code to make them up to date.

composite: claiming endpoint is now done by setting ep->claimed flag,
not ep->driver_data.

epautoconf: usb_ep_autoconfig() and usb_ep_autoconfig_ss() return
claimed endpoint with ep->claimed flag already set.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

show more ...


Revision tags: v4.2-rc7, v4.2-rc6, v4.2-rc5, v4.2-rc4, v4.2-rc3, v4.2-rc2, v4.2-rc1, v4.1, v4.1-rc8, v4.1-rc7, v4.1-rc6
# 1066c482 31-May-2015 Diego Viola <diego.viola@gmail.com>

drivers/usb/gadget/composite.c: i18n is not an acronym

Signed-off-by: Diego Viola <diego.viola@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>


# 53e6242d 09-Jul-2015 Macpaul Lin <macpaul@gmail.com>

usb: gadget: composite: add USB_DT_OTG request handling

Copy usb_otg_descriptor from config's descriptor if host requests
USB_DT_OTG.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Signed-off-by: L

usb: gadget: composite: add USB_DT_OTG request handling

Copy usb_otg_descriptor from config's descriptor if host requests
USB_DT_OTG.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

show more ...


Revision tags: v4.1-rc5, v4.1-rc4, v4.1-rc3
# d5bb9b81 04-May-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: composite: add bind_deactivated flag to usb_function

This patch introduces 'bind_deactivated' flag in struct usb_function.
Functions which don't want to be activated automatically after bind sh

usb: composite: add bind_deactivated flag to usb_function

This patch introduces 'bind_deactivated' flag in struct usb_function.
Functions which don't want to be activated automatically after bind should
set this flag, and when they start to be ready to work they should call
usb_function_activate().

When USB function sets 'bind_deactivated' flag, initial deactivation
counter is incremented automatically, so there is no need to call
usb_function_deactivate() in function bind.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

show more ...


# 5601250b 04-May-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: composite: fix usb_function_activate/deactivate functions

Using usb_gadget_disconnect to make gadget temporarily invisible to host
doesn't provide desired result, because gadget is connected im

usb: composite: fix usb_function_activate/deactivate functions

Using usb_gadget_disconnect to make gadget temporarily invisible to host
doesn't provide desired result, because gadget is connected immediately
after binding regardless to previous usb_gadget_disconnect() calls.

For this reason we use usb_gadget_deactivate() instead of
usb_gadget_disconnect() to make it working as expected.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

show more ...


12345678910>>...16