aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* hkbd(4): Split driver lock on interrupt and syscons locksVladimir Kondratyev2021-01-071-69/+95
| | | | | | | | This allows to mark HID-device interrupt handlers as MP-SAFE. Atomics-based lockless key event queue with swi_giant taskqueue is used to pass key-press events into Giant-protected system console. Reviewed by: hselasky (as part of D27991)
* hid: Port ukbd to HID and attach to buildVladimir Kondratyev2021-01-077-801/+628
| | | | | Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27991
* hid: Copy ukbd(4) to HID subsystem.Vladimir Kondratyev2021-01-072-0/+2385
|
* hid: Port multitouch hmt(4) driver to hidbus and attach to buildVladimir Kondratyev2021-01-076-505/+383
| | | | | Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27990
* hid: Copy wmt(4) to HID subsystem as a base to upcoming hmt(4) driver.Vladimir Kondratyev2021-01-072-0/+1124
|
* hid: Import hconf(4) - digitizer configuration top-level collection support.Vladimir Kondratyev2021-01-077-0/+476
| | | | Reviewed by: hselasky (as part of D27990)
* hid: Import usbhid - USB transport backend for HID subsystem.Vladimir Kondratyev2021-01-0714-1/+897
| | | | | | | | | | | | | | | | This change implements hid_if.m methods for HID-over-USB protocol [1]. Also, this change adds USBHID_ENABLED kernel option which changes device_probe() priority and adds/removes PnP records to prefer usbhid over ums, ukbd, wmt and other USB HID device drivers and vice-versa. The module is based on uhid(4) driver. It is disabled by default for now due to conflicts with existing USB HID drivers. [1] https://www.usb.org/sites/default/files/hid1_11.pdf Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27893
* hid: Import iichid - I2C transport backend for HID subsystemVladimir Kondratyev2021-01-0710-0/+1368
| | | | | | | | | | | | | | | | | This implements hid_if.m methods for HID-over-I2C protocol [1]. Following kernel options are added: IICHID_SAMPLING - Enable support for a sampling mode as interrupt resource acquisition is not always possible in a case of GPIO interrupts. IICHID_DEBUG - Enable debug output. The module is based on prior Marc Priggemeyer work (D16698). [1] http://download.microsoft.com/download/7/d/d/7dd44bb7-2a7a-4505-ac1c-7227d3d96d5b/hid-over-i2c-protocol-spec-v1-0.docx Differential revision: https://reviews.freebsd.org/D27892
* hid: Import quirk subsystem.Vladimir Kondratyev2021-01-076-1/+618
| | | | | | | | hidquirk(4) is derived from usb_quirk(4) and inherits all its HID-related functionality. It does not support ioctl(2) interface yet. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27890
* hid: Import hidbus(4)Vladimir Kondratyev2021-01-077-1/+1196
| | | | | | | | | | | | | | | This driver provides support for multiple HID driver attachments to single HID transport backend. This ability existed in Net/OpenBSD (uhidev and ihidev drivers) but has never been ported to FreeBSD. Unlike Net/OpenBSD we do not use report number alone to distinct report source but we follow MS way and use a top level collection (TLC) usage index that report belongs to as a location key. The driver performs child device autodiscovery based on HID report descriptor data, proxying of HID requests from child devices to parent transport backends and broadcasting of interrupts in backward direction. Differential revision: https://reviews.freebsd.org/D27888
* hid: Import HID transport method definitions and helper functions.Vladimir Kondratyev2021-01-075-1/+224
| | | | | | | | | | | | | | | | | | | | | | | | | Create an abstract HID interface that provides hardware independent access to HID capabilities and functions through the device tree. hid_if.m resembles existing USBHID KPI and consist of next methods: HID method USBHID variant ----------------------------------------------------------------------- hid_intr_setup usbd_transfer_setup (INTERRUPT IN xfer) hid_intr_unsetup usbd_transfer_unsetup (INTERRUPT IN xfer) hid_intr_start usbd_transfer_start (INTERRUPT IN xfer) hid_intr_stop usbd_transfer_drain (INTERRUPT IN xfer) hid_intr_poll usbd_transfer_poll (INTERRUPT IN xfer) hid_get_rdesc usbd_req_get_report_descriptor hid_read No direct analog. Not intended for common use. hid_write uhid(4) write() hid_get_report usbd_req_get_report hid_set_report usbd_req_set_report hid_set_idle usbd_req_set_idle hid_set_protocol usbd_req_set_protocol This change is part of D27888
* hid: Chase for HID function name changes in existing USB HID driversVladimir Kondratyev2021-01-0710-69/+49
| | | | | | | | | | Also hide shim code added in a previous commit under COMPAT_USBHID12. Note: it is enough to add -DCOMPAT_USBHID12 to CFLAGS to compile old code with new HID subsystem, but it is not enough to link it at runtime. HID dependency has to be added explicitly with MODULE_DEPEND macro. Reviewed by: manu, hselasky (as part of D27887)
* hid: Import functions and constants required by new subsystemVladimir Kondratyev2021-01-0719-48/+342
| | | | | | | | | | | | | | | | | | | | This does an import of quirk stubs, debugging macros from USB code and numerous usage constants used by dependent drivers. Besides, this change renames some functions to get a better matching with userland library and NetBSD/OpenBSD HID code. Namely: - Old hid_report_size() renamed to hid_report_size_max() - New hid_report_size() calculates size of given report rather than maximum size of all reports. - hid_get_data_unsigned() renamed to hid_get_udata() - hid_put_data_unsigned() renamed to hid_put_udata() Compat shim functions are provided in usbhid.h to make possible compile of legacy code unmodified after this change. Reviewed by: manu, hselasky Differential revision: https://reviews.freebsd.org/D27887
* Factor-out hardware-independent part of USB HID support to new moduleVladimir Kondratyev2021-01-0748-1478/+185
| | | | | | | | It will be used by the upcoming HID-over-i2C implementation. Should be no-op, except hid.ko module dependency is to be added to affected drivers. Reviewed by: hselasky, manu Differential revision: https://reviews.freebsd.org/D27867
* Copy HID over USB support files to new sys/dev/hid directoryVladimir Kondratyev2021-01-073-0/+1605
|
* libkern/strcasestr.c: Drop xlocale support and connect to build.Vladimir Kondratyev2021-01-073-14/+10
| | | | | Reviewed by: markj, hselasky Differential revision: https://reviews.freebsd.org/D27866
* Copy strcasestr.c from libc to libkern.Vladimir Kondratyev2021-01-071-0/+74
|
* evdev: Allow open() handler to be interrupted by a signalVladimir Kondratyev2021-01-072-5/+15
| | | | | | | It is possible that the client list lock is taken by other process for too long due to e.g. IO timeouts. Allow user to terminate open() in this case. Reviewed by: markj (as part of D27865)
* evdev: Make open(2) and close(3) handlers sleepable.Vladimir Kondratyev2021-01-074-67/+156
| | | | | | | | | | | | | | | | | | | | At the beginning of evdev there was a LOR between hardware driver's and evdev client list locks as they were taken in different order at driver's interrupt and evdev open()/close() handlers. The LOR was fixed with introduction of evdev_register_mtx() function which allowed to use a hardware driver's lock as evdev client list lock. While this works good with PS/2 and USB, this does not work with I2C. Unlike PS/2 and USB, I2C open()/close() handlers do unbound sleeps while waiting for I2C bus to release and while performing IO. This change uses epoch(9) for traversing evdev client list in interrupt handler to avoid the LOR thus making possible to convert evdev client list lock to sleepable sx. While here add brief locking protocol description. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D27865
* evdev: Remove useless "initial value" parameter from evdev_support_abs()Vladimir Kondratyev2021-01-0710-28/+25
| | | | | It can not be used for setting of state of multitouch events. If necessary, use evdev_push_event() instead of it.
* Allow HID report descriptor parser to return more then 1 usage per itemVladimir Kondratyev2021-01-072-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handles parsing of following descriptor, containing array of usages: 0x05, 0x01, // Usage Page (Generic Desktop Ctrls) 0x09, 0x80, // Usage (Sys Control) 0xA1, 0x01, // Collection (Application) 0x75, 0x02, // Report Size (2) 0x95, 0x01, // Report Count (1) 0x15, 0x01, // Logical Minimum (1) 0x25, 0x03, // Logical Maximum (3) 0x09, 0x82, // Usage (Sys Sleep) 0x09, 0x81, // Usage (Sys Power Down) 0x09, 0x83, // Usage (Sys Wake Up) 0x81, 0x60, // Input (Data,Array,Abs) 0x75, 0x06, // Report Size (6) 0x81, 0x03, // Input (Const,Var,Abs) 0xC0, // End Collection Our current parser returns only first usage (Sys Sleep) and loses next two. Set HID_ITEM_MAXUSAGE limit relatively low as existing code usually allocates hid_item on stack. Also tweak hid_locate() to support hid items with multiple usages. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D27748
* hid_locate: do not ignore constant items.Vladimir Kondratyev2021-01-071-1/+1
| | | | | | | | | | | | | | | | | | | hid_locate() currently ignores all HID items which tagged as constant, i.e. bit 0 of main item data is set to 1. See p.6.2.2.4 of hid1_11.pdf [1]. Such an items are unconditionally treated as byte-alignment padding. While that may be right decision for input and output reports that is wrong for features reports. Feature reports can contain constant capabilities e.g. 'Contact Count Maximum'. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232040 Remove check for constant from hid_locate() to make possible parsing of such a reports. [1] https://www.usb.org/sites/default/files/documents/hid1_11.pdf Reviewed by: hselasky Obtained from: sysutils/iichid Differential Revision: https://reviews.freebsd.org/D27747
* Rewrite the disk I/O management system in fsck_ffs(8). Other thanKirk McKusick2021-01-0717-1384/+1215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | making fsck_ffs(8) run faster, there should be no functional change. The original fsck_ffs(8) had its own disk I/O management system. When gjournal(8) was added to FreeBSD 7, code was added to fsck_ffs(8) to do the necessary gjournal rollback. Rather than use the existing fsck_ffs(8) disk I/O system, it wrote its own from scratch. Similarly when journalled soft updates were added in FreeBSD 9, code was added to fsck_ffs(8) to do the necessary journal rollback. And once again, rather than using either of the existing fsck_ffs(8) disk I/O systems, it wrote its own from scratch. Lastly the fsdb(8) utility uses the fsck_ffs(8) disk I/O management system. In preparation for making the changes necessary to enable snapshots to be taken when using journalled soft updates, it was necessary to have a single disk I/O system used by all the various subsystems in fsck_ffs(8). This commit merges the functionality required by all the different subsystems into a single disk I/O system that supports all of their needs. In so doing it picks up optimizations from each of them with the results that each of the subsystems does fewer reads and writes than it did with its own customized I/O system. It also greatly simplifies making changes to fsck_ffs(8) since everything goes through a single place. For example the ginode() function fetches an inode from the disk. When inode check hashes were added, they previously had to be checked in the code implementing inode fetch in each of the three different disk I/O systems. Now they need only be checked in ginode(). Tested by: Peter Holm Sponsored by: Netflix
* du: tests: make H_flag tests more strict about output requirementsKyle Evans2021-01-071-4/+12
| | | | | | | | | | | | | | The current version of this test will effectively pass as long as one of the specified paths is in the output, and it could even be a subset of one of the paths. Strengthen up the test a little bit: * Specify beginning/end anchors for each path * Add egrep -v checks to make sure we don't have any *additional* paths * Ratchet down paths2 to exactly the two paths we expect to appear Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D27984
* du: tests: fix the H_flag test (primarily grep usage)Kyle Evans2021-01-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test attempts to use \t (tab intended) in a grep expression. With the former /usr/bin/grep (i.e. gnugrep), this was interpreted as a literal 't'. The expression would work anyways because the tr(1) usage would ultimately replace all of the spaces with a single newline, and they would match the paths whether they were correctly fromatted or not. Current /usr/bin/grep (i.e. bsdgrep) is less-tolerant of ordinary-escapes, a property of the underlying regex(3) engine, to make it easier to identify when stuff like this happens. In-fact, this expression broke after the switch happened. This revision does the bare basics to fix the usage by using a printf to get a literal tab character to insert into the expression. It also swaps out the manual insertion of the line prefix into the grep expression by pulling that part out of $sep and reusing it for the leading path. The secondary issue was the tr(1) usage, since tr would only replace the first character of string1 with the first character of string2. This has instead been replaced by a sed expression, which similary understands \n to be a newline on all supported versions of FreeBSD. Each path now gets prefixed with the appropriate context that should be there (i.e. numeric sequence followed by a tab). PR: 252446 Reviewed by: emaste, ngie Differential Revision: https://reviews.freebsd.org/D27983
* stand: remove bogus dependency from libsa32Kyle Evans2021-01-071-2/+0
| | | | libsa32 is independent of libsa, they can build in parallel if needed.
* stand: avoid adding fdt SUBDIR_DEPEND if WITHOUT_FDT is setKyle Evans2021-01-071-0/+2
| | | | | | This unbreaks the efi build if WITHOUT_FDT is set. Reported by: peterj
* pf: Copy kif flags to userspaceKristof Provost2021-01-071-0/+1
| | | | | | | | This was overlooked in the pfi_kkif/pfi_kif splitup and as a result userspace could no longer tell which interfaces had the skip flag applied. MFC after: 2 weeks
* iflib: ensure that tx interrupts enabled and cleanupsMatt Macy2021-01-0711-41/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing a 'dd' over iscsi will reliably cause stalls. Tx cleaning _should_ reliably happen as data is sent. However, currently if the transmit queue fills it will wait until the iflib timer (hz/2) runs. This change causes the the tx taskq thread to be run if there are completed descriptors. While here: - make timer interrupt delay a sysctl - simplify txd_db_check handling - comment on INTR types Background on the change: Initially doorbell updates were minimized by only writing to the register on every fourth packet. If txq_drain would return without writing to the doorbell it scheduled a callout on the next tick to do the doorbell write to ensure that the write otherwise happened "soon". At that time a sysctl was added for users to avoid the potential added latency by simply writing to the doorbell register on every packet. This worked perfectly well for e1000 and ixgbe ... and appeared to work well on ixl. However, as it turned out there was a race to this approach that would lockup the ixl MAC. It was possible for a lower producer index to be written after a higher one. On e1000 and ixgbe this was harmless - on ixl it was fatal. My initial response was to add a lock around doorbell writes - fixing the problem but adding an unacceptable amount of lock contention. The next iteration was to use transmit interrupts to drive delayed doorbell writes. If there were no packets in the queue all doorbell writes would be immediate as the queue started to fill up we could delay doorbell writes further and further. At the start of drain if we've cleaned any packets we know we've moved the state machine along and we write the doorbell (an obvious missing optimization was to skip that doorbell write if db_pending is zero). This change required that tx interrupts be scheduled periodically as opposed to just when the hardware txq was full. However, that just leads to our next problem. Initially dedicated msix vectors were used for both tx and rx. However, it was often possible to use up all available vectors before we set up all the queues we wanted. By having rx and tx share a vector for a given queue we could halve the number of vectors used by a given configuration. The problem here is that with this change only e1000 passed the necessary value to have the fast interrupt drive tx when appropriate. Reported by: mav@ Tested by: mav@ Reviewed by: gallatin@ MFC after: 1 month Sponsored by: iXsystems Differential Revision: https://reviews.freebsd.org/D27683
* vfs: fix rangelock range in vn_rdwr() for IO_APPENDChuck Silvers2021-01-071-0/+2
| | | | | | | | | vn_rdwr() must lock the entire file range for IO_APPEND just like vn_io_fault() does for O_APPEND. Reviewed by: kib, imp, mckusick Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28008
* Fix dateMateusz Piotrowski2021-01-071-1/+1
| | | | | | It's 2021 already. Reported by: delphij
* arm64: enable build of the ipmi moduleMitchell Horne2021-01-073-5/+17
| | | | | | | | | Only ACPI attachment is supported for now, some others depend on the presence of smbios(4) support, which we lack on arm64. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28009
* Refactor rt_addrmsg() and rt_routemsg().Alexander V. Chernikov2021-01-079-50/+78
| | | | | | | | | | | | | | Summary: * Refactor rt_addrmsg(): make V_rt_add_addr_allfibs decision locally. * Fix rt_routemsg() and multipath by accepting nexthop instead of interface pointer. * Refactor rtsock_routemsg(): avoid accessing rtentry fields directly. * Simplify in_addprefix() by moving prefix search to a separate function. Reviewers: #network Subscribers: imp, ae, bz Differential Revision: https://reviews.freebsd.org/D28011
* armv8crypto: add AES-XTS supportMitchell Horne2021-01-073-11/+138
| | | | | | | | | | | A straightforward(ish) port from aesni(4). This implementation does not perform loop unrolling on the input blocks, so this is left as a future performance improvement. Submitted by: Greg V <greg AT unrelenting.technology> Looks good: jhb, jmg Tested by: mhorne Differential Revision: https://reviews.freebsd.org/D21017
* loader: do not update palette in text modeToomas Soome2021-01-071-1/+1
| | | | | Apparently palette update while in text mode, will cause some adapters to end up with blank display.
* isci: use maxphys rather than 128KB to size s/g listAndrew Gallatin2021-01-071-1/+1
| | | | | | | | | | | | | | | | In the conversion into a tunable, we converted the size of the s/g list used by the driver to be based off of a hardcoded size of 128k rather than maxphys, this caused performance problems for us. Revert this to use the maxphys tunable. Note that this constant is used to size dynamically allocated things, and not static data structs, so this is safe. Reviewed By: imp, kib, mav Tested By:i dhw Differential Revision: https://reviews.freebsd.org/D28023 Sponsored by: Netflix
* Fix the bug in committers-ports.dot with my mentor.Neel Chauhan2021-01-071-1/+1
| | | | | | Reviewed by: 0mp Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D28022
* src.conf.5: regenerate after MK_WERROR changeAlex Richardson2021-01-071-1/+5
| | | | This was missed in 7fa2f2a62f04f095e1e27ad55aa22a8f59b1df8f.
* arm64 GENERIC: sort to match amd64, to ease comparisonEd Maste2021-01-071-99/+102
| | | | | | | | | | No functional change - only moved lines, changed whitespace, and updated comments. Reviewed by: allanjude MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28001
* Add support for PL2303HXN to uplcom(4).Hans Petter Selasky2021-01-073-12/+92
| | | | | | | | | | | Code changes in this commit were obtained from straight from OpenBSD's uplcom.c with almost no modification, the list of chip names and USB IDs was obtained from Linux. Differential Revision: https://reviews.freebsd.org/D27952 Submitted by: tomli_tomli.me (Yifeng Li) MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Add new PCI ID for XHCI(4).Hans Petter Selasky2021-01-071-0/+2
| | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Fix a typoMateusz Piotrowski2021-01-071-2/+2
| | | | MFC after: 3 days
* libcompat: remove redundant path for ncursesBaptiste Daroussin2021-01-071-1/+1
| | | | Reported by: kevans
* prepare-commit-msg: Avoid warning on macOS and shellcheck fixesAlex Richardson2021-01-071-5/+5
| | | | | | | | | The macOS /bin/sh complains about using return outside of functions. Replace `return 0` with `exit 0` to fix this. While editing this files I've also fixed all the shellcheck warnings that were displayed by my IDE. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D28016
* Drop some unncessary stale code from Makefile.bootAlex Richardson2021-01-071-9/+0
| | | | No longer required after 0e1e341b486cdf4769195ba1e5b3cb32e7387873.
* tools/build/make.py: Fix macOS build after a920b9817Alex Richardson2021-01-071-4/+21
| | | | | | If we set STRIPBIN, we also have to set XSTRIPBIN since we otherwise use the host /usr/bin/strip during buildworld. However, this does not work on macOS since /usr/bin/strip doesn't handle ELF binaries.
* Rename NO_WERROR -> MK_WERROR=noAlex Richardson2021-01-0725-33/+40
| | | | | | | | As suggested in D27598. This also supports MK_WERROR.clang=no and MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D27601
* Stop passing MK_WARNS=no for bootstrap toolsAlex Richardson2021-01-073-7/+7
| | | | | | | | | | | | | | | | | I got annoyed by the number of warnings that the CheriBSD build was emitting. It turns out that we are emitting lots of warnings during bootstrap because bootstrap tools are built with the default compiler flags and ignore the warnings flags that are set in bsd.sys.mk. Looking at git blame, it appears that MK_WARNS=no has been passed since rS112869, replacing the -DNO_WERROR option that was added in rS87775. This commit changes MK_WARNS=no back to -DNO_WERROR. We need to pass -DNO_WERROR, since the system compiler might have new warnings that we don't know about yet, and we shouldn't fail the build in that case. Reviewed By: imp, brooks Differential Revision: https://reviews.freebsd.org/D27598
* Fix warnings during bootstrap phase on macOSAlex Richardson2021-01-071-1/+1
|
* Fix warnings during bootstrap on Linux systemsAlex Richardson2021-01-0712-64/+74
| | | | | Most warnings are currently off for the boostrap phase, but once D27598 lands they will be enabled again.