Commit Graph

75 Commits

Author SHA1 Message Date
Josef Karthauser
242fcd8d18 Slight tidy up to reduce the differences between our version and NetBSD's.
(No functional changes).
2002-04-09 12:55:46 +00:00
Josef Karthauser
0ad441b80d Lock down Giant in the usb_task_thread() kthread. 2002-04-08 18:13:21 +00:00
Josef Karthauser
3119539124 MFNetBSD:
revision 1.58
    date: 2001/11/20 23:53:26;  author: augustss;  state: Exp;  lines: +61 -33
    Create a special kernel thread to run the usb short lived tasks (instead
    of using the device discovery threads).
2002-04-07 14:21:32 +00:00
Josef Karthauser
0f349fb04e MFNetBSD:
revision 1.65
    date: 2002/01/03 22:20:45;  author: augustss;  state: Exp;  lines: +9 -2
    Add a DIAGNOSTIC check.  From FreeBSD.

(Just wrap these changes, that we already had, with a #ifdef DIAGNOSTIC).
2002-04-07 14:12:56 +00:00
Josef Karthauser
00955db9e4 MFNetBSD:
revision 1.62
    date: 2002/01/02 20:55:58;  author: augustss;  state: Exp;  lines: +11 -10
    Some more usb_proc_ptr changes.
    Also some minor stylistic changes.

    revision 1.63
    date: 2002/01/02 20:58:12;  author: augustss;  state: Exp;  lines: +4 -4
    Fix typo in last commit.

    revision 1.64
    date: 2002/01/02 22:44:44;  author: augustss;  state: Exp;  lines: +7 -4
    Add a comment.

The usb_proc_ptr changes were introduced in 1.62 and backed out in 1.64.
2002-04-07 14:10:52 +00:00
Josef Karthauser
0af822462a MFNetBSD:
revision 1.61
    date: 2001/12/31 15:55:51;  author: augustss;  state: Exp;  lines: +3 -5
    Delay bus enumeration a little in case the controller is a companion
    controller.  This way the main controller can gain ownership of the port
    before enumeration starts.
2002-04-07 14:02:31 +00:00
Josef Karthauser
9a7693dbe2 MFNetBSD:
revision 1.59
    date: 2001/11/26 20:16:55;  author: augustss;  state: Exp;  lines: +3 -3
    Change wchan name for usb task thread.
2002-04-07 13:59:32 +00:00
Josef Karthauser
c47378c38f MFNetBSD: usb.c (1.58)
date: 2001/11/20 23:53:26;  author: augustss;  state: Exp;  lines: +61 -33
    Create a special kernel thread to run the usb short lived tasks (instead
    of using the device discovery threads).

The change to usb_port.h is a little hack whilst I address an issue
with NetBSD.
2002-04-07 13:58:06 +00:00
Josef Karthauser
05f37aafc4 MFNetBSD: ohci.c (1.109), uhci.c (1.144), uhub.c (1.56), usb.c (1.57),
usbdi.c (1.86), usbdivar.h (1.66)
	  [Some partial, because most of this was merged in a while ago]

    date: 2001/11/20 13:48:03;  author: augustss;
    Keep track of device speed for USB 2.0.
2002-04-07 11:19:05 +00:00
Josef Karthauser
e373532341 MFNetBSD: (partial merge, as part was already there).
revision 1.56
    date: 2001/11/13 07:55:30;  author: augustss;  state: Exp;  lines: +4 -4
    Add some #endif comments.
2002-04-02 10:48:58 +00:00
Josef Karthauser
44e0c682e0 MFNetBSD:
revision 1.54
    date: 2001/11/09 14:59:11;  author: augustss;  state: Exp;  lines: +2 -1
    Add a debug message.
2002-04-02 10:47:01 +00:00
Josef Karthauser
09f681d7b7 MFNetBSD: usb.c (1.53), usbdi.h (1.49)
date: 2001/01/23 17:04:30;  author: augustss;
    Ad function to remove a usb task.
2002-04-02 09:58:16 +00:00
Josef Karthauser
7e9590a260 MFNetBSD:
revision 1.52
    date: 2001/01/21 19:00:29;  author: augustss;  state: Exp;  lines: +5 -0
    Ad a comment.
2002-04-02 09:51:10 +00:00
Josef Karthauser
e469fe6e0a MFNetBSD: uhub.c (1.49), usb.c (1.51), usbdi.h (1.48), usbdivar.h (1.63)
date: 2001/01/21 19:00:06;  author: augustss;
    Change the operation of the USB event thread.  Before it only
    performed USB device discovery, now it can also perform (short)
    tasks for device drivers that need a process context, but don't
    have one.  This is not pretty, but better than using busy-wait
    in an interrupt context.
2002-04-02 09:49:36 +00:00
Josef Karthauser
8be36692c3 MFNetBSD: ohci.c (1.99), uhci.c (1.133), usb.c (1.49), usb_port.h
(1.39), usbdi.c (1.79), usbdi.h (1.47), usbdivar.h (1.62)

    date: 2001/01/21 02:39:52;  author: augustss;
    Add code to use soft interrupt to handle USB interrupt processing.
    Don't enable the code since it doesn't work with the kludgy Ethernet
    drivers.
2002-04-01 21:34:01 +00:00
Josef Karthauser
84aa7f035a Update $NetBSD$ idents to reflect reality. 2002-04-01 17:54:07 +00:00
Josef Karthauser
cf39046c9d Merge from NetBSD: Removed unnecessary variable declaration. 2002-04-01 17:49:12 +00:00
Josef Karthauser
167145ddc0 Merge from NetBSD:
usb.c rev 1.43, usb_port.h rev 1.26, usb_subr.c rev 1.71

Some OpenBSD portability fixes.
2002-04-01 16:53:29 +00:00
Josef Karthauser
0f657c164b Merge from NetBSD:
usb.c 1.40:
    revision 1.40
    date: 2000/03/14 23:13:12;  author: augustss;  state: Exp;  lines: +4 -1
    Make sure the USB event thread discovers all devices first time
    it call usb_discover().  It should now be possible to have the
    root NFS mounted over a USB Ethernet Adapter.
2002-04-01 16:29:24 +00:00
Josef Karthauser
be036866cf Be more specific about when block major numbers disappeared from
the cdev switch.
2002-03-11 16:22:15 +00:00
Alfred Perlstein
5bcd0580d7 Prefix structure members to protect them against clashes with eg.
c++ keywords.

This keeps us in sync with NetBSD because they actually committed
my delta first.

Ok'd by: lennard
2002-02-20 20:47:21 +00:00
Josef Karthauser
c67fd26e98 Re-add bmaj to the cdevsw's, but don't compile it in on -current.
This makes the code more portable between -current, -stable and the
other BSDs.
2002-02-15 22:54:10 +00:00
Brian Feldman
d515a5410b Fix a bug introduced in rev.1.40 which can cause systems to crash when
detaching USB devices.  Specifically, a variable which was not meant
to be reused was, in fact, being reused.
2002-02-14 08:22:37 +00:00
Josef Karthauser
0a7fe9cc0b Follow NetBSD and ANSIfy the function definitions.
Remove trailing whitespaces (submitted to NetBSD).
2002-02-03 17:03:34 +00:00
Josef Karthauser
a07e9d4af3 Merge from NetBSD.
uhub.c:     revision 1.37
    usb.4:      revision 1.30
    usb.c:      revision 1.38
    usb.h:      revision 1.40
    usb_port.h: revision 1.21
    usb_subr.c: revision 1.65
    usbdi.h:    revision 1.40

Split the attach/detach events up into device, driver and controller
attach and detach events.

The commit message from NetBSD was:
        date: 2000/02/02 07:34:00;  author: augustss;  state: Exp;
        Change the USB event mechanism to include more information
        about devices and drivers.  Partly from FreeBSD.

Also rework usbd to take these new event types into account.
2002-01-28 01:03:19 +00:00
Josef Karthauser
eb92aa3c3e Back out the last commit. I committed the wrong file by accident.
The commit message wasn't relevant to that change.  This code will
be committed later.
2002-01-26 13:57:08 +00:00
Josef Karthauser
7fac607b74 Rearrange the code in USB_DETACH, so that it's like NetBSD's.
No functional change.
2002-01-26 13:52:53 +00:00
Josef Karthauser
31c1f0005b Merge from NetBSD:
usb.c:	revision 1.39

	revision 1.39
	date: 2000/02/22 11:30:56;  author: augustss;  lines: +7 -1
	Prepare a little for having USB interrupt processing done
	outside the hard interrupt level (in a thread or a softintr).
	No real soft processing done yet.
2002-01-26 12:48:57 +00:00
Josef Karthauser
29ac7b3190 Merge from NetBSD:
usb.c:	revision 1.41

	revision 1.41
	date: 2000/03/16 00:46:38;  author: augustss;  lines: +2 -2
	Make the USB event queue longer.  Mine overflows before the
	(user-land) event handler has started.  But then I have
	about 25 devices connected. :)
