path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* OpenZFS merge main-gf11b09Matt Macy2021-01-08471-6691/+34096
| | | | | | | | - add dRAID support - fix duplicate close handling - fix memory leak in prefetch - fix problem with SIMD benchmarking on FreeBSD boot ...
* aio_fsync(2): Support O_DSYNC.Thomas Munro2021-01-082-9/+29
| | | | | | | aio_fsync(O_DSYNC, ...) is the asynchronous version of fdatasync(2). Reviewed by: kib, asomers, jhb Differential Review: https://reviews.freebsd.org/D25071
* ffs: Support O_DSYNC.Thomas Munro2021-01-081-1/+3
| | | | | | | | | Respect the new IO_DATASYNC flag when performing synchronous writes. Compared to O_SYNC, O_DSYNC lets us skip updating the inode in some cases, matching the behaviour of fdatasync(2). Reviewed by: kib Differential Review: https://reviews.freebsd.org/D25160
* open(2): Add O_DSYNC flag.Thomas Munro2021-01-085-7/+19
| | | | | | | | | | | | | | | POSIX O_DSYNC means that writes include an implicit fdatasync(2), just as O_SYNC implies fsync(2). VOP_WRITE() functions that understand the new IO_DATASYNC flag can act accordingly, but we'll still pass down IO_SYNC so that file systems that don't understand it will continue to provide the stronger O_SYNC behaviour. Flag also applies to fcntl(2). Reviewed by: kib, delphij Differential Revision: https://reviews.freebsd.org/D25090
* pccard: remove pccbb_isaWarner Losh2021-01-081-257/+0
| | | | It was never used and quite stale.
* pccard: Move power_if.m from pccard to cardbusWarner Losh2021-01-082-1/+1
| | | | power_if.m is used by both pccard and cardbus. Move it into cardbus.
* fd: use seqc_read_notmodify when translating fdsMateusz Guzik2021-01-071-7/+3
* fd: make fd/fp mandatoryMateusz Guzik2021-01-071-7/+5
| | | | They are both always passed anyway.
* cache: stop checkpointing cn_flagsMateusz Guzik2021-01-071-16/+25
| | | | They are only modified, if ever, for the last component.
* cache: stop checkpointing cn_nameptrMateusz Guzik2021-01-071-3/+9
| | | | | For aborts cn_nameptr is the same as cn_pnbuf. For partial results the same cn_nameptr is to be used.
* cache: stop manipulating pathlenMateusz Guzik2021-01-071-20/+100
| | | | | It is a copy-pasto from regular lookup. Add debug to ensure the result is the same.
* hid: Add UPDATING entry and bump __FreeBSD_versionVladimir Kondratyev2021-01-071-1/+1
| | | | | Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D28019
* hid: Import hidmap-based drivers written by Greg VVladimir Kondratyev2021-01-079-1/+718
| | | | | | | | | | | This change includes: hpen - Generic / MS Windows compatible HID pen tablet driver. hgame - Generic game controller and joystick driver. xb360gp - Xbox360-compatible game controller driver. Submitted by: Greg V <greg_unrelenting.technology> Reviewed by: hselasky (as part of D27993)
* hid: Import hidmap and bunch of drivers based on itVladimir Kondratyev2021-01-0713-1/+3228
| | | | | | | | | | | | | | hidmap is a kernel module that maps HID input usages to evdev events. Following dependent drivers is included in the commit: hms - HID mouse driver. hcons - Consumer page AKA Multimedia keys driver. hsctrl - System Controls page (Power/Sleep keys) driver. ps4dshock - Sony DualShock 4 gamepad driver. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27993
* evdev: Implement fuzz.Vladimir Kondratyev2021-01-071-1/+19
| | | | | | | Fuzz is used to filter noise from the event stream. Upcoming gamepad drivers use it. Reviewed by: hselasky (as part of D27993)
* hidraw(4): Add HIDRAW_MAKE_UHID_ALIAS kernel optionVladimir Kondratyev2021-01-077-4/+31
| | | | | | | | | | which installs /dev/uhid# alias to hidraw character device for compatibility with some existing uhid(4) users like Firefox. As side effect it renames traditional uhid(4) driver to hidraw to make possible using of common unit number allocator. Requested by: Greg V <greg_unrelenting.technology> Reviewed by: hselasky (as part of D27992)
* hid: Import hidraw(4) - driver for access to raw HID device dataVladimir Kondratyev2021-01-076-2/+1012
| | | | | | | | | | | | This driver provides raw access to HID devices through uhid(4)-compatible interface and is based on pre-8.x uhid(4) code. Unlike uhid(4) it does not take devices in to monopoly ownership and allows parallel access from other drivers. hidraw supports Linux's hidraw-compatible interface as well. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27992
* 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-075-775/+594
| | | | | Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D27991
* hid: Copy ukbd(4) to HID subsystem.Vladimir Kondratyev2021-01-071-0/+2197
* hid: Port multitouch hmt(4) driver to hidbus and attach to buildVladimir Kondratyev2021-01-074-492/+370
| | | | | 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-071-0/+1043
* hid: Import hconf(4) - digitizer configuration top-level collection support.Vladimir Kondratyev2021-01-075-0/+385
| | | | Reviewed by: hselasky (as part of D27990)
* hid: Import usbhid - USB transport backend for HID subsystem.Vladimir Kondratyev2021-01-0712-1/+817
| | | | | | | | | | | | | | | | 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-078-0/+1271
| | | | | | | | | | | | | | | | | 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-074-1/+474
| | | | | | | | 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-075-1/+1093
| | | | | | | | | | | | | | | 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-0738-1476/+164
| | | | | | | | 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. 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
* 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
* 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
* 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
* 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-072-11/+89
| | | | | | | | | | | 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
* Install dtrace.h and dependenciesAlex Richardson2021-01-071-2/+12
| | | | | | | | | | | | | This makes the minimum amount of changes to allow inclusion of dtrace.h without all the solaris compatibility headers. Installing dtrace.h allows compiling consumers of libdtrace (e.g. https://github.com/tmetsch/python-dtrace) without requiring a copy of the source tree. For python-dtrace I worked around this in https://github.com/tmetsch/python-dtrace/commit/58019c9a12022203a9ffda286dd8b41f1a5ace42 but being able to build the library without installed sources would be extremely useful. Reviewed By: gnn Differential Revision: https://reviews.freebsd.org/D27884