aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/serial
AgeCommit message (Collapse)Author
2017-03-28USB: serial: f81534: use calc_num_endpoints to verify endpointsJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present and moving the max-packet check to calc_num_ports. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28USB: serial: aircable: use calc_num_endpoints to verify endpointsJohan Hovold
Use the calc_num_ports rather than probe callback to determine which interface to bind to. This allows us to remove some duplicate code. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28USB: serial: pl2303: clean up legacy endpoint hackJohan Hovold
Implement the "horrible endpoint hack" for some legacy devices as a quirk and clean up the code somewhat. Note that the bulk-endpoint check can be removed as core will already have verified this. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28USB: serial: move pl2303 hack out of usb-serial coreJohan Hovold
Some pl2303 devices require the use of the interrupt endpoint of an unrelated interface. This has so far been dealt with in usb-serial core, but can now be moved to a driver calc_num_ports callback. Note that we relax the endpoint requirements checked by core and instead verify that we have an interrupt-in endpoint in calc_num_ports for all devices so that the hack can first be applied. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28USB: serial: relax generic driver bulk-endpoint requirementJohan Hovold
Relax the generic driver bulk-endpoint requirement. The driver handles devices without bulk-out endpoints just fine these days. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28USB: serial: add calc_num_ports callback to generic driverJohan Hovold
Add a calc_num_ports callback to the generic driver and verify that the device has the required endpoints there instead of in core. Note that the generic driver num_ports field was never used. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28USB: serial: add probe callback to generic driverJohan Hovold
Add a probe callback to the generic driver and print the only-for-testing message there. This is a first step in getting rid of the CONFIG_USB_SERIAL_GENERIC ifdef from usb-serial core. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28USB: serial: allow subdrivers to modify port-endpoint mappingJohan Hovold
Allow subdrivers to modify the port-endpoint mapping by passing the endpoint descriptors to calc_num_ports. The callback can now also be used to verify that the required endpoints exists and abort probing otherwise. This will allow us to get rid of a few hacks in subdrivers that are already modifying the port-endpoint mapping (or aborting probe due to missing endpoints), but only after the port structures have been setup. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-21usb/serial: Add DBC debug device support to usb_debugLu Baolu
This patch adds DBC debug device support to the usb_debug driver. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Johan Hovold <johan@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mathias Nyman <mathias.nyman@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: linux-usb@vger.kernel.org Link: http://lkml.kernel.org/r/1490083293-3792-5-git-send-email-baolu.lu@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-03-18USB: serial: qcserial: add Dell DW5811eBjørn Mork
This is a Dell branded Sierra Wireless EM7455. Cc: <stable@vger.kernel.org> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: whiteheat: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Note that the driver registers four ports but uses five bulk-endpoint pairs. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: symbolserial: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: spcp8x5: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: pl2303: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: oti6858: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: opticon: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: omninet: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Note that the driver uses the second bulk-out endpoint for writing. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: mos7720: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Note that the driver expects two bulk-endpoint pairs also for mcs7715 devices for which only one serial port is registered. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: kobil_sct: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: keyspan_pda: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: iuu_phoenix: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: io_edgeport: simplify and tighten endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Also require the presence of a bulk-out endpoint, something which prevents the driver from trying to send bulk messages over the control pipe should a bulk-out endpoint be missing. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: digi_acceleport: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Note that this driver uses an additional bulk-endpoint pair as an out-of-band port. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: cyberjack: simplify endpoint checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: ark3116: simplify endpoint sanity checkJohan Hovold
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: add endpoint sanity check to coreJohan Hovold
Allow drivers to specify a minimum number of endpoints per type, which USB serial core will verify after subdriver probe has returned (where the current alternate setting may have been changed). Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: replace runtime overflow checkJohan Hovold
Since commit 0a8fd1346254 ("USB: fix problems with duplicate endpoint addresses") USB core guarantees that there are no more than 15 endpoint descriptors per type (and altsetting) so the corresponding overflow checks can now be replaced with a compile-time check on the array sizes (and indirectly the maximum number of ports). Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: refactor and clean up endpoint handlingJohan Hovold
Refactor and clean up endpoint handling. This specifically moves the endpoint-descriptor arrays of the stack. Note that an err_free_epds label is not yet added to avoid a compilation warning when neither CONFIG_USB_SERIAL_PL2303 or CONFIG_USB_SERIAL_GENERIC is selected. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: clean up endpoint and port-counter typesJohan Hovold
Use unsigned-char type for the endpoint and port counters. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16USB: serial: clean up probe error pathsJohan Hovold
Clean up the probe error paths by adding a couple of new error labels. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-14USB: serial: option: add Quectel UC15, UC20, EC21, and EC25 modemsDan Williams
Add Quectel UC15, UC20, EC21, and EC25. The EC20 is handled by qcserial due to a USB VID/PID conflict with an existing Acer device. Signed-off-by: Dan Williams <dcbw@redhat.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-13USB: serial: ftdi_sio: allow other bases for "event_char"Ian Abbott
The 'store' function for the "event_char" device attribute currently expects a base 10 value. The value is composed of an enable bit in bit 8 and an 8-bit "event character" code in bits 7 to 0. It seems reasonable to allow hexadecimal and octal numbers to be written to the device attribute in addition to decimal. Make it so. Change the debug message to show the value in hexadecimal, rather than decimal. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-13USB: serial: ftdi_sio: only allow valid event_char valuesIan Abbott
The "event_char" device attribute value, when written, is interpreted as an enable bit in bit 8, and an "event character" in bits 7 to 0. Return an error -EINVAL for out-of-range values. Use kstrtouint() to parse the integer instead of the obsolete simple_strtoul(). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-13USB: serial: ftdi_sio: only allow valid latency timer valuesIan Abbott
Valid latency timer values are between 1 ms and 255 ms in 1 ms steps. The store function for the "latency_timer" device attribute currently allows any value, although only the lower 16 bits will be sent to the device, and the device only stores the lower 8 bits. The hardware appears to accept the (invalid) value 0 and treats it the same as 1 (resulting in a latency of 1 ms). Change the latency_timer_store() function to accept only the values 0 to 255, returning an error -EINVAL for out-of-range values. Call kstrtou8() to parse the integer instead of the obsolete simple_strtoul(). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-13USB: serial: ftdi_sio: detect BM chip with iSerialNumber bugIan Abbott
If a BM type chip has iSerialNumber set to 0 in its EEPROM, an incorrect value is read from the bcdDevice field of the USB descriptor, making it look like an AM type chip. Attempt to correct this in ftdi_determine_type() by attempting to read the latency timer for an AM type chip if it has iSerialNumber set to 0. If that succeeds, assume it is a BM type chip. Currently, read_latency_timer() bails out without reading the latency timer for an AM type chip, so factor out the guts of read_latency_timer() into a new function _read_latency_timer() that attempts to read the latency timer regardless of chip type, and returns either the latency timer value or a negative error number. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-13USB: serial: ftdi_sio: don't access latency timer on old chipsIan Abbott
The latency timer was introduced with the FT232BM and FT245BM chips. Do not bother attempting to read or write it for older chip versions. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-08USB: serial: safe_serial: fix information leak in completion handlerJohan Hovold
Add missing sanity check to the bulk-in completion handler to avoid an integer underflow that could be triggered by a malicious device. This avoids leaking up to 56 bytes from after the URB transfer buffer to user space. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-08USB: serial: io_ti: fix information leak in completion handlerJohan Hovold
Add missing sanity check to the bulk-in completion handler to avoid an integer underflow that can be triggered by a malicious device. This avoids leaking 128 kB of memory content from after the URB transfer buffer to user space. Fixes: 8c209e6782ca ("USB: make actual_length in struct urb field u32") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> # 2.6.30 Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-08USB: serial: omninet: drop open callbackJohan Hovold
Remove the now redundant open callback and let core call the generic handler for us instead. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-08USB: serial: omninet: fix reference leaks at openJohan Hovold
This driver needlessly took another reference to the tty on open, a reference which was then never released on close. This lead to not just a leak of the tty, but also a driver reference leak that prevented the driver from being unloaded after a port had once been opened. Fixes: 4a90f09b20f4 ("tty: usb-serial krefs") Cc: stable <stable@vger.kernel.org> # 2.6.28 Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-08USB: serial: io_ti: fix NULL-deref in interrupt callbackJohan Hovold
Fix a NULL-pointer dereference in the interrupt callback should a malicious device send data containing a bad port number by adding the missing sanity check. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-06USB: serial: digi_acceleport: fix OOB-event processingJohan Hovold
A recent change claimed to fix an off-by-one error in the OOB-port completion handler, but instead introduced such an error. This could specifically led to modem-status changes going unnoticed, effectively breaking TIOCMGET. Note that the offending commit fixes a loop-condition underflow and is marked for stable, but should not be backported without this fix. Reported-by: Ben Hutchings <ben@decadent.org.uk> Fixes: 2d380889215f ("USB: serial: digi_acceleport: fix OOB data sanity check") Cc: stable <stable@vger.kernel.org> # v2.6.30: 2d380889215f Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-02sched/headers: Prepare to move signal wakeup & sigpending methods from ↵Ingo Molnar
<linux/sched.h> into <linux/sched/signal.h> Fix up affected files that include this signal functionality via sched.h. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-02-22Merge tag 'usb-4.11-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/PHY updates from Greg KH: "Here is the big USB and PHY driver updates for 4.11-rc1. Nothing major, just the normal amount of churn in the usb gadget and dwc and xhci controllers, new device ids, new phy drivers, a new usb-serial driver, and a few other minor changes in different USB drivers. All have been in linux-next for a long time with no reported issues" * tag 'usb-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (265 commits) usb: cdc-wdm: remove logically dead code USB: serial: keyspan: drop header file USB: serial: io_edgeport: drop io-tables header file usb: musb: add code comment for clarification usb: misc: add USB251xB/xBi Hi-Speed Hub Controller Driver usb: misc: usbtest: remove redundant check on retval < 0 USB: serial: upd78f0730: sort device ids USB: serial: upd78f0730: add ID for EVAL-ADXL362Z ohci-hub: fix typo in dbg_port macro usb: musb: dsps: Manage CPPI 4.1 DMA interrupt in DSPS usb: musb: tusb6010: Clean up tusb_omap_dma structure usb: musb: cppi_dma: Clean up cppi41_dma_controller structure usb: musb: cppi_dma: Clean up cppi structure usb: musb: cppi41: Detect aborted transfers in cppi41_dma_callback() usb: musb: dma: Add a DMA completion platform callback drivers: usb: usbip: Add missing break statement to switch usb: mtu3: remove redundant dev_err call in get_ssusb_rscs() USB: serial: mos7840: fix another NULL-deref at open USB: serial: console: clean up sanity checks USB: serial: console: fix uninitialised spinlock ...
2017-02-21Merge tag 'pinctrl-v4.11-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "Pin control bulk changes for the v4.11 kernel cycle. Core changes: - Switch the generic pin config argument from 16 to 24 bits, only use 8 bits for the configuration type. We might need to encode more information about a certain setting than we need to encode different generic settings. - Add a cross-talk API to the pin control GPIO back-end, utilizing pinctrl_gpio_set_config() from GPIO drivers that want to set up a certain pin configuration in the back-end. This also includes the .set_config() refactoring of the GPIO chips, so that they pass a generic configuration for things like debouncing and single ended (typically open drain). This change has also been merged in an immutable branch to the GPIO tree. - Take hogs with a delayed work, so that we finalize probing a pin controller before trying to get any hogs. - For pin controllers putting all group and function definitions into the device tree, we now have generic code to deal with this and it is used in two drivers so far. - Simplifications of the pin request conflict check. - Make dt_free_map() optional. Updates to drivers: - pinctrl-single now use the generic helpers to generate dynamic group and function tables from the device tree. - Texas Instruments IOdelay configuration driver add-on to pinctrl-single. - i.MX: use radix trees to store groups and functions, use the new generic group and function helpers to manage them. - Intel: add support for hardware debouncing and 1K pull-down. New subdriver for the Gemini Lake SoC. - Renesas SH-PFC: drive strength and bias support, CAN bus muxing, MSIOF, SDHI, HSCIF for r8a7796. Gyro-ADC supporton r8a7791. - Aspeed: use syscon cross-dependencies to set up related bits in the LPC host controller and display controller. - Aspeed: finalize G4 and G5 support. Fix mux configuration on GPIOs. Add banks Y, Z, AA, AB and AC. - AMD: support additional GPIO. - STM32: set this controller to strict muxing mode. STM32H743 MCU support. - Allwinner sunxi: deep simplifications on how to support subvariants of SoCs without adding to much SoC-specific data for each subvariant, especially for sun5i variants. New driver for V3s SoCs. New driver for the H5 SoC. Support A31/A31s variants with the new variant framework. - Mvebu: simplifications to use a MMIO and regmap abstraction. New subdrivers for the 98DX3236, 98DX5241 SoCs. - Samsung Exynos: delete Exynos4415 support. Add crosstalk to the SoC driver to access regmaps. Add infrastructure for pin-bank retention control. Clean out the pin retention control from arch/arm/mach-exynos and arch/arm/mach-s5p and put it properly in the Samsung pin control driver(s). - Meson: add HDMI HPD/DDC pins. Add pwm_ao_b pin. - Qualcomm: use raw spinlock variants: this makes the qualcomm driver realtime-safe" * tag 'pinctrl-v4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (111 commits) pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data() pinctrl: intel: unlock on error in intel_config_set_pull() pinctrl: berlin: make bool drivers explicitly non-modular pinctrl: spear: make bool drivers explicitly non-modular pinctrl: mvebu: make bool drivers explicitly non-modular pinctrl: sunxi: make sun5i explicitly non-modular pinctrl: sunxi: Remove stray printk call in sun5i driver's probe function pinctrl: samsung: mark PM functions as __maybe_unused pinctrl: sunxi: Remove redundant A31s pinctrl driver pinctrl: sunxi: Support A31/A31s with pinctrl variants pinctrl: Amend bindings for STM32 pinctrl pinctrl: Add STM32 pinctrl driver DT bindings pinctrl: stm32: Add STM32H743 MCU support include: dt-bindings: Add STM32H7 pinctrl DT defines gpio: aspeed: Remove dependence on GPIOF_* macros pinctrl: stm32: fix bad location of gpiochip_lock_as_irq drivers: pinctrl: add driver for Allwinner H5 SoC pinctrl: intel: Add Intel Gemini Lake pin controller support pinctrl: intel: Add support for 1k additional pull-down pinctrl: intel: Add support for hardware debouncer ...
2017-02-16Merge tag 'usb-serial-4.11-rc1-2' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for v4.11-rc1 part 2 Here's one more device id for the new upd78f0730 driver and three clean-up patches that are mostly moving some code around. All have been in linux-next with no reported issues. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-02-15USB: serial: keyspan: drop header fileJohan Hovold
Move all declarations and definitions in keyspan.h to keyspan.c, which is the only place were they are used. This specifically moves the driver device-id tables and usb-serial driver definitions to the source file where they are expected to be found. While at it, fix up some multi-line comments and minor white-space issues (spaces instead of tabs and superfluous white space). Note that the information in the comment header of the removed header file is also present in the source file. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-02-15USB: serial: io_edgeport: drop io-tables header fileJohan Hovold
Move the driver device-id tables and usb-serial driver definitions to the source file where they are expected to be found. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2017-02-13USB: serial: upd78f0730: sort device idsJohan Hovold
Sort the device ids by vendor id. Signed-off-by: Johan Hovold <johan@kernel.org>
2017-02-13USB: serial: upd78f0730: add ID for EVAL-ADXL362ZMaksim Salau
The adaptor on Analog Devices EVAL-ADXL362Z development board is used to flash and debug firmware of on-board Renesas RL78/G13 MCU. Also added support of the 153600 baud rate, since the stock firmware uses it. Signed-off-by: Maksim Salau <maksim.salau@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org>