aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* arp(8): fixing the deletion failure of IEEE1394 associated addressesstable/9Tai-hwa Liang2021-05-261-0/+1
| | | | | | | | | | | Without this, 'arp -d ${IEEE1394_ADDRESS}' gives the following error: arp: delete: cannot locate 10.0.0.71 Reviewed by: glebius MFC after: 2 weeks (cherry picked from commit a0d6d0d0b9aba6d4c025b2f2807e7c4b4c4b2415)
* if_firewire: fixing panic upon packet reception for VNET buildTai-hwa Liang2021-05-251-0/+2
| | | | | | | | | | netisr_dispatch_src() needs valid VNET pointer or firewire_input() will panic when receiving a packet. Reviewed by: glebius MFC after: 2 weeks (cherry picked from commit d9b61e7153c64b141436b4d9619b166c6d35a0a6)
* MFC r363988:Dimitry Andric2020-08-101-2/+2
| | | | | | | | | | | | | | Fix clang 11 -Wformat warnings in yp_mkdb: usr.sbin/yp_mkdb/yp_mkdb.c:91:40: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat] printf("%.*s %.*s\n", (int)key.size, key.data, (int)data.size, ~~~~ ^~~~~~~~ usr.sbin/yp_mkdb/yp_mkdb.c:92:7: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat] data.data); ^~~~~~~~~ Notes: svn path=/stable/9/; revision=364084
* MFC r362623:Dimitry Andric2020-06-301-2/+2
| | | | | | | | | | | Fix copy/paste mistake in kvm_getswapinfo(3) It seems this manpage was copied from kvm_getloadavg(3), but the DIAGNOSTICS section was not updated completely. Update the section with correct information about a return value of -1. Notes: svn path=/stable/9/; revision=362800
* MFC r361977: libusb: improve compatibilityKyle Evans2020-06-164-1/+61
| | | | | | | | | | | | | | | Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API. Descriptions and functionality for these derived from the documentation at [0]. The current set of capabilities are all supported by libusb. These were detected as missing after updating net/freerdp to 2.1.1, which attempted to use both. [0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html Notes: svn path=/stable/9/; revision=362224
* Adapt merge of r361581 to 9-stable to unbreak kernel compilation.Hans Petter Selasky2020-06-091-2/+1
| | | | | | | | | This is a direct commit. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=361989
* MFC r361827:Hans Petter Selasky2020-06-082-42/+44
| | | | | | | | | | | | | | | | | | USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=361922
* MFC r361582:Hans Petter Selasky2020-06-081-3/+4
| | | | | | | | | | Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=361917
* MFC r361581:Hans Petter Selasky2020-06-082-0/+78
| | | | | | | | | | Implement helper function, usbd_get_max_frame_length(), which allows kernel device drivers to correctly predict the default USB transfer frame length. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=361913
* MFC r361577:Hans Petter Selasky2020-06-081-1/+1
| | | | | | | | | | Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=361909
* MFC r361075:Hans Petter Selasky2020-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=361359
* MFC r360075:Hans Petter Selasky2020-04-261-17/+0
| | | | | | | | | | | | | | Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because we don't implement link power management, LPM. This fixes error code XHCI_TRB_ERROR_BANDWIDTH for isochronous USB 3.0 transactions. Submitted by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=360336
* MFC r359120:Hans Petter Selasky2020-03-262-6/+52
| | | | | | | | | | Correctly implement support for remote wakeup for USB 3.0 device. Submitted by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=359319
* MFC r359014:Hans Petter Selasky2020-03-191-1/+0
| | | | | | | | | | | Fix for double unlock in ipoib. The ipoib_unicast_send() function is not supposed to unlock the priv lock. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=359124
* MFC r358838:Hans Petter Selasky2020-03-132-1/+5
| | | | | | | | | | Add support for the device statistics IOCTL, needed by the coming linux_libusb upgrade. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=358946
* MFC r253338:Hans Petter Selasky2020-03-132-1/+13
| | | | | | | Add some missing LIBUSB IOCTL conversion codes. Notes: svn path=/stable/9/; revision=358945
* Define USB_FS_OPEN_STREAM, even if not supported.Hans Petter Selasky2020-03-131-0/+1
| | | | | | | | | This is a direct commit. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=358944
* MFC r358695:Hans Petter Selasky2020-03-131-0/+4
| | | | | | | | | | Define more subsystem orders. Intended for use with module_init_order() in the LinuxKPI. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=358938
* MFC r358694:Hans Petter Selasky2020-03-131-3/+3
| | | | | | | | | Fix some whitespace issues in ipoib. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=358934
* MFC r358629:Hans Petter Selasky2020-03-114-21/+20
| | | | | | | | | | | | | | | | | | Implement a detaching flag for the sound(4) subsystem to take appropriate actions when we are trying to detach an audio device, but cannot because someone is using it. This avoids applications having to wait for the DSP read data timeout before they receive any error indication. Tested with virtual_oss(8). Remove some unused definitions while at it. PR: 194727 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=358880
* MFC r358738:Hans Petter Selasky2020-03-112-9/+6
| | | | | | | | | | | | | | | Remove the power bit from the super speed root hub port status register because it clobbers the super speed link status when a device is in super speed mode. Currently the power bit is not needed for anything in the USB hub driver. This fixes USB warm reset for super speed devices. Tested by: Shichun.Ma@dell.com Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=358876
* MFC r357212: libfetch: fix urldecode buffer overrunEd Maste2020-03-081-2/+8
| | | | | | | | Reported by: Duncan Overbruck Security: CVE-2020-7450 Notes: svn path=/stable/9/; revision=358741
* MFC r357298:Hans Petter Selasky2020-02-031-1/+3
| | | | | | | | | | | | | Add missing mutex unlock in failure case. Differential Revision: https://reviews.freebsd.org/D23430 Submitted by: cem Reported by: Coverity Coverity CID: 1368773 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=357441
* MFC r349409 and r349410:Hans Petter Selasky2020-02-032-13/+26
| | | | | | | | | | | | Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently all devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE flag. Make sure when the flag is not specified no arrival events are generated for currently enumerated devices. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=357440
* MFC r357226:Dimitry Andric2020-01-311-14/+14
| | | | | | | | | | | | | | | | | | | | | | Merge r357224 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in binutils: contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (efi) ^ contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) ^ contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (!efi) ^ contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) ^ Notes: svn path=/stable/9/; revision=357351
* MFC r352710:Dimitry Andric2019-09-284-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not left-shift a negative number (inducing undefined behavior in C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate computations that compute the IEEE-754 bit pattern for |2**k| for integer |k|. The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to compute IEEE-754 bit patterns for 2**k in certain places. (k is an integer and 2**k is exactly representable in IEEE-754.) Currently they do things like 0x3FF0'0000+(k<<20), which is to say they take the bit pattern representing 1 and then add directly to the exponent field to get the desired power of two. This is fine when k is non-negative. But when k<0 (and certain classes of input trigger this), this left-shifts a negative number -- an operation with undefined behavior in C and C++. The desired semantics can be achieved by instead adding the possibly-negative k to the IEEE-754 exponent bias to get the desired exponent field, _then_ shifting that into its proper overall position. (Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD and SET_FLOAT_WORD uses further down in each of these files that perform shift operations involving k, but by these points k's range has been restricted to 2 < k <= 56, and the shift operations under those circumstances can't do anything that would be UB.) Submitted by: Jeff Walden, https://github.com/jswalden Obtained from: https://github.com/freebsd/freebsd/pull/411 Obtained from: https://github.com/freebsd/freebsd/pull/412 Notes: svn path=/stable/9/; revision=352835
* MFC r348797:Hans Petter Selasky2019-06-111-0/+8
| | | | | | | | | | | | Fix for reading the configuration descriptor in libusb. Catch invalid configuration descriptor reads early on to avoid issues with devices that don't check for a valid USB configuration read request. Submitted by: takahiro.kurosawa@gmail.com PR: 238412 Notes: svn path=/stable/9/; revision=348896
* MFC r348631:Hans Petter Selasky2019-06-101-4/+47
| | | | | | | | | | | | | In usb(4) fix a lost completion event issue towards libusb(3). It may happen if a USB transfer is cancelled that we need to fake a completion event. Implement missing support in ugen_fs_copy_out() to handle this. This fixes issues with webcamd(8) and firefox. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=348858
* MFC r345499:Hans Petter Selasky2019-04-051-13/+59
| | | | | | | | | | | | | | | | | | | Change all kernel C-type macros into static inline functions. The current kernel C-type macros might obscurely hide the fact that the input argument might be used multiple times. This breaks code like: isalpha(*ptr++) Use static inline functions instead of macros to fix this. Reviewed by: kib @ Differential Revision: https://reviews.freebsd.org/D19694 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=345944
* MFC r343905:Hans Petter Selasky2019-02-151-1/+127
| | | | | | | | | | | | | Improve Bluetooth device discovery support for Android and Microsoft devices. Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8) project at github.com. PR: 210089 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=344147
* MFC r343572:Hans Petter Selasky2019-02-085-1/+400
| | | | | | | | | | | | Add support for Audio Sink and Audio Source profiles to sdpd(8). This allows user-space programs like virtual_oss(8) to act as a Bluetooth speaker device. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=343903
* MFC r342549:Hans Petter Selasky2019-01-032-0/+5
| | | | | | | | | | Add USB quirk for SPL Crimson Rev 1. PR: 234380 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=342729
* MFC r342456:Hans Petter Selasky2019-01-031-7/+46
| | | | | | | | | | | | Fix reading of USB sample rate descriptor for SPL Crimson Rev 1. Read first one entry, then try to read the full rate descriptor table. PR: 234380 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=342728
* MFC r340248:Hans Petter Selasky2018-11-111-1/+11
| | | | | | | | | | Don't read the USB audio sync endpoint when we don't use it to save isochronous bandwidth. Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=340353
* MFC r339366David C Somayajulu2018-10-293-35/+372
| | | | | | | | | Add support for Error Recovery Submitted by:Vaishali.Kulkarni@cavium.com Notes: svn path=/stable/9/; revision=339887
* MFC r338734David C Somayajulu2018-10-291-8/+10
| | | | | | | | | | | Fixed isses: State check before enqueuing transmit task in bxe_link_attn() routine. State check before invoking bxe_nic_unload in bxe_shutdown(). Submitted by:Vaishali.Kulkarni@cavium.com Notes: svn path=/stable/9/; revision=339885
* MFC r339587:Hans Petter Selasky2018-10-291-35/+182
| | | | | | | | | | | | | | | Added support for formula-based arbitrary baud rates, in contrast to the current fixed values, which enables use of rates above 1 Mbps. Improved the detection of HXD chips, and the status flag handling as well. Submitted by: Gabor Simon <gabor.simon75@gmail.com> PR: 225932 Differential revision: https://reviews.freebsd.org/D16639 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=339854
* MFC r339582:Hans Petter Selasky2018-10-251-2/+15
| | | | | | | | | | | Drop sequencer mutex around uiomove() and make sure we don't move more bytes than is available, else a panic might happen. Found by: Peter Holm <peter@holm.cc> Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=339722
* MFC r339581:Hans Petter Selasky2018-10-251-1/+1
| | | | | | | | | | Fix off-by-one which can lead to panics. Found by: Peter Holm <peter@holm.cc> Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=339716
* MFC r339509: Fix loader.conf(5) "password" featureDevin Teske2018-10-241-0/+1
| | | | | | | | | | | | Restore the ability to prevent the user from interrupting the boot process without first entering the password stored in loader.conf(5). PR: kern/207069 Reported by: david@dcrosstech.com Sponsored by: Smule, Inc. Notes: svn path=/stable/9/; revision=339699
* MFC r338200: Adding device ID for Terratec SiXPack 5.1+.Tai-hwa Liang2018-10-101-0/+1
| | | | Notes: svn path=/stable/9/; revision=339295
* MFC r338993:Hans Petter Selasky2018-10-051-0/+6
| | | | | | | | | | | | | | When multiple threads are involved receiving completion events in LibUSB make sure there is always a master polling thread, by setting the "ctx_handler" field in the context. Else the reception of completion events can stop. This happens if event threads are created and destroyed during runtime. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231742 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=339191
* MFC r338679:Hans Petter Selasky2018-09-192-19/+36
| | | | | | | | | | | | | Improve LibUSB debugging by simultaneously allowing both function and transfer prints. Make sure the debug level comes from the correct USB context. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231264 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=338793
* MFC r338616:Hans Petter Selasky2018-09-193-43/+91
| | | | | | | | | | | | | | | | | Fix issues about cancelling USB transfers in LibUSB when the USB device has been detached. When a USB device has been detached the kernel file handle stops responding to commands. USB applications which continue to run after the USB device has been detached, depend on LibUSB generated events to tear down its pending USB transfers. Add code to handle the needed cleanup when processing the USB transfer(s) fails and prevent new USB transfer(s) from being submitted. Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> PR: 231076 Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=338790
* MFC r309748 (by glebius):Dimitry Andric2018-09-181-0/+3
| | | | | | | | | | | | | | | | Treat R_X86_64_PLT32 relocs as R_X86_64_PC32. If we load a binary that is designed to be a library, it produces relocatable code via assembler directives in the assembly itself (rather than compiler options). This emits R_X86_64_PLT32 relocations, which are not handled by the kernel linker. Submitted by: gallatin Reviewed by: kib PR: 231451 Notes: svn path=/stable/9/; revision=338756
* MFC r338038: Extending the delay cycles to give the codec more time to pump ↵Tai-hwa Liang2018-08-261-1/+1
| | | | | | | | | | | | | | | | ADC data across the AC-link. Without this patch, some CS4614 cards will need users to reload the driver manually or the hardware won't be initialised properly. Something like: # kldload snd_csa # kldunload snd_csa # kldload snd_csa Tested with: Terratec SiXPack 5.1+ Notes: svn path=/stable/9/; revision=338327
* MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout)Devin Teske2018-08-101-1/+2
| | | | | | | | | PR: bin/229806 Reported by: Andreas Sommer <andreas.sommer87@googlemail.com> Sponsored by: Smule, Inc. Notes: svn path=/stable/9/; revision=337588
* MFC r336438David C Somayajulu2018-08-091-13/+29
| | | | | | | | | | | | | Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com Notes: svn path=/stable/9/; revision=337512
* MFC r336632:Hans Petter Selasky2018-07-301-0/+1
| | | | | | | | | Update modify counter when setting a mixer control. PR: 229969 Notes: svn path=/stable/9/; revision=336891
* MFC r335700:Hans Petter Selasky2018-07-301-2/+27
| | | | | | | | | | | Improve the kernel's USB descriptor reading function. Some USB devices does not allow a partial descriptor readout. Found by: bz@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/9/; revision=336888