2002-01-26 12:40:03 +00:00
Josef Karthauser
46d0cbc2cd Merge from NetBSD:
usb.c:	-r1.35 - 1.37
    usb_port.h:	tiny bit of -r1.26 + an extra bit in the FreeBSD config section.

	revision 1.37
	date: 2000/01/24 18:35:51;  author: thorpej;  state: Exp;  lines: +7 -1
	Use config_pending.
	----------------------------
	revision 1.36
	date: 1999/12/22 23:54:09;  author: augustss;  state: Exp;  lines: +2 -2
	Use the flags `locator' to govern if devices are detected early or
	late during cold boot.
	----------------------------
	revision 1.35
	date: 1999/12/20 02:12:23;  author: augustss;  state: Exp;  lines: +8 -5
	Make sure tsleep() is not called during cold boot.
2002-01-24 20:21:17 +00:00
Josef Karthauser
0f24ab6fa0 Revert uio.uio_td back to uio.uio_procp, using a #define in usb_port to
do the right thing on -current.
2002-01-02 23:31:08 +00:00
Josef Karthauser
7ccc786694 Sync with NetBSD. Non-functional changes that bring this file
closer to the NetBSD version.

Reviewed by:	md5
2002-01-02 21:56:02 +00:00
Josef Karthauser
2ba633961e Sync usb.h with NetBSD, apart from usb_device_info.speed, which
requires logic changes.  For now leave it as usb_device_info.lowspeed.
It will get addressed when the usb.c code is sync'd.
2002-01-02 20:16:53 +00:00
Josef Karthauser
44ae5917e2 NetBSD have introduced usb_proc_ptr for us (they'll be needing it soon too)
to hide the distinction between struct proc and struct thread.
2002-01-02 16:33:53 +00:00
John Baldwin
ed01445d8f Use the passed in thread to selrecord() instead of curthread. 2001-09-21 22:46:54 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Nick Hibma
e1f5734cbe Pull in the most recent version of usb_quirks.h and propagate the necessary
changes to the various files.

Also, pull in most of the current usb_subr.c file.
2001-07-05 10:12:59 +00:00
Peter Wemm
7b77e0fa50 Activate the kthread mechanism for doing usb bus discovery. This means
that device add/remove will work without usbd running.  usbd is still
used for execing stuff, but that is all now.  Ideally it could be replaced
by a devd some day.  Until now, usbd had to be running so that the
USB_DISCOVER ioctl could be called to walk the tree when an attachment
status change was noticed.

Among the changes:
- when a detach happens, remove any pending 'attach' messages or the system
suffers from whiplash from exec moused / kill moused loops if you do lots
of attach/detach and later start usbd.
- tweaks related to kthread differences
- disable the select handler for the old interface (never return success).
I have not removed it yet or old usbd's will abort.  That can get removed
later once usbd is cleaned up and things have stabilized for a few weeks.
- get Giant in the kthread.
- a couple of minor potential bug fixes (usb_nevents vs malloc failure etc)

Pre-approved by: n_hibma (ages and ages ago)
2001-06-06 22:00:03 +00:00
Mark Murray
fb919e4d5a Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

Also help the deprecation of lockmgr.h by making it a sub-include of
sys/lock.h and removing sys/lockmgr.h form kernel .c files.

Sort sys/*.h includes where possible in affected files.

OK'ed by:	bde (with reservations)
2001-05-01 08:13:21 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
John Baldwin
19eb87d22a Grab the process lock while calling psignal and before calling psignal. 2001-03-07 03:37:06 +00:00
Nick Hibma
cf4bfc5243 Change default devfs permissions to the ones in MAKEDEV.
Suggested by:	rwatson
2001-02-19 18:14:49 +00:00
Garrett Wollman
0a2c3d48c6 select() DKI is now in <sys/selinfo.h>. 2001-01-09 04:33:49 +00:00
Nick Hibma
adeb72abfb Finally make the module dependencies work. kern_linker.c now allows
modules to depend on modules in the same file (uhub depends on usb) or
even on themselves (usb on usb, makes the define in usb_port.h a lot
less convoluted).

Use ANSI prototypes.
2000-08-04 19:05:49 +00:00
Nick Hibma
69e1451082 Make the module dependencies actually work.
Specifying 'umass_load="YES"' in /boot/loader.conf or doing a
'kldload umass' now loads usb.ko automagically.

Prodded by:	green
2000-06-15 13:51:30 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Nick Hibma
128aa3af3c Change Lennart's e-mail address. 2000-05-14 16:43:10 +00:00
Nick Hibma
600a4a54cc Use the new and shiny module versioning. This enables you to load the
ums driver (mouse) and get the usb driver at the same time.

This also shows that
	MODULE_VERSION(usb, 1);
	MODULE_DEPEND(usb, usb, 1, 1, 1);
in the same module in one source file works.
2000-05-08 15:10:05 +00:00
Nick Hibma
1a5eec23dc Increase the debugging level on a printf. 2000-05-07 18:38:41 +00:00