Commit Graph

33 Commits

Author SHA1 Message Date
n_hibma
ead87009c8 UMASS_DEBUG implemented panic(9).
PR:		24044
Submitted by:	Mike Bristow <mike@urgle.com>
2001-01-04 11:27:41 +00:00
n_hibma
238804cd26 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
n_hibma
43bf08cdc0 Properly fix world.
Sorry for breaking things in the first place.
2000-07-06 13:23:35 +00:00
n_hibma
db8ea5a2fa Use the packed attribute for the descriptor on the wire 2000-07-05 08:11:43 +00:00
n_hibma
0fcf20a180 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
n_hibma
34b4d74e79 Change Lennart's e-mail address. 2000-05-14 16:43:10 +00:00
n_hibma
78d6764b68 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
n_hibma
e8d2781288 OpenBSD has a broken debugger that does not grok static. Use a
#define Static  static

that the OpenBSD folks can define it to be empty if they like.
2000-04-03 20:58:30 +00:00
n_hibma
99b2c99c19 Get rid of the last remnants of powerhook abuse. 2000-03-18 14:54:54 +00:00
n_hibma
8ae617209b Correctly handle the conversion from virtual to physical addresses. The
problem was basically (for offset > 4096):

	vtophys(addr) + offset != vtophys(addr + offset)

Also, use TD's with a maximum size of 4k instead of 8kb for OHCI
controllers.

This problem occurs in drivers that use large transfer sizes:
umass, host2host and ethernet with jumbo frames.
2000-02-10 18:50:19 +00:00
n_hibma
0bc10786e8 Add support for DEVICE_SUSPEND, DEVICE_RESUME and DEVICE_SHUTDOWN
methods for USB devices.

However: with none of the devices I have here suspend seems to work
properly.  This is probably a bug in uhci_power which I still have to
look at.

Prodded and pushed by:  Christopher Masto <chris@netmonger.net>
2000-01-20 22:24:35 +00:00
n_hibma
92ac5ca18b Correct the last parameter for clalloc 1999-11-28 21:07:11 +00:00
n_hibma
6034fe5118 Addition of new fields to the usb_devinfo struct to enable the new
and shiny usbd daemon to handle events.

usb_port.h:
- Add a macro to retrieve the unit number from a USBBASEDEVICE

usb.h, usb_subr.c:
- Add fields to the device_info struct.

usb_subr.c:
- Fill in the new fields.
- Remove the notification of the event up a bit to make sure all the
  information is still available to fill the usb_devinfo struct.

This requires recompilation of usbdevs (src/usr.sbin/usbdevs) and the
ezdownload/ezupload (ports/misc/ezload) utilities in any case.
1999-11-21 17:30:42 +00:00
n_hibma
7b1ee495db Synchronisation with NetBSD as of 1999/11/16:
Cleaning up the code:
- Declare many functions static
- Change variable names to make them more self explanatory
- Change usbd_request_handle -> usbd_xfer_handle
- Syntactical changes
- Remove some unused code
- Other KNF changes

Interrupt context handling
- Change delay to usbd_delay_ms were possible (takes polling mode into
  account)
- Change detection mechanism for interrupt context

Add support for pre-allocation DMA-able memory by device driver

Add preliminary support for isochronous to the UHCI driver (not for OHCI
yet).

usb.c, uhci.c, ohci.c
- Initial attempt at detachable USB host controllers
- Handle the use_polling flag with a lttle more care and only set it if
we are cold booting.

usb.c, uhci.c ohci.c, usbdi.c usbdi_util.c usb_subr.c
- Make sure an aborted pipe is marked as not running.
- Start queued request in the right order.
- Insert some more DIAGNOSTIC sanity checks.
- Remove (almost) unused definitions USBD_XFER_OUT and USBD_XFER_IN.

usb.c, usb_subr.c
- Add an event mechanism so that a userland process can watch devices
  come and go.

ohci.c
- Handle the case when a USB transfer is so long that it crosses two
  page (4K) boundaries.  OHCI cannot do that with a single TD so we make
  a chain.

ulpt.c
- Use a bigger buffer when transferring data.
- Pre-allocate the DMA buffer.  This makes the driver slightly more
  efficient.
- Comment out the GET_DEVICE_ID code, because for some unknown reason it
  causes printing to fail sometimes.

usb.h
- Add a macro to extract the isoc type.
- Add a macro to check whether the routine has been entered after splusb
  and if not, complain.

usbdi.c
- Fix a glitch in dequeueing and aborting requests on interrupt pipes.
- Add a flag in the request to determine if the data copying is done by
  the driver or the usbdi layer.
1999-11-17 22:33:51 +00:00
n_hibma
3a05f68970 Remove superfluous header file includes
Remove definition of initialiser.

Some clean up.
1999-11-08 21:12:25 +00:00
n_hibma
8e903977d2 Major synchronisation with the NetBSD USB stack:
- Some cleanup and improvements in the uhci and ohci drivers
- Support for plugging and unplugging devices improved
- Now available is bulk transport over OHCI controllers
- Resume and suspend have been temporarily been disabled again.  Proper
  support for it is available in the uhci.c and ohci.c files but I have
  not yet spent the brain cycles to use it.
- OpenBSD now uses the USB stack as well
- Add FreeBSD tags
1999-10-07 19:26:38 +00:00
n_hibma
a7ea15fd80 Remove superfluous semi-colon 1999-06-27 22:24:20 +00:00
n_hibma
b35a2aeca2 Replace usbd_device_set_desc by device_set_desc_copy 1999-06-27 09:42:40 +00:00
n_hibma
633a15109e Change 'device' to 'self', to be more like the rest of the code 1999-06-26 12:55:25 +00:00
dfr
5229d3887a Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
n_hibma
d9618608dd Forgot one.
Original log message:

Remove feature creep: STAILQ_REMOVE_HEAD_UNTIL added it for convenience
but we can do without it.

Obtained from:	Peter Wemm
1999-04-21 12:08:07 +00:00
peter
dc1b9002a0 Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core
1999-04-16 21:22:55 +00:00
n_hibma
248c7f5396 Added macro logprintf 1999-04-07 17:07:07 +00:00
n_hibma
fac5996c0d Fixed bug in disconnect handling in uhub.c 1999-01-22 00:44:31 +00:00
n_hibma
72b25cc2b1 Removal unneccessary definitions 1999-01-14 01:35:12 +00:00
n_hibma
b5541042ef Sync with NetBSD sources. Almost there. Mostly style fixes. 1999-01-10 18:42:54 +00:00
n_hibma
ca1ae944c9 Major synchronisation with NetBSD USB code 1999-01-07 23:07:57 +00:00
n_hibma
a9505ebd25 Added Id to all files 1998-12-14 09:32:25 +00:00
n_hibma
e317edbb36 Added copyright and Id 1998-12-14 09:13:29 +00:00
n_hibma
c660351e14 small oops on previous bug fix, it's late... 1998-12-13 23:53:42 +00:00
n_hibma
2f21dedbde Removed unneeded definition 1998-12-13 23:16:20 +00:00
n_hibma
a7f0130cc8 Various bug fixes:
1) Removed 'emulation' of bitmaps in printfs, FreeBSD seems to have caught
  up on that one
2) Fixed a few bugs in the timeout/timo timeout variables
3) First attempt at fixing a bug mentioned by Kazu: uhci_run is not able
  start/stop his USB host on his motherboard.
1998-12-09 23:36:15 +00:00
n_hibma
2cf279dba5 Initial commit of ported NetBSD USB stack 1998-11-26 23:13:13 +00:00