Commit Graph

280 Commits

Author SHA1 Message Date
n_hibma
d0fd416b57 Move the warning on wrong IRQ values to the right place, before any
resource allocation is attempted.

It will present the user with a message that he has to switch on USB
support in his BIOS.
2000-02-20 14:22:44 +00:00
n_hibma
e8b624173a 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
8fafd8e769 Add PCI Id's for i810 chipsets.
PR:		16517
Submitted by:	SAKIYAMA Nobuo <sakichan@lares.dti.ne.jp>
Approved by:	jhk
2000-02-07 12:50:33 +00:00
n_hibma
f07fcd07c8 Don't use tsleep when cold booting. It is called before bus->use_polling
is initialised by usb_init.

This might solve problems with some controllers not being initiliased
properly, because a delay was effectively a tsleep that returned
immediately.

Approved by:	jhk
2000-02-06 14:59:00 +00:00
n_hibma
adad9ac78e Disable the generation of SMIs (System Management Interrupts). Always set
the PIRQD bit.

This fixes the problem of uhub0 hanging forever during boot when USB
keyboard support is switched on in the BIOS on motherboards with Intel
chipsets (UHCI).

Approved by:	The Sheep
2000-02-06 14:52:27 +00:00
n_hibma
ffc4c1858f Commit missing bits, forgotten when committing support for suspend/resume
for USB.

Call uhci_power when suspending and resuming.

Approved by: The One.
2000-02-04 10:18:37 +00:00
n_hibma
576210bc48 bus_release_resource is spellt like bus_release_resource not like
bus_delete_resource.

Fixes a problem when the probe succeeded, but the attach failed. The
release of the resources was done inproperly.

Approved by:	jkh
2000-01-31 14:05:21 +00:00
n_hibma
c403f310c9 Get the KASSERT right. 2000-01-29 18:53:42 +00:00
n_hibma
7a76a6d4d2 Fix debugging output. The TDs are linked through the dnext field, not
nexttd.
2000-01-29 18:01:15 +00:00
n_hibma
5b4848a6e2 Remove a warning from LINT 2000-01-29 16:25:55 +00:00
n_hibma
66f371b6b8 Unbreak LINT.
Pointed out by:   Peter Wemm
2000-01-29 15:55:03 +00:00
n_hibma
46a154cb23 First part of the fix for ohci_hash_find_td panic.
Some controllers submit bogus pointers to the Done queue.
ohci_hash_find_td fails to find these in its hash and panics. Instead of
panicing we now assume the whole done queue is lost and let the timeout
code to clean up the mess after us.
2000-01-29 14:53:47 +00:00
n_hibma
c63e4d9590 Add comments and debugging info. 2000-01-29 14:41:48 +00:00
n_hibma
0701def723 The toggle carry bit is stored in the headp not the tailp. 2000-01-29 14:18:31 +00:00
n_hibma
904db0db42 Mask off the last two bits before comparing. It might just be that some
hardware might leave those bits in the wrong state.
2000-01-29 11:59:31 +00:00
n_hibma
720b7903cb Tripmine for bad hardware. 2000-01-29 11:50:44 +00:00
wpaul
e81c093824 Minor tweak: the D-Link 10/100 USB ethernet adapter is apparently using
the same design as the LinkSys adapter and needs the same special handling
to enable its PHY.
2000-01-29 02:16:47 +00:00
n_hibma
76324b32bd Correct the list of error messages. It was incomplete. 2000-01-28 13:05:26 +00:00
n_hibma
f9bed91ed9 Regen. 2000-01-28 10:31:12 +00:00
n_hibma
0ea7dddb88 Correct the entry for the Kodak DC290.
Submitted By:	Oliver Fromme <olli@dorifer.heim3.tu-clausthal.de>
2000-01-28 10:26:29 +00:00
wpaul
10d6a2ddbb Fix a bug in the uhci driver that breaks large bulk IN transfers. The
uhci_check_intr() routine needs to be more careful about deciding when
the end of a transfer has been detected.

This allows me to remove the nasty workaround code from if_aue and if_cue.
Receive performance is now much better for these adapters (500KB/sec
vs. 350KB/sec).

