summaryrefslogtreecommitdiff
path: root/sys/dev/usb
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r266470, r273546, r276017, r277932, r279153, r279778, r279780, r278797,Marius Strobl2017-08-203-15/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r278861, r280283, r280284, r280294, r280452, r280558, r280571, r281863, r282049, r282357, r282440, r282441, r282358, r282359, r283550, r283918, r290171, r290667, r290381, r290533, r290666, r292483, r295659, r297545, r298305, r298383, r298428, r306489, r306557, r307067, r307068, r307087, r307088, r307089, r307091, r307092, r307093, r307098, r307115, r307154, r307240, r307241, r315967, r316476 Unbreak BCM2835/RPI-B support by bringing it in line with stable/11 and head: - Optimise reading of pending interrupt registers. - Fix a bug where some DTS layouts could cause the premature ending of the search (i.e. without returning any result) and you would end up with a random MAC address. - Reduce the diff between head and arm_intrng with the bcm2835 interrupt controller. - Allow the retrieving of the reserved pins state. - Add support to the bcm2835 mailbox driver to work before interrupts are enabled. This will be needed to enable the power on devices early on in the boot process. - Add support for enabling the USB on the Raspberry Pi boards when it hasn't been done by U-Boot. This allows the USB to work when we load the kernel directly. - Call config_intrhook_disestablish on failure of the bcm2835 fb and fbd intr hooks. With this we can get through the boot even if these functions fail. - Add the structures needed to get/set the power state. These can be used when, for example, we boot without U-Boot and wish to enable USB, or to suspend an unneeded device. - Add a mask to match only the relative base address of BSC controllers. - Move the code to set the device power to the bcm2835 mailbox driver so it can be reused by other drivers. - Add the SOC_BCM2835 and SOC_BCM2836 options for the arm kernel and add the former to std.bcm2835. - Add a helper function to read clock frequencies from videocore and use this to get the default frequency of the sdhci device. - Add partial support for the Raspberry Pi 2. - Remove a debug #error from the bcm2835 sdhci driver. - Fetch the SDHCI frequency from videocore (our prefered source) and only if it fails, fetch the clock-frequency from DTB. If both methods fail, use the hardcoded default. - Pass the supplied buffer length instead of a fixed size. - Add the routines to query and setup the framebuffer state using the BCM2835_MBOX_CHAN_PROP channel. The old channel (BCM2835_MBOX_CHAN_FB) seems deprecated on recent firmware versions and is causing a freeze on RPi 2. - Fix DMA on RPi 2. BCM2836 has a different base address for peripherals. - Enable DMA for sdhci on RPi 2 (BCM2836). - Add a missing wakeup when releasing ownership of the SPI hardware. - Fix framebuffer compatibility with new RPi firmware. - Refactor bcm2835_cpufreq to use bcm2835_mbox_property API. - Fix the sc(4) framebuffer driver on RPi 2. - Fix the vt(4) framebuffer driver on RPi 2. - Remove unused mutex and softc variables. - Refactor mailbox property API to make it usable for /dev/vcio driver. - Replace semaphore-base locking with sleep/wait synchronization. - Fix infinite loop if response from VideoCore never received. - Set have_message in interrupt to handle "response before READ" case. - Serialize access to property channel when using bcm2835_mbox_property. - Force framebuffer virtual viewport to be the same as physical. - Use proper type of tag in bcm2835_mbox_fb_init. - bcm2835_cpufreq: Only attach driver if we correcly match on the machine compatible string. - Add dev.fb.X.resync sysctl to resync ARM framebuffer with VideoCore. - Do not use DMA channels used by GPU. - Define local-intc for BCM2836 platform (RPI2) and make BCM2835 intc a child of it. - Fix build for Pi kernels with syscons enabled. - Use VM_MEMATTR_WRITE_COMBINING memattr for mmap(2) on framebuffer. - Make intc driver compatible with upstream DTS. - Make Rapsberry Pi watchdog driver compatible with upstream DTS. - Make sure intc is attached before interrupt consumers. - Make framebuffer driver compatible with upstream DT. - Add one more heuristic to determine MAC address of the SMSC device. - Add compatibility strings from upstream DT. - Fix spelling mistake, BCM2835_PASWORD -> BCM2835_PASSWORD. Approved by: re (kib) Notes: svn path=/stable/10/; revision=322724
* MFC r321722:Hans Petter Selasky2017-08-031-16/+17
| | | | | | | | | | Properly range check length of parsed information elements in RSU driver. Found by: Ilja van Sprundel <ivansprundel@ioactive.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=321981
* MFC: r314345, r318276Marius Strobl2017-05-181-0/+6
| | | | | | | | - Add ID for NEC uPD720202 xHCI controller. - Describe Intel Apollo Lake and Braswell USB 3.0 controllers. Notes: svn path=/stable/10/; revision=318499
* MFC r316412: Add IDs for Intel Cougar Point USB 2.0 controller.Alexander Motin2017-04-091-0/+4
| | | | Notes: svn path=/stable/10/; revision=316651
* MFC r312424:Hans Petter Selasky2017-03-143-16/+35
| | | | | | | | | | | | | | Fix problem with suspend and resume when using Skylake chipsets. Make sure the XHCI controller is reset after halting it. The problem is clearly a BIOS bug as the suspend and resume is failing without loading the XHCI driver. The same happens when using Linux and the XHCI driver is not loaded. Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com> PR: 216261 Notes: svn path=/stable/10/; revision=315252
* MFC r312338:Hans Petter Selasky2017-03-143-0/+6
| | | | | | | | | | Add USB audio support for S/PDIF output with C-Media CM6206 devices. Submitted by: Julien Nadeau <vedge@hypertriton.com> PR: 216131 Notes: svn path=/stable/10/; revision=315249
* MFC r310242:Hans Petter Selasky2017-01-092-1/+27
| | | | | | | | | | | Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid boot panics in conjunction with the recently added EARLY_AP_STARTUP feature. The panics happen due to using kernel facilities like callouts too early. Tested by: jhb @ Notes: svn path=/stable/10/; revision=311799
* MFC r307902:Edward Tomasz Napierala2016-12-191-4/+5
| | | | | | | | | Make the USB attach strings in dmesg include product name. MFC after: 1 month Notes: svn path=/stable/10/; revision=310281
* MFC r308730:Hans Petter Selasky2016-11-281-2/+4
| | | | | | | | | Make sure MAC address is reprogrammed when if_init() callback is invoked. Else promiscious mode must be used to pass traffic. While at it fix a debug print macro. Notes: svn path=/stable/10/; revision=309255
* MFC r308464, r308471: Add some device IDs found in my new laptop.Alexander Motin2016-11-161-0/+2
| | | | Notes: svn path=/stable/10/; revision=308739
* MFC r307518:Hans Petter Selasky2016-11-0714-81/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix device delete child function. When detaching device trees parent devices must be detached prior to detaching its children. This is because parent devices can have pointers to the child devices in their softcs which are not invalidated by device_delete_child(). This can cause use after free issues and panic(). Device drivers implementing trees, must ensure its detach function detaches or deletes all its children before returning. While at it remove now redundant device_detach() calls before device_delete_child() and device_delete_children(), mostly in the USB controller drivers. Tested by: Jan Henrik Sylvester <me@janh.de> Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D8070 Notes: svn path=/stable/10/; revision=308402
* MFC r308144 and r308165:Hans Petter Selasky2016-11-071-3/+9
| | | | | | | | | | | | | | | | Fixes for virtual T-axis buttons. Make sure the virtual T-axis buttons gets cleared for USB mice which has less than 6 buttons. Make sure the virtual T-axis buttons generate button release event(s) for continuous tilting. PR: 213919 PR: 213957 Notes: svn path=/stable/10/; revision=308395
* MFC 304973,304975,304976,304979,305044-305048Sepherosa Ziehau2016-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 304973 hyperv/hn: Switch to new RNDIS query for link status extraction. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7654 304975 hyperv/hn: Switch to new RNDIS query for RSS capabilities extraction. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7656 304976 hyperv/hn: Fix # of channels setting, if RSS is not available. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7657 304979 hyperv/hn: Switch to new RNDIS set for RSS parameters. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7658 305044 hyperv/hn: Move OIDs to net/rndis.h; they are standard NDIS OIDs. Actually all OIDs defined in net/rndis.h are standard NDIS OIDs. While I'm here, use the verbose macro name as in NDIS spec. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7679 305045 hyperv/hn: Indentation and field comment fixup for ndis.h. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7680 305046 net/rndis: Packet types are defined by NDIS; not RNDIS specific. Reviewed by: hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7681 305047 hyperv/hn: Switch to new RNDIS set for RX filters. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7683 305048 hyperv/hn: Remove unused function Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7684 Notes: svn path=/stable/10/; revision=307184
* MFC 304654,304722,304723Sepherosa Ziehau2016-10-132-272/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 304654 net: Split RNDIS protocol structs/macros out of dev/usb/net/if_urndisreg.h So that Hyper-V can leverage them instead of rolling its own definition. Discussed with: hps Reviewed by: hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7592 304722 net/rndis: Add canonical RNDIS major/minor version as of today. Reviewed by: hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7593 304723 net/rndis: Fix RNDIS_STATUS_PENDING definition. While I'm here, sort the RNDIS status in ascending order. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7594 Notes: svn path=/stable/10/; revision=307175
* MFC r306478:Hans Petter Selasky2016-10-102-5/+7
| | | | | | | | | | | | Add new USB ID. While at it remove some whitespaces. Submitted by: Jose Luis Duran <jlduran@gmail.com> PR: 213110 Notes: svn path=/stable/10/; revision=306957
* MFC r306205:Luiz Otavio O Souza2016-09-272-0/+2
| | | | | | | | | | Add the ID for the Huawei ME909S LTE modem. Submitted by: svenauhagen at github Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/stable/10/; revision=306370
* MFC r305590:Hans Petter Selasky2016-09-151-2/+2
| | | | | | | | | | | Correctly map the USB mouse tilt delta values into buttons 5 and 6 instead of 3 and 4 which is used for the scroll wheel, according to X.org. PR: 170358 Notes: svn path=/stable/10/; revision=305829
* MFC r305421:Hans Petter Selasky2016-09-127-27/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | Resolve deadlock between device_detach() and usbd_do_request_flags() by reviving the SX control request lock and refining which lock protects the common scratch area in "struct usb_device". The SX control request lock was removed by r246759 because it caused a lock order reversal with the USB enumeration lock inside usbd_transfer_setup() as a function of r246616. It was thought that reducing the number of locks would resolve the LOR, but because some USB device drivers use usbd_do_request_flags() inside callback functions, like in taskqueues, a deadlock may occur when these are drained from device_detach(). By restoring the SX control request lock usbd_do_request_flags() is allowed to complete its execution when a USB device driver is detaching. By using the SX control request lock to protect the scratch area, the LOR introduced by r246616 is also resolved. Bump the FreeBSD version while at it to force recompilation of all USB kernel modules. Found by: avos@ Notes: svn path=/stable/10/; revision=305734
* MFC r304571:Hans Petter Selasky2016-09-091-8/+39
| | | | | | | | | | | Make the UKBD USB transfers double buffered and set them up one by one, so they are memory independent which allows for handling panics triggered by the keyboard driver itself, typically via CTRL+ALT+ESC sequences. Or if the USB keyboard driver was processing a key at the moment of panic. Allow UKBD to be attached while keyboard polling is active. Notes: svn path=/stable/10/; revision=305645
* MFC r303891, r303892:Pedro F. Giffuni2016-09-081-6/+6
| | | | | | | | | | | sys: replace comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone. Notes: svn path=/stable/10/; revision=305615
* MFC r281499:Hans Petter Selasky2016-09-083-3/+3
| | | | | | | | | | | | | | Modify the return value of the uhci/ehci/xhci PCI probe routines to 'BUS_PROBE_DEFAULT'. This allows bhyve's 'ppt' driver to claim ownership of the device and pass it through to the guest. In the common case where there are no competing drivers for USB controllers this change is a no-op. PR: 212256 Notes: svn path=/stable/10/; revision=305589
* MFC r305388:Dimitry Andric2016-09-071-2/+2
| | | | | | | | | | | | | | | | | | | | With clang 3.9.0, compiling uplcom results in the following warnings: sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion] if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1) ~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~ sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE' #define UT_READ_VENDOR_DEVICE (UT_READ | UT_VENDOR | UT_DEVICE) ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ This is because UT_READ is 0x80, so the int8_t argument is wrapped to a negative value. Fix this by using uint8_t instead. Reviewed by: imp, hselasky Differential Revision: https://reviews.freebsd.org/D7776 Notes: svn path=/stable/10/; revision=305557
* MFC r304629:Hans Petter Selasky2016-08-291-0/+4
| | | | | | | | | | | | | Don't separate the status stage of the XHCI USB control transfers into its own job because this breaks the simplified QEMU XHCI TRB parser, which expects the complete USB control transfer as a series of back to back TRBs. The old behaviour is kept under #ifdef in case this change breaks enumeration of any USB devices. PR: 212021 Notes: svn path=/stable/10/; revision=304998
* MFC r304597:Hans Petter Selasky2016-08-291-6/+8
| | | | | | | | | | | | | Fix for invalid use of bits in input context. Basically split configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and xhci_cmd_configure_ep() respectivly. This resolves some errors when using XHCI under QEMU and gets is more in line with the XHCI specification. PR: 212021 Notes: svn path=/stable/10/; revision=304993
* MFC r303765:Hans Petter Selasky2016-08-151-1/+11
| | | | | | | | | | | Keep a reference count on USB keyboard polling to allow recursive cngrab() during a panic for example, similar to what the AT-keyboard driver is doing. Found by: Bruce Evans <brde@optusnet.com.au> Notes: svn path=/stable/10/; revision=304125
* MFC r303806:Cy Schubert2016-08-131-0/+1
| | | | | | | Add Logitech Unifying receiver. Notes: svn path=/stable/10/; revision=304030
* MFC r302371:Hans Petter Selasky2016-08-121-1/+1
| | | | | | | | Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure "struct xhci_dev_ctx_addr" fits into a single 4K page until further. Notes: svn path=/stable/10/; revision=303996
* MFC r302336:Hans Petter Selasky2016-07-111-16/+18
| | | | | | | | | | Fix interrupt loop when switching from USB device to USB host mode by clearing all endpoint interrupt bits. PR: 210736 Notes: svn path=/stable/10/; revision=302563
* MFC r302306:Hans Petter Selasky2016-07-111-1/+4
| | | | | | | | | | | Fix detection of USB device disconnects in USB host mode when the USB device is connected directly to the USB port of the DWC OTG, in this case a RPI-zero. PR: 210695 Notes: svn path=/stable/10/; revision=302562
* MFC r302076:Hans Petter Selasky2016-06-293-7/+8
| | | | | | | | | | | Update the definition for number of scratch pages to match the latest version of the XHCI specification. Make sure the code can handle the maximum number of allowed scratch pages. Submitted by: Shichun_Ma@Dell.com Notes: svn path=/stable/10/; revision=302266
* MFC r301206:Pedro F. Giffuni2016-06-051-1/+3
| | | | | | | | | | | usb/uhso: Don't bail out on first USB error. CID: 1305680 Submitted by: hselasky MFC after: 3 days Notes: svn path=/stable/10/; revision=301446
* MFC r300667:Hans Petter Selasky2016-06-033-2/+32
| | | | | | | | | Check for signals when locking the USB enumeration thread from userspace, so that USB applications can be killed if an enumeration thread should be stuck for various reasons. Notes: svn path=/stable/10/; revision=301253
* MFC r299060:Hans Petter Selasky2016-06-031-1/+3
| | | | | | | | | Extend the UQ_NO_STRINGS quirk to also cover the USB language string descriptor. This fixes enumeration of some older Samsung Galaxy S3 phones. Notes: svn path=/stable/10/; revision=301250
* MFC r298983: Add some device IDs from Intel Sunrise Point chipsets.Alexander Motin2016-05-201-0/+2
| | | | Notes: svn path=/stable/10/; revision=300312
* MFC r297696 and r298424:Hans Petter Selasky2016-04-292-0/+9
| | | | | | | | | | | | Add new USB quirks. Submitted by: AJ <aleksanderlothe@live.com> PR: 208623 Submitted by: Naram Qashat <cyberbotx@cyberbotx.com> PR: 208642 Notes: svn path=/stable/10/; revision=298781
* MFC r297387: Add some device IDs found on AMD FCH shipsets.Alexander Motin2016-04-123-1/+7
| | | | Notes: svn path=/stable/10/; revision=297852
* MFC r296342:Hans Petter Selasky2016-04-071-2/+0
| | | | | | | | | | Allow for overlapping quirk device ranges. Prior to this patch only the first device entry matching the USB vendor, product and revision would be searched for quirks. After this patch all device entries will be searched for quirks. Notes: svn path=/stable/10/; revision=297643
* r297229 (by hselasky): Add more UHCI PCI IDs.Alexander Motin2016-03-291-0/+6
| | | | Notes: svn path=/stable/10/; revision=297375
* MFC r297049: Add IDs for Intel Wellsburg USB controllers.Alexander Motin2016-03-282-0/+6
| | | | Notes: svn path=/stable/10/; revision=297341
* MFC r295463 (by hselasky): Correct PCI device description.Alexander Motin2016-03-281-1/+1
| | | | Notes: svn path=/stable/10/; revision=297340
* MFC r275137 (by adrian): Add PCI ID for Intel Lynx Point LP controller.Alexander Motin2016-03-281-0/+2
| | | | | | | PR: kern/195398 Notes: svn path=/stable/10/; revision=297339
* MFC r295928:Hans Petter Selasky2016-03-072-0/+14
| | | | | | | | | | | | | | Configure the correct bMaxPacketSize for control endpoints before requesting the initial complete device descriptor and not as part of the subsequent babble error recovery. Babble means that the received USB packet was bigger than than configured maximum packet size. This only affects enumeration of FULL speed USB devices which use a bMaxPacketSize different from 8 bytes. This patch might help fix enumeration of USB devices which exhibit USB I/O errors in dmesg during boot. Notes: svn path=/stable/10/; revision=296446
* MFC r295923:Hans Petter Selasky2016-03-071-1/+2
| | | | | | | | | Be more verbose when truncating number of HID items. Suggested by: Larry Rosenman <ler@lerctr.org> Notes: svn path=/stable/10/; revision=296444
* MFC r295608:Hans Petter Selasky2016-03-071-1/+1
| | | | | | | | Fix variable assignment inside if-clause in the smsc driver. Found by D5245 / PVS. Notes: svn path=/stable/10/; revision=296443
* MFC r294235:Ian Lepore2016-01-231-21/+24
| | | | | | | | | | | | | | | Make PPS ASSERT/CLEAR events match the RS-232 signal levels as per RFC 2783. Previously the polarity was for TTL levels, which are the reverse of RS-232. Also add handling of the UART_PPS_INVERT_PULSE option bit in the sysctl value, the same as was recently added to uart(4), so that people using TTL level connections can request a logical inverting of the signal. Use the named constants from the new dev/uart/uart_ppstypes.h for the pps capture modes and option bits. Notes: svn path=/stable/10/; revision=294637
* MFC r293192:Hans Petter Selasky2016-01-121-6/+21
| | | | | | | Fix for directly connected FULL or LOW speed USB devices. Notes: svn path=/stable/10/; revision=293735
* MFC 292366: Flag the first port on a Sheevaplug ftdi serial device as jtag.Ian Lepore2016-01-051-1/+1
| | | | Notes: svn path=/stable/10/; revision=293209
* MFC r291199:Hans Petter Selasky2016-01-041-1/+1
| | | | | | | Fix compile warning about shifting signed negative constant. Notes: svn path=/stable/10/; revision=293146
* MFC: r285909, r285913 (partial)Marius Strobl2015-12-271-71/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Probe UICLASS_CDC/UISUBCLASS_ABSTRACT_CONTROL_MODEL/0xff again. This variant of Microsoft RNDIS, i. e. their unofficial version of CDC ACM, has been disabled in r261544 (r262363 in stable/10) for resolving a conflict with umodem(4). Eventually, in r275790 (r276243 in stable/10) that problem was dealt with in the right way. However, r275790 failed to put probing of RNDIS devices in question back. - Initialize the device prior to querying it, as required by the RNDIS specification. Otherwise already determining the MAC address may fail rightfully. - On detach, halt the device again. - Use UCDC_SEND_ENCAPSULATED_{COMMAND,RESPONSE}. While these macros are resolving to the same values as UR_{CLEAR_FEATURE,GET_STATUS}, the former set is way more appropriate in this context. - Report unknown - rather: unimplemented - events unconditionally and not just in debug mode. This ensures that we'll get some hint of what is going wrong instead of the driver silently failing. - Deal with the Microsoft ActiveSync requirement of using an input buffer the size of the expected reply or larger - except for variably sized replies - when querying a device. - Fix some pointless NULL checks, style bugs etc. This changes allow urndis(4) to communicate with a Microsoft-certified USB RNDIS test token. Notes: svn path=/stable/10/; revision=292792
* MFC r291953:Hans Petter Selasky2015-12-141-1/+1
| | | | | | | | | | | | | | | When setting up VLANs on a Raspberry Pi ethernet port, the MTU drops from 1500 to 1496 bytes. The MTU should remain at 1500, extending the frame size as per IEEE 802.3. Adding IFCAP_VLAN_MTU to the if_capabilities field in the smsc driver solves the problem. The datasheet for the LAN9512 chip, section 3.2.3 states that the chip supports the extended frame. Submitted by: rpp@ci.com.au PR: 205050 Notes: svn path=/stable/10/; revision=292185