The NetBSD Project

CVS log for src/sys/dev/usb/usbdi.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / usb

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.253: download - view: text, markup, annotated - select for diffs
Fri Apr 5 18:57:10 2024 UTC (8 months, 1 week ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +4 -2 lines
usb *hci: Always set ux_status before usbd_xfer_schedule_timeout.

Add an assert to usbd_xfer_schedule_timeout to enforce this.

Since access to ux_status is serialized by the bus lock, and nothing
releases the bus lock in the interim, this doesn't make a functional
change.  But it does reduce confusion by readers, who no longer have
to worry if some callers got the order wrong.  It could also now
potentially be factored out in a subsequent commit.

Revision 1.173.2.6: download - view: text, markup, annotated - select for diffs
Tue Mar 12 12:36:17 2024 UTC (9 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE
Diff to: previous 1.173.2.5: preferred, colored; branchpoint 1.173: preferred, colored; next MAIN 1.174: preferred, colored
Changes since revision 1.173.2.5: +28 -8 lines
Pull up following revision(s) (requested by riastradh in ticket #1940):

	sys/dev/usb/usbdi.c: revision 1.248

usbdi(9): Avoid calling ubm_softint with lock held and polling on.

PR kern/57783

Revision 1.182.4.6: download - view: text, markup, annotated - select for diffs
Tue Mar 12 12:34:50 2024 UTC (9 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE
Diff to: previous 1.182.4.5: preferred, colored; branchpoint 1.182: preferred, colored; next MAIN 1.183: preferred, colored
Changes since revision 1.182.4.5: +28 -8 lines
Pull up following revision(s) (requested by riastradh in ticket #1807):

	sys/dev/usb/usbdi.c: revision 1.248

usbdi(9): Avoid calling ubm_softint with lock held and polling on.

PR kern/57783

Revision 1.247.4.1: download - view: text, markup, annotated - select for diffs
Sun Mar 10 18:36:12 2024 UTC (9 months ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-0-RELEASE, netbsd-10-0-RC6
Diff to: previous 1.247: preferred, colored; next MAIN 1.248: preferred, colored
Changes since revision 1.247: +44 -15 lines
Pull up following revision(s) (requested by riastradh in ticket #613):

	sys/dev/usb/usbdi.c: revision 1.248
	sys/dev/usb/usbdi.c: revision 1.249

usbdi(9): Avoid calling ubm_softint with lock held and polling on.
usbdi(9): Avoid taking locks in usbd_transfer while polling.

PR kern/57783

Revision 1.252: download - view: text, markup, annotated - select for diffs
Fri Feb 9 22:08:37 2024 UTC (10 months ago) by andvar
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +3 -3 lines
fix spelling mistakes, mainly in comments and log messages.

Revision 1.251: download - view: text, markup, annotated - select for diffs
Sun Feb 4 05:43:06 2024 UTC (10 months, 1 week ago) by mrg
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +3 -3 lines
update my email address.

Revision 1.250: download - view: text, markup, annotated - select for diffs
Sat Jan 13 18:22:13 2024 UTC (11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +5 -6 lines
usbdi(9): Assert not polling in abort path.

XXX Not sure if this is safe.

Revision 1.249: download - view: text, markup, annotated - select for diffs
Sat Jan 13 12:42:10 2024 UTC (11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +18 -9 lines
usbdi(9): Avoid taking locks in usbd_transfer while polling.

PR kern/57783

XXX pullup-10
XXX pullup-9
XXX pullup-8

Revision 1.248: download - view: text, markup, annotated - select for diffs
Sat Jan 13 12:27:54 2024 UTC (11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +28 -8 lines
usbdi(9): Avoid calling ubm_softint with lock held and polling on.

PR kern/57783

XXX pullup-10
XXX pullup-9
XXX pullup-8

Revision 1.247: download - view: text, markup, annotated - select for diffs
Tue Sep 13 10:32:58 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +79 -6 lines
usbdi(9): Sprinkle usbhist into usb xfer timeout logic.

Revision 1.246: download - view: text, markup, annotated - select for diffs
Tue Sep 13 10:32:41 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +11 -11 lines
usbdi(9): Fix mistake in usbdi.c 1.244.

Need to clear ux_timeout_set only when we finally actually process
the timeout in usbdi_xfer_timeout_task, not in the callout which
schedules the task which asserts that the timeout is still set on
entry.

Must've exported the wrong version of my change from git.

Revision 1.245: download - view: text, markup, annotated - select for diffs
Tue Sep 13 09:47:17 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +5 -5 lines
usbdi(9): Rule out possible race to read xfer->ux_status.

I think this might actually be safe, because when it's synchronous,
the xfer can't be reused except by the caller after usbd_transfer
returns.  But let's make it definitely not wrong instead of maybe
actually safe.

Revision 1.244: download - view: text, markup, annotated - select for diffs
Wed Sep 7 10:41:34 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +11 -2 lines
usbdi(9): Fix timeout after non-racy xfer resubmission.

Previously we would never clear ux_timeout_set if an xfer timedout,
so resubmission of the same xfer later would fail to schedule a
callout.

Revision 1.243: download - view: text, markup, annotated - select for diffs
Sat Aug 20 11:32:20 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +2 -33 lines
usbdi(9): Nix resurrected usbd_request_async.

We killed this back in 2013, but it came back from the dead on a
driver imported from OpenBSD.

Revision 1.242: download - view: text, markup, annotated - select for diffs
Wed Apr 6 22:01:45 2022 UTC (2 years, 8 months ago) by mlelstv
Branches: MAIN
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +1 -5 lines
revert accidental last commit (except ukbd.c)

Revision 1.241: download - view: text, markup, annotated - select for diffs
Wed Apr 6 21:51:29 2022 UTC (2 years, 8 months ago) by mlelstv
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +7 -3 lines
remove debug printf

Revision 1.240: download - view: text, markup, annotated - select for diffs
Sun Mar 20 00:40:52 2022 UTC (2 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +15 -2 lines
usbdi(9): Make sure aborting a pipe waits for all callbacks.

There may be a callback in flight from an xfer that has already been
taken off the queue by the time usbd_ar_pipe gets to it.  We must
guarantee that even that callback has completed before returning
control to the caller.

Revision 1.239: download - view: text, markup, annotated - select for diffs
Sat Mar 19 10:05:52 2022 UTC (2 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +16 -8 lines
usbdi(9): Fix usbd_get_no_alts.

This incorrectly rejected the configuration as invalid if any
descriptor is not large enough to be interface descriptors.

Instead, it should reject the configuration only if any descriptor is
not large enough to be a _descriptor_, or if any interface-type
descriptor is not large enough to be an interface descriptor, but
skip over descriptors of other types even if they're smaller than
interface descriptors.

Candidate fix for PR kern/56762.

Revision 1.238: download - view: text, markup, annotated - select for diffs
Sun Mar 13 13:07:39 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +3 -3 lines
usbdi(9): Fix paste-o in previous change to usbd_ar_pipe.

Revision 1.237: download - view: text, markup, annotated - select for diffs
Sun Mar 13 11:30:13 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +6 -5 lines
usb: Parse descriptors a little more robustly.

- Avoid reading past the end in the event of bogus bLength.
- Avoid arithmetic overflow by rearranging inequalities.

Reported-by: syzbot+511227c050a2f164e34c@syzkaller.appspotmail.com

Revision 1.236: download - view: text, markup, annotated - select for diffs
Sun Mar 13 11:29:01 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +7 -3 lines
usb: Clarify contract of usbd_xfer_trycomplete.

No functional change.  This rule has always been in place since
usbd_xfer_trycomplete was created, just wasn't clearly articulated
anywhere.

Revision 1.235: download - view: text, markup, annotated - select for diffs
Sun Mar 13 11:28:42 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +18 -2 lines
usbdi(9): Assert no concurrent aborts on a single pipe.

It is a driver bug to try to abort a pipe at the same time in two
different threads.

HCI drivers may release the bus lock to sleep in upm_abort while
waiting for the hardware to acknowledge an abort, so it won't try to,
e.g., scribble over a DMA buffer in the xfer that we've recycled
after usbd_abort_pipe returns.

If this happens, a concurrent usbd_abort_pipe might try to apply
upm_abort to the same xfer, which HCI drivers are not prepared for
and may wreak havoc.

To avoid this, allow only one usbd_abort_pipe in flight at any given
time.

Revision 1.234: download - view: text, markup, annotated - select for diffs
Sun Mar 13 11:28:33 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +3 -2 lines
usbdi(9): Assert sleepable in usbd_ar_pipe.

Caller of usbd_suspend_pipe or usbd_abort_pipe must be prepared to
sleep for hardware to acknowledge abort and for in-flight callback on
another CPU to complete.  Let's catch the mistake early of calling
them in non-sleepable contexts where they might get lucky.

Revision 1.233: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:13:23 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +28 -3 lines
usbdi(9): dtrace probes for USB control requests.

Revision 1.232: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:12:49 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +4 -4 lines
usb: Assert hci doesn't synchronously complete async xfers.

The xfer callback must not be invoked synchronously, because it might
need to take a lock that the caller holds.

However, the hci might return failure to the caller, meaning the xfer
callback will not be invoked at all.

Revision 1.231: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:12:11 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +4 -7 lines
usb: Hold pipe lock across upm_transfer and upm_start.

This simplifies the code and fixes races with abort.  Access to the
pipe's queue is now done exclusively while the pipe is locked.

Revision 1.230: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:09:57 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +16 -10 lines
usb: In usbd_transfer, test whether aborting under the lock.

Otherwise this test is racy and can cause the bad state of a pipe
with a transfer that will never be completed in a pipe that's about
to close under the expectation that the pipe is empty.

Revision 1.229: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:09:44 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +12 -35 lines
usb: Inline usb_insert_transfer.

This makes it clearer which part happens irrespective of error
(putting it on the queue -- unconditional, not rolled back by
usb_insert_transfer) and what the possible `errors' mean (neither of
which is an error, per se).

Revision 1.228: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:09:33 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +19 -4 lines
usbdi(9): New usbd_suspend_pipe, usbd_resume_pipe.

- New usbd_suspend_pipe to persistently stop transfers on a pipe and
  cancel pending ones or wait for their callbacks to finish.
  Idempotent.

- New usbd_resume_pipe to allow transfers again.  Idempotent, but no
  new xfers may be submitted before repeating this.

  This way it is safe to usbd_abort_pipe in two threads concurrently,
  e.g. if one thread is closing a device while another is revoking it
  -- but the threads have to agree on when it is done being aborted
  before starting to use it again.

- Existing usbd_abort_pipe now does suspend then resume.  No change
  in semantics so drivers that relied on being able to submit
  transfers again won't be broken any worse than the already are
  broken.

This allows drivers to avoid races such as:

	/* read */
	if (sc->sc_dying)
		return ENXIO;
	/* (*) */
	err = usbd_bulk_transfer(...);

	/* detach or or close */
	sc->sc_dying = true;
	usbd_abort_pipe(...);
	wait_for_io_to_drain(...);

The detach or close logic might happen at the same time as (*), with
no way to stop the bulk transfer before it starts, leading to
deadlock when detach/close waits for I/O operations like read to
drain.  Instead, the close routine can use usbd_suspend_pipe, and the
usbd_bulk_transfer is guaranteed to fail.

But some drivers such as ucom(4) don't close and reopen pipes after
aborting them -- they open on attach and close on detach, and just
abort when the /dev node is closed, expecting that xfers will
continue to work when next opened.  These drivers can instead use
usbd_suspend_pipe on close and usbd_resume_pipe on open.  Perhaps it
would be better to make them open pipes on open and close pipes on
close, but these functions make for a less intrusive transition.

Revision 1.227: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:08:50 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +10 -6 lines
usb: Factor usb_transfer_complete out of ubm_abortx method.

Revision 1.226: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:07:11 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +4 -5 lines
usb: usbd_free_xfer never fails.  Make it return void.

Revision 1.225: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:06:52 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +3 -5 lines
usb: usbd_close_pipe never fails.  Make it return void.

Prune dead branches as a result of this change.

Revision 1.224: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:05:38 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +8 -11 lines
usb: usbd_abort_pipe never fails.  Make it return void.

Prune dead branches as a result of this change.

Revision 1.223: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:04:31 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +12 -4 lines
usb: Factor usb_insert_transfer out of upm_transfer and make private.

Almost every upm_transfer function starts with:

	mutex_enter(&sc->sc_lock);
	err = usb_insert_transfer(xfer);
	mutex_exit(&sc->sc_lock);
	if (err)
		return err;

Some of them have debug messages sprinkled in here too, or assert
that err == USBD_NORMAL_COMPLETION (alternative is USBD_IN_PROGRESS,
only for pipes with up_running or up_serialise, presumably not
applicable for these types of pipes).  Some of them also assert
xfer->ux_status == USBD_NOT_STARTED, which is guaranteed on entry and
preserved by usb_insert_transer.

Exceptions:

- arch/mips/adm5120/dev/ahci.c ahci_device_isoc_transfer just returns
  USBD_NORMAL_COMPLETION, but I'm pretty sure this is and always has
  been broken anyway, so won't make anything worse (if anything, might
  make it better...)

- external/bsd/dwc2/dwc2.c dwc2_device_bulk_transfer and
  dwc2_device_isoc_transfer _also_ issue dwc2_device_start(xfer)
  under the lock.  This is probably a better way to do it, but let's
  do it uniformly across all HCIs at once.

- rump/dev/lib/libugenhc/ugenhc.c rumpusb_device_bulk_transfer
  sometimes returns USBD_IN_PROGRESS _without_ queueing the transfer,
  in the !rump_threads case.  Not really sure how this is supposed to
  work...  If it actually breaks anything, we can figure it out.

Revision 1.222: download - view: text, markup, annotated - select for diffs
Thu Jan 20 03:14:03 2022 UTC (2 years, 10 months ago) by mrg
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +2 -4 lines
don't 'extern' some other .c file's data, espcially when it's
already in usbhist.h.

Revision 1.221: download - view: text, markup, annotated - select for diffs
Fri Dec 31 12:00:18 2021 UTC (2 years, 11 months ago) by skrll
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +3 -3 lines
usbd_do_request_len (and friends) return usbd_status so return one in
the usbd_create_xfer failure case.  Spotted by Riastradh.

Revision 1.220: download - view: text, markup, annotated - select for diffs
Tue Dec 21 09:51:22 2021 UTC (2 years, 11 months ago) by skrll
Branches: MAIN
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +4 -4 lines
Change the usb_mem API to take a bus_dma_tag_t in usb_allocmem instead of
a struct usbd_bus *.

This allows an HCD to use more than one tag.

Revision 1.219: download - view: text, markup, annotated - select for diffs
Tue Sep 7 10:44:18 2021 UTC (3 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +15 -2 lines
usb(4): Fix xfer race between software abort and hardware completion.

This fixes a bug in the API contract of usbd_abort_pipe: with the
change, the caller is guaranteed the xfer completion callbacks have
returned; without the change, completion callbacks could still be
running on the queued xfers while the caller of usbd_abort_pipe
proceeds to concurrently issue usbd_destroy_xfer.

This also fixes the following problem for interrupt pipes, whose
xfers stay on the queue until the pipe is aborted:

Thread 1: Hardware completion interrupt calls usb_transfer_complete.
Thread 1: pipe->up_repeat is 1, so usb_transfer_complete keeps xfer
  queued.
Thread 2: Calls usbd_abort_pipe (e.g., in detach).
Thread 2: usbd_abort_pipe waits for bus lock.
Thread 1: usb_transfer_complete releases bus lock to invoke callback.
Thread 2: Sets pipe->up_repeat := 0 (too late for thread 1 to see).
Thread 1: usb_transfer_complete waits to reacquire bus lock before
  resetting xfer status to USBD_NOT_STARTED.
Thread 2: Repeatdly calls upm_abort on the same xfer, which does
  nothing because upm_abort just does usbd_abort_xfer which does
  nothing because the xfer status is (e.g.) USBD_IOERROR and not
  USBD_IN_PROGRESS.

Thread 2 is now spinning forever with the bus lock held (and possibly
the kernel lock) waiting for queue or xfer status to change, which
will never happen as long as it holds the bus lock.

The resolution is for thread 2 to notice that thread 1 is busy
invoking a callback, and to wait until thread 1 has finished invoking
the callback and updated the xfer status to reset it to
USBD_NOT_STARTED at which point thread 1 can make progress again.

XXX pullup-9

Revision 1.204.6.1: download - view: text, markup, annotated - select for diffs
Thu Jun 17 04:46:31 2021 UTC (3 years, 5 months ago) by thorpej
Branches: thorpej-i2c-spi-conf
Diff to: previous 1.204: preferred, colored; next MAIN 1.205: preferred, colored
Changes since revision 1.204: +61 -46 lines
Sync w/ HEAD.

Revision 1.218: download - view: text, markup, annotated - select for diffs
Wed Jun 16 13:20:49 2021 UTC (3 years, 5 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +3 -3 lines
usb(4): Fix uninitialized variable for error branch.

Revision 1.217: download - view: text, markup, annotated - select for diffs
Mon Jun 14 15:35:34 2021 UTC (3 years, 6 months ago) by mlelstv
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +3 -3 lines
appease gcc9

Revision 1.216: download - view: text, markup, annotated - select for diffs
Sun Jun 13 00:13:24 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +46 -19 lines
usb(4): Tighten interface locking and pipe references.

- Just use a reference count, not a list of pipes.

- Take the reference in usbd_open_pipe*, before we even look up the
  endpoint by address; the endpoint is not stable until we hold the
  interface and prevent usbd_set_interface.

- Make opening pipes just fail if usbd_set_interface is in progress.
  => No need to block -- might block for a while, and this is
     essentially a driver error rather than a legitimate reason to
     block.
  => This should maybe be a kassert, but it's not clear that ugen(4)
     doesn't have a user-triggerable path to that kassert, so let's
     keep it as a graceful failure for now until someone can audit
     ugen(4) and make an informed decision.

- No need for a separate interface pipe lock; just use the bus lock.

This is a little bit longer than before, but makes the bracketed
nature of the references a little clearer and introduces more
kasserts to detect mistakes with internal API usage.

Revision 1.215: download - view: text, markup, annotated - select for diffs
Sat Jun 12 15:49:45 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +4 -4 lines
usb(4): Nix unused struct usbd_interface::ui_priv.

Revision 1.214: download - view: text, markup, annotated - select for diffs
Sat Jun 12 15:41:22 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +3 -16 lines
usb(4): Make usbd_fill_iface_data atomic.

Now either it replaces and frees the old endpoints array, or it
leaves everything in place; it never leaves a partial update nor
requires the caller to free the old array.

Revision 1.213: download - view: text, markup, annotated - select for diffs
Sat Jun 12 15:40:07 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +4 -7 lines
usb(4): Tweak style in usbd_close_pipe.

No functional change intended.

Revision 1.212: download - view: text, markup, annotated - select for diffs
Sat Jun 12 15:39:57 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +7 -5 lines
usb(4): Merge logic in usbd_kill_pipe and usbd_close_pipe.

usbd_kill_pipe is now just usbd_abort/close_pipe.

No functional change intended.

Revision 1.211: download - view: text, markup, annotated - select for diffs
Sat Jun 12 15:39:46 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +4 -7 lines
usb(4): Fix fix for interface change pipe fix.

If there is an interface:
- Always put the pipe on the list in usbd_setup_pipe (if successful).
- Always have the pipe on the list from _before_ upm_open.
- Always keep the pipe on the list to _after_ upm_close, and after
  the async task has completed.

This brings the logic in usbd_close_pipe and usbd_kill_pipe closer.

Revision 1.210: download - view: text, markup, annotated - select for diffs
Sat Jun 12 15:09:18 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +5 -9 lines
Revert "usb(4): Fix mistake in previous fix for pipe/interface-change races."

Little too fast on the commit trigger there before testing, oops.
We don't have the pipe yet until usbd_setup_pipe_flags returns!

Revision 1.209: download - view: text, markup, annotated - select for diffs
Sat Jun 12 14:57:53 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +9 -5 lines
usb(4): Fix mistake in previous fix for pipe/interface-change races.

Must block interface changes _before_ we enter usbd_setup_pipe_flags,
which calls the bus pipe open method.

Revision 1.208: download - view: text, markup, annotated - select for diffs
Sat Jun 12 14:43:27 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +17 -8 lines
usb(4): Fix races between usbd_open_pipe* and usbd_set_interface.

Revision 1.207: download - view: text, markup, annotated - select for diffs
Sat Jun 12 13:58:05 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +3 -5 lines
usb(4): Fix racy endpoint reference counting.

Rules:

1. After usbd_setup_pipe*, must usbd_kill_pipe.
2. After usbd_open_pipe*, must usbd_close_pipe.

Still haven't merged the logic in usbd_kill_pipe and usbd_close_pipe,
but getting closer.

Revision 1.206: download - view: text, markup, annotated - select for diffs
Sat Jun 12 13:57:51 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +4 -8 lines
usb(4): Omit needless lock/unlock cycle in usbd_pipe_close.

pipe->up_intrxfer is stable after construction, so no need to hold
the lock to check it.

Revision 1.205: download - view: text, markup, annotated - select for diffs
Sat Jun 12 13:57:40 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +4 -2 lines
usb(4): Cancel and wait for async task on closing pipe.

XXX usbd_kill_pipe and usbd_close_pipe should not be copypasta; there
should be only one instance of this logic.

Revision 1.204: download - view: text, markup, annotated - select for diffs
Wed Aug 19 02:19:07 2020 UTC (4 years, 3 months ago) by msaitoh
Branches: MAIN
CVS tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +3 -3 lines
s/ be be / be /

Revision 1.182.4.5: download - view: text, markup, annotated - select for diffs
Sat Jul 18 15:09:28 2020 UTC (4 years, 4 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Diff to: previous 1.182.4.4: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.4.4: +8 -2 lines
Pull up following revision(s) (requested by mrg in ticket #1020):

	sys/dev/usb/usbdi.c: revision 1.203

for both usbd_transfer() and usbd_ar_pipe() be sure to reset the
xfer ux_state to XFER_BUSY when removing from the queue.
seems to fix an occasional panic i was seeing on pinebook and
pinebookpro lately with axen(4).

from riastradh@.

XXX: pullup-9.

Revision 1.203: download - view: text, markup, annotated - select for diffs
Mon Jul 13 05:43:38 2020 UTC (4 years, 5 months ago) by mrg
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +8 -2 lines
for both usbd_transfer() and usbd_ar_pipe() be sure to reset the
xfer ux_state to XFER_BUSY when removing from the queue.

seems to fix an occasional panic i was seeing on pinebook and
pinebookpro lately with axen(4).

from riastradh@.

XXX: pullup-9.

Revision 1.202: download - view: text, markup, annotated - select for diffs
Tue May 19 18:32:35 2020 UTC (4 years, 6 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +4 -4 lines
Use usbd_destroy_xfer() in usbd_request_async() instead of usbd_free_xfer().

The only user of usbd_request_async() & co. does a usbd_create_xfer(), so use
the correct deconstructor.

Revision 1.201: download - view: text, markup, annotated - select for diffs
Fri May 15 06:15:42 2020 UTC (4 years, 7 months ago) by skrll
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +5 -2 lines
Update ux_length in usbd_setup_isoc_xfer and use this to usb_syncmem
in the HCDs

Revision 1.175.4.2: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:04:51 2020 UTC (4 years, 8 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.175.4.1: preferred, colored; branchpoint 1.175: preferred, colored; next MAIN 1.176: preferred, colored
Changes since revision 1.175.4.1: +549 -112 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.200: download - view: text, markup, annotated - select for diffs
Sun Apr 5 20:59:38 2020 UTC (4 years, 8 months ago) by skrll
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +4 -3 lines
Switch USB to use non-coherent buffers for data transfers in the
same way as OpenBSD.

The use of coherent (uncacheable on ARM and other arches) mappings
for transfer buffers impacts performance, espcially where memcpys
are involved.

Audit the necessary usb_syncmem operations - a few were missing.

Revision 1.182.4.4: download - view: text, markup, annotated - select for diffs
Fri Apr 3 12:27:55 2020 UTC (4 years, 8 months ago) by martin
Branches: netbsd-9
Diff to: previous 1.182.4.3: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.4.3: +7 -8 lines
Pull up following revision(s) (requested by skrll in ticket #819):

	sys/dev/usb/usbdi.c: revision 1.199

Avoid crashes if we fail to allocate a transfer buffer and avoid an
unnecessary usbd_free_buffer before usbd_free_xfer

Worked out by Riastradh

Revision 1.199: download - view: text, markup, annotated - select for diffs
Fri Apr 3 06:05:00 2020 UTC (4 years, 8 months ago) by skrll
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +7 -8 lines
Avoid crashes if we fail to allocate a transfer buffer and avoid an
unnecessary usbd_free_buffer before usbd_free_xfer

Worked out by Riastradh

Revision 1.198: download - view: text, markup, annotated - select for diffs
Sat Mar 14 02:35:33 2020 UTC (4 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +5 -5 lines
revert the 0x% -> %# change for fixed width formats pointed out by uwe.

Revision 1.197: download - view: text, markup, annotated - select for diffs
Sat Mar 14 02:22:16 2020 UTC (4 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +3 -3 lines
more changes from sc.dying in PR/55068

Revision 1.196: download - view: text, markup, annotated - select for diffs
Fri Mar 13 18:17:41 2020 UTC (4 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +10 -10 lines
PR/55068: sc.dying: Fix printf formats:
- no %s/%p for kernel log
- 0x% -> %#
- always %j for kernel log

Revision 1.182.4.3: download - view: text, markup, annotated - select for diffs
Sun Mar 1 12:35:16 2020 UTC (4 years, 9 months ago) by martin
Branches: netbsd-9
Diff to: previous 1.182.4.2: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.4.2: +396 -8 lines
Pull up following revision(s) (requested by riastradh in ticket #744):

	sys/dev/usb/uhci.c: revision 1.292
	sys/dev/usb/uhci.c: revision 1.293
	sys/dev/usb/usbdi.h: revision 1.99
	sys/dev/usb/motg.c: revision 1.26
	sys/dev/usb/motg.c: revision 1.27
	sys/dev/usb/motg.c: revision 1.28
	sys/dev/usb/motg.c: revision 1.29
	sys/external/bsd/dwc2/dwc2.c: revision 1.70
	sys/external/bsd/dwc2/dwc2.c: revision 1.71
	sys/dev/usb/usb.c: revision 1.181
	sys/arch/mips/adm5120/dev/ahci.c: revision 1.20
	sys/dev/usb/usb.c: revision 1.182
	sys/dev/usb/xhci.c: revision 1.116
	sys/dev/usb/xhci.c: revision 1.117
	sys/dev/usb/xhci.c: revision 1.118
	sys/dev/usb/uhci.c: revision 1.289
	sys/dev/usb/usbdivar.h: revision 1.121
	sys/dev/usb/usbdi.c: revision 1.190
	sys/dev/usb/usbdivar.h: revision 1.122
	sys/dev/usb/usbdi.c: revision 1.191
	sys/dev/usb/usbdi.c: revision 1.192
	sys/external/bsd/dwc2/dwc2var.h: revision 1.7
	sys/dev/usb/motg.c: revision 1.30
	sys/dev/usb/motg.c: revision 1.31
	sys/dev/usb/motg.c: revision 1.32
	sys/dev/usb/motg.c: revision 1.33
	sys/external/bsd/dwc2/dwc2.c: revision 1.67
	sys/external/bsd/dwc2/dwc2.c: revision 1.68
	sys/dev/usb/ehci.c: revision 1.270
	sys/external/bsd/dwc2/dwc2.c: revision 1.69
	sys/dev/usb/usbdi.h: revision 1.100
	sys/dev/usb/ehci.c: revision 1.271
	sys/arch/mips/adm5120/dev/ahci.c: revision 1.18
	sys/dev/usb/usbdi.h: revision 1.101
	sys/dev/usb/ehci.c: revision 1.272
	sys/dev/ic/sl811hs.c: revision 1.103
	sys/arch/mips/adm5120/dev/ahci.c: revision 1.19
	sys/dev/usb/ehci.c: revision 1.273
	sys/dev/usb/ohci.c: revision 1.293
	sys/dev/usb/uhci.c: revision 1.290
	sys/dev/usb/ohci.c: revision 1.294
	sys/dev/usb/uhci.c: revision 1.291
	sys/dev/usb/ohci.c: revision 1.295

Teach usb_rem_task to return whether removed from queue or not.

New function usb_task_pending for diagnostic assertions.
Usable only for negative diagnostic assertions:

        KASSERT(!usb_task_pending(dev, task))

If you can think of a better name for this than !usb_task_pending,
I'm all ears.

 -

Nothing guarantees xfer's timeout has completed.

Wait for it when we free the xfer.

 -


New xfer state variables ux_timeout_set and ux_timeout_reset.

These are needed because:
- The host controller interrupt cannot wait for the callout or task
  to finish running.
- Nothing in the USBD API as is waits for the callout or task to
  finish running.
- Callers expect to be able to resubmit USB xfers from xfer callbacks
  without waiting for anything to finish running.

The variable ux_timeout_set can be used by a host controller to
decide on submission whether to schedule the callout or to ask an
already-scheduled callout or already-queued task to reschedule the
callout, by setting the variable ux_timeout_reset to true.

When the callout or task runs and sees that ux_timeout_reset is true,
rather than queue the task or abort the xfer, it can instead just
schedule the callout anew.

 -

Fix steady state of timeouts in ehci.

This is complicated because:
1. There are three ways that an xfer can be completed:
   (a) hardware interrupt completes xfer
   (b) software decision aborts xfer with USBD_CANCELLED
   (c) timeout aborts xfer with USBD_TIMEOUT
2. The timeout abort can't be done in callout because ehci_sync_hc,
   called unconditionally by ehci_abort_xfer to wait until the device
   has finished using any references to the xfer, may sleep.  So we
   have to schedule a callout that, when run, will schedule a usb_task.
3. The hardware completion interrupt can't sleep waiting for a callout
   or task to finish -- can't use callout_halt or usb_rem_task_wait.
   So the callout and usb_task must be able to run _after_ the hardware
   completion interrupt, and recognize that they're late to the party.
   (Note, though, that usbd_free_xfer does wait for the callout and
   task to complete, so there's no danger they may use themselves after
   free.)
4. The xfer may resubmitted -- and the timeout may be rescheduled --
   immediately after the hardware completion interrupt, _while_ the
   callout and/or usb_task may still be scheduled.  Specifically, we
   may have the following sequence of events:
   (a) hardware completion interrupt
   (b) callout or usb_task fires
   (c) driver resubmits xfer
   (d) callout or usb_task acquires lock and looks around dazed and
       bewildered at the firehose of events like reading the news in 2019

The mechanism for sorting this out is that we have two bits of state:
- xfer->ux_timeout_set informs the driver, when submitting an xfer and
  setting up its timeout, whether either the callout or usb_task is
  already scheduled or not.
- xfer->ux_timeout_reset informs the callout or usb_task whether it
  should reschedule the callout, because the xfer got resubmitted, or
  not.

 -

Factor out HCI-independent xfer completion logic.

New API for HCI drivers to synchronize hardware completion
interrupts, synchronous aborts, and asynchronous timeouts:
- When submitting an xfer to hardware, call
  usbd_xfer_schedule_timeout(xfer).
- On HCI completion interrupt for xfer completion:
        if (!usbd_xfer_trycomplete(xfer))
                return;         /* timed out or aborted, ignore it */
- In upm_abort methods, call usbd_xfer_abort(xfer).

For HCI drivers that use this API (not needed in drivers that don't,
or for xfers like root intr xfers that don't use it):
- New ubm_abortx method serves role of former *hci_abort_xfer, but
  without any logic for wrangling timeouts/callouts/tasks -- caller
  in usbd_xfer_abort has already handled them.
- New ubm_dying method, returns true if the device is in the process
  of detaching, used by the timeout logic.

Converted and tested:
- ehci
- ohci

Converted and compile-tested:
- ahci (XXX did this ever work?)
- dwc2
- motg (XXX missing usbd_xfer_schedule_timeout in motg_*_start?)
- uhci
- xhci

Not changed:
- slhci (sys/dev/ic/sl811hs.c) -- doesn't use a separate per-xfer
  callout for timeouts (XXX but maybe should?)
- ugenhc (sys/rump/dev/lib/libugenhc/ugenhc.c) -- doesn't manage its
  own transfer timeouts

 -

Fix steady state of root intr xfers.

Why?
- Avoid completing a root intr xfer multiple times in races.
- Avoid potential use-after-free in poll_hub callouts (uhci, ahci).

How?
- Use sc->sc_intr_xfer or equivalent to store only a pending xfer
  that has not yet completed -- whether successfully, by timeout, or
  by synchronous abort.  When any of those happens, set it to null
  under the lock, so the xfer is completed only once.
- For hci drivers that use a callout to poll the root hub (uhci, ahci):
  . Pass the softc pointer, not the xfer, to the callout, so the
    callout is not even tempted to use xfer after free -- if the
    callout fires, but the xfer is synchronously aborted before the
    callout can do anything, the xfer might be freed by the time the
    callout starts to examine it.
  . Teach the callout to do nothing if it is callout_pending after it
    has fired.  This way:
    1. completion or synchronous abort can just callout_stop
    2. start can just callout_schedule
    If the callout had already fired before (1), and doesn't acquire
    the bus lock until after (2), it may be tempted to abort the new
    root intr xfer just after submission, which would be wrong -- so
    instead we just have the callout do nothing if it notices it has
    been rescheduled, since it will fire again after the appropriate
    time has elapsed.

 -

Initialize xfer->ux_status in uhci_root_intr_start.

Otherwise, it will be USBD_NOT_STARTED, so usbd_ar_pipe will skip
calling upm_abort.
Candidate fix for PR kern/54963, same problem as reported at:
href="https://mail-index.NetBSD.org/current-users/2020/02/13/msg037740.html

 -

Set ux_isdone in uhci_poll_hub for DIAGNOSTIC.

 -

Fix mistakes in previous sloppy change with root intr xfers.
- Make sure ux_status is set to USBD_IN_PROGRESS when started.
  Otherwise, if it is still in flight when we abort the pipe,
  usbd_ar_pipe will skip calling upm_abort.
- Initialize ux_status under the lock; in principle a completion
  interrupt (or a delay) could race with the initialization.
- KASSERT that the xfer is in progress when we're about to complete
  it.

Candidate fix for PR kern/54963 for other HCI drivers than uhci.
ok nick
ok phone
(This is the change that nick evidently MEANT to ok when he ok'd the
previous one!)

 -

Fix build

 -

Fix non-DIAGNOSTIC builds.

 -

Fix wrong KASSERT in motg abort.
This has been wrong since last summer when we did the transition to
xfer->ux_status = USBD_CANCELLED earlier.
XXX pullup-9

 -

Fix mistakes in timeout/abort/completion changes in motg(4).
- Call usbd_xfer_schedule_timeout so we actually do time out.
- Don't call usbd_xfer_trycomplete until all the data have been
  transferred -- it commits to completion, not timeout.
- Use xfer->ux_status != USBD_IN_PROGRESS to test whether, after a
  partial write, an xfer has been interrupted or timed out and need
  not be continued.
- Remove wrong assertion.

 -

Fix mistake in use of usbd_xfer_schedule_timeout in motg.

This code path is used both for xfers that are new, and xfers that
are being done piece by piece and are partway done.  For the latter
case, skip usbd_xfer_schedule_timeout so we schedule it only once per
xfer.

 -

Simplify some branches and kassert some redundant assignments.

Revision 1.186.2.1: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:19:17 2020 UTC (4 years, 9 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.186: preferred, colored; next MAIN 1.187: preferred, colored
Changes since revision 1.186: +487 -58 lines
Sync with head.

Revision 1.182.4.2: download - view: text, markup, annotated - select for diffs
Thu Feb 20 14:53:09 2020 UTC (4 years, 9 months ago) by martin
Branches: netbsd-9
Diff to: previous 1.182.4.1: preferred, colored; branchpoint 1.182: preferred, colored
Changes since revision 1.182.4.1: +3 -2 lines
Pull up following revision(s) (requested by riastradh in ticket #716):

	sys/dev/usb/usbdi.c: revision 1.194

When aborting a pipe, set pipe->up_running = 0.

This prevents any concurrent usb_transfer_complete from restarting
the pipe with usbd_start_next.

Revision 1.195: download - view: text, markup, annotated - select for diffs
Wed Feb 19 16:07:37 2020 UTC (4 years, 9 months ago) by riastradh
Branches: MAIN
CVS tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +88 -5 lines
usbdi dtrace probes

Revision 1.194: download - view: text, markup, annotated - select for diffs
Mon Feb 17 08:16:44 2020 UTC (4 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +3 -2 lines
When aborting a pipe, set pipe->up_running = 0.

This prevents any concurrent usb_transfer_complete from restarting
the pipe with usbd_start_next.

Revision 1.193: download - view: text, markup, annotated - select for diffs
Sun Feb 16 09:40:35 2020 UTC (4 years, 9 months ago) by maxv
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +2 -76 lines
Move usb_desc_* into usbdi_util.c, no functional change.

Revision 1.192: download - view: text, markup, annotated - select for diffs
Wed Feb 12 16:01:00 2020 UTC (4 years, 10 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +387 -2 lines
Factor out HCI-independent xfer completion logic.

New API for HCI drivers to synchronize hardware completion
interrupts, synchronous aborts, and asynchronous timeouts:

- When submitting an xfer to hardware, call
  usbd_xfer_schedule_timeout(xfer).

- On HCI completion interrupt for xfer completion:

	if (!usbd_xfer_trycomplete(xfer))
		return;		/* timed out or aborted, ignore it */

- In upm_abort methods, call usbd_xfer_abort(xfer).

For HCI drivers that use this API (not needed in drivers that don't,
or for xfers like root intr xfers that don't use it):

- New ubm_abortx method serves role of former *hci_abort_xfer, but
  without any logic for wrangling timeouts/callouts/tasks -- caller
  in usbd_xfer_abort has already handled them.

- New ubm_dying method, returns true if the device is in the process
  of detaching, used by the timeout logic.

Converted and tested:
- ehci
- ohci

Converted and compile-tested:
- ahci (XXX did this ever work?)
- dwc2
- motg (XXX missing usbd_xfer_schedule_timeout in motg_*_start?)
- uhci
- xhci

Not changed:

- slhci (sys/dev/ic/sl811hs.c) -- doesn't use a separate per-xfer
  callout for timeouts (XXX but maybe should?)

- ugenhc (sys/rump/dev/lib/libugenhc/ugenhc.c) -- doesn't manage its
  own transfer timeouts

- vhci -- times transfers out only on detach; could be adapted easily
  if we wanted to use the xfer->ux_callout

Revision 1.191: download - view: text, markup, annotated - select for diffs
Wed Feb 12 16:00:17 2020 UTC (4 years, 10 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +3 -2 lines
New xfer state variables ux_timeout_set and ux_timeout_reset.

These are needed because:

- The host controller interrupt cannot wait for the callout or task
  to finish running.

- Nothing in the USBD API as is waits for the callout or task to
  finish running.

- Callers expect to be able to resubmit USB xfers from xfer callbacks
  without waiting for anything to finish running.

The variable ux_timeout_set can be used by a host controller to
decide on submission whether to schedule the callout or to ask an
already-scheduled callout or already-queued task to reschedule the
callout, by setting the variable ux_timeout_reset to true.

When the callout or task runs and sees that ux_timeout_reset is true,
rather than queue the task or abort the xfer, it can instead just
schedule the callout anew.

Revision 1.190: download - view: text, markup, annotated - select for diffs
Wed Feb 12 15:59:59 2020 UTC (4 years, 10 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +10 -8 lines
Nothing guarantees xfer's timeout has completed.

Wait for it when we free the xfer.

Revision 1.189: download - view: text, markup, annotated - select for diffs
Sat Feb 8 07:57:16 2020 UTC (4 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +7 -20 lines
Dedup usb_desc_iter_next with usb_desc_iter_peek.

Revision 1.188: download - view: text, markup, annotated - select for diffs
Sat Feb 8 07:53:23 2020 UTC (4 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +6 -16 lines
Introduce usbd_clear_endpoint_feature(), and dedup.

Revision 1.187: download - view: text, markup, annotated - select for diffs
Sat Feb 8 07:38:17 2020 UTC (4 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +56 -2 lines
Move uvideo's parsers into usbdi.c, to make them global. Rename
usb_desc_iter_peek_next -> usb_desc_iter_peek for consistency.

Revision 1.161.2.5: download - view: text, markup, annotated - select for diffs
Sat Nov 16 16:13:56 2019 UTC (5 years ago) by martin
Branches: netbsd-7
Diff to: previous 1.161.2.4: preferred, colored; branchpoint 1.161: preferred, colored; next MAIN 1.162: preferred, colored
Changes since revision 1.161.2.4: +15 -3 lines
Pull up following revision(s) (requested by mrg in ticket #1713):

	sys/dev/usb/usbdi.h: revision 1.97 (via patch)
	sys/dev/usb/usbdi.c: revision 1.186 (via patch)
	sys/dev/usb/usb_subr.c: revision 1.239 (via patch)

add new usbd_do_request_len() that can allocate a larger than
request size buffer.  reimplement usbd_do_request_flags() in
terms of this.  use this for fetching string descriptors.

fixes a very strange problem where an axe(4) attaching (either
has ugen(4) or axe(4)) would ask for 2 bytes, usb_mem.c would
allocate a 2 byte fragment, perform the operation, and sometime
shortly afterwards (usually by the time the next allocation
is made for this fragment), would become corrupted (usually
two bytes were written with 0x0304.)
(initial request of 4 bytes also avoids the problem on this
device.  it really seems like a HC problem -- host should not
allow the device to write more than req.wLength!  nor should
it allow this write to happen after completion.)

avoid an (almost) always double-log in usbd_transfer().

Revision 1.182.4.1: download - view: text, markup, annotated - select for diffs
Sun Sep 1 13:00:37 2019 UTC (5 years, 3 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +53 -45 lines
Pull up following revision(s) (requested by mrg in ticket #135):

	distrib/sets/lists/comp/mi			1.2279
	distrib/sets/lists/modules/mi			1.123
	share/man/man9/Makefile				1.438
	share/man/man9/usbnet.9				1.1-1.9
	sys/dev/ic/rndisreg.h				1.3
	sys/dev/usb/TODO				1.47-1.52
	sys/dev/usb/TODO.usbmp				1.15,1.16
	sys/dev/usb/files.usb				1.157-1.167
	sys/dev/usb/if_aue.c				1.155-1.161
	sys/dev/usb/if_auereg.h				1.30-1.32
	sys/dev/usb/if_axe.c				1.103-1.119
	sys/dev/usb/if_axen.c				1.51-1.53,1.55-1.67
	sys/dev/usb/if_axenreg.h			1.15
	sys/dev/usb/if_cdce.c				1.54-1.67
	sys/dev/usb/if_cue.c				1.85,1.86
	sys/dev/usb/if_cuereg.h				1.23
	sys/dev/usb/if_kue.c				1.97-1.100
	sys/dev/usb/if_kuereg.h				1.23,1.24
	sys/dev/usb/if_mue.c				1.51-1.55
	sys/dev/usb/if_muereg.h				1.6
	sys/dev/usb/if_muevar.h				1.9
	sys/dev/usb/if_smsc.c				1.46-1.61
	sys/dev/usb/if_smscreg.h			1.6
	sys/dev/usb/if_smscvar.h			delete
	sys/dev/usb/if_udav.c				1.60-1.71
	sys/dev/usb/if_udavreg.h			1.14,1.15
	sys/dev/usb/if_upl.c				1.65,1.66
	sys/dev/usb/if_ure.c				1.15-1.31
	sys/dev/usb/if_urevar.h				1.4,1.5
	sys/dev/usb/if_url.c				1.67-1.70
	sys/dev/usb/if_urlreg.h				1.14
	sys/dev/usb/if_urndis.c				1.22-1.33
	sys/dev/usb/if_urtwn.c				1.72
	sys/dev/usb/ohci.c				1.290
	sys/dev/usb/uhub.c				1.143
	sys/dev/usb/usb.c				1.180
	sys/dev/usb/usb.h				1.118
	sys/dev/usb/usb_mem.c				1.71
	sys/dev/usb/usb_subr.c				1.238,1.239
	sys/dev/usb/usbdevs				1.772
	sys/dev/usb/usbdi.c				1.183,1.186
	sys/dev/usb/usbdi.h				1.97
	sys/dev/usb/usbdi_util.c			1.75
	sys/dev/usb/usbhist.h				1.5,1.6
	sys/dev/usb/usbnet.c				1.1-1.24
	sys/dev/usb/usbnet.h				1.1-1.14
	sys/dev/usb/usbroothub.c			1.9
	sys/dev/usb/xhci.c				1.109,1.110
	sys/modules/Makefile				1.223
	sys/modules/usbnet/Makefile			1.1

usbnet(9): Add common framework for USB network devices.
This bring various safety fixes to all updated drivers,
and includes locking clean up, detach safety when being
used or not, separate rx/tx locks to improve performance,
porting to NET_MPSAFE, many edge/error case bugs in
drivers fixed, as well as resovling PRs 54303 and 54308.
These drivers are converted: axe(4), axen(4), aue(4),
cdce(4), cue(4), kue(4), mue(4), smsc(4), udav(4),
upl(4), ure(4), url(4), and urndis(4).

Revision 1.186: download - view: text, markup, annotated - select for diffs
Wed Aug 28 01:44:39 2019 UTC (5 years, 3 months ago) by mrg
Branches: MAIN
CVS tags: phil-wifi-20191119, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +18 -8 lines
add new usbd_do_request_len() that can allocate a larger than
request size buffer.  reimplement usbd_do_request_flags() in
terms of this.  use this for fetching string descriptors.

fixes a very strange problem where an axe(4) attaching (either
has ugen(4) or axe(4)) would ask for 2 bytes, usb_mem.c would
allocate a 2 byte fragment, perform the operation, and sometime
shortly afterwards (usually by the time the next allocation
is made for this fragment), would become corrupted (usually
two bytes were written with 0x0304.)

(initial request of 4 bytes also avoids the problem on this
device.  it really seems like a HC problem -- host should not
allow the device to write more than req.wLength!  nor should
it allow this write to happen after completion.)

avoid an (almost) always double-log in usbd_transfer().

Revision 1.185: download - view: text, markup, annotated - select for diffs
Sat Aug 24 07:43:00 2019 UTC (5 years, 3 months ago) by mrg
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +4 -4 lines
don't try to deref a maybe-NULL pointer.  instead of logging
potentially garbage (if not NULL), log the request length.

Revision 1.184: download - view: text, markup, annotated - select for diffs
Thu Aug 22 07:38:06 2019 UTC (5 years, 3 months ago) by mrg
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +3 -3 lines
fix more kernhist vs 32 bit issues.

Revision 1.183: download - view: text, markup, annotated - select for diffs
Wed Aug 21 10:48:37 2019 UTC (5 years, 3 months ago) by mrg
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +38 -40 lines
convert pairs of USBHIST_CALLED()+USBHIST_LOG*() into
USBHIST_CALLARGS() calls.  this reduces the number of
kernel history lines consumed by these callers, and
for the +LOGN versions, add useful log info to a
message that just says "called!".

reduces the line spam which means the total info in a
full log is significantly increased.

Revision 1.175.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:07:35 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +78 -22 lines
Sync with HEAD

Revision 1.182: download - view: text, markup, annotated - select for diffs
Sun Feb 17 04:17:31 2019 UTC (5 years, 9 months ago) by rin
Branches: MAIN
CVS tags: phil-wifi-20190609, netbsd-9-base, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +9 -5 lines
Fix system freeze when USB NICs with multiple outstanding transfers
are detached from xhci(4) or ehci(4), that enable up_serialise for
bulk transfers.

The cause of problem is that usbd_ar_pipe() waits xfers of
USBD_NOT_STARTED to be removed, although underlying upm_abort
functions do not remove such queues, as reported by "sc dying".

Therefore, remove xfers of USBD_NOT_STARTED when pipe is closed.

Patch provided by Nick Hudson.

Revision 1.175.2.5: download - view: text, markup, annotated - select for diffs
Fri Jan 18 08:50:44 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.175.2.4: preferred, colored; branchpoint 1.175: preferred, colored; next MAIN 1.176: preferred, colored
Changes since revision 1.175.2.4: +4 -3 lines
Synch with HEAD

Revision 1.161.2.4: download - view: text, markup, annotated - select for diffs
Fri Jan 11 15:58:23 2019 UTC (5 years, 11 months ago) by martin
Branches: netbsd-7
Diff to: previous 1.161.2.3: preferred, colored; branchpoint 1.161: preferred, colored
Changes since revision 1.161.2.3: +4 -3 lines
Pull up following revision(s) (requested by skrll in ticket #1671):

	sys/dev/usb/usbdi.c: revision 1.181

Avoid use after free when closing interrupt pipe transfer by calling
upm_close before destroying the interupt pipe xfer.

Found by kasan on wiz's machine.

Revision 1.173.2.5: download - view: text, markup, annotated - select for diffs
Fri Jan 11 15:52:24 2019 UTC (5 years, 11 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Diff to: previous 1.173.2.4: preferred, colored; branchpoint 1.173: preferred, colored
Changes since revision 1.173.2.4: +4 -3 lines
Pull up following revision(s) (requested by skrll in ticket #1161):

	sys/dev/usb/usbdi.c: revision 1.181

Avoid use after free when closing interrupt pipe transfer by calling
upm_close before destroying the interupt pipe xfer.

Found by kasan on wiz's machine.

Revision 1.181: download - view: text, markup, annotated - select for diffs
Thu Jan 10 22:13:07 2019 UTC (5 years, 11 months ago) by skrll
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +4 -3 lines
Avoid use after free when closing interrupt pipe transfer by calling
upm_close before destroying the interupt pipe xfer.

Found by kasan on wiz's machine.

Revision 1.175.2.4: download - view: text, markup, annotated - select for diffs
Mon Nov 26 10:43:36 2018 UTC (6 years ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.175.2.3: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.3: +2 -6 lines
Missed a $Id$ conflict in the last sync-with-HEAD

Revision 1.175.2.3: download - view: text, markup, annotated - select for diffs
Mon Nov 26 01:52:49 2018 UTC (6 years ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.175.2.2: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.2: +28 -5 lines
Sync with HEAD, resolve a couple of conflicts

Revision 1.173.2.4: download - view: text, markup, annotated - select for diffs
Tue Nov 20 16:05:38 2018 UTC (6 years ago) by martin
Branches: netbsd-8
Diff to: previous 1.173.2.3: preferred, colored; branchpoint 1.173: preferred, colored
Changes since revision 1.173.2.3: +24 -5 lines
Pull up following revision(s) (requested by manu in ticket #1099):

	sys/dev/usb/usb_quirks.c: revision 1.90
	sys/dev/usb/usbdi.c: revision 1.179
	sys/dev/usb/usb_quirks.h: revision 1.29
	sys/dev/usb/usbdi.c: revision 1.180

Workaround NBP PN533 USB toggle bit bugs

The PN533 is known to mishandle the USB toggle bit, causing replies to
be filtered out by the host controller. As a result, the kernel sees
a timed out operation.

Vendor errata suggests that userland applications should detect the
situation on read timeout, and write a dumy frame to resync the toggle bit.
NFC Tools's libnfc does just that, but in order to succeed, the dummy
frame write must not be reported as timed out.

We therefore introduce a new USB quirk for devices known to miss output
acks. When that occur, we pretend that the operation succeeded, leaving
userland the duty to check that everything went okay.

This workaround lets libnfc recover from interrupted communications
without the need te reboot the system.

 -

Build fix
From David H. Gutteridge

Revision 1.180: download - view: text, markup, annotated - select for diffs
Fri Nov 16 00:34:50 2018 UTC (6 years ago) by manu
Branches: MAIN
CVS tags: pgoyette-compat-1226, pgoyette-compat-1126
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +3 -3 lines
Build fix

From David H. Gutteridge

Revision 1.179: download - view: text, markup, annotated - select for diffs
Thu Nov 15 02:35:23 2018 UTC (6 years, 1 month ago) by manu
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +24 -5 lines
Workaround NBP PN533 USB toggle bit bugs

The PN533 is known to mishandle the USB toggle bit, causing replies to
be filtered out by the host controller. As a result, the kernel sees
a timed out operation.

Vendor errata suggests that userland applications should detect the
situation on read timeout, and write a dumy frame to resync the toggle bit.
NFC Tools's libnfc does just that, but in order to succeed, the dummy
frame write must not be reported as timed out.

We therefore introduce a new USB quirk for devices known to miss output
acks. When that occur, we pretend that the operation succeeded, leaving
userland the duty to check that everything went okay.

This workaround lets libnfc recover from interrupted communications
without the need te reboot the system.

Revision 1.175.2.2: download - view: text, markup, annotated - select for diffs
Sun Sep 30 01:45:51 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.175.2.1: preferred, colored; branchpoint 1.175: preferred, colored
Changes since revision 1.175.2.1: +12 -11 lines
Ssync with HEAD

Revision 1.173.2.3: download - view: text, markup, annotated - select for diffs
Thu Sep 27 14:52:26 2018 UTC (6 years, 2 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.173.2.2: preferred, colored; branchpoint 1.173: preferred, colored
Changes since revision 1.173.2.2: +12 -11 lines
Pull up following revision(s) (requested by mrg in ticket #1037):

	sys/dev/usb/uhub.c: revision 1.139
	sys/external/bsd/dwc2/dwc2.c: revision 1.55
	sys/ddb/db_output.c: revision 1.34
	sys/ddb/db_command.c: revision 1.160
	sys/dev/usb/ehci.c: revision 1.264
	sys/dev/usb/xhci.c: revision 1.99
	sys/dev/usb/ehci.c: revision 1.265
	sys/kern/subr_userconf.c: revision 1.27
	sys/dev/usb/ehcivar.h: revision 1.46
	sys/dev/usb/ohci.c: revision 1.287
	sys/dev/usb/uhci.c: revision 1.284
	sys/dev/usb/usbdi.c: revision 1.178
	sys/dev/usb/usb.c: revision 1.172
	sys/dev/pci/xhci_pci.c: revision 1.14
	sys/dev/usb/usb.c: revision 1.173
	sys/dev/usb/usb.c: revision 1.174
	share/man/man4/usb.4: revision 1.110
	sys/ddb/db_command.c: revision 1.159
	sys/dev/usb/usb_subr.c: revision 1.227
	sys/dev/usb/uhcivar.h: revision 1.56
	(all via patch)

consolidate the handling of polling across HC drivers, and generic USB:
- don't take mutexes if polling
- normalise the code across all drivers
- add some not yet code to block discovery to/from polling
- minor CSE
- adjust comment for usbd_set_polling() to reality now i properly
  understand what it is used for and why.

this, with a hack to make RB_ASKNAME to wait 5 seconds allows boot -a
work with USB keyboards.  there are still multiple issues remaining:
- discovery and polling need to be mutually exclusive
- attachment of ukbd and wskbd is not handled by config_pending, and
  the 5 second delay isn't going to always be enough.

call cnpollc(1) and cnpollc(0) around cngetc().
(christos has a good idea to add a function that does all 3,
and we should switch all the callers in this sequence to use
it (and fix the MD ones missing it still).  not all can, as
eg, line-grabbing functions can use cngetsn(), which only
calls cnpollc() twice.)


When this file is used when not building the kernel (eg: /usr/sbin/crash)
make cnpollc() go away.


reorder some struct members to remove holes.


add config_pending usage to uhub and general USB device attachment.
- call config_pending_incr() and config_pending_decr() around attaching
  devices against "usbdevif" attribute.

uhub:
- convert sc_explorepending and sc_running to bool.  add new sc_first_explore.
- call config_pending_incr() at the start of uhub_attach().  dropped in
  uhub_explore(), if this is the first explore.


implement a gross hack to fix "boot -a" on systems with usb keyboards on
systems with ehci handover to uhci (and maybe ohci), and fix a similar
problem for "boot -s".

there is effort to ensure that all devices attached via USB are probed
before RB_ASKNAME or RB_SINGLE attempts to ask any questions on the console,
and largely this works, often by chance, today, for USB disks and root.
i've recently pushed this more into uhub and general USB device attachment
as well, and kept a config_pending reference across the first explore of
a bus.  these fix many issues with directly attached hubs.

however, on systems where devices connected to ehci ports are handed over
to a companion uhci or ohci port, it may not be the first, or even second,
bus explore that finds the device finally before attachment, and at this
point all config_pending references are dropped.

there is no direct communication between drivers, the potentials are
looked up but their device_t is only used for generic things like the name,
so informing the correct companion to expect a device and deal with the
config_pending references is not possible without some fairly ugly layer
violations or multi-level callbacks (eg, we have "ehci0", and usually an
the relevant companion, eg, "uhci2", but it is the uhub that uhci2 has
attached that will deal with the device attachment.)

with the above fixes to generic USB code, the disown happens during the
first explore.  the hack works by, at this point, checking if (a) root
is not mounted, (b) single user or ask name are set, and (c) if the hack
as not been triggered already.  if all 3 conditions are true, then a
config_pending_incr() is called and a callback is triggered for (default)
5 seconds to call config_pending_decr().  ehci detach pauses waiting for
this callback if scheduled.

this allows enough time for the uhub and the ukbd/wskbd to attach before
the RK_ASKROOT prompts appear.  testing shows it takes between 1.5 and
2 seconds for the keyboard to appear after the disown occurs.

Index: dev/usb/ehcivar.c
- new sc_compcallout, sc_compcallout, sc_complock, and a state for th
  handover hack.

Index: dev/usb/ehci.c
ehci_init():
- use aprint_normal_dev() instead of manual device_xname().
- initialise sc_compcallout, sc_compcallout, sc_complock, and sc_comp_state.
ehci_detach():
- if there are companion controllers, tear own the above, including waiting
  if there is a callback scheduled.
ehci_disown_callback():
- new callout to call config_pending_decr() in the the future.
  schedule this ca
ehci_disown_sched_callback():
- if booting to single user or asking names, call config_pending_incr() and
  schedule the callout above, default 5 second delay.
ehci_disown():
- if disowning a port call ehci_disown_sched_callback().
deal with partial attach failures in usb_attach vs usb_detach aka PR 53598.
- make sure xhci's sc->sc_ios is NULL if failure happens.
- rearrange usb_attach() / usb_doattach() to make it simpler to clean up.
- move usb_async_intr softint into usb_once_init().  previously, each USB
  controller would start a new one, and leave the old one leaked.
- handle controller interrupts without a bus attached


remove usb(4)'s "flags 1" code.  it has been dead for a while,
as it runs during the interrupts part of configuration now,
and all the devices try attach as early as possible, including
any root or boot required disk or keyboard device, which is
what this flag was for.

Revision 1.178: download - view: text, markup, annotated - select for diffs
Sun Sep 16 20:21:56 2018 UTC (6 years, 2 months ago) by mrg
Branches: MAIN
CVS tags: pgoyette-compat-1020, pgoyette-compat-0930
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +12 -11 lines
consolidate the handling of polling across HC drivers, and generic USB:
- don't take mutexes if polling
- normalise the code across all drivers
- add some not yet code to block discovery to/from polling
- minor CSE
- adjust comment for usbd_set_polling() to reality now i properly
  understand what it is used for and why.

this, with a hack to make RB_ASKNAME to wait 5 seconds allows boot -a
work with USB keyboards.  there are still multiple issues remaining:
- discovery and polling need to be mutually exclusive
- attachment of ukbd and wskbd is not handled by config_pending, and
  the 5 second delay isn't going to always be enough.

Revision 1.175.2.1: download - view: text, markup, annotated - select for diffs
Thu Sep 6 06:56:06 2018 UTC (6 years, 3 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +37 -6 lines
Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.161.2.3: download - view: text, markup, annotated - select for diffs
Sat Aug 25 14:57:35 2018 UTC (6 years, 3 months ago) by martin
Branches: netbsd-7
CVS tags: netbsd-7-2-RELEASE
Diff to: previous 1.161.2.2: preferred, colored; branchpoint 1.161: preferred, colored
Changes since revision 1.161.2.2: +6 -6 lines
Pull up following revision(s) (requested by mrg in ticket #1632):

	sys/dev/usb/usbdivar.h: revision 1.117
	sys/external/bsd/dwc2/dwc2.c: revision 1.52
	sys/dev/usb/xhcivar.h: revision 1.10
	sys/dev/usb/motg.c: revision 1.22
	sys/dev/usb/ehci.c: revision 1.260
	sys/dev/usb/ehci.c: revision 1.261
	sys/dev/usb/xhci.c: revision 1.96
	sys/dev/usb/ohci.c: revision 1.282
	sys/dev/usb/ohci.c: revision 1.283
	sys/dev/usb/ehcivar.h: revision 1.45
	sys/dev/usb/uhci.c: revision 1.281
	sys/dev/usb/uhci.c: revision 1.282
	sys/dev/usb/usbdi.c: revision 1.177
	sys/dev/usb/ohcivar.h: revision 1.60
	sys/dev/usb/uhcivar.h: revision 1.55
	(all via patch)

pull across abort fixes from nick-nhusb.  add more abort fixes, using
ideas from Taylor and Nick, and myself.  special thanks to both who
inspired much of the code here, if not wrote it directly.

among other problems, this assert should no longer trigger:

   panic: kernel diagnostic assertion "xfer->ux_state == XFER_ONQU" failed: file "/current/src/sys/dev/usb/usbdi.c", line 914

using usbhist i was able to track down my instance of it being related
to userland close() beginning, dropping the sc_lock, and then the usb
softintr completes the transfer normally, and when it is done, the
abort path attempts to re-complete the transfer, and the above assert
is tripped.

changes from nhusb were commited with these logs:
--
Move the struct usb_task to struct usbd_xfer for everyone to use.
--
Set device transfer status to USBD_IN_PROGRESS if start methods succeeds
--
Actually set the transfer status on transfers in ohci_abort_xfer and
the controller is dying
--
Don't supply the lock to callout_halt when polling as it won't be held
--
Improve transfer abort
--
Mark device transfers as USBD_IN_PROGRESS appropriately and improve
abort handling
--
--
Mark device transfers as USBD_IN_PROGRESS appropriately and improve
abort handling
--

additional changes include:
- initialise the usb abort task in the HCI allocx routine, so that it
  can be safely usb_rem_task()'d.
- rework the handling of softintr vs cancellation vs timeout abort based
  upon a scheme from Taylor:
  when completing a transfer normally:
  - if the status is not in progress, it must be cancelled or timed out,
    and we should not process this xfer.
  - set the status as normal.
  - unconditionallly callout_stop() and usb_rem_task().  they're safe and
    either aren't running, or will run and do nothing.
  - finally call usb_transfer_complete().
  when aborting a transfer:
  - status should be cancelled or timed out.
  - if cancelling, callout_halt and usb_rem_task_wait() to make sure the
    timer is either done or cancelled.
  - at this point, the ux_status must not be cancelled or timed out, and
    if it is not in progress we're done.
  - set the status.
  - if the controller is dying, just return.
  - perform HCI-specific tasks to abort this xfer.
  - finally call usb_transfer_complete().
  for the timeout and timeout task:
  - if the HCI is not dying, and the ux_status is in progress, then
    trigger the usb abort task.
- remove UXFER_ABORTWAIT and UXFER_ABORTING.

tested on:
- multiple PC systems with several types of devices: ugen/UPS, ucom,
  umass with disk, ssd and cdrom backends, kbd, ms, using uhci, ehci
  and xhci.
- erlite3: sd@umass on dwc2.
- sunblade2000: kbd/ms and umass disk on ohci.

untested:
- motg, slhci and ahci.  motg has some portion of the new scheme
  applied, but slhci and ahci require more study.

future work includes pushing a lot of the common abort handling into
usbdi.c and leaving upm_abort() for HC specific tasks, but this change
is pullup-able to netbsd-7 and netbsd-8 as it does not change any
external API, as well as removing over 100 lines of code while adding
over 30 new asserts.

XXX: pullup-7, pullup-8.

fix DIAGNOSTIC build by not copying ub_usepolling to stack before use

Sprinkle __diagused

Revision 1.173.2.2: download - view: text, markup, annotated - select for diffs
Sat Aug 25 11:29:52 2018 UTC (6 years, 3 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.173.2.1: preferred, colored; branchpoint 1.173: preferred, colored
Changes since revision 1.173.2.1: +6 -6 lines
Pull up following revision(s) (requested by mrg in ticket #980):

	sys/dev/usb/usbdivar.h: revision 1.117
	sys/external/bsd/dwc2/dwc2.c: revision 1.52
	sys/dev/usb/xhcivar.h: revision 1.10
	sys/dev/usb/motg.c: revision 1.22
	sys/dev/usb/ehci.c: revision 1.260
	sys/dev/usb/ehci.c: revision 1.261
	sys/dev/usb/xhci.c: revision 1.96
	sys/dev/usb/ohci.c: revision 1.282
	sys/dev/usb/ohci.c: revision 1.283
	sys/dev/usb/ehcivar.h: revision 1.45
	sys/dev/usb/uhci.c: revision 1.281
	sys/dev/usb/uhci.c: revision 1.282
	sys/dev/usb/usbdi.c: revision 1.177
	sys/dev/usb/ohcivar.h: revision 1.60
	sys/dev/usb/uhcivar.h: revision 1.55
	(all via patch)

pull across abort fixes from nick-nhusb.  add more abort fixes, using
ideas from Taylor and Nick, and myself.  special thanks to both who
inspired much of the code here, if not wrote it directly.
among other problems, this assert should no longer trigger:

   panic: kernel diagnostic assertion "xfer->ux_state == XFER_ONQU" failed: file "/current/src/sys/dev/usb/usbdi.c", line 914

using usbhist i was able to track down my instance of it being related
to userland close() beginning, dropping the sc_lock, and then the usb
softintr completes the transfer normally, and when it is done, the
abort path attempts to re-complete the transfer, and the above assert
is tripped.

changes from nhusb were commited with these logs:
--
Move the struct usb_task to struct usbd_xfer for everyone to use.
--
Set device transfer status to USBD_IN_PROGRESS if start methods succeeds
--
Actually set the transfer status on transfers in ohci_abort_xfer and
the controller is dying
--
Don't supply the lock to callout_halt when polling as it won't be held
--
Improve transfer abort
--
Mark device transfers as USBD_IN_PROGRESS appropriately and improve
abort handling
--
--
Mark device transfers as USBD_IN_PROGRESS appropriately and improve
abort handling
--

additional changes include:
- initialise the usb abort task in the HCI allocx routine, so that it
  can be safely usb_rem_task()'d.
- rework the handling of softintr vs cancellation vs timeout abort based
  upon a scheme from Taylor:
  when completing a transfer normally:
  - if the status is not in progress, it must be cancelled or timed out,
    and we should not process this xfer.
  - set the status as normal.
  - unconditionallly callout_stop() and usb_rem_task().  they're safe and
    either aren't running, or will run and do nothing.
  - finally call usb_transfer_complete().
  when aborting a transfer:
  - status should be cancelled or timed out.
  - if cancelling, callout_halt and usb_rem_task_wait() to make sure the
    timer is either done or cancelled.
  - at this point, the ux_status must not be cancelled or timed out, and
    if it is not in progress we're done.
  - set the status.
  - if the controller is dying, just return.
  - perform HCI-specific tasks to abort this xfer.
  - finally call usb_transfer_complete().
  for the timeout and timeout task:
  - if the HCI is not dying, and the ux_status is in progress, then
    trigger the usb abort task.
- remove UXFER_ABORTWAIT and UXFER_ABORTING.

tested on:
- multiple PC systems with several types of devices: ugen/UPS, ucom,
  umass with disk, ssd and cdrom backends, kbd, ms, using uhci, ehci
  and xhci.
- erlite3: sd@umass on dwc2.
- sunblade2000: kbd/ms and umass disk on ohci.

untested:
- motg, slhci and ahci.  motg has some portion of the new scheme
  applied, but slhci and ahci require more study.

future work includes pushing a lot of the common abort handling into
usbdi.c and leaving upm_abort() for HC specific tasks, but this change
is pullup-able to netbsd-7 and netbsd-8 as it does not change any
external API, as well as removing over 100 lines of code while adding
over 30 new asserts.

XXX: pullup-7, pullup-8.

fix DIAGNOSTIC build by not copying ub_usepolling to stack before use

Sprinkle __diagused

Revision 1.177: download - view: text, markup, annotated - select for diffs
Thu Aug 9 06:26:47 2018 UTC (6 years, 4 months ago) by mrg
Branches: MAIN
CVS tags: pgoyette-compat-0906, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +6 -6 lines
pull across abort fixes from nick-nhusb.  add more abort fixes, using
ideas from Taylor and Nick, and myself.  special thanks to both who
inspired much of the code here, if not wrote it directly.

among other problems, this assert should no longer trigger:

   panic: kernel diagnostic assertion "xfer->ux_state == XFER_ONQU" failed: file "/current/src/sys/dev/usb/usbdi.c", line 914

using usbhist i was able to track down my instance of it being related
to userland close() beginning, dropping the sc_lock, and then the usb
softintr completes the transfer normally, and when it is done, the
abort path attempts to re-complete the transfer, and the above assert
is tripped.


changes from nhusb were commited with these logs:
--
Move the struct usb_task to struct usbd_xfer for everyone to use.
--
Set device transfer status to USBD_IN_PROGRESS if start methods succeeds
--
Actually set the transfer status on transfers in ohci_abort_xfer and
the controller is dying
--
Don't supply the lock to callout_halt when polling as it won't be held
--
Improve transfer abort
--
Mark device transfers as USBD_IN_PROGRESS appropriately and improve
abort handling
--
#ifdef DIAGNOSTIC -> KASSERT and add another KASSERT
--
Mark device transfers as USBD_IN_PROGRESS appropriately and improve
abort handling
--

additional changes include:
- initialise the usb abort task in the HCI allocx routine, so that it
  can be safely usb_rem_task()'d.
- rework the handling of softintr vs cancellation vs timeout abort based
  upon a scheme from Taylor:
  when completing a transfer normally:
  - if the status is not in progress, it must be cancelled or timed out,
    and we should not process this xfer.
  - set the status as normal.
  - unconditionallly callout_stop() and usb_rem_task().  they're safe and
    either aren't running, or will run and do nothing.
  - finally call usb_transfer_complete().
  when aborting a transfer:
  - status should be cancelled or timed out.
  - if cancelling, callout_halt and usb_rem_task_wait() to make sure the
    timer is either done or cancelled.
  - at this point, the ux_status must not be cancelled or timed out, and
    if it is not in progress we're done.
  - set the status.
  - if the controller is dying, just return.
  - perform HCI-specific tasks to abort this xfer.
  - finally call usb_transfer_complete().
  for the timeout and timeout task:
  - if the HCI is not dying, and the ux_status is in progress, then
    trigger the usb abort task.
- remove UXFER_ABORTWAIT and UXFER_ABORTING.

tested on:
- multiple PC systems with several types of devices: ugen/UPS, ucom,
  umass with disk, ssd and cdrom backends, kbd, ms, using uhci, ehci
  and xhci.
- erlite3: sd@umass on dwc2.
- sunblade2000: kbd/ms and umass disk on ohci.

untested:
- motg, slhci and ahci.  motg has some portion of the new scheme
  applied, but slhci and ahci require more study.

future work includes pushing a lot of the common abort handling into
usbdi.c and leaving upm_abort() for HC specific tasks, but this change
is pullup-able to netbsd-7 and netbsd-8 as it does not change any
external API, as well as removing over 100 lines of code while adding
over 30 new asserts.

XXX: pullup-7, pullup-8.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Tue Jul 31 16:44:30 2018 UTC (6 years, 4 months ago) by khorben
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +33 -2 lines
Add a port of the umb(4) driver from OpenBSD

The umb(4) driver provides support for USB MBIM (Mobile Broadband
Interface Model) devices.

MBIM devices establish connections via cellular networks such as GPRS,
UMTS, and LTE. They appear as a regular point-to-point network interface, transporting raw IP frames.

Required configuration parameters like PIN and APN have to be set with
umbctl(8), a new tool specific to this driver. The IP address is configured
automatically; the default route and DNS server information have to be set
separately.

The driver is not fully functional yet, it is therefore still marked as
experimental and disabled by default. Any help welcome to complete it!

Tested on NetBSD/amd64, with a Sierra Wireless EM7345 LTE modem on a Lenovo
ThinkPad T440s. No functional change expected otherwise.

Revision 1.139.2.4: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:37:36 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.139.2.3: preferred, colored; branchpoint 1.139: preferred, colored; next MAIN 1.140: preferred, colored
Changes since revision 1.139.2.3: +688 -630 lines
update from HEAD

Revision 1.173.2.1: download - view: text, markup, annotated - select for diffs
Thu Nov 2 21:29:52 2017 UTC (7 years, 1 month ago) by snj
Branches: netbsd-8
CVS tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +78 -63 lines
Pull up following revision(s) (requested by pgoyette in ticket #335):
	share/man/man9/kernhist.9: 1.5-1.8
	sys/arch/acorn26/acorn26/pmap.c: 1.39
	sys/arch/arm/arm32/fault.c: 1.105 via patch
	sys/arch/arm/arm32/pmap.c: 1.350, 1.359
	sys/arch/arm/broadcom/bcm2835_bsc.c: 1.7
	sys/arch/arm/omap/if_cpsw.c: 1.20
	sys/arch/arm/omap/tiotg.c: 1.7
	sys/arch/evbarm/conf/RPI2_INSTALL: 1.3
	sys/dev/ic/sl811hs.c: 1.98
	sys/dev/usb/ehci.c: 1.256
	sys/dev/usb/if_axe.c: 1.83
	sys/dev/usb/motg.c: 1.18
	sys/dev/usb/ohci.c: 1.274
	sys/dev/usb/ucom.c: 1.119
	sys/dev/usb/uhci.c: 1.277
	sys/dev/usb/uhub.c: 1.137
	sys/dev/usb/umass.c: 1.160-1.162
	sys/dev/usb/umass_quirks.c: 1.100
	sys/dev/usb/umass_scsipi.c: 1.55
	sys/dev/usb/usb.c: 1.168
	sys/dev/usb/usb_mem.c: 1.70
	sys/dev/usb/usb_subr.c: 1.221
	sys/dev/usb/usbdi.c: 1.175
	sys/dev/usb/usbdi_util.c: 1.67-1.70
	sys/dev/usb/usbroothub.c: 1.3
	sys/dev/usb/xhci.c: 1.75
	sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.34
	sys/kern/kern_history.c: 1.15
	sys/kern/kern_xxx.c: 1.74
	sys/kern/vfs_bio.c: 1.275-1.276
	sys/miscfs/genfs/genfs_io.c: 1.71
	sys/sys/kernhist.h: 1.21
	sys/ufs/ffs/ffs_balloc.c: 1.63
	sys/ufs/lfs/lfs_vfsops.c: 1.361
	sys/ufs/lfs/ulfs_inode.c: 1.21
	sys/ufs/lfs/ulfs_vnops.c: 1.52
	sys/ufs/ufs/ufs_inode.c: 1.102
	sys/ufs/ufs/ufs_vnops.c: 1.239
	sys/uvm/pmap/pmap.c: 1.37-1.39
	sys/uvm/pmap/pmap_tlb.c: 1.22
	sys/uvm/uvm_amap.c: 1.108
	sys/uvm/uvm_anon.c: 1.64
	sys/uvm/uvm_aobj.c: 1.126
	sys/uvm/uvm_bio.c: 1.91
	sys/uvm/uvm_device.c: 1.66
	sys/uvm/uvm_fault.c: 1.201
	sys/uvm/uvm_km.c: 1.144
	sys/uvm/uvm_loan.c: 1.85
	sys/uvm/uvm_map.c: 1.353
	sys/uvm/uvm_page.c: 1.194
	sys/uvm/uvm_pager.c: 1.111
	sys/uvm/uvm_pdaemon.c: 1.109
	sys/uvm/uvm_swap.c: 1.175
	sys/uvm/uvm_vnode.c: 1.103
	usr.bin/vmstat/vmstat.c: 1.219
Reorder to test for null before null deref in debug code
--
Reorder to test for null before null deref in debug code
--
KNF
--
No need for '\n' in UVMHIST_LOG
--
normalise a BIOHIST log message
--
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...
(As proposed on tech-kern@ with additional changes and enhancements.)
Details of changes:
* All history arguments are now stored as uintmax_t values[1], both in
   the kernel and in the structures used for exporting the history data
   to userland via sysctl(9).  This avoids problems on some architectures
   where passing a 64-bit (or larger) value to printf(3) can cause it to
   process the value as multiple arguments.  (This can be particularly
   problematic when printf()'s format string is not a literal, since in
   that case the compiler cannot know how large each argument should be.)
* Update the data structures used for exporting kernel history data to
   include a version number as well as the length of history arguments.
* All [2] existing users of kernhist(9) have had their format strings
   updated.  Each format specifier now includes an explicit length
   modifier 'j' to refer to numeric values of the size of uintmax_t.
* All [2] existing users of kernhist(9) have had their format strings
   updated to replace uses of "%p" with "%#jx", and the pointer
   arguments are now cast to (uintptr_t) before being subsequently cast
   to (uintmax_t).  This is needed to avoid compiler warnings about
   casting "pointer to integer of a different size."
* All [2] existing users of kernhist(9) have had instances of "%s" or
   "%c" format strings replaced with numeric formats; several instances
   of mis-match between format string and argument list have been fixed.
* vmstat(1) has been modified to handle the new size of arguments in the
   history data as exported by sysctl(9).
* vmstat(1) now provides a warning message if the history requested with
   the -u option does not exist (previously, this condition was silently
   ignored, with only a single blank line being printed).
* vmstat(1) now checks the version and argument length included in the
   data exported via sysctl(9) and exits if they do not match the values
   with which vmstat was built.
* The kernhist(9) man-page has been updated to note the additional
   requirements imposed on the format strings, along with several other
   minor changes and enhancements.
[1] It would have been possible to use an explicit length (for example,
     uint64_t) for the history arguments.  But that would require another
     "rototill" of all the users in the future when we add support for an
     architecture that supports a larger size.  Also, the printf(3)
format
     specifiers for explicitly-sized values, such as "%"PRIu64, are much
     more verbose (and less aesthetically appealing, IMHO) than simply
     using "%ju".
[2] I've tried very hard to find "all [the] existing users of
kernhist(9)"
     but it is possible that I've missed some of them.  I would be glad
to
     update any stragglers that anyone identifies.
--
For some reason this single kernel seems to have outgrown its declared
size as a result of the kernhist(9) changes.  Bump the size.
XXX The amount of increase may be excessive - anyone with more detailed
XXX knowledge please feel free to further adjust the value
appropriately.
--
Misssed one cast of pointer --> uintptr_t in previous kernhist(9) commit
--
And yet another one.  :(
--
Use correct mark-up for NetBSD version.
--
More improvements in grammar and readability.
--
Remove a stray '"' (obvious typo) and add a couple of casts that are
probably needed.
--
And replace an instance of "%p" conversion with "%#jx"
--
Whitespace fix. Give Bl tag table a width. Fix Xr.

Revision 1.175: download - view: text, markup, annotated - select for diffs
Sat Oct 28 00:37:12 2017 UTC (7 years, 1 month ago) by pgoyette
Branches: MAIN
CVS tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +78 -63 lines
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
  the kernel and in the structures used for exporting the history data
  to userland via sysctl(9).  This avoids problems on some architectures
  where passing a 64-bit (or larger) value to printf(3) can cause it to
  process the value as multiple arguments.  (This can be particularly
  problematic when printf()'s format string is not a literal, since in
  that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
  include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
  updated.  Each format specifier now includes an explicit length
  modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
  updated to replace uses of "%p" with "%#jx", and the pointer
  arguments are now cast to (uintptr_t) before being subsequently cast
  to (uintmax_t).  This is needed to avoid compiler warnings about
  casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
  "%c" format strings replaced with numeric formats; several instances
  of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
  history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
  the -u option does not exist (previously, this condition was silently
  ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
  data exported via sysctl(9) and exits if they do not match the values
  with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
  requirements imposed on the format strings, along with several other
  minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
    uint64_t) for the history arguments.  But that would require another
    "rototill" of all the users in the future when we add support for an
    architecture that supports a larger size.  Also, the printf(3) format
    specifiers for explicitly-sized values, such as "%"PRIu64, are much
    more verbose (and less aesthetically appealing, IMHO) than simply
    using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
    but it is possible that I've missed some of them.  I would be glad to
    update any stragglers that anyone identifies.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Thu Oct 19 05:39:22 2017 UTC (7 years, 1 month ago) by skrll
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +5 -4 lines
KASSERT -> KASSERTMSG and while I'm here update a comment

Revision 1.162.2.51: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:52:30 2017 UTC (7 years, 3 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.50: preferred, colored; branchpoint 1.162: preferred, colored; next MAIN 1.163: preferred, colored
Changes since revision 1.162.2.50: +3 -7 lines
Sync with HEAD

Revision 1.173: download - view: text, markup, annotated - select for diffs
Thu Jun 1 02:45:12 2017 UTC (7 years, 6 months ago) by chs
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base
Branch point for: netbsd-8
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +3 -7 lines
remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.161.2.2: download - view: text, markup, annotated - select for diffs
Wed Apr 5 19:54:21 2017 UTC (7 years, 8 months ago) by snj
Branches: netbsd-7
Diff to: previous 1.161.2.1: preferred, colored; branchpoint 1.161: preferred, colored
Changes since revision 1.161.2.1: +679 -632 lines
Pull up following revision(s) (requested by skrll in ticket #1395):
	share/man/man4/axe.4: netbsd-7-nhusb
	share/man/man4/axen.4: netbsd-7-nhusb
	share/man/man4/cdce.4: netbsd-7-nhusb
	share/man/man4/uaudio.4: netbsd-7-nhusb
	share/man/man4/ucom.4: netbsd-7-nhusb
	share/man/man4/uep.4: netbsd-7-nhusb
	share/man/man4/urtw.4: netbsd-7-nhusb
	share/man/man4/usb.4: netbsd-7-nhusb
	share/man/man4/uyap.4: netbsd-7-nhusb
	share/man/man4/xhci.4: netbsd-7-nhusb
	share/man/man9/usbdi.9: netbsd-7-nhusb
	sys/arch/amd64/conf/ALL: netbsd-7-nhusb
	sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
	sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
	sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
	sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
	sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
	sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
	sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
	sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
	sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
	sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
	sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
	sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
	sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
	sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
	sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
	sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
	sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
	sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
	sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
	sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
	sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
	sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
	sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
	sys/arch/i386/conf/ALL: netbsd-7-nhusb
	sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
	sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
	sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
	sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
	sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
	sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
	sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
	sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
	sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
	sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
	sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
	sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
	sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
	sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
	sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
	sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
	sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
	sys/conf/files: netbsd-7-nhusb
	sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
	sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
	sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
	sys/dev/ic/sl811hs.c: netbsd-7-nhusb
	sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
	sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
	sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
	sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
	sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
	sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
	sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
	sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
	sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
	sys/dev/usb/TODO: netbsd-7-nhusb
	sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
	sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
	sys/dev/usb/auvitek.c: netbsd-7-nhusb
	sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
	sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
	sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
	sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
	sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
	sys/dev/usb/ehci.c: netbsd-7-nhusb
	sys/dev/usb/ehcireg.h: netbsd-7-nhusb
	sys/dev/usb/ehcivar.h: netbsd-7-nhusb
	sys/dev/usb/emdtv.c: netbsd-7-nhusb
	sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
	sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
	sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
	sys/dev/usb/ezload.c: netbsd-7-nhusb
	sys/dev/usb/ezload.h: netbsd-7-nhusb
	sys/dev/usb/files.usb: netbsd-7-nhusb
	sys/dev/usb/hid.c: netbsd-7-nhusb
	sys/dev/usb/hid.h: netbsd-7-nhusb
	sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
	sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
	sys/dev/usb/if_atu.c: netbsd-7-nhusb
	sys/dev/usb/if_atureg.h: netbsd-7-nhusb
	sys/dev/usb/if_aue.c: netbsd-7-nhusb
	sys/dev/usb/if_auereg.h: netbsd-7-nhusb
	sys/dev/usb/if_axe.c: netbsd-7-nhusb
	sys/dev/usb/if_axen.c: netbsd-7-nhusb
	sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
	sys/dev/usb/if_axereg.h: netbsd-7-nhusb
	sys/dev/usb/if_cdce.c: netbsd-7-nhusb
	sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
	sys/dev/usb/if_cue.c: netbsd-7-nhusb
	sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
	sys/dev/usb/if_kue.c: netbsd-7-nhusb
	sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
	sys/dev/usb/if_otus.c: netbsd-7-nhusb
	sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
	sys/dev/usb/if_rum.c: netbsd-7-nhusb
	sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
	sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
	sys/dev/usb/if_run.c: netbsd-7-nhusb
	sys/dev/usb/if_runvar.h: netbsd-7-nhusb
	sys/dev/usb/if_smsc.c: netbsd-7-nhusb
	sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
	sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
	sys/dev/usb/if_udav.c: netbsd-7-nhusb
	sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
	sys/dev/usb/if_upgt.c: netbsd-7-nhusb
	sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
	sys/dev/usb/if_upl.c: netbsd-7-nhusb
	sys/dev/usb/if_ural.c: netbsd-7-nhusb
	sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
	sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
	sys/dev/usb/if_url.c: netbsd-7-nhusb
	sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
	sys/dev/usb/if_urndis.c: netbsd-7-nhusb
	sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
	sys/dev/usb/if_urtw.c: netbsd-7-nhusb
	sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
	sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
	sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
	sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
	sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
	sys/dev/usb/if_zyd.c: netbsd-7-nhusb
	sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
	sys/dev/usb/irmce.c: netbsd-7-nhusb
	sys/dev/usb/moscom.c: netbsd-7-nhusb
	sys/dev/usb/motg.c: netbsd-7-nhusb
	sys/dev/usb/motgvar.h: netbsd-7-nhusb
	sys/dev/usb/ohci.c: netbsd-7-nhusb
	sys/dev/usb/ohcireg.h: netbsd-7-nhusb
	sys/dev/usb/ohcivar.h: netbsd-7-nhusb
	sys/dev/usb/pseye.c: netbsd-7-nhusb
	sys/dev/usb/slurm.c: netbsd-7-nhusb
	sys/dev/usb/stuirda.c: netbsd-7-nhusb
	sys/dev/usb/u3g.c: netbsd-7-nhusb
	sys/dev/usb/uark.c: netbsd-7-nhusb
	sys/dev/usb/uatp.c: netbsd-7-nhusb
	sys/dev/usb/uaudio.c: netbsd-7-nhusb
	sys/dev/usb/uberry.c: netbsd-7-nhusb
	sys/dev/usb/ubsa.c: netbsd-7-nhusb
	sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
	sys/dev/usb/ubsavar.h: netbsd-7-nhusb
	sys/dev/usb/ubt.c: netbsd-7-nhusb
	sys/dev/usb/uchcom.c: netbsd-7-nhusb
	sys/dev/usb/ucom.c: netbsd-7-nhusb
	sys/dev/usb/ucomvar.h: netbsd-7-nhusb
	sys/dev/usb/ucycom.c: netbsd-7-nhusb
	sys/dev/usb/udl.c: netbsd-7-nhusb
	sys/dev/usb/udl.h: netbsd-7-nhusb
	sys/dev/usb/udsbr.c: netbsd-7-nhusb
	sys/dev/usb/udsir.c: netbsd-7-nhusb
	sys/dev/usb/uep.c: netbsd-7-nhusb
	sys/dev/usb/uftdi.c: netbsd-7-nhusb
	sys/dev/usb/uftdireg.h: netbsd-7-nhusb
	sys/dev/usb/ugen.c: netbsd-7-nhusb
	sys/dev/usb/ugensa.c: netbsd-7-nhusb
	sys/dev/usb/uhci.c: netbsd-7-nhusb
	sys/dev/usb/uhcireg.h: netbsd-7-nhusb
	sys/dev/usb/uhcivar.h: netbsd-7-nhusb
	sys/dev/usb/uhid.c: netbsd-7-nhusb
	sys/dev/usb/uhidev.c: netbsd-7-nhusb
	sys/dev/usb/uhidev.h: netbsd-7-nhusb
	sys/dev/usb/uhmodem.c: netbsd-7-nhusb
	sys/dev/usb/uhso.c: netbsd-7-nhusb
	sys/dev/usb/uhub.c: netbsd-7-nhusb
	sys/dev/usb/uipad.c: netbsd-7-nhusb
	sys/dev/usb/uipaq.c: netbsd-7-nhusb
	sys/dev/usb/uirda.c: netbsd-7-nhusb
	sys/dev/usb/uirdavar.h: netbsd-7-nhusb
	sys/dev/usb/ukbd.c: netbsd-7-nhusb
	sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
	sys/dev/usb/ukyopon.c: netbsd-7-nhusb
	sys/dev/usb/ukyopon.h: netbsd-7-nhusb
	sys/dev/usb/ulpt.c: netbsd-7-nhusb
	sys/dev/usb/umass.c: netbsd-7-nhusb
	sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
	sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
	sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
	sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
	sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
	sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
	sys/dev/usb/umassvar.h: netbsd-7-nhusb
	sys/dev/usb/umcs.c: netbsd-7-nhusb
	sys/dev/usb/umct.c: netbsd-7-nhusb
	sys/dev/usb/umidi.c: netbsd-7-nhusb
	sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
	sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
	sys/dev/usb/umodem.c: netbsd-7-nhusb
	sys/dev/usb/umodem_common.c: netbsd-7-nhusb
	sys/dev/usb/umodemvar.h: netbsd-7-nhusb
	sys/dev/usb/ums.c: netbsd-7-nhusb
	sys/dev/usb/uplcom.c: netbsd-7-nhusb
	sys/dev/usb/urio.c: netbsd-7-nhusb
	sys/dev/usb/urio.h: netbsd-7-nhusb
	sys/dev/usb/usb.c: netbsd-7-nhusb
	sys/dev/usb/usb.h: netbsd-7-nhusb
	sys/dev/usb/usb_mem.c: netbsd-7-nhusb
	sys/dev/usb/usb_mem.h: netbsd-7-nhusb
	sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
	sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
	sys/dev/usb/usb_subr.c: netbsd-7-nhusb
	sys/dev/usb/usbdevices.config: netbsd-7-nhusb
	sys/dev/usb/usbdevs: netbsd-7-nhusb
	sys/dev/usb/usbdevs.h: netbsd-7-nhusb
	sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
	sys/dev/usb/usbdi.c: netbsd-7-nhusb
	sys/dev/usb/usbdi.h: netbsd-7-nhusb
	sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
	sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
	sys/dev/usb/usbdivar.h: netbsd-7-nhusb
	sys/dev/usb/usbhid.h: netbsd-7-nhusb
	sys/dev/usb/usbhist.h: netbsd-7-nhusb
	sys/dev/usb/usbroothub.c: netbsd-7-nhusb
	sys/dev/usb/usbroothub.h: netbsd-7-nhusb
	sys/dev/usb/usbroothub_subr.c: delete
	sys/dev/usb/usbroothub_subr.h: delete
	sys/dev/usb/uscanner.c: netbsd-7-nhusb
	sys/dev/usb/uslsa.c: netbsd-7-nhusb
	sys/dev/usb/usscanner.c: netbsd-7-nhusb
	sys/dev/usb/ustir.c: netbsd-7-nhusb
	sys/dev/usb/uthum.c: netbsd-7-nhusb
	sys/dev/usb/utoppy.c: netbsd-7-nhusb
	sys/dev/usb/uts.c: netbsd-7-nhusb
	sys/dev/usb/uvideo.c: netbsd-7-nhusb
	sys/dev/usb/uvisor.c: netbsd-7-nhusb
	sys/dev/usb/uvscom.c: netbsd-7-nhusb
	sys/dev/usb/uyap.c: netbsd-7-nhusb
	sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
	sys/dev/usb/uyurex.c: netbsd-7-nhusb
	sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
	sys/dev/usb/xhci.c: netbsd-7-nhusb
	sys/dev/usb/xhcireg.h: netbsd-7-nhusb
	sys/dev/usb/xhcivar.h: netbsd-7-nhusb
	sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
	sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
	sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
	sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
	sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
	sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
	sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
	sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
	sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
	sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
	sys/external/bsd/drm2/include/linux/err.h: delete
	sys/external/bsd/drm2/include/linux/workqueue.h: delete
	sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
	sys/external/bsd/drm2/linux/linux_work.c: delete
	sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
	sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
	sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
	sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
	sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
	sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
	sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
	sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
	sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
	sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
	sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
	sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
	sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
	sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
	sys/sys/mbuf.h: netbsd-7-nhusb
	usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
	usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
     - kern/48308
     - uhub status notification improvements
     - umass(4) probe fix (applied to HEAD already)
     - ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
  This gives the callback a chance of running when another softint handler
  at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
  the network stack.
     - kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
       softnet_lock held across usb xfr
     - kern/50491 - unkillable wait in usbd_transfer while using usmsc0
       on raspberry pi 2
     - kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)

Revision 1.161.2.1.4.3: download - view: text, markup, annotated - select for diffs
Thu Jan 26 21:54:25 2017 UTC (7 years, 10 months ago) by skrll
Branches: netbsd-7-nhusb
Diff to: previous 1.161.2.1.4.2: preferred, colored; branchpoint 1.161.2.1: preferred, colored; next MAIN 1.161.2.2: preferred, colored
Changes since revision 1.161.2.1.4.2: +6 -5 lines
Sync with HEAD/nhusb

Revision 1.171.2.1: download - view: text, markup, annotated - select for diffs
Sat Jan 7 08:56:42 2017 UTC (7 years, 11 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.171: preferred, colored; next MAIN 1.172: preferred, colored
Changes since revision 1.171: +3 -3 lines
Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.162.2.50: download - view: text, markup, annotated - select for diffs
Tue Dec 27 14:43:59 2016 UTC (7 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.49: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.49: +3 -3 lines
Fix a comment

Revision 1.162.2.49: download - view: text, markup, annotated - select for diffs
Sun Dec 11 17:31:09 2016 UTC (8 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.48: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.48: +4 -3 lines
KASSERT -> KASSERTMSG

Revision 1.162.2.48: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:55:20 2016 UTC (8 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.47: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.47: +3 -3 lines
Sync with HEAD

Revision 1.172: download - view: text, markup, annotated - select for diffs
Sun Dec 4 10:12:35 2016 UTC (8 years ago) by skrll
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, nick-nhusb-base-20170204, nick-nhusb-base-20161204, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +3 -3 lines
Whitespace

Revision 1.161.2.1.4.2: download - view: text, markup, annotated - select for diffs
Wed Sep 7 10:26:39 2016 UTC (8 years, 3 months ago) by skrll
Branches: netbsd-7-nhusb
Diff to: previous 1.161.2.1.4.1: preferred, colored; branchpoint 1.161.2.1: preferred, colored
Changes since revision 1.161.2.1.4.1: +3 -3 lines
Sync with HEAD

Revision 1.161.2.1.4.1: download - view: text, markup, annotated - select for diffs
Tue Sep 6 20:33:09 2016 UTC (8 years, 3 months ago) by skrll
Branches: netbsd-7-nhusb
Diff to: previous 1.161.2.1: preferred, colored
Changes since revision 1.161.2.1: +676 -630 lines
First pass at netbsd-7 updated with USB code from HEAD

Revision 1.162.2.47: download - view: text, markup, annotated - select for diffs
Sun May 29 08:44:31 2016 UTC (8 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.46: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.46: +3 -7 lines
Sync with HEAD

Revision 1.171: download - view: text, markup, annotated - select for diffs
Tue May 17 11:37:50 2016 UTC (8 years, 6 months ago) by pooka
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, localcount-20160914
Branch point for: pgoyette-localcount
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +3 -3 lines
initialize buf to NULL for error branch on line 532

Revision 1.170: download - view: text, markup, annotated - select for diffs
Fri May 6 05:19:32 2016 UTC (8 years, 7 months ago) by skrll
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +2 -6 lines
Fix polling mode and USB keyboards in ddb

Revision 1.169: download - view: text, markup, annotated - select for diffs
Sat Apr 23 10:15:32 2016 UTC (8 years, 7 months ago) by skrll
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +580 -598 lines
Merge nick-nhusb

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
    - kern/48308
    - uhub status notification improvements
    - umass(4) probe fix (applied to HEAD already)
    - ohci(4) short transfer fix

Revision 1.162.2.46: download - view: text, markup, annotated - select for diffs
Sat Apr 16 13:22:00 2016 UTC (8 years, 7 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.45: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.45: +4 -3 lines
Prefix ucom_attach_args struct members with ucaa_ and rename variables
for consistency.

No functional change.

Revision 1.162.2.45: download - view: text, markup, annotated - select for diffs
Fri Mar 25 08:32:57 2016 UTC (8 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.44: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.44: +4 -4 lines
Better debug

Revision 1.162.2.44: download - view: text, markup, annotated - select for diffs
Thu Mar 17 09:04:53 2016 UTC (8 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.43: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.43: +7 -5 lines
All HCDs were fighting the seriaisation of transfers in usbdi.c for isoc
transfers.  Instead allow the HCDs to specify which pipes can handle
removing this serialisation and apply it appropriately.

dwctwo(4) can handle this for all transfer types, but only enable
bulk/isoc for now.

Revision 1.162.2.43: download - view: text, markup, annotated - select for diffs
Sun Feb 28 09:16:20 2016 UTC (8 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.42: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.42: +39 -53 lines
Centralise the up_repeat handling and use the standard pipe method to
start the next transfer.  This allows the removal of a bunch of code
in the upm_done methods for interrupt transfers which had copies of
the upm_start method code.

At the same time we can perform the upm_done method before calling the
transfer callback allowing correct bus_dma(9) operations before
using the transfer DMA buffer.

Revision 1.162.2.42: download - view: text, markup, annotated - select for diffs
Sun Feb 7 15:50:43 2016 UTC (8 years, 10 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.41: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.41: +12 -20 lines
Simplify usbd_do_request/usbd_setup_default_xfer.

G/C usbd_do_request_flags_pipe as it's not required

Revision 1.162.2.41: download - view: text, markup, annotated - select for diffs
Mon Dec 28 10:13:45 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.40: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.40: +8 -3 lines
Drop/re-acquire the pipe lock when destroying up_intrxfer.  The fini
methods expect to be called unlocked.

Revision 1.162.2.40: download - view: text, markup, annotated - select for diffs
Mon Dec 28 09:26:33 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.39: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.39: +15 -13 lines
Strictly follow the sequence abort pipe, destroy xfers, and close pipe as
API now requires.  Plug some memory leaks in some drivers while doing
this.

Also, remove up_refcnt as it was broken and helped leak more memory.

Revision 1.162.2.39: download - view: text, markup, annotated - select for diffs
Sun Dec 27 12:10:00 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.38: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.38: +26 -9 lines
Sync with HEAD (as of 26th Dec)

Revision 1.168: download - view: text, markup, annotated - select for diffs
Tue Dec 22 22:26:16 2015 UTC (8 years, 11 months ago) by skrll
Branches: MAIN
CVS tags: nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +11 -2 lines
In usbd_transfer deal with errors from the HCD transfer (and start)
methods properly by removing the failed xfer from the pipe queue.

For example, an Apple keyboard and FS hub with attached ums(4) on
dwctwo(4) (rpo0/rpi model a) needs this fix otherwise probing
usbd_new_device will never complete after first failed attempt to get
the initial device descriptor.

Revision 1.167: download - view: text, markup, annotated - select for diffs
Tue Dec 22 15:12:39 2015 UTC (8 years, 11 months ago) by skrll
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +8 -7 lines
Improve debug/comments (mostly from nhusb)

Revision 1.166: download - view: text, markup, annotated - select for diffs
Tue Dec 22 13:37:01 2015 UTC (8 years, 11 months ago) by skrll
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +3 -4 lines
Can't use usbd_errstr in USBHIST_LOG as vmstat(1) doesn't like it

Revision 1.162.2.38: download - view: text, markup, annotated - select for diffs
Mon Dec 21 15:26:40 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.37: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.37: +3 -3 lines
Need to usbd_destroy_xfer the interrupt xfer that is automatically
provided using usbd_create_xfer

Revision 1.162.2.37: download - view: text, markup, annotated - select for diffs
Mon Dec 21 15:18:41 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.36: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.36: +2 -8 lines
usbd_close_pipe should never be called with NULL for pipe.  Remove some
dead DIAGNOSTIC code when pipe == NULL

Revision 1.162.2.36: download - view: text, markup, annotated - select for diffs
Sat Dec 19 10:11:13 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.35: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.35: +3 -3 lines
Use NULL instead of 0 for (function) pointer

Revision 1.162.2.35: download - view: text, markup, annotated - select for diffs
Sat Dec 19 10:06:32 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.34: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.34: +8 -2 lines
Add some debug

Revision 1.162.2.34: download - view: text, markup, annotated - select for diffs
Sat Dec 19 10:04:35 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.33: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.33: +7 -2 lines
KNF

Revision 1.162.2.33: download - view: text, markup, annotated - select for diffs
Wed Oct 21 07:36:31 2015 UTC (9 years, 1 month ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.32: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.32: +13 -12 lines
Cache the usbd_bus pointer in the usbd_xfer struct for memory allocation
and softc access.  This removes a level of indirection for memory
allocation.

Also cache the xfer pipe methods for later (temporary?) use.

Revision 1.162.2.32: download - view: text, markup, annotated - select for diffs
Mon Oct 12 10:18:54 2015 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.31: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.31: +27 -18 lines
Provide init/fini methods for HCDs

Revision 1.162.2.31: download - view: text, markup, annotated - select for diffs
Sun Oct 11 09:17:51 2015 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.30: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.30: +7 -7 lines
Update ubm_allocx with the isoc frame count parameter and use it in
dwctwo(4)

Revision 1.162.2.30: download - view: text, markup, annotated - select for diffs
Sat Oct 10 07:23:25 2015 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.29: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.29: +4 -3 lines
KNF

Revision 1.162.2.29: download - view: text, markup, annotated - select for diffs
Tue Oct 6 21:32:15 2015 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.28: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.28: +60 -32 lines
Move from usbd_{alloc,free}_xfer and usbd_{alloc,free}_buffer to
usbd_{create,destroy}_xfer.  The API change will allow future changes
to HCDs to simplify the transfer resource allocation and activation.

Several devices tested including ucom, umass, smsc, uvideo, and uaudio.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Sat Sep 26 13:59:28 2015 UTC (9 years, 2 months ago) by skrll
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +9 -6 lines
Deal with polling in usbd_start_next

Revision 1.162.2.28: download - view: text, markup, annotated - select for diffs
Tue Sep 22 12:06:01 2015 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.27: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.27: +3 -4 lines
Sync with HEAD

Revision 1.164: download - view: text, markup, annotated - select for diffs
Sun Aug 23 11:12:01 2015 UTC (9 years, 3 months ago) by skrll
Branches: MAIN
CVS tags: nick-nhusb-base-20150921
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +2 -12 lines
Expose usbd_xfer_isread

Revision 1.162.2.27: download - view: text, markup, annotated - select for diffs
Thu Jun 11 07:12:08 2015 UTC (9 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.26: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.26: +2 -39 lines
There is nothing to do on a STALL during a control transfer (aka
"protocol stall") accoriding to the USB specifications, so remove
the code in usbd_do_request_flags_pipe that tries to recover from
this.

Revision 1.162.2.26: download - view: text, markup, annotated - select for diffs
Mon Mar 30 12:09:30 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.25: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.25: +27 -72 lines
Replace #ifdef DIAGNOTIC code with KASSERT{,MSG}

Revision 1.162.2.25: download - view: text, markup, annotated - select for diffs
Mon Mar 30 12:07:03 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.24: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.24: +3 -3 lines
s/0/NULL/ for pointer

Revision 1.162.2.24: download - view: text, markup, annotated - select for diffs
Sun Mar 29 11:13:34 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.23: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.23: +22 -16 lines
Fix transfer buffer handling post the URQ_AUTO_BUFFER removal

Revision 1.162.2.23: download - view: text, markup, annotated - select for diffs
Sat Mar 28 15:56:45 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.22: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.22: +3 -3 lines
s/0/NULL/ for pointer

Revision 1.162.2.22: download - view: text, markup, annotated - select for diffs
Thu Mar 19 17:26:43 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.21: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.21: +78 -78 lines
Do the same as OpenBSD and get rid of the *_handle typedefs and use
plain structures insteads

Revision 1.162.2.21: download - view: text, markup, annotated - select for diffs
Wed Mar 18 15:45:45 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.20: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.20: +2 -12 lines
Expose usbd_xfer_isread

Revision 1.162.2.20: download - view: text, markup, annotated - select for diffs
Tue Mar 17 19:02:44 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.19: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.19: +3 -3 lines
Spello

Revision 1.162.2.19: download - view: text, markup, annotated - select for diffs
Wed Mar 11 07:48:42 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.18: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.18: +3 -3 lines
Fix malloc to kmem conversion by grabbing nendpt before calling
usbd_fill_iface_data

Revision 1.162.2.18: download - view: text, markup, annotated - select for diffs
Fri Mar 6 14:08:39 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.17: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.17: +3 -3 lines
Another USBD_NOMEM rather than ENOMEM where appropriate.

Pointed out by Takahiro HAYASHI. Thanks.

Revision 1.162.2.17: download - view: text, markup, annotated - select for diffs
Fri Mar 6 12:54:29 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.16: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.16: +3 -3 lines
Use USBD_NOMEM rather than ENOMEM where appropriate.

Revision 1.162.2.16: download - view: text, markup, annotated - select for diffs
Fri Mar 6 12:52:51 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.15: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.15: +2 -3 lines
Whitespace

Revision 1.162.2.15: download - view: text, markup, annotated - select for diffs
Fri Mar 6 12:52:09 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.14: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.14: +3 -3 lines
Actually grab the err value being reported in USBHIST_LOG.

Pointed out by Takahiro HAYASHI. Thanks.

Revision 1.162.2.14: download - view: text, markup, annotated - select for diffs
Thu Mar 5 12:39:08 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.13: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.13: +4 -5 lines
Minor USBHIST_LOG changes

Revision 1.162.2.13: download - view: text, markup, annotated - select for diffs
Thu Mar 5 09:06:20 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.12: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.12: +3 -8 lines
What was I thinking... usbd_free_xfer handles the buffer free.

Need more coffee

Revision 1.162.2.12: download - view: text, markup, annotated - select for diffs
Thu Mar 5 08:48:07 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.11: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.11: +10 -5 lines
Don't leak memory in previous

Revision 1.162.2.11: download - view: text, markup, annotated - select for diffs
Thu Mar 5 08:34:47 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.10: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.10: +23 -42 lines
Kill URQ_AUTO_BUFFER

Revision 1.124.4.2.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 11 15:40:38 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-5-1
Diff to: previous 1.124.4.2: preferred, colored; next MAIN 1.124.4.3: preferred, colored
Changes since revision 1.124.4.2: +4 -4 lines
Pull up following revision(s) (requested by aymeric in ticket #1948):
	sys/dev/usb/usbdi.c: revision 1.163
clip xfer->actlen also in the !DIAGNOSTIC case

Revision 1.124.4.2.6.1: download - view: text, markup, annotated - select for diffs
Wed Feb 11 15:40:12 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-5-2
Diff to: previous 1.124.4.2: preferred, colored; next MAIN 1.124.4.3: preferred, colored
Changes since revision 1.124.4.2: +4 -4 lines
Pull up following revision(s) (requested by aymeric in ticket #1948):
	sys/dev/usb/usbdi.c: revision 1.163
clip xfer->actlen also in the !DIAGNOSTIC case

Revision 1.124.4.3: download - view: text, markup, annotated - select for diffs
Wed Feb 11 15:39:33 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-5
Diff to: previous 1.124.4.2: preferred, colored; branchpoint 1.124: preferred, colored; next MAIN 1.125: preferred, colored
Changes since revision 1.124.4.2: +4 -4 lines
Pull up following revision(s) (requested by aymeric in ticket #1948):
	sys/dev/usb/usbdi.c: revision 1.163
clip xfer->actlen also in the !DIAGNOSTIC case

Revision 1.134.8.1: download - view: text, markup, annotated - select for diffs
Wed Feb 11 14:38:25 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-6-0
Diff to: previous 1.134: preferred, colored; next MAIN 1.135: preferred, colored
Changes since revision 1.134: +4 -4 lines
Pull up following revision(s) (requested by aymeric in ticket #1250):
	sys/dev/usb/usbdi.c: revision 1.163
clip xfer->actlen also in the !DIAGNOSTIC case

Revision 1.134.10.1: download - view: text, markup, annotated - select for diffs
Wed Feb 11 14:36:15 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-6-1
Diff to: previous 1.134: preferred, colored; next MAIN 1.135: preferred, colored
Changes since revision 1.134: +4 -4 lines
Pull up following revision(s) (requested by aymeric in ticket #1250):
	sys/dev/usb/usbdi.c: revision 1.163
clip xfer->actlen also in the !DIAGNOSTIC case

Revision 1.134.4.1: download - view: text, markup, annotated - select for diffs
Wed Feb 11 14:35:13 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-6
Diff to: previous 1.134: preferred, colored; next MAIN 1.135: preferred, colored
Changes since revision 1.134: +4 -4 lines
Pull up following revision(s) (requested by aymeric in ticket #1250):
	sys/dev/usb/usbdi.c: revision 1.163
clip xfer->actlen also in the !DIAGNOSTIC case

Revision 1.161.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 11 09:32:19 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-7
CVS tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Branch point for: netbsd-7-nhusb
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +4 -4 lines
Pull up following revision(s) (requested by aymeric in ticket #505):
	sys/dev/usb/usbdi.c: revision 1.163
clip xfer->actlen also in the !DIAGNOSTIC case

Revision 1.163: download - view: text, markup, annotated - select for diffs
Mon Feb 9 20:12:47 2015 UTC (9 years, 10 months ago) by aymeric
Branches: MAIN
CVS tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +4 -4 lines
clip xfer->actlen also in the !DIAGNOSTIC case

Revision 1.162.2.10: download - view: text, markup, annotated - select for diffs
Sun Feb 1 13:09:15 2015 UTC (9 years, 10 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.9: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.9: +3 -3 lines
Remove newline character in USBHIST_LOG format

Revision 1.162.2.9: download - view: text, markup, annotated - select for diffs
Fri Dec 5 09:37:50 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.8: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.8: +64 -64 lines
KNF. Remove ( ) from return statements.

Revision 1.162.2.8: download - view: text, markup, annotated - select for diffs
Wed Dec 3 22:33:56 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.7: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.7: +2 -3 lines
Remove #include <sys/malloc.h> where it's not (no longer) needed

Revision 1.162.2.7: download - view: text, markup, annotated - select for diffs
Wed Dec 3 14:18:07 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.6: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.6: +7 -5 lines
Replace malloc(9) with kmem(9)

Revision 1.162.2.6: download - view: text, markup, annotated - select for diffs
Wed Dec 3 12:52:07 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.5: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.5: +283 -283 lines
The grand renaming of structure members.

No functional change.

Revision 1.162.2.5: download - view: text, markup, annotated - select for diffs
Tue Dec 2 09:00:34 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.4: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.4: +104 -59 lines
Step #1 of memory allocation re-organisation.

Centralised the buffer allocation routine which now supports DMA
and non-DMA capable host controllers.  Remove the
ubm_{alloc,free}m methods from usbd_bus_methods.

The buffer allocation is only allowed in thread context and,
therefore, negates the usefulness of the reserve dma code which
is removed in this change.

USBD_NO_COPY is also no longer required as usbd_transfer and
usbd_transfer_complete now track buffer usage and handle any
copying.

Revision 1.162.2.4: download - view: text, markup, annotated - select for diffs
Mon Dec 1 12:38:39 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.3: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.3: +24 -24 lines
Add prefixes to method structures member names. No functional change.

Revision 1.162.2.3: download - view: text, markup, annotated - select for diffs
Sun Nov 30 16:38:45 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.2: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.2: +5 -8 lines
Use ASSERT_SLEEPABLE.

Revision 1.162.2.2: download - view: text, markup, annotated - select for diffs
Sun Nov 30 13:14:11 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162.2.1: preferred, colored; branchpoint 1.162: preferred, colored
Changes since revision 1.162.2.1: +4 -4 lines
Whitespace

Revision 1.162.2.1: download - view: text, markup, annotated - select for diffs
Sun Nov 30 12:18:58 2014 UTC (10 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +31 -31 lines
Use C99 types. u_int{8,16,32,64}_t to uint{8,16,32,64}_t.

No functional change.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Fri Sep 12 16:40:38 2014 UTC (10 years, 3 months ago) by skrll
Branches: MAIN
CVS tags: nick-nhusb-base
Branch point for: nick-nhusb
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +135 -69 lines
Improve USB debugging with USBHIST based on KERNHIST.

Convert some DPRINTFs to USBHIST_LOG and allow usbdebug, ehcidebug and
umassdebug to be changed via sysctl.

Remove the #define mess in usb.h.

This was started by mrg@ and updated by reinoud@

Revision 1.139.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:03:51 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.139.2.2: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.2: +30 -93 lines
Rebase to HEAD as of a few days ago.

Revision 1.160.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:54:59 2014 UTC (10 years, 4 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.160: preferred, colored; next MAIN 1.161: preferred, colored
Changes since revision 1.160: +2 -5 lines
Rebase.

Revision 1.161: download - view: text, markup, annotated - select for diffs
Tue Aug 5 06:35:24 2014 UTC (10 years, 4 months ago) by skrll
Branches: MAIN
CVS tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base
Branch point for: netbsd-7
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +2 -5 lines
Simplify the freeing of the interrupt pipe transfer.  Inspired by OpenBSD.

Revision 1.133.2.5: download - view: text, markup, annotated - select for diffs
Thu May 22 11:40:37 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.133.2.4: preferred, colored; branchpoint 1.133: preferred, colored; next MAIN 1.134: preferred, colored
Changes since revision 1.133.2.4: +35 -94 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.152.4.2: download - view: text, markup, annotated - select for diffs
Sun May 18 17:45:48 2014 UTC (10 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.152.4.1: preferred, colored; branchpoint 1.152: preferred, colored; next MAIN 1.153: preferred, colored
Changes since revision 1.152.4.1: +24 -87 lines
sync with head

Revision 1.160: download - view: text, markup, annotated - select for diffs
Sat Nov 30 12:16:14 2013 UTC (11 years ago) by skrll
Branches: MAIN
CVS tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +3 -4 lines
Simplify

Revision 1.159: download - view: text, markup, annotated - select for diffs
Fri Oct 4 12:47:04 2013 UTC (11 years, 2 months ago) by skrll
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +4 -4 lines
Small KNF

Revision 1.158: download - view: text, markup, annotated - select for diffs
Thu Oct 3 07:35:37 2013 UTC (11 years, 2 months ago) by skrll
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +19 -36 lines
Simply the code now that all (real) HCDs provide a get_lock method.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Thu Sep 26 10:31:02 2013 UTC (11 years, 2 months ago) by skrll
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +2 -4 lines
Remove the usbd_do_request_async_cb prototype. This was missed from the
previous commit.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Thu Sep 26 07:25:31 2013 UTC (11 years, 2 months ago) by skrll
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +4 -47 lines
Remove usbd_do_request_async. It's callback was calling usbd_free_xfer
from softint context.

Adjust callers appropriately

	- usbd_clear_endpoint_stall_async is already triggered via a
	  usb_task, so simply call usbd_do_request.

	- uhidev_set_report_async had one caller in ukbd_set_leds.
	  Convert this usage to use usb_task as well.

Discussed with mrg@

Revision 1.152.4.1: download - view: text, markup, annotated - select for diffs
Wed Aug 28 23:59:27 2013 UTC (11 years, 3 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +10 -7 lines
sync with head

Revision 1.155: download - view: text, markup, annotated - select for diffs
Thu Aug 22 20:00:43 2013 UTC (11 years, 3 months ago) by aymeric
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +4 -3 lines
Check that the xfer we are about to abort didn't finish yet since abort
methods fail in this case (at least ehci's one).

Revision 1.154: download - view: text, markup, annotated - select for diffs
Thu Jul 11 19:46:44 2013 UTC (11 years, 5 months ago) by aymeric
Branches: MAIN
CVS tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +5 -3 lines
In usbd_transfer(), abort the xfer if it is interrupted by a signal while in
progress.
This prevents that xfer from being freed while still on queue, and ensuing
panic().

Revision 1.153: download - view: text, markup, annotated - select for diffs
Sat Jul 6 14:38:54 2013 UTC (11 years, 5 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +6 -6 lines
Use NULL instead of 0 when returning a NULL pointer.
Also, remedy minor whitespace issue.

Revision 1.139.2.2: download - view: text, markup, annotated - select for diffs
Sun Jun 23 06:20:22 2013 UTC (11 years, 5 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.139.2.1: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.1: +11 -10 lines
resync from head

Revision 1.152: download - view: text, markup, annotated - select for diffs
Thu Apr 4 13:27:56 2013 UTC (11 years, 8 months ago) by skrll
Branches: MAIN
CVS tags: khorben-n900
Branch point for: rmind-smpnet
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +10 -9 lines
Don't take the bus lock in usbd_transfer_complete when polling.

Sprinkle || polling in KASSERTsw

Revision 1.151: download - view: text, markup, annotated - select for diffs
Sun Mar 24 22:38:45 2013 UTC (11 years, 8 months ago) by skrll
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +3 -3 lines
Add || defined(OHCI_DEBUG) to pick up usbd_dump_pipe

Fixes kern/47690

Revision 1.139.2.1: download - view: text, markup, annotated - select for diffs
Mon Feb 25 00:29:42 2013 UTC (11 years, 9 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +34 -13 lines
resync with head

Revision 1.133.2.4: download - view: text, markup, annotated - select for diffs
Wed Jan 23 00:06:16 2013 UTC (11 years, 10 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.133.2.3: preferred, colored; branchpoint 1.133: preferred, colored
Changes since revision 1.133.2.3: +33 -12 lines
sync with head

Revision 1.150: download - view: text, markup, annotated - select for diffs
Tue Jan 22 13:27:59 2013 UTC (11 years, 10 months ago) by jmcneill
Branches: MAIN
CVS tags: yamt-pagecache-base8, agc-symver-base, agc-symver
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +4 -3 lines
usbd_open_pipe and usbd_open_pipe_intr take different flags! Make sure
the value of USBD_MPSAFE doesn't conflict with flags for either of them, as
it can be passed to both.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Tue Jan 22 13:18:47 2013 UTC (11 years, 10 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +4 -4 lines
Use usbd_setup_pipe_flags instead of usbd_setup_pipe so the supplied flags
get passed through.

Revision 1.148: download - view: text, markup, annotated - select for diffs
Tue Jan 22 12:40:43 2013 UTC (11 years, 10 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +14 -2 lines
- Add a USBD_MPSAFE flag to usbd_open_pipe. If not set, acquire KERNEL_LOCK
  before invoking xfer callbacks on this pipe.
- Add an extra flags parameter to usb_init_task. If USBD_TASKQ_MPSAFE is not
  present, acquire KERNEL_LOCK before invoking the task callback.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Tue Jan 22 08:33:18 2013 UTC (11 years, 10 months ago) by skrll
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +3 -3 lines
Improve a DIAGNOSTIC so it doesn't confuse people who need more coffee,
e.g. me.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Sat Jan 19 15:10:05 2013 UTC (11 years, 10 months ago) by skrll
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +3 -3 lines
Pay attention to the return value from cv_wait_sig as well in
usbd_transfer.  hi christos.

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sat Jan 19 14:36:41 2013 UTC (11 years, 10 months ago) by skrll
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +8 -4 lines
Improve some DIAGNOSTIC stuff

Revision 1.144: download - view: text, markup, annotated - select for diffs
Wed Jan 16 15:36:49 2013 UTC (11 years, 10 months ago) by christos
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +7 -4 lines
don't wait for completion if we were interrupted.

Revision 1.133.2.3: download - view: text, markup, annotated - select for diffs
Wed Jan 16 05:33:37 2013 UTC (11 years, 11 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.133.2.2: preferred, colored; branchpoint 1.133: preferred, colored
Changes since revision 1.133.2.2: +3 -3 lines
sync with (a bit old) head

Revision 1.143: download - view: text, markup, annotated - select for diffs
Tue Jan 15 23:57:13 2013 UTC (11 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +3 -3 lines
Don't do the xfer once, wait till it is done. I did not find this, someone
else did. Fixes slow devices such as scanners.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Sat Jan 5 23:34:20 2013 UTC (11 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +2 -3 lines
fix debug variables.
- include opt_usb.h in usb.h so that USB_DEBUG gets set properly in it.
- normalize and sort debugging variables

Revision 1.141: download - view: text, markup, annotated - select for diffs
Sat Jan 5 01:30:17 2013 UTC (11 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +4 -2 lines
- need opt_usb.h if depending on USB_DEBUG
- remove trailing whitespace
- add missing KERNEL_RCSID

Revision 1.140: download - view: text, markup, annotated - select for diffs
Tue Dec 4 15:10:04 2012 UTC (12 years ago) by skrll
Branches: MAIN
CVS tags: yamt-pagecache-base7
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +3 -3 lines
Improve DIAGNOSTIC printf

Revision 1.133.2.2: download - view: text, markup, annotated - select for diffs
Tue Oct 30 17:22:11 2012 UTC (12 years, 1 month ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.133.2.1: preferred, colored; branchpoint 1.133: preferred, colored
Changes since revision 1.133.2.1: +97 -31 lines
sync with head

Revision 1.139: download - view: text, markup, annotated - select for diffs
Sun Jul 15 21:13:31 2012 UTC (12 years, 5 months ago) by mrg
Branches: MAIN
CVS tags: yamt-pagecache-base6
Branch point for: tls-maxphys
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +13 -7 lines
commit my workaround for PR 46648 for now, as the more involved
fix is not ready yet:

move the clear endpoint stall async call into the task thread,
to avoid trying to call kmem_alloc() from a softint thread.

XXX ideally moving callbacks into the task thread (or perhaps
a different high priority task thread) would be better than this
workaround, once that method is working.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Sun Jun 10 06:15:55 2012 UTC (12 years, 6 months ago) by mrg
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +86 -26 lines
merge the jmcneill-usbmp branch.  many thanks to jared for the
initial work, and every one else who has tested things for me.
this is largely my fault at this point :-)

the main changes are something like:

        - usbd_bus_methods{} gains a get_lock() to enable the
          host controller to provide a lock for the USB code.
          if the lock isn't provided, old-style protection is
          (partially) applied.

        - ehci/ohci/uhci have been converted to the new
          interfaces, including mutex/cv/etc conversion.

        - usbdivar.h contains a discussion about locking and
          what locks are held for which method calls.  more
          to come for usbdi(9) here.

        - audio drivers (uaudio, umidi, auvitek) have been
          properly SMPified now that USB is ready.

        - scsi drivers have been modified to take the kernel
          lock explicitly before calling into scsi code.

        - usb pipes are associated with a lock, that is the
          same as the controller lock.  (this could be split
          up further in the future.)

        - several usbfoo_locked() or usbfoo_unlocked()
          functions have been added to the usbdi(9) to
          enable functionality with or without the USB
          lock (per controller) already being held.

the TODO.usbmp file has specific details on what is left to
do, including what device-specific changes should be done now
that the whole framework is ready.

Revision 1.134.2.16: download - view: text, markup, annotated - select for diffs
Sat Jun 2 08:07:25 2012 UTC (12 years, 6 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.15: preferred, colored; branchpoint 1.134: preferred, colored; next MAIN 1.135: preferred, colored
Changes since revision 1.134.2.15: +23 -8 lines
convert usbd_{intr,bulk}_transfer() in the USBMP world:
- add a new USBD_SYNCHRONOUS_SIG flag for transfers
- in usbd_transfer(), if USBD_SYNCHRONOUS_SIG is set use cv_wait_sig()
  (or tlseep(xfer, PZERO|PATCH, ...) for the unconverted controllers)
- add a usbd_sync_transfer_sig() front-end to usbd_transfer()
- greatly simplify both usbd_{intr,bulk}_transfer() to just
  usbd_sync_transfer_sig() and usbd_get_xfer_status().

this fixes lockdebug issues where usbd_{intr,bulk}_transfer() where it
taking the pipe lock, when usbd_transfer() would call functions that
expect the pipe lock not to be taken (and try to taken it.)

Revision 1.133.2.1: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:08:09 2012 UTC (12 years, 8 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +15 -13 lines
sync with head

Revision 1.137: download - view: text, markup, annotated - select for diffs
Sun Mar 11 01:06:07 2012 UTC (12 years, 9 months ago) by mrg
Branches: MAIN
CVS tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base10
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +4 -5 lines
minor cleanups from usbmp:
- move usbd_delay_ms() into usbdivar.h in the usb_subr.c section
- minor rcsid fixes
- copyright maintenence

Revision 1.136: download - view: text, markup, annotated - select for diffs
Sun Mar 11 00:34:46 2012 UTC (12 years, 9 months ago) by mrg
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +4 -4 lines
pull down from usbmp branch:
- remove usbd_bus{} intr_context member, and replace the checks against
  it with cpu_intr_p() and cpu_softintr_p().

Revision 1.134.2.15: download - view: text, markup, annotated - select for diffs
Tue Mar 6 18:26:48 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.14: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.14: +4 -5 lines
sync to -current

Revision 1.135: download - view: text, markup, annotated - select for diffs
Tue Mar 6 02:36:46 2012 UTC (12 years, 9 months ago) by mrg
Branches: MAIN
CVS tags: jmcneill-usbmp-base6
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +2 -8 lines
pull down from usbmp branch:

- remove SPLUSBCHECK.  it has been broken and disabled for ages.

Revision 1.134.2.14: download - view: text, markup, annotated - select for diffs
Sun Feb 26 05:05:45 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.13: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.13: +3 -3 lines
- add some more "XXXSMP ok" tags
- use cpu_softintr_p() instead of checking LP_INTR directly

Revision 1.134.2.13: download - view: text, markup, annotated - select for diffs
Sat Feb 25 20:46:34 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.12: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.12: +4 -4 lines
replace the (diagnostic-only) intr_context with checks against LP_INTR
and cpu_intr_p().

XXX: there's one check that changes behaviour

Revision 1.134.2.12: download - view: text, markup, annotated - select for diffs
Sat Feb 25 10:26:24 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.11: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.11: +4 -4 lines
copyright maintenence.

Revision 1.134.2.11: download - view: text, markup, annotated - select for diffs
Thu Feb 23 09:25:04 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.10: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.10: +6 -6 lines
update a bunch of comments for reality.  usb lock isn't a "thread lock",
which is terminology we copied from the audiomp code.

Revision 1.134.2.10: download - view: text, markup, annotated - select for diffs
Mon Feb 20 22:42:47 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.9: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.9: +2 -6 lines
keep the thread lock taken for the abort() callback.

Revision 1.134.2.9: download - view: text, markup, annotated - select for diffs
Mon Feb 20 06:50:21 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.8: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.8: +3 -3 lines
remove the intr_lock from the mp usb api, it wasn't used.

Revision 1.134.2.8: download - view: text, markup, annotated - select for diffs
Mon Feb 20 05:09:36 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.7: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.7: +4 -3 lines
timeout_handle callout is MPSAFE, mark it as such.

Revision 1.134.2.7: download - view: text, markup, annotated - select for diffs
Mon Feb 20 02:12:24 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.6: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.6: +16 -7 lines
several changes to the MP usb apis, and other misc changes:

- usb_transfer_complete()/usb_insert_transfer()/usb_start_next() all
  must have the thread lock held

- (*soft_intr) now is called with the thread lock held unless we are
  in polling mode.  add a usb_soft_intr() to deal with this

- XXX usbd_set_polling() api exists to increase/decrease the polling
  count, but only ukbd uses.  everyone else open codes it, but this
  should probably be changed

- (*abort) is now called with the thread lock held

- update several comments to not refer to splusb() anymore

- add many more asserts

- use more c99 struct initialisers

Revision 1.134.2.6: download - view: text, markup, annotated - select for diffs
Sun Feb 19 21:37:12 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.5: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.5: +2 -5 lines
remove the spl handling from usb_insert_transfer() since we're
already holding the relevant lock (which is asserted.)

Revision 1.134.2.5: download - view: text, markup, annotated - select for diffs
Fri Dec 9 01:53:00 2011 UTC (13 years ago) by mrg
Branches: jmcneill-usbmp
CVS tags: jmcneill-usbmp-pre-base2
Diff to: previous 1.134.2.4: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.4: +11 -4 lines
- make pipe->close method take the thread lock

- convert usb_taskq to use mutex/cv

- convert needs_explore usage into a cv on the thread lock

- remove KERNEL_*LOCK from uaudio and umidi, since we're supposedly
  MPSAFE here now

- use IPL_SCHED instead of IPL_USB (aka biglocked) interrupts

- drop the audio thread lock when calling into usb when it may sleep,
  avoiding a deadlock between audiowrite and audioioctl.  this fixes
  mixerctl -a vs. playing hanging the system
  XXX probably need to check this in a bunch more places.

Revision 1.134.2.4: download - view: text, markup, annotated - select for diffs
Thu Dec 8 22:38:47 2011 UTC (13 years ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.3: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.3: +5 -6 lines
make ohci mostly work again.

Revision 1.134.2.1.2.4: download - view: text, markup, annotated - select for diffs
Thu Dec 8 22:04:56 2011 UTC (13 years ago) by mrg
Branches: mrg-ohci-jmcneill-usbmp
Diff to: previous 1.134.2.1.2.3: preferred, colored; branchpoint 1.134.2.1: preferred, colored; next MAIN 1.134.2.2: preferred, colored
Changes since revision 1.134.2.1.2.3: +10 -9 lines
sync usb_subr.c and usbdivar.h with the branch entirely, and most of
usbdi.c as well.

Revision 1.134.2.1.2.3: download - view: text, markup, annotated - select for diffs
Thu Dec 8 20:21:31 2011 UTC (13 years ago) by mrg
Branches: mrg-ohci-jmcneill-usbmp
Diff to: previous 1.134.2.1.2.2: preferred, colored; branchpoint 1.134.2.1: preferred, colored
Changes since revision 1.134.2.1.2.2: +31 -26 lines
pull across a few more of the changes from the main branch.

Revision 1.134.2.1.2.2: download - view: text, markup, annotated - select for diffs
Thu Dec 8 10:22:40 2011 UTC (13 years ago) by mrg
Branches: mrg-ohci-jmcneill-usbmp
Diff to: previous 1.134.2.1.2.1: preferred, colored; branchpoint 1.134.2.1: preferred, colored
Changes since revision 1.134.2.1.2.1: +2 -7 lines
merge a few more things from the main branch.  uaudio@ohci still works.

Revision 1.134.2.1.2.1: download - view: text, markup, annotated - select for diffs
Thu Dec 8 07:53:56 2011 UTC (13 years ago) by mrg
Branches: mrg-ohci-jmcneill-usbmp
Diff to: previous 1.134.2.1: preferred, colored
Changes since revision 1.134.2.1: +3 -3 lines
there's something wrong with uaudio@ohci on the usbmp branch.
this is the minimally working port of ohci to mpusb, and it works
with uaudio but is lacking many other changes, yet.

Revision 1.134.2.3: download - view: text, markup, annotated - select for diffs
Thu Dec 8 03:10:09 2011 UTC (13 years ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.2: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.2: +5 -5 lines
convert the remaining wakeup(xfer)'s to use the xfer->cv.

utoppy - untested.

Revision 1.134.2.2: download - view: text, markup, annotated - select for diffs
Thu Dec 8 02:51:08 2011 UTC (13 years ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.134.2.1: preferred, colored; branchpoint 1.134: preferred, colored
Changes since revision 1.134.2.1: +30 -28 lines
- convert usbd_bus_methods{} and usbd_pipe_methods{} to use
  c99 struct initialisers

- move the locks from the pipe to the bus, since we'll need
  access to them from bus-level ops

- remove dead-for-years SPLUSBCHECK and replaced it with
  asserts that the thread lock is held

- begin to document the locking scheme

- convert usbd_*lock_pipe() into real function-like macros

Revision 1.134.2.1: download - view: text, markup, annotated - select for diffs
Sun Dec 4 13:23:17 2011 UTC (13 years ago) by jmcneill
Branches: jmcneill-usbmp
CVS tags: mrg-ohci-jmcneill-usbmp-base
Branch point for: mrg-ohci-jmcneill-usbmp
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +43 -15 lines
Make ehci mpsafe.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Sun Nov 27 03:25:00 2011 UTC (13 years ago) by jmcneill
Branches: MAIN
CVS tags: netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base
Branch point for: netbsd-6-1, netbsd-6-0, netbsd-6, jmcneill-usbmp
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +11 -2 lines
assert kernel_lock in usbd_transfer, usb_transfer_complete,
and usb_insert_transfer

Revision 1.133: download - view: text, markup, annotated - select for diffs
Sat Jul 30 20:05:36 2011 UTC (13 years, 4 months ago) by jmcneill
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +5 -5 lines
PR# port-i386/18818: cannot enter ddb with usb keyboard

- ohci: when polling, make sure sc_eintrs has the OHCI_WDH flag set
  otherwise ohci_intr1 won't actually read data
- usbdi: kick the host controller by calling its soft_intr callback when
  switching out of polling mode too

DDB with a USB keyboard works for me now with ohci.

Revision 1.131.6.1: download - view: text, markup, annotated - select for diffs
Thu Jun 23 14:20:12 2011 UTC (13 years, 5 months ago) by cherry
Branches: cherry-xenmp
Diff to: previous 1.131: preferred, colored; next MAIN 1.132: preferred, colored
Changes since revision 1.131: +8 -4 lines
Catchup with rmind-uvmplock merge.

Revision 1.127.4.2: download - view: text, markup, annotated - select for diffs
Sun Jun 12 00:24:27 2011 UTC (13 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.127.4.1: preferred, colored; branchpoint 1.127: preferred, colored; next MAIN 1.128: preferred, colored
Changes since revision 1.127.4.1: +6 -2 lines
sync with head

Revision 1.132: download - view: text, markup, annotated - select for diffs
Thu Jun 9 19:08:33 2011 UTC (13 years, 6 months ago) by matt
Branches: MAIN
CVS tags: rmind-uvmplock-nbase, rmind-uvmplock-base
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +8 -4 lines
Move EHCI_DEBUG, OHCI_DEBUG, UHCI_DEBUG, USB_DEBUG, UHUB_DEBUG to opt_usb.h
(ya dependencies).
Cleanup usb_mem.c a little more and add block tracking code.  Help find
corruption problems.
Comment out the SPEED check for ETTF.  XXX why doesn't that work right?

Revision 1.127.4.1: download - view: text, markup, annotated - select for diffs
Sat Mar 5 20:54:17 2011 UTC (13 years, 9 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +6 -6 lines
sync with head

Revision 1.131: download - view: text, markup, annotated - select for diffs
Mon Dec 20 18:49:11 2010 UTC (13 years, 11 months ago) by phx
Branches: MAIN
CVS tags: matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, cherry-xenmp-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: cherry-xenmp
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +3 -3 lines
usbd_dump_*() functions are also needed when just EHCI_DEBUG is defined,
without USB_DEBUG.

Revision 1.127.2.1: download - view: text, markup, annotated - select for diffs
Sat Nov 6 08:08:41 2010 UTC (14 years, 1 month ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.127: preferred, colored; next MAIN 1.128: preferred, colored
Changes since revision 1.127: +5 -5 lines
Sync with HEAD.

Revision 1.130: download - view: text, markup, annotated - select for diffs
Wed Nov 3 22:34:24 2010 UTC (14 years, 1 month ago) by dyoung
Branches: MAIN
CVS tags: uebayasi-xip-base4
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +5 -5 lines
Stop using the compatibility macros USB_ATTACH(), USB_DETACH(),
USB_MATCH(), et cetera.  These files produce the same assembly
(according to objdump -d) before and after the change

Revision 1.129: download - view: text, markup, annotated - select for diffs
Sat Sep 4 05:09:06 2010 UTC (14 years, 3 months ago) by cegger
Branches: MAIN
CVS tags: yamt-nfs-mp-base11, uebayasi-xip-base3
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +1 -2 lines
revert previous.
requested from mrg

Revision 1.128: download - view: text, markup, annotated - select for diffs
Fri Sep 3 23:15:09 2010 UTC (14 years, 3 months ago) by cegger
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +4 -3 lines
fix NULL pointer dereference on detaching:
Attach an USB device that looks like this:
ugen1 at uhub0 port 2
ugen1: detached
ugen1: at uhub0 port 2 (addr 3) disconnected


When unplugging the device:

usb_transfer_complete: xfer=0xffff80000832a800 not busy 0x00000055
usb_transfer_complete: bad dequeue 0xffff80000832a800 != 0x0

Revision 1.124.4.1.4.1: download - view: text, markup, annotated - select for diffs
Wed Apr 21 00:27:54 2010 UTC (14 years, 7 months ago) by matt
Branches: matt-nb5-mips64
CVS tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Diff to: previous 1.124.4.1: preferred, colored; next MAIN 1.124.4.2: preferred, colored
Changes since revision 1.124.4.1: +5 -2 lines
sync to netbsd-5

Revision 1.121.20.3: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:04:08 2010 UTC (14 years, 9 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.121.20.2: preferred, colored; branchpoint 1.121: preferred, colored; next MAIN 1.122: preferred, colored
Changes since revision 1.121.20.2: +6 -3 lines
sync with head

Revision 1.124.4.2: download - view: text, markup, annotated - select for diffs
Wed Jan 27 20:56:45 2010 UTC (14 years, 10 months ago) by sborrill
Branches: netbsd-5
CVS tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, matt-nb5-pq3-base, matt-nb5-pq3
Branch point for: netbsd-5-2, netbsd-5-1
Diff to: previous 1.124.4.1: preferred, colored; branchpoint 1.124: preferred, colored
Changes since revision 1.124.4.1: +5 -2 lines
Pull up the following revisions(s) (requested by bouyer in ticket #1247):
	sys/dev/usb/usbdi.c:	revision 1.127

Fix leak of a usbd_xfer_handle when a interrupt pipe is aborted then
closed. Confirmed to fix the memory leak on close() with umodem(4) and
uplcom(4).

Revision 1.127: download - view: text, markup, annotated - select for diffs
Sat Jan 16 17:03:03 2010 UTC (14 years, 11 months ago) by bouyer
Branches: MAIN
CVS tags: yamt-nfs-mp-base9, yamt-nfs-mp-base10, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +5 -2 lines
Fix leak of a usbd_xfer_handle when a interrupt pipe is aborted then
closed:
usbd_open_pipe_intr() allocates a usbd_xfer_handle for pipe->intrxfer.
Most usb device drivers using interrupt pipes call usbd_abort_pipe()
then usbd_close_pipe(), usbd_close_pipe() is supposed to free pipe->intrxfer.
But usbd_abort_pipe() calls [uoe]hci_device_intr_abort() which,
if the xfer aborted is pipe's intrxfer, sets pipe->intrxfer to NULL.
So usbd_close_pipe() can't free it and the usbd_xfer_handle is lost.

To fix this, in usbd_abort_pipe() remember the pipe->intrxfer's value
on entrie, and if it's different after usbd_ar_pipe(), call
usbd_free_xfer with the original value.
Confirmed to fix the memory leak on close() with umodem(4) and
uplcom(4).

Revision 1.119.12.8: download - view: text, markup, annotated - select for diffs
Thu Nov 12 08:04:04 2009 UTC (15 years, 1 month ago) by uebayasi
Branches: itohy-usb1
Diff to: previous 1.119.12.7: preferred, colored; branchpoint 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119.12.7: +2 -2 lines
Reduce diff to HEAD.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Thu Nov 12 07:58:32 2009 UTC (15 years, 1 month ago) by uebayasi
Branches: MAIN
CVS tags: matt-premerge-20091211
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +3 -3 lines
Typo in a debug printf.

Revision 1.119.12.7: download - view: text, markup, annotated - select for diffs
Thu Nov 12 07:55:42 2009 UTC (15 years, 1 month ago) by uebayasi
Branches: itohy-usb1
Diff to: previous 1.119.12.6: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.12.6: +28 -23 lines
Sort functions to reduce the diff.  Put a comment about a backward-incompatible
API change.

Revision 1.121.20.2: download - view: text, markup, annotated - select for diffs
Mon May 4 08:13:22 2009 UTC (15 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.121.20.1: preferred, colored; branchpoint 1.121: preferred, colored
Changes since revision 1.121.20.1: +20 -38 lines
sync with head.

Revision 1.124.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 19 13:19:09 2009 UTC (15 years, 10 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.124: preferred, colored; next MAIN 1.125: preferred, colored
Changes since revision 1.124: +11 -2 lines
Sync with HEAD.

Revision 1.121.16.2: download - view: text, markup, annotated - select for diffs
Sat Jan 17 13:29:10 2009 UTC (15 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.121.16.1: preferred, colored; branchpoint 1.121: preferred, colored; next MAIN 1.122: preferred, colored
Changes since revision 1.121.16.1: +17 -10 lines
Sync with HEAD.

Revision 1.124.4.1: download - view: text, markup, annotated - select for diffs
Sat Dec 13 21:44:42 2008 UTC (16 years ago) by bouyer
Branches: netbsd-5
CVS tags: netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b
Branch point for: matt-nb5-mips64
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +11 -2 lines
Pull up following revision(s) (requested by jmorse in ticket #185):
	sys/dev/usb/usbdi.c: revision 1.125
	sys/dev/usb/umass.c: revision 1.130
	sys/dev/usb/usbdi.h: revision 1.77
PR#39651
Fix two problems in umass:
 * usb xfers being freed before being removed from pipe, leading to null
deref
 * config_activate requests not supported, which leads to
config_deactivate requests not being passed through. Spotted by jmcneill@=
Added mechanism to usbdi allowing the default pipe to be aborted

Revision 1.123.4.2: download - view: text, markup, annotated - select for diffs
Sat Dec 13 01:14:53 2008 UTC (16 years ago) by haad
Branches: haad-dm
Diff to: previous 1.123.4.1: preferred, colored; branchpoint 1.123: preferred, colored; next MAIN 1.124: preferred, colored
Changes since revision 1.123.4.1: +11 -2 lines
Update haad-dm branch to haad-dm-base2.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Fri Dec 12 05:35:11 2008 UTC (16 years ago) by jmorse
Branches: MAIN
CVS tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, mjf-devfs2-base, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, haad-nbase2, haad-dm-base2, haad-dm-base
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +11 -2 lines
PR#39651
Fix two problems in umass:
 * usb xfers being freed before being removed from pipe, leading to null deref
 * config_activate requests not supported, which leads to config_deactivate requests not being passed through. Spotted by jmcneill@

Added mechanism to usbdi allowing the default pipe to be aborted

Revision 1.123.4.1: download - view: text, markup, annotated - select for diffs
Sun Oct 19 22:17:10 2008 UTC (16 years, 1 month ago) by haad
Branches: haad-dm
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +10 -12 lines
Sync with HEAD.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sat Oct 11 05:07:20 2008 UTC (16 years, 2 months ago) by jmcneill
Branches: MAIN
CVS tags: netbsd-5-base, matt-mips64-base2, haad-dm-base1, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap, netbsd-5
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +10 -12 lines
If we're not dealing with an interrupt endpoint, invoke the xfer's
callback after calling the xfer's done method to give the device driver
a change to reschedule the same xfer, from FreeBSD.

Revision 1.122.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 23 04:31:37 2008 UTC (16 years, 5 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.122: preferred, colored; next MAIN 1.123: preferred, colored
Changes since revision 1.122: +3 -28 lines
Sync w/ -current. 34 merge conflicts to follow.

Revision 1.121.18.2: download - view: text, markup, annotated - select for diffs
Wed Jun 4 02:05:21 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.121.18.1: preferred, colored; branchpoint 1.121: preferred, colored; next MAIN 1.122: preferred, colored
Changes since revision 1.121.18.1: +3 -28 lines
sync with head

Revision 1.121.16.1: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:23:56 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +3 -35 lines
Sync with HEAD.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Mon May 26 18:00:33 2008 UTC (16 years, 6 months ago) by drochner
Branches: MAIN
CVS tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl
Branch point for: haad-dm
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +3 -28 lines
some cleanup:
-unifdef
-since the roothub attach doesn't use locators, don't call
 config_stdsubmatch() -- it is a no-op in that case
-ifsubmatch has configuration and interface always set to useful values,
 remove unnecessary checks
-remove now unused locator definitions from shared header

Revision 1.119.12.6: download - view: text, markup, annotated - select for diffs
Wed May 21 05:04:03 2008 UTC (16 years, 6 months ago) by itohy
Branches: itohy-usb1
Diff to: previous 1.119.12.5: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.12.5: +4 -2 lines
Hold mbuf chain in struct usbd_xfer.

Revision 1.121.18.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:34:52 2008 UTC (16 years, 7 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +2 -9 lines
sync with head.

Revision 1.121.20.1: download - view: text, markup, annotated - select for diffs
Fri May 16 02:25:12 2008 UTC (16 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +2 -9 lines
sync with head.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Mon Apr 28 20:24:01 2008 UTC (16 years, 7 months ago) by martin
Branches: MAIN
CVS tags: yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +2 -9 lines
Remove clause 3 and 4 from TNF licenses

Revision 1.120.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 6 23:30:45 2007 UTC (17 years, 1 month ago) by matt
Branches: matt-armv6
CVS tags: matt-armv6-prevmlocking
Diff to: previous 1.120: preferred, colored; next MAIN 1.121: preferred, colored
Changes since revision 1.120: +4 -4 lines
sync with HEAD

Revision 1.108.2.5: download - view: text, markup, annotated - select for diffs
Sat Oct 27 11:34:44 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.108.2.4: preferred, colored; branchpoint 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108.2.4: +4 -4 lines
sync with head.

Revision 1.119.18.2: download - view: text, markup, annotated - select for diffs
Fri Oct 26 15:48:00 2007 UTC (17 years, 1 month ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.119.18.1: preferred, colored; branchpoint 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119.18.1: +4 -4 lines
Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.120.6.1: download - view: text, markup, annotated - select for diffs
Thu Oct 25 22:39:53 2007 UTC (17 years, 1 month ago) by bouyer
Branches: bouyer-xenamd64
Diff to: previous 1.120: preferred, colored; next MAIN 1.121: preferred, colored
Changes since revision 1.120: +4 -4 lines
Sync with HEAD.

Revision 1.119.4.4: download - view: text, markup, annotated - select for diffs
Tue Oct 23 20:09:57 2007 UTC (17 years, 1 month ago) by ad
Branches: vmlocking
Diff to: previous 1.119.4.3: preferred, colored; branchpoint 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119.4.3: +4 -4 lines
Sync with head.

Revision 1.121: download - view: text, markup, annotated - select for diffs
Fri Oct 19 12:01:23 2007 UTC (17 years, 1 month ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, mjf-devfs, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jmcneill-pm-base, jmcneill-base, hpcarm-cleanup-base, cube-autoconf-base, cube-autoconf, bouyer-xeni386-nbase, bouyer-xeni386-merge1, bouyer-xeni386-base, bouyer-xeni386, bouyer-xenamd64-base2, bouyer-xenamd64-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp, mjf-devfs2
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +4 -4 lines
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h

Revision 1.108.2.4: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:39:24 2007 UTC (17 years, 3 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.108.2.3: preferred, colored; branchpoint 1.108: preferred, colored
Changes since revision 1.108.2.3: +16 -36 lines
sync with head.

Revision 1.119.4.3: download - view: text, markup, annotated - select for diffs
Mon Aug 20 18:38:01 2007 UTC (17 years, 3 months ago) by ad
Branches: vmlocking
Diff to: previous 1.119.4.2: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.2: +9 -7 lines
Sync with HEAD.

Revision 1.119.18.1: download - view: text, markup, annotated - select for diffs
Thu Aug 16 11:03:24 2007 UTC (17 years, 4 months ago) by jmcneill
Branches: jmcneill-pm
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +9 -7 lines
Sync with HEAD.

Revision 1.119.14.1: download - view: text, markup, annotated - select for diffs
Wed Aug 15 13:48:49 2007 UTC (17 years, 4 months ago) by skrll
Branches: nick-csl-alignment
Diff to: previous 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119: +9 -7 lines
Sync with HEAD.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Wed Aug 15 04:00:34 2007 UTC (17 years, 4 months ago) by kiyohara
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking-base, nick-csl-alignment-base5
Branch point for: matt-armv6, bouyer-xenamd64
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +9 -7 lines
* splsoftusb, IPL_SOFTUSB, and IPL_HARDUSB defines in usbdi.h
-> the current names are confusing (didn't change other drivers)
* fix invalid memory access in usbd_transfer (kern/24636)
-> needed for this driver
* fix USB HC detach race condition (kern/32011)
-> main patch needed for this driver, sc_dying changes in other drivers
not necessary but seem right to me

Patch from Matthew Orgass.
  http://mail-index.netbsd.org/tech-kern/2007/06/26/0001.html

Revision 1.119.4.2: download - view: text, markup, annotated - select for diffs
Sun Jul 15 15:52:51 2007 UTC (17 years, 5 months ago) by ad
Branches: vmlocking
Diff to: previous 1.119.4.1: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.1: +7 -5 lines
Sync with head.

Revision 1.119.4.1: download - view: text, markup, annotated - select for diffs
Sun Jul 1 21:49:03 2007 UTC (17 years, 5 months ago) by ad
Branches: vmlocking
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +5 -7 lines
Adapt to callout API change.

Revision 1.119.12.5: download - view: text, markup, annotated - select for diffs
Thu Jun 28 10:07:16 2007 UTC (17 years, 5 months ago) by itohy
Branches: itohy-usb1
Diff to: previous 1.119.12.4: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.12.4: +13 -8 lines
Do not use xfer contents after non-error completion of transfer method,
since the callback function may reuse the xfer.
Pointed out by Matthew Orgass.

Revision 1.119.12.4: download - view: text, markup, annotated - select for diffs
Fri Jun 22 10:36:42 2007 UTC (17 years, 5 months ago) by itohy
Branches: itohy-usb1
Diff to: previous 1.119.12.3: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.12.3: +1 -1 lines
Oops, xfer->rqflags -> xfer->flags

Revision 1.119.12.3: download - view: text, markup, annotated - select for diffs
Fri Jun 22 10:12:24 2007 UTC (17 years, 5 months ago) by itohy
Branches: itohy-usb1
Diff to: previous 1.119.12.2: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.12.2: +25 -5 lines
- Introduce USBD_CALLBACK_AS_TASK flag, which causes the callback function
  is called as a USB_TASKQ_DRIVER task, with thread context.
  This makes sharing Ethernet drivers with FreeBSD (that requires context
  for some network-related code) much easier.
  The flag is not used by NetBSD/OpenBSD for now.

- Rename xfer->async_task as xfer->task, now used by both async xfer and the
  callback above.

- Use 0 as idle task queue ID (definition USB_TASKQ_IDLE added), and
  increase USB_TASKQ_HC and USB_TASKQ_DRIVER accordingly.
  This makes passing zero-initialized (but not initialized by usb_init_task())
  usb_task to usb_rem_task() be ignored, rather than panic the system.

Revision 1.119.12.2: download - view: text, markup, annotated - select for diffs
Thu May 31 23:15:18 2007 UTC (17 years, 6 months ago) by itohy
Branches: itohy-usb1
Diff to: previous 1.119.12.1: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.12.1: +28 -6 lines
usbdi(9): Change usbd_map_buffer_mbuf to return the result, since
	mbuf(9) chain may be fragmented and mapping failure will happen.
-void usbd_map_buffer_mbuf(usbd_xfer_handle xfer, struct mbuf *chain)
+usbd_status usbd_map_buffer_mbuf(usbd_xfer_handle xfer, struct mbuf *chain)

usbdi(9): Add more diagnostic assertions.
uhci(4): fix aux dma for mbuf mapping.
slhci(4): fix repeated interrupt transfer (not tested).
ehci/slhci/ohci/uhci: Add checks where mbuf(4) transfer is not supported.

usb_port.h: Add some compat macros for FreeBSD.
usb_mem_nodma.c: Fix typos.

Revision 1.119.12.1: download - view: text, markup, annotated - select for diffs
Tue May 22 14:57:49 2007 UTC (17 years, 6 months ago) by itohy
Branches: itohy-usb1
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +310 -82 lines
Overhaul of USB stack, mostly DMA related

This applies to NetBSD 4.99.13 (March 1, 2007)

usbdi(9) interface is based on FreeBSD version, excluding
 - removal of portability code

Patch most NetBSD changes, excluding
 - DMA memory "reserve", since we don't need contiguous buffers any longer
 - volatiles in DMA structure, since it should not be needed
   with proper bus_dmamap_sync(9)s

DMA/non-DMA memory management overhaul
 - Move all DMA related code to usb_mem.[ch]
   (add usb_alloc_buffer_dma(), usb_free_buffer_dma(), etc.).
   XXX Should usb_mem.[ch] be renamed as usb_mem_dma.[ch] ?
 - Add corresponding non-DMA code to usb_mem_nodma.[ch] .
   Currently just use malloc(9).
 - Above files are conditionally used by config framework (added
   attributes to conf/files and dev/usb/files.usb).
 - Add diagnostic panics when resource allocation is requested
   on interrupt context.
 - Change memory allocations (that require context) from NOWAIT to WAITOK.

Allocate DMA/non-DMA buffer per host interface, not globally.
 advantage:	Buffers can be freed on detaching host interface.
		Activity of a host interface does not affect others.
 disadvantages:	It possibly consumes more memory.

API changes
 - usbd_alloc_xfer() is changed:
    old: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev);
    new: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev,
		usbd_pipe_handle pipe);
 - pipe argument of usbd_setup_*xfer() are now unused
   XXX the pipe argument should be removed?
 - add mapping APIs
 - async request will be processed as a task (kernel thread context),
   and delayed to some extent
 - usbdivar.h: struct usbd_xfer: renamed a member "allocbuf" to "hcbuffer"
   (mapped/allocated/refered buffer for HCI driver)
 - usb_port.h: change usb_proc_ptr from  struct ptoc *  to struct lwp *
 - usb_port.h: add usb_sigproc_ptr for psignal(9) (struct proc *)
 - usb.h: add UE_MAXPKTSZ(ep) and UE_MAXPKTSZ_MASK macros for USB 2.0

changes to USB device drivers
 - atu, aue, axe, cdce, cue, kue, rum, udav, upl, ural, url,
   uaudio, ubt, ucom, ugen, uhidev, uirda, ulpt, umidi, urio,
   uscanner, ustir, utoppy:
    * catch up API change of usbd_alloc_xfer()
 - umass, usscanner:
    * catch up API change of usbd_alloc_xfer()
    * eliminate memory copy for large transfer

ohci
 - free resources on detach
 - add lots of bus_dmamap_sync() operations
 - simplify the code of loading std chain
 - rewrite code of looking up TD/ITD from DMA addr by using allocation chunk
 - add workaround for CMD Tech 670 and 673 chipsets
 - make sure resources are not allocated in interrupt context
 - add support for mapping buffer and mbuf

slhci
 - allocate xfer and slhci_xfer at once, and simplify relevant code
 - add slhci_detach()
 - remove second arg of slhci_attach() since it is the same as the first arg.
 - add support for "mapping" (no, it doesn't map since it doesn't do DMA)
   buffer and mbuf
 - add pcmcia frontend
 - NOT TESTED, missing hardware

ehci
 - add lots of bus_dmamap_sync() operations, possibly too many
 - make sure resources are not allocated in interrupt context
 - add support for mapping buffer and mbuf
 - done only simple test

uhci
 - add lots of bus_dmamap_sync() operations, possibly too many
 - make sure resources are not allocated in interrupt context
 - add support for mapping buffer and mbuf

To do
 - review, test, debug
 - rewrite network drivers to utilize usbd_map_buffer_mbuf()
 - rewrite uaudio(4) to eliminate memcpy
 - "pipe" argument of usbd_setup_*xfer() should eventually be removed

Revision 1.114.2.2: download - view: text, markup, annotated - select for diffs
Fri Apr 6 18:43:51 2007 UTC (17 years, 8 months ago) by bouyer
Branches: netbsd-4
CVS tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm
Diff to: previous 1.114.2.1: preferred, colored; branchpoint 1.114: preferred, colored; next MAIN 1.115: preferred, colored
Changes since revision 1.114.2.1: +37 -15 lines
Pull up following revision(s) (requested by pavel in ticket #556):
	sys/dev/usb/ugen.c: revision 1.89
	sys/dev/usb/usb.c: revisions 1.92, 1.93
	sys/dev/usb/usb_subr.c: revision 1.139, 1.140
	sys/dev/usb/usb.h: revision 1.75
	sys/dev/usb/usbdi.h: revisions 1.71, 1.72
	sys/dev/usb/usbdi.c: revision 1.115, 1.116
	sys/dev/usb/uhid.c: revision 1.73
Restore compatibility of USB_DEVICEINFO ioctl and reads from /dev/usb with
NetBSD 3.x.  The code is conditionally compiled depending on COMPAT_30.

Revision 1.118.2.1: download - view: text, markup, annotated - select for diffs
Tue Feb 27 16:54:09 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.118: preferred, colored; next MAIN 1.119: preferred, colored
Changes since revision 1.118: +9 -31 lines
- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Mon Feb 26 13:44:40 2007 UTC (17 years, 9 months ago) by drochner
Branches: MAIN
CVS tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, nick-csl-alignment-base, mjf-ufs-trans-base, mjf-ufs-trans, matt-mips64-base, matt-mips64, itohy-usb1-base, hpcarm-cleanup, ad-audiomp-base, ad-audiomp
Branch point for: vmlocking, nick-csl-alignment, jmcneill-pm, itohy-usb1
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +9 -31 lines
-g/c usbd_init()/usbd_finish() which don't do anything useful
-use <fs/unicode.h> for utf16->utf8 conversion instead of a private
 implementation
-streamline the COMPAT_30 utf16->ascii conversion a bit: remove
 length check (USB_MAX_STRING_LEN is too large to be useful) and
 replace array index arithmetics

Revision 1.108.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:10:50 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.108.2.2: preferred, colored; branchpoint 1.108: preferred, colored
Changes since revision 1.108.2.2: +2 -7 lines
sync with head.

Revision 1.114.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 21 13:26:41 2007 UTC (17 years, 9 months ago) by tron
Branches: netbsd-4
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +2 -3 lines
Pull up following revision(s) (requested by mlelstv in ticket #450):
	sys/dev/usb/ohci.c: revision 1.181
	sys/dev/usb/uhci.c: revision 1.207
	sys/dev/usb/ehci.c: revision 1.122
	sys/dev/usb/usbdi.c: revision 1.118
The diagnostic code doesn't track busy_free correctly when a
device gets removed. However, when the diagnostic check fails,
it is much better to complete the free operation than to abort
it, because this just causes an infinite loop.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sat Feb 10 07:52:29 2007 UTC (17 years, 10 months ago) by mlelstv
Branches: MAIN
Branch point for: yamt-idlelwp
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +2 -3 lines
The diagnostic code doesn't track busy_free correctly when a
device gets removed. However, when the diagnostic check fails,
it is much better to complete the free operation than to abort
it, because this just causes an infinite loop.

Revision 1.110.20.3: download - view: text, markup, annotated - select for diffs
Thu Feb 1 08:48:31 2007 UTC (17 years, 10 months ago) by ad
Branches: newlock2
Diff to: previous 1.110.20.2: preferred, colored; branchpoint 1.110: preferred, colored; next MAIN 1.111: preferred, colored
Changes since revision 1.110.20.2: +2 -6 lines
Sync with head.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Mon Jan 29 01:52:45 2007 UTC (17 years, 10 months ago) by hubertf
Branches: MAIN
CVS tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +2 -6 lines
Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.

Revision 1.110.20.2: download - view: text, markup, annotated - select for diffs
Fri Jan 12 00:57:49 2007 UTC (17 years, 11 months ago) by ad
Branches: newlock2
Diff to: previous 1.110.20.1: preferred, colored; branchpoint 1.110: preferred, colored
Changes since revision 1.110.20.1: +39 -17 lines
Sync with head.

Revision 1.108.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:49:39 2006 UTC (17 years, 11 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.108.2.1: preferred, colored; branchpoint 1.108: preferred, colored
Changes since revision 1.108.2.1: +47 -23 lines
sync with head.

Revision 1.110.22.2: download - view: text, markup, annotated - select for diffs
Sun Dec 10 07:18:18 2006 UTC (18 years ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.110.22.1: preferred, colored; branchpoint 1.110: preferred, colored; next MAIN 1.111: preferred, colored
Changes since revision 1.110.22.1: +40 -18 lines
sync with head.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Tue Dec 5 20:45:36 2006 UTC (18 years ago) by macallan
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +4 -3 lines
move int j into #ifdef COMPAT_30 to avoid an unused variable warning when
building without COMPAT_30

Revision 1.115: download - view: text, markup, annotated - select for diffs
Sun Dec 3 22:34:58 2006 UTC (18 years ago) by pavel
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +39 -18 lines
Restore compatibility of USB_DEVICEINFO ioctl and reads from /dev/usb with
NetBSD 3.x. Patch from Stephan Thesing provided in
http://mail-index.netbsd.org/current-users/2006/03/21/0002.html, with some
modifications by me.
See also
http://mail-index.netbsd.org/current-users/2006/08/29/0017.html

The code is conditionally compiled depending on COMPAT_30.

Also fix a leak of struct usb_event in usbread() introduced while converting
on-stack variables to dynamic allocation.

Reviewed by martin@.

Revision 1.110.20.1: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:34:51 2006 UTC (18 years ago) by ad
Branches: newlock2
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +10 -8 lines
Sync with head.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Thu Nov 16 01:33:27 2006 UTC (18 years, 1 month ago) by christos
Branches: MAIN
CVS tags: netbsd-4-base
Branch point for: netbsd-4
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +3 -3 lines
__unused removal on arguments; approved by core.

Revision 1.110.22.1: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:06:53 2006 UTC (18 years, 1 month ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +10 -8 lines
sync with head

Revision 1.113: download - view: text, markup, annotated - select for diffs
Thu Oct 12 01:32:00 2006 UTC (18 years, 2 months ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base2
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +4 -4 lines
- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.112: download - view: text, markup, annotated - select for diffs
Wed Oct 4 23:55:22 2006 UTC (18 years, 2 months ago) by dogcow
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +6 -4 lines
add braces for if-else statement, in the event that DPRINTF is an
empty statement; shuts gcc up about 'empty statement in if-else'.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Tue Oct 3 18:20:57 2006 UTC (18 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +4 -4 lines
Coverity CID 3014: Don't check for NULL after deref (from Arnaud Lacombe)

Revision 1.108.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 15:07:45 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +3 -3 lines
sync with head.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Sat Dec 24 20:27:52 2005 UTC (18 years, 11 months ago) by perry
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5, yamt-uio_vmspace, yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, yamt-pdpolicy, simonb-timecounters-base, simonb-timecounters, simonb-timcounters-final, rpaulo-netinet-merge-pcb-base, rpaulo-netinet-merge-pcb, peter-altq-base, peter-altq, gdamore-uart-base, gdamore-uart, elad-kernelauth-base, elad-kernelauth, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, newlock2
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +3 -3 lines
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:24:01 2005 UTC (19 years ago) by christos
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +2 -2 lines
merge ktrace-lwp.

Revision 1.103.6.5: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:08:06 2005 UTC (19 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.103.6.4: preferred, colored; branchpoint 1.103: preferred, colored; next MAIN 1.104: preferred, colored
Changes since revision 1.103.6.4: +17 -11 lines
Sync with HEAD. Here we go again...

Revision 1.108: download - view: text, markup, annotated - select for diffs
Mon May 30 04:21:39 2005 UTC (19 years, 6 months ago) by christos
Branches: MAIN
CVS tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Branch point for: yamt-lazymbuf
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +5 -5 lines
- const poisoning
- eliminate variable shadowing

Revision 1.107: download - view: text, markup, annotated - select for diffs
Mon May 2 15:32:18 2005 UTC (19 years, 7 months ago) by augustss
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +14 -8 lines
Use UTF8 to encode strings read from the device (instead of using '?' for
characters >=0x100).

Also add serial number string to the device information struct.

Revision 1.103.6.4: download - view: text, markup, annotated - select for diffs
Tue Nov 2 07:53:03 2004 UTC (20 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.103.6.3: preferred, colored; branchpoint 1.103: preferred, colored
Changes since revision 1.103.6.3: +83 -2 lines
Sync with HEAD.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sun Oct 24 12:52:40 2004 UTC (20 years, 1 month ago) by augustss
Branches: MAIN
CVS tags: yamt-km-base4, yamt-km-base3, yamt-km-base2, yamt-km-base, yamt-km, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, kent-audio2-base, kent-audio2, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +3 -2 lines
Whine about not being able to figure out default language if we are debugging.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Sat Oct 23 13:26:34 2004 UTC (20 years, 1 month ago) by augustss
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +82 -2 lines
Make an iterator abstraction for looping through all descriptors.

Move usb_get_string() and make it public.

Revision 1.103.6.3: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:33:52 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.103.6.2: preferred, colored; branchpoint 1.103: preferred, colored
Changes since revision 1.103.6.2: +2 -2 lines
Fix the sync with head I botched.

Revision 1.103.6.2: download - view: text, markup, annotated - select for diffs
Sat Sep 18 14:51:47 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.103.6.1: preferred, colored; branchpoint 1.103: preferred, colored
Changes since revision 1.103.6.1: +0 -0 lines
Sync with HEAD.

Revision 1.103.6.1: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:51:42 2004 UTC (20 years, 4 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +7 -6 lines
Sync with HEAD

Revision 1.103.8.1: download - view: text, markup, annotated - select for diffs
Fri Jul 23 15:46:53 2004 UTC (20 years, 4 months ago) by tron
Branches: netbsd-2-0
CVS tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Diff to: previous 1.103: preferred, colored; next MAIN 1.104: preferred, colored
Changes since revision 1.103: +7 -6 lines
Pull up revision 1.104 (requested by mycroft in ticket #688):
ugen_isoc_rintr() may recycle the xfer immediately.  Therefore, we avoid
touching the xfer after calling the callback in usb_transfer_complete().
From PR 25960.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sat Jul 17 20:16:13 2004 UTC (20 years, 5 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +7 -6 lines
ugen_isoc_rintr() may recycle the xfer immediately.  Therefore, we avoid
touching the xfer after calling the callback in usb_transfer_complete().
From PR 25960.

Revision 1.79.2.8: download - view: text, markup, annotated - select for diffs
Fri Oct 18 02:44:40 2002 UTC (22 years, 2 months ago) by nathanw
Branches: nathanw_sa
CVS tags: nathanw_sa_end
Diff to: previous 1.79.2.7: preferred, colored; next MAIN 1.80: preferred, colored
Changes since revision 1.79.2.7: +1 -1 lines
Catch up to -current.

Revision 1.81.2.5: download - view: text, markup, annotated - select for diffs
Thu Oct 10 18:42:49 2002 UTC (22 years, 2 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.81.2.4: preferred, colored; branchpoint 1.81: preferred, colored; next MAIN 1.82: preferred, colored
Changes since revision 1.81.2.4: +3 -3 lines
sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.103: download - view: text, markup, annotated - select for diffs
Fri Sep 27 15:37:38 2002 UTC (22 years, 2 months ago) by provos
Branches: MAIN
CVS tags: netbsd-2-0-base, nathanw_sa_before_merge, nathanw_sa_base, kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Branch point for: netbsd-2-0, ktrace-lwp
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +3 -3 lines
remove trailing \n in panic().  approved perry.

Revision 1.81.2.4: download - view: text, markup, annotated - select for diffs
Fri Sep 6 08:47:19 2002 UTC (22 years, 3 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.81.2.3: preferred, colored; branchpoint 1.81: preferred, colored
Changes since revision 1.81.2.3: +33 -33 lines
sync kqueue branch with HEAD

Revision 1.79.2.7: download - view: text, markup, annotated - select for diffs
Thu Aug 1 02:46:09 2002 UTC (22 years, 4 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.79.2.6: preferred, colored
Changes since revision 1.79.2.6: +33 -33 lines
Catch up to -current.

Revision 1.99.8.3: download - view: text, markup, annotated - select for diffs
Mon Jul 15 10:36:20 2002 UTC (22 years, 5 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.99.8.2: preferred, colored; branchpoint 1.99: preferred, colored; next MAIN 1.100: preferred, colored
Changes since revision 1.99.8.2: +33 -33 lines
catch up with -current.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Thu Jul 11 21:14:35 2002 UTC (22 years, 5 months ago) by augustss
Branches: MAIN
CVS tags: gehenna-devsw-base
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +33 -33 lines
Get rid of trailing white space.

Revision 1.81.2.3: download - view: text, markup, annotated - select for diffs
Sun Jun 23 17:49:16 2002 UTC (22 years, 5 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.81.2.2: preferred, colored; branchpoint 1.81: preferred, colored
Changes since revision 1.81.2.2: +9 -11 lines
catch up with -current on kqueue branch

Revision 1.99.8.2: download - view: text, markup, annotated - select for diffs
Thu Jun 20 16:34:18 2002 UTC (22 years, 5 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.99.8.1: preferred, colored; branchpoint 1.99: preferred, colored
Changes since revision 1.99.8.1: +5 -7 lines
catch up with -current.

Revision 1.79.2.6: download - view: text, markup, annotated - select for diffs
Thu Jun 20 03:47:02 2002 UTC (22 years, 6 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.79.2.5: preferred, colored
Changes since revision 1.79.2.5: +9 -11 lines
Catch up to -current.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Sat Jun 1 23:51:04 2002 UTC (22 years, 6 months ago) by lukem
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +5 -7 lines
SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups

Revision 1.99.8.1: download - view: text, markup, annotated - select for diffs
Thu May 30 14:47:49 2002 UTC (22 years, 6 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +6 -6 lines
Catch up with -current.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Sun May 19 06:24:33 2002 UTC (22 years, 7 months ago) by augustss
Branches: MAIN
CVS tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +6 -6 lines
Update dma memory access API a little.

Revision 1.79.2.5: download - view: text, markup, annotated - select for diffs
Mon Apr 1 07:47:42 2002 UTC (22 years, 8 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.79.2.4: preferred, colored
Changes since revision 1.79.2.4: +3 -3 lines
Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.81.2.2: download - view: text, markup, annotated - select for diffs
Sat Mar 16 16:01:43 2002 UTC (22 years, 9 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.81.2.1: preferred, colored; branchpoint 1.81: preferred, colored
Changes since revision 1.81.2.1: +11 -9 lines
Catch up with -current.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Thu Feb 28 04:49:16 2002 UTC (22 years, 9 months ago) by thorpej
Branches: MAIN
CVS tags: newlock-base, newlock, ifpoll-base, eeh-devprop-base, eeh-devprop
Branch point for: gehenna-devsw
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +3 -3 lines
Don't use NULL for non-pointer arguments.

Revision 1.79.2.4: download - view: text, markup, annotated - select for diffs
Thu Feb 28 04:14:36 2002 UTC (22 years, 9 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.79.2.3: preferred, colored
Changes since revision 1.79.2.3: +11 -9 lines
Catch up to -current.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Tue Feb 26 10:22:48 2002 UTC (22 years, 9 months ago) by augustss
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +3 -3 lines
Fix a typo that prevented timeout in control requests from working.
Spotted by Alfred Perlstein <bright@mu.org>.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Wed Feb 20 20:30:14 2002 UTC (22 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +3 -3 lines
Prefix structure members to protect them against clashes with eg. c++ keywords.
Suggested by Alfred Perlstein, from FreeBSD, ok'd by augustss

Revision 1.96: download - view: text, markup, annotated - select for diffs
Mon Feb 11 15:11:49 2002 UTC (22 years, 10 months ago) by augustss
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +9 -7 lines
Give usbd_do_request_flags() an extra argument for the timeout.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Mon Feb 11 12:42:48 2002 UTC (22 years, 10 months ago) by augustss
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +3 -3 lines
A little const poisoning.  (From FreeBSD.)

Revision 1.81.2.1: download - view: text, markup, annotated - select for diffs
Thu Jan 10 19:59:09 2002 UTC (22 years, 11 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +101 -15 lines
Sync kqueue branch with -current.

Revision 1.79.2.3: download - view: text, markup, annotated - select for diffs
Tue Jan 8 00:32:21 2002 UTC (22 years, 11 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.79.2.2: preferred, colored
Changes since revision 1.79.2.2: +52 -12 lines
Catch up to -current.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Dec 30 20:26:59 2001 UTC (22 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +5 -2 lines
Make sure we don't have any pending softintrs when entering polling mode.
Thanks to Darrin for finding and fixing this problem when using USB
keyboards in DDB.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Mon Dec 24 21:36:15 2001 UTC (22 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +21 -3 lines
Add some more DIAGNOSTIC tests.
Make usb_match_device() match on USB_PRODUCT_ANY.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Wed Dec 12 15:38:58 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +7 -3 lines
Some more paranoia checks when DIAGNOSTIC.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Wed Dec 12 15:23:59 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +2 -3 lines
Move usbd_clear_endpoint_toggle() prototype to usbdi.h.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Mon Dec 3 01:47:12 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +4 -4 lines
Handle vendor/product lookup with a common routine.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sun Dec 2 23:25:25 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +18 -2 lines
Add a subroutine to search for a vendor/product pair.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Thu Nov 22 04:31:01 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +3 -3 lines
Improve dump routine slightly.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Wed Nov 21 15:37:41 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +5 -5 lines
Fix indentation and typos.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Tue Nov 20 13:48:04 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +5 -4 lines
Keep track of device speed for USB 2.0.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Thu Nov 15 15:15:59 2001 UTC (23 years, 1 month ago) by augustss
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +3 -4 lines
usbd_interface2device_handle() cannot fail.

Revision 1.79.2.2: download - view: text, markup, annotated - select for diffs
Wed Nov 14 19:16:23 2001 UTC (23 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.79.2.1: preferred, colored
Changes since revision 1.79.2.1: +54 -8 lines
Catch up to -current.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Tue Nov 13 06:24:56 2001 UTC (23 years, 1 month ago) by lukem
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +4 -1 lines
add RCSIDs

Revision 1.81.6.1: download - view: text, markup, annotated - select for diffs
Mon Nov 12 21:18:38 2001 UTC (23 years, 1 month ago) by thorpej
Branches: thorpej-mips-cache
Diff to: previous 1.81: preferred, colored; next MAIN 1.82: preferred, colored
Changes since revision 1.81: +51 -8 lines
Sync the thorpej-mips-cache branch with -current.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Sat Nov 10 17:11:38 2001 UTC (23 years, 1 month ago) by augustss
Branches: MAIN
CVS tags: thorpej-mips-cache-base
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +1 -7 lines
Get rid of unused abort_handle.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Sat Nov 10 16:54:56 2001 UTC (23 years, 1 month ago) by augustss
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +51 -2 lines
Add some dump routines for debugging.

Revision 1.79.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 21 20:06:30 2001 UTC (23 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +8 -23 lines
Catch up to -current.

Revision 1.47.2.3: download - view: text, markup, annotated - select for diffs
Sat Apr 21 17:50:11 2001 UTC (23 years, 7 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.47.2.2: preferred, colored; branchpoint 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47.2.2: +8 -23 lines
Sync with HEAD

Revision 1.81: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:05:33 2001 UTC (23 years, 8 months ago) by augustss
Branches: MAIN
CVS tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base, thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-mips-cache, kqueue
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +7 -1 lines
Add a DIAGNOSTIC.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Fri Apr 13 11:19:58 2001 UTC (23 years, 8 months ago) by augustss
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +2 -23 lines
Finally get rid of the UGLY and EVIL hack for avoiding tsleep().

Revision 1.47.2.2: download - view: text, markup, annotated - select for diffs
Sun Feb 11 19:16:33 2001 UTC (23 years, 10 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.47.2.1: preferred, colored; branchpoint 1.47: preferred, colored
Changes since revision 1.47.2.1: +5 -2 lines
Sync with HEAD.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Jan 21 02:39:53 2001 UTC (23 years, 10 months ago) by augustss
Branches: MAIN
Branch point for: nathanw_sa
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +4 -1 lines
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.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Fri Jan 19 04:01:10 2001 UTC (23 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +2 -2 lines
Make this compile again after const-ification.

Revision 1.47.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 20 11:43:32 2000 UTC (24 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +468 -449 lines
Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Sat Sep 23 21:02:04 2000 UTC (24 years, 2 months ago) by augustss
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +11 -2 lines
Add a way to do control transfers on other pipes than the default pipe.

Revision 1.72.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 22 17:08:47 2000 UTC (24 years, 5 months ago) by minoura
Branches: minoura-xpg4dl
Diff to: previous 1.72: preferred, colored; next MAIN 1.73: preferred, colored
Changes since revision 1.72: +95 -177 lines
Sync w/ netbsd-1-5-base.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Tue Jun 6 11:36:21 2000 UTC (24 years, 6 months ago) by augustss
Branches: MAIN
CVS tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +3 -2 lines
Initialize pointer before doing free of it.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Thu Jun 1 15:51:27 2000 UTC (24 years, 6 months ago) by augustss
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +3 -2 lines
Make it compile with USB_DEBUG.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Thu Jun 1 14:29:02 2000 UTC (24 years, 6 months ago) by augustss
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +74 -171 lines
Bring the coding style into the 80s, i.e., get rid of __P and use
ANSI prototypes and declarations.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Wed May 31 16:14:42 2000 UTC (24 years, 6 months ago) by augustss
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +19 -6 lines
Be more careful when setting the alternate interface so we don't end up with
nothing set at all if it fails.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Thu Apr 27 15:26:51 2000 UTC (24 years, 7 months ago) by augustss
Branches: MAIN
CVS tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +2 -2 lines
Change my email address.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Mar 29 01:45:21 2000 UTC (24 years, 8 months ago) by augustss
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +6 -1 lines
Do not accept new xfers for queuing while a pipe is aborting.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Mar 28 09:48:25 2000 UTC (24 years, 8 months ago) by augustss
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +2 -1 lines
Add a comment.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Mar 27 12:33:58 2000 UTC (24 years, 8 months ago) by augustss
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +9 -9 lines
Change (almost) all static to Static.  The symbol `Static' can then be defined
to `' or `static' depending on if you want to debug or not.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Sat Mar 25 18:02:33 2000 UTC (24 years, 8 months ago) by augustss
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +12 -7 lines
Rename and move around callout handles to make it more sane.
Add some DIAGNOSTIC.
Fix buglet in isoc abort on UHCI.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Fri Mar 24 22:03:32 2000 UTC (24 years, 8 months ago) by augustss
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +3 -5 lines
Some cleanup and renaming of the callouts used in USB drivers.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Thu Mar 23 18:59:10 2000 UTC (24 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +11 -1 lines
Shake out some bugs from the callout changes.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Wed Mar 8 15:34:10 2000 UTC (24 years, 9 months ago) by augustss
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +4 -2 lines
Get the status right when a polled transfer times out.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Thu Mar 2 15:49:29 2000 UTC (24 years, 9 months ago) by augustss
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +2 -2 lines
Fix typo in argument to ratecheck().

Revision 1.63: download - view: text, markup, annotated - select for diffs
Thu Mar 2 12:37:51 2000 UTC (24 years, 9 months ago) by augustss
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +16 -1 lines
Use ratecheck() to limit error messages on disconnect.
Break out some common functionality.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Tue Feb 8 18:46:03 2000 UTC (24 years, 10 months ago) by augustss
Branches: MAIN
CVS tags: chs-ubc2-newbase
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +5 -4 lines
Don't stall the control pipe on error.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Mon Jan 31 20:13:07 2000 UTC (24 years, 10 months ago) by augustss
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +20 -4 lines
Change the way the HC done method is invoked a little.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Wed Jan 19 00:23:58 2000 UTC (24 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +27 -12 lines
Add an argument to usbd_open_pipe_intr() to specify the polling interval
for an interrupt pipe in case we don't what what the descriptor suggests.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Tue Jan 18 20:23:42 2000 UTC (24 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +1 -2 lines
Move the zeroing of the xfer to the individual methods.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Tue Jan 18 20:11:01 2000 UTC (24 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +5 -23 lines
Turn xfer allocation into a method in the HC driver.  The reason is that
an HC driver may want to subclass the xfer to have additional private fields.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sun Jan 16 23:11:43 2000 UTC (24 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +3 -3 lines
Add usbd_reload_device_desc() to get the device descriptor again from a device.
Useful if e.g. downloading firmware updates the revision number.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sun Jan 16 13:34:51 2000 UTC (24 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +4 -2 lines
Get timeout right in the gruesome hack.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sun Jan 16 13:22:18 2000 UTC (24 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +15 -2 lines
XXX Add a temporary, gruesome hack.  It allows transfers to
XXX be done using delay() instead of tsleep().
XXX This enables transfers to be made from an interrupt context, which
XXX is needed until some more threads are added to the kernel.
XXX Using this hack (which is rare) causes the kernel to busy-wait
XXX for up to 1 ms at splusb().

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sun Jan 16 09:37:18 2000 UTC (24 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +5 -5 lines
Let usbd_set_polling() work on a usbd_device_handle instead of
a usbd_interface_handle.

Revision 1.43.2.1: download - view: text, markup, annotated - select for diffs
Mon Dec 27 18:35:46 1999 UTC (24 years, 11 months ago) by wrstuden
Branches: wrstuden-devbsize
Diff to: previous 1.43: preferred, colored; next MAIN 1.44: preferred, colored
Changes since revision 1.43: +353 -406 lines
Pull up to last week's -current.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sun Nov 28 22:49:53 1999 UTC (25 years ago) by augustss
Branches: MAIN
CVS tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +19 -1 lines
More USB_DEBUG and DIAGNOSTIC output.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Nov 26 01:40:01 1999 UTC (25 years ago) by augustss
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -3 lines
Cosmetic change.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Thu Nov 18 23:32:33 1999 UTC (25 years, 1 month ago) by augustss
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +21 -11 lines
Cosmetic changes and some small improvements.  From FreeBSD and Nick Hibma.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Wed Nov 17 23:00:50 1999 UTC (25 years, 1 month ago) by augustss
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +30 -30 lines
A few more purely stylistic changes that I missed in the last round.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Tue Nov 16 22:19:03 1999 UTC (25 years, 1 month ago) by augustss
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +4 -2 lines
Add a few more diagnostics.

Revision 1.47.4.1: download - view: text, markup, annotated - select for diffs
Mon Nov 15 00:41:40 1999 UTC (25 years, 1 month ago) by fvdl
Branches: fvdl-softdep
Diff to: previous 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47: +286 -287 lines
Sync with -current

Revision 1.48: download - view: text, markup, annotated - select for diffs
Fri Nov 12 00:34:58 1999 UTC (25 years, 1 month ago) by augustss
Branches: MAIN
CVS tags: fvdl-softdep-base
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +286 -287 lines
A number of stylistic changes to increase readability (many suggested
by Nick Hibma):
	use NULL not 0
	declare all local definitions static
	rename s/usbd_request/usbd_xfer/ s/reqh/xfer/
	rename s/r/err/
	use implicit test for no err
	KNF

Revision 1.47: download - view: text, markup, annotated - select for diffs
Wed Oct 13 23:46:10 1999 UTC (25 years, 2 months ago) by augustss
Branches: MAIN
CVS tags: comdex-fall-1999-base, comdex-fall-1999
Branch point for: thorpej_scsipi, fvdl-softdep
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +13 -8 lines
Fix a glitch in dequeueing and aborting requests on interrupt pipes.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed Oct 13 14:28:07 1999 UTC (25 years, 2 months ago) by augustss
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +2 -2 lines
Temporarily disable a DIAGNOSTIC.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed Oct 13 08:10:58 1999 UTC (25 years, 2 months ago) by augustss
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +35 -142 lines
Merge in a large batch of changes from Nick Hibma <hibma@skylink.it> so
the USB stack compiles on FreeBSD again.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Tue Oct 12 11:54:56 1999 UTC (25 years, 2 months ago) by augustss
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +27 -6 lines
Add an event mechanism so that a userland process can watch devices come
and go.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Sep 15 21:08:59 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Branch point for: wrstuden-devbsize
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +10 -2 lines
Add a sanity check to the computed actual transfer length.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Sep 15 14:17:15 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +5 -2 lines
Handle the use_polling flag with a lttle more care and only set it if
we are cold booting.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Wed Sep 15 10:25:32 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +2 -3 lines
Add preliminary (untested) code for detaching the USB host controller
(needed for CardBus based controllers).

Revision 1.40: download - view: text, markup, annotated - select for diffs
Mon Sep 13 21:33:25 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +21 -8 lines
* Make sure an aborted pipe is marked as not running.
* Start queued request in the right order.
* Insert some more DIAGNOSTIC sanity checks.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Sep 13 19:18:17 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +2 -2 lines
Rearrange the code a little so we can decide if we are in process
or interrupt context in a reliable way.  Mainly used for DIAGNOSTIC.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sun Sep 12 08:23:42 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +25 -13 lines
Add a flag in the request to determine if the data copying is done by the
driver or the usbdi layer.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat Sep 11 08:19:27 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +94 -22 lines
* Move DMA buffer allocation to HC independent code.
* Remove (almost) unused definitions USBD_XFER_OUT and USBD_XFER_IN.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Thu Sep 9 12:26:47 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +93 -76 lines
Change the internal API to allow DMA buffers to be pre-allocated by
the device driver instead of happening automagically in the HC driver.
This affects both the HC-USBD interface as well as the USBD-device
interface.
This change will allow DMA buffers to be reused e.g. in isochronous
traffic.

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

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sun Sep 5 21:22:39 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +16 -16 lines
Change some printf to DPRINTF for consistency.  From Nick Hibma, FreeBSD.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Sep 5 19:32:19 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +3 -3 lines
Change the way the `struct device' base part of all driver softc are
declared and accessed to make it more portable.  Idea from Nick Hibma, FreeBSD.
No functional changes.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat Aug 28 10:04:01 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +9 -1 lines
Add some comments.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Mon Aug 23 22:55:14 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +3 -2 lines
Make sure to mark the device as dying already in the (de)activate routine.
This avoids access to it before the detach routine has blown it away.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sun Aug 22 20:12:39 1999 UTC (25 years, 3 months ago) by augustss
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +109 -52 lines
Move more of the transfer completion processing to HC independent code.
Fix some problems with transfer abort & timeout.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Aug 17 20:59:04 1999 UTC (25 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -1 lines
Redo the UHCI data toggle handling.
Make sure data toggles get synchronized on open and
when clearing an endpoint stall.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Tue Aug 17 16:06:21 1999 UTC (25 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +2 -2 lines
Make some small changes to make it compile on OpenBSD.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Aug 16 20:24:33 1999 UTC (25 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +31 -17 lines
Change the way transfers are dequeued so thet we know that they
are removed from the queue before being deallocated.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Aug 14 14:49:32 1999 UTC (25 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +4 -5 lines
Some changes from FreeBSD (no functional differences).

Revision 1.21.4.3: download - view: text, markup, annotated - select for diffs
Mon Aug 2 22:09:00 1999 UTC (25 years, 4 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.21.4.2: preferred, colored; branchpoint 1.21: preferred, colored; next MAIN 1.22: preferred, colored
Changes since revision 1.21.4.2: +14 -1 lines
Update from trunk.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Tue Jul 6 07:12:03 1999 UTC (25 years, 5 months ago) by augustss
Branches: MAIN
CVS tags: chs-ubc2-base
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +14 -1 lines
Add some sanity checks.

Revision 1.21.4.2: download - view: text, markup, annotated - select for diffs
Thu Jul 1 23:40:24 1999 UTC (25 years, 5 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.21.4.1: preferred, colored; branchpoint 1.21: preferred, colored
Changes since revision 1.21.4.1: +8 -11 lines
Sync w/ -current.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Jun 30 06:44:23 1999 UTC (25 years, 5 months ago) by augustss
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +8 -11 lines
Totally redo the way device detach is done.  It now uses a kernel event
thread and the config detach method.
Squish a number of space leaks on detach.

Revision 1.21.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 21 01:19:30 1999 UTC (25 years, 6 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +14 -381 lines
Sync w/ -current.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Mon Jun 14 17:09:58 1999 UTC (25 years, 6 months ago) by augustss
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -378 lines
Get rid of a bunch of code that was part of an old USBDI proposal, but that
is unused in our USB stack.

Once upon a time, when I started writing the USB stack for NetBSD, there
was an effort to make a standard for how USB device drivers should interact
with the rest of the USB stack.  This effort had contributors from just
about all Un*x camps (but not Micro$oft :).  I based my design on one of their
early proposals since I thought it would be a good idea if we could all
share device drivers with a minimum effort.  Shortly after I started my work
all the free Un*x people were thrown out of the USBDI work since we did not
pay the USB membership fee.  Well, some time has passed now and the work of
the standardization group is almost public again.  But alas, the new standard
has grown to be a monster!  I do not want to have this as the basis for the
*BSD USB stack; it is far too complicated.
So, since we are not even close to being compilant with the standard, I've
thrown out some old baggage.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu May 13 23:29:41 1999 UTC (25 years, 7 months ago) by augustss
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +6 -1 lines
More DIAGNOSTIC tests.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sun May 9 14:36:42 1999 UTC (25 years, 7 months ago) by augustss
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +8 -4 lines
Minor rearrengment for better readability.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun Jan 10 19:13:16 1999 UTC (25 years, 11 months ago) by augustss
Branches: MAIN
CVS tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame
Branch point for: chs-ubc2
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +6 -6 lines
Some minor updates from FreeBSD.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Jan 8 11:58:26 1999 UTC (25 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +113 -51 lines
Various little fixes from the FreeBSD version.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Jan 3 01:00:56 1999 UTC (25 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +6 -3 lines
Add a length paarmeter to usbd_do_request_flags().

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Dec 29 14:29:53 1998 UTC (25 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -2 lines
Minor change in a debug printf.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Tue Dec 29 03:13:10 1998 UTC (25 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +12 -2 lines
Make it possible to specify the request flags when issuing a raw USB request.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Dec 28 20:14:00 1998 UTC (25 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +32 -34 lines
Change the host controller internal API a little and add some incomplete
support for isochronous transfers.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Dec 26 12:53:04 1998 UTC (25 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +73 -12 lines
Merge changes to make the USB stack work with FreeBSD.  The original
diffs from Nick Hibma <n_hibma@freebsd.org>, but with substantial
changes from me.
XXX Not tested on FreeBSD yet.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Dec 10 23:16:48 1998 UTC (26 years ago) by augustss
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +5 -3 lines
Take care of some lines > 80 chars.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Wed Dec 9 00:18:11 1998 UTC (26 years ago) by augustss
Branches: MAIN
CVS tags: kenh-if-detach-base, kenh-if-detach
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +31 -13 lines
Improvement to the ugen driver.
Better error checking.
Some code rearrengment.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Tue Dec 8 15:18:45 1998 UTC (26 years ago) by augustss
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +62 -5 lines
Some minor API changes and additions.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Wed Nov 25 22:32:05 1998 UTC (26 years ago) by augustss
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +4 -3 lines
Make the copyright header conform to the NetBSD template.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue Oct 20 21:28:32 1998 UTC (26 years, 2 months ago) by augustss
Branches: MAIN
CVS tags: chs-ubc-base, chs-ubc
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -2 lines
Fix typo.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sun Aug 2 22:30:53 1998 UTC (26 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +32 -2 lines
Improve some error messages.
Make some preparations for isochronous transfers.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Aug 1 18:16:20 1998 UTC (26 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +11 -3 lines
Switch from a global flag to tell if the host controller should use
polling to a local one for each controller.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Wed Jul 29 20:50:12 1998 UTC (26 years, 4 months ago) by augustss
Branches: MAIN
CVS tags: eeh-paddr_t-base, eeh-paddr_t
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +76 -2 lines
Add functions to execute asynchronous requests and use these from
interrupt context.
[I had some feline debugging help here.  I noticed that every time Kem,
our kitty, jumped onto the USB keyboard the machine crashed.]

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Jul 26 17:42:49 1998 UTC (26 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +10 -1 lines
A first stab att supporting console access with a USB keyboard.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Jul 25 15:22:11 1998 UTC (26 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +5 -1 lines
Add an ioctl() to get host controller statistics.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Jul 24 21:02:51 1998 UTC (26 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +7 -5 lines
Make sure requests are aborted properly when the pipe is aborted.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Thu Jul 23 13:44:22 1998 UTC (26 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +16 -3 lines
Add some comments and a function to set the alternate settings in an
interface.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed Jul 22 12:22:09 1998 UTC (26 years, 4 months ago) by augustss
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -2 lines
Loop over all configurations when trying to probe for interface drivers.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sun Jul 12 19:52:01 1998 UTC (26 years, 5 months ago) by augustss
Branches: MAIN
Add USB support.  Supported so far:
* UHCI and OHCI host controllers on PCI
* Hubs
* HID devices withe special drivers for mouse and keyboard
* Printers

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>