Also removed unused KUE_CUTOFF define from if_kuereg.h.

Submitted by: Lennart Augustsson
Reviewed by: n_hibma
2000-01-28 02:15:31 +00:00
n_hibma
d9cd3d7688 The values for OHCI_HALTED and OHCI_TOGGLECARRY were reversed. 2000-01-28 00:03:45 +00:00
n_hibma
5674e93381 Move the defines to the right location.
Add a DIAGNOSTIC when closing interrupt pipes.

Insert splx(s) which were left out with iso pipes (non-functional yet) and
in a DIAGNOSTIC.
2000-01-27 23:25:58 +00:00
n_hibma
64633582ac Add umass.c 2000-01-27 23:19:14 +00:00
n_hibma
7e6dc45292 Properly teardown the allocated and initialised stuff when an error
occurs (OHCIwas already done for UHCI).

Get rid of the usbus variable. It is confusing.

Align uhci_pci.c and ohci_pci.c again.
2000-01-26 10:52:27 +00:00
n_hibma
64cda4e365 Don't set ivars until we checked the return value from device_add_child. 2000-01-26 10:27:12 +00:00
n_hibma
4a29dd1cc9 Add comments 2000-01-26 08:46:41 +00:00
n_hibma
97f54a6227 Add usbd_clear_endpoint_toggle(pipe) function.
This is needed to implement a asynchronous callback for clear endpoint
stall, needed for the umass driver.
2000-01-25 18:40:39 +00:00
n_hibma
54e504ae5d Correct subroutine names in DPRINTF 2000-01-25 18:37:58 +00:00
n_hibma
5bef12b54e The previous fix for the USB ugen device set configuration ioctl()
has a slight error, and returns EIO way too often.

PR:		16315
Submitted by:  Louis Mamakos <louie@TransSys.COM>
2000-01-24 10:23:57 +00:00
peter
fb5d4fa843 Fix some warnings. 2000-01-23 19:27:11 +00:00
peter
6588369b69 remove "extern int cold" from SPLUSBCHECK - it causes a heap of warnings. 2000-01-23 19:26:16 +00:00
peter
71c7f2956d Fix a warning in DIAGNOSTIC code. 2000-01-23 19:25:29 +00:00
n_hibma
744b2db779 Check whether we can change config at all. If any of the endpoints
has been opened, we should not allow configuration changes as endpoint
descriptors might disappear.

PR:	16256, 16168
2000-01-23 15:48:29 +00:00
n_hibma
46612cf2e7 Zap the vnodes for the control endpoint as well. 2000-01-23 15:42:08 +00:00
n_hibma
154c09625c Add ID for the AMD-756 OHCI controller 2000-01-21 10:46:29 +00:00
n_hibma
ac7818da20 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
c5a17a034f Remove duplicate include 2000-01-20 22:05:30 +00:00
n_hibma
1b6a1333f6 Properly remove interrupts if initialisation fails. 2000-01-20 21:36:07 +00:00
wpaul
b5ac56c339 Fix test for deciding when a bulk IN transfer got truncated. I thought
I fixed this last night, but apparently I only applied the patch to the
copy of the code in /dev/brain0.
2000-01-20 19:57:43 +00:00
yokota
697f77edf9 Do not include `ukbd.h'; it's not used.
Pointed out by: bde
2000-01-20 13:24:28 +00:00
wpaul
9408134d9b Regen. 2000-01-20 07:39:19 +00:00
wpaul
d5c9bbfbf2 More USB ethernet tweaks:
- Sync ohci, uhci and usbdi modules with NetBSD in order to obtain the
  following improvements:
        o New USBD_NO_TSLEEP flag can be used in place of UQ_NO_TSLEEP
          quirk. This allows drivers to specify busy waiting only for
          certain transfers (namely control transfers for reading/writing
          registers and stuff).
        o New USBD_FORCE_SHORT_XFER flag can be used to deal with
          devices like the ADMtek Pegasus that sense the end of bulk OUT
          transfers in a special way (if a transfer is exactly a multiple
          of 64 bytes in size, you need to send an extra empty packet
          to terminate the transfer).
        o usbd_open_pipe_intr() now accepts an interval argument which
          can be used to change the rate at which the interrupt callback
          routine is invoked. Specifying USBD_DEFAULT_INTERVAL uses the
          value specified in the device's config data, but drivers can
          override it if needed.
- Change if_aue to use USBD_FORCE_SHORT_XFER for packet transmissions.
- Change if_aue, if_kue and if_cue to use USBD_NO_TSLEEP for all
  control transfers. We no longer force the non-tsleep hack for
  bulk transfers since these are done asynchronously anyway.
- Removed quirk entry fiddling from if_aue and if_kue since we don't
  need it anymore now that we have the USBD_NO_TSLEEP flag.
- Tweak ulpt, uhid, ums and ukbd drivers to use the new arg to
  usbd_open_pipe_intr().
- Add a flag to the softc struct in the ethernet drivers to indicate
  when a device has been detached, and use this flag to perform
  tests to prevent the drivers from trying to do control transfers
  if this is the case. This is necessary because calling if_detach()
  with INET6 enabled will eventually result in a call to the driver's
  ioctl() routine to delete the multicast groups on the interface,
  which will result in attempts to perform control transfers. (It's
  possible this also happens even without INET6 support enabled.) This
  is pointless since we know that if the detach method has been called,
  the hardware has been unplugged.
- Changed watchdog timeout routines to just call the driver init routines
  to initialize the device states without trying to close and re-open the
  pipes. This is partly because we don't want to frob things at interrupt
  context, but also because this doesn't seem to work right and I don't
  want to panic the system just because a USB device may have stopped
  responding.
- Fix aue_rxeof() to be a little smarter about detecting when a double
  transfer is needed. Unfortunately, the design of the chip makes it hard
  to get this exactly right. Hopefully, this will go away once either
  Nick or Lennart finds the bug in the uhci driver that makes this ugly
  hack necessary.
- Also sync usbdevs with NetBSD.
2000-01-20 07:38:33 +00:00
wpaul
a3e3508a66 Fix a couple of bugs:
- The busy wait hack in usbdi.c was doing its timeout in microseconds
  instead of milliseconds.
- if_aue.c:aue_intr() is creating a bitmask by and'ing two bits when it
  should be or'ing them.

Submitted by:	Lennart Augustsson
2000-01-19 01:01:56 +00:00
wpaul
e2506df725 Change the mechanism by which we detect that the firmware is already
running. It turns out that trying to read the MAC address when there's
no firmware creates a zero length transfer. This apparently doesn't
hurt anything on a UHCI controller, but OHCI controllers generate an
IOERROR, and the device doesn't initialize.

Instead, check the bcdDevice revision code. We know this will be
different when the firmware is running, so if we detect the firmware's
code instead of the bare hardware's code, we skip the firmware load.
2000-01-17 23:14:40 +00:00
wpaul
9a7458c2e6 The correct part number for the CATC ASIC is USB-EL1210A, not
USB-EL1201A or even USB-EL1202A. Wonder what drugs I was on when
I made this mistake, and then propagated it to 6 different files.

*sigh*
2000-01-17 18:49:20 +00:00
wpaul
b28a2a02c5 Remove device name strings from vendor/product lists since we don't use
them (they're read from the device directly). Also do a set_config
command for the ADMtek and CATC drivers.
2000-01-16 22:45:07 +00:00
wpaul
617faab114 Minor enhancement: set the 'dual link LED' bit in the auxmode register
of the Broadcom BCM5201 PHY on the LinkSys USB100TX adapter so that the
link LED correctly (lights up amber for 10mbps link, green for 100mbps
link).

Note that the sticker on the bottom of the adapter says amber for 10
and green for 100, but the appendix in the manual that comes with
the adapter says green for 10 and amber for 100. Given that there doesn't
seem to be any way to make the hardware produce the latter combination,
I think it's safe to say the sticker is right and the manual is wrong.
I'm just shocked, shocked I tell you.
2000-01-15 18:43:07 +00:00
wpaul
39da78bb33 Fix multicast filter programming. 2000-01-14 17:03:00 +00:00
wpaul
f87edded23 Do a few minor cleanups. 2000-01-14 07:08:33 +00:00