opnsense-src/sys/dev/usb
Alfred Perlstein 85f190e4d1 Fixes to make select/poll mpsafe.
Problem:
  selwakeup required calling pfind which would cause lock order
  reversals with the allproc_lock and the per-process filedesc lock.
Solution:
  Instead of recording the pid of the select()'ing process into the
  selinfo structure, actually record a pointer to the thread.  To
  avoid dereferencing a bad address all the selinfo structures that
  are in use by a thread are kept in a list hung off the thread
  (protected by sellock).  When a selwakeup occurs the selinfo is
  removed from that threads list, it is also removed on the way out
  of select or poll where the thread will traverse its list removing
  all the selinfos from its own list.

Problem:
  Previously the PROC_LOCK was used to provide the mutual exclusion
  needed to ensure proper locking, this couldn't work because there
  was a single condvar used for select and poll and condvars can
  only be used with a single mutex.
Solution:
  Introduce a global mutex 'sellock' which is used to provide mutual
  exclusion when recording events to wait on as well as performing
  notification when an event occurs.

Interesting note:
  schedlock is required to manipulate the per-thread TDF_SELECT
  flag, however if given its own field it would not need schedlock,
  also because TDF_SELECT is only manipulated under sellock one
  doesn't actually use schedlock for syncronization, only to protect
  against corruption.

Proc locks are no longer used in select/poll.

Portions contributed by: davidc
2002-03-14 01:32:30 +00:00
..
devlist2h.awk Add usbdevs and friends. 1999-11-18 18:02:44 +00:00
dsbr100io.h Support for USB fm radio. 2002-03-04 03:51:21 +00:00
FILES Support for USB fm radio. 2002-03-04 03:51:21 +00:00
hid.c Sync with NetBSD (1.16 - 1.17) 2001-12-29 20:37:14 +00:00
hid.h Remove __P prototypes to reduce diffs between the NetBSD and FreeBSD 2000-07-17 18:41:20 +00:00
if_aue.c Add a new linksys ethernet adapter: USB_PRODUCT_LINKSYS_USB10TX2. 2002-01-03 18:56:35 +00:00
if_auereg.h Support MELCO LUA2-TX USB ethernet adaptor. 2001-11-19 18:47:49 +00:00
if_cue.c Make these depend on the usb module so they can use its symbols if they 2001-08-22 05:33:57 +00:00
if_cuereg.h Disable the mutex locking calls. These do not work in their present form 2001-02-27 01:05:25 +00:00
if_kue.c Make these depend on the usb module so they can use its symbols if they 2001-08-22 05:33:57 +00:00
if_kuereg.h Disable the mutex locking calls. These do not work in their present form 2001-02-27 01:05:25 +00:00
kue_fw.h OpenBSD has a broken debugger that does not grok static. Use a 2000-04-03 20:58:30 +00:00
Makefile.usbdevs Make the makefile work properly. 2000-03-15 22:13:50 +00:00
ohci.c Fix debug printf formats 2002-02-28 00:06:59 +00:00
ohci_pci.c KNF style the code, ready for an MFC. 2002-02-17 11:58:58 +00:00
ohcireg.h Merge from NetBSD: 2002-01-21 05:02:21 +00:00
ohcivar.h Merge from NetBSD: 2002-01-26 12:04:22 +00:00
rio500_usb.h Update the urio driver. It now works on NetBSD and OpenBSD as well. 2000-04-08 17:02:13 +00:00
udbp.c select() DKI is now in <sys/selinfo.h>. 2001-01-09 04:33:49 +00:00
udbp.h The USB double bulk pipe driver (Host to host cables). Currently there 2000-05-01 22:48:23 +00:00
ufm.c On FreeBSD make usb_proc_t the same as d_thred_t always. 2002-03-11 16:38:53 +00:00
ugen.c Be more specific about when block major numbers disappeared from 2002-03-11 16:22:15 +00:00
uhci.c Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
uhci_pci.c Fix a formatting error. 2002-02-17 12:41:50 +00:00
uhcireg.h Update the $NetBSD$ ident. 2002-01-26 13:09:52 +00:00
uhcivar.h Reduce the diffs between NetBSD and our version where appropriate 2002-01-26 13:08:57 +00:00
uhid.c Be more specific about when block major numbers disappeared from 2002-03-11 16:22:15 +00:00
uhub.c Merge from NetBSD: 2002-02-19 02:00:27 +00:00
ukbd.c Sync with NetBSD: 2002-01-02 18:28:45 +00:00
ulpt.c Be more specific about when block major numbers disappeared from 2002-03-11 16:22:15 +00:00
umass.c Clean up some debugging output. 2002-02-19 10:53:25 +00:00
umodem.c Be more specific about when block major numbers disappeared from 2002-03-11 16:22:15 +00:00
ums.c Fixes to make select/poll mpsafe. 2002-03-14 01:32:30 +00:00
urio.c Be more specific about when block major numbers disappeared from 2002-03-11 16:22:15 +00:00
usb.c Be more specific about when block major numbers disappeared from 2002-03-11 16:22:15 +00:00
usb.h Revert part of the last commit. A couple of defines were removed 2002-02-26 10:00:32 +00:00
usb_ethersubr.c Lock down the network interface queues. The queue mutex must be obtained 2000-11-25 07:35:38 +00:00
usb_ethersubr.h Pull my head out of my ass and actually make the tx netisr stuff work right. 2000-01-14 01:36:16 +00:00
usb_if.m * Factor out the object system from new-bus so that it can be used by 2000-04-08 14:17:18 +00:00
usb_mem.h Remove __P prototypes to reduce diffs between the NetBSD and FreeBSD 2000-07-17 18:41:20 +00:00
usb_port.h Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
usb_quirks.c Pull in the most recent version of usb_quirks.h and propagate the necessary 2001-07-05 10:12:59 +00:00
usb_quirks.h Pull in the most recent version of usb_quirks.h and propagate the necessary 2001-07-05 10:12:59 +00:00
usb_subr.c Prefix structure members to protect them against clashes with eg. 2002-02-20 20:47:21 +00:00
usbcdc.h Add more CDC defines. 2000-08-13 18:23:07 +00:00
usbdevs Support the HP 5400C scanner. 2002-02-14 02:51:12 +00:00
usbdevs.h Regenerate. 2002-02-14 03:03:08 +00:00
usbdevs_data.h Regenerate. 2002-02-14 03:03:08 +00:00
usbdi.c Prefix structure members to protect them against clashes with eg. 2002-02-20 20:47:21 +00:00
usbdi.h Merge from NetBSD: revs 1.55 and 1.56 2002-02-11 03:15:08 +00:00
usbdi_util.c Don't free memory that has been freed already. 2001-06-30 10:57:37 +00:00
usbdi_util.h Remove __P prototypes to reduce diffs between the NetBSD and FreeBSD 2000-07-17 18:41:20 +00:00
usbdivar.h Merge from NetBSD: 2002-02-16 00:51:26 +00:00
usbhid.h Sync usb.h with NetBSD, apart from usb_device_info.speed, which 2002-01-02 20:16:53 +00:00
uscanner.c Be more specific about when block major numbers disappeared from 2002-03-11 16:22:15 +00:00