Commit Graph

76 Commits

Author SHA1 Message Date
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Poul-Henning Kamp
e22b0e7682 Include fcntl.h
Check O_NONBLOCK instead of IO_NDELAY
Don't include vnode.h
2004-12-22 17:34:25 +00:00
Warner Losh
a9557e2194 Add sys/uio.h explicitly, and move sys/vnode.h include to be more
alphabetical.

# vnode.h should not be included here, but it is required for proper decoding
# of the flags args.  This may change in the future...
2004-12-13 07:08:22 +00:00
Takanori Watanabe
42d69dd63e Don't use matchlvl attach arg. It seems to be not initialized
in FreeBSD probe mechanism.
2004-10-09 07:48:31 +00:00
Warner Losh
1ff2328528 Tweak the compatibility macros a little so that the device printing is
moved into them.
2004-08-15 23:39:18 +00:00
Warner Losh
d1458cfdf4 MFp4: First batch of dev/usb/usbdevs.h -> usbdevs.h changes. 2004-06-27 12:41:44 +00:00
Lukas Ertl
35ea382b1a Our softc has no sc_hdev, but a sc_dev. This in turn has no direct
sc_parent, so back out the previous commit, as it breaks the build.

If there's a pointy hat left, pass it on.
2004-06-26 13:12:46 +00:00
Lukas Ertl
5bebcf6d1c MFNetBSD.
uhid.c (1.61), author: jdolecek
   add support for USB_GET_DEVICEINFO and USB_GET_STRING_DESC ioctls,
   with same meaning as for ugen(4)

usbdi_util.h (1.29), usb_quirks.c (1.50), uhid.c (1.62),
ugen.c (1.68), usb_subr.c (1.114) author: mycroft
   Yes, some devices return incorrect lengths in their string
   descriptors.  Rather than losing, do what Windows does: just
   request the maximum size, and allow a shorter response.  Obsoletes
   the need for UQ_NO_STRINGS, and therefore these "quirks" are removed.

usb_subr.c (1.116), author: mycroft
    In the "seemed like a good idea until I found the fatal flaw"
    department...  Attempting to read a maximum-size string descriptor
    causes my kue device to go completely apeshit.  So, go back to the
    original method, but allow the device to return a shorter string than
    it claimed.

Obtained from:   NetBSD
2004-06-26 10:35:10 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Lukas Ertl
b04f1772b7 Update URL to HID spec.
Obtained from:  NetBSD
2004-05-23 16:55:28 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Seigo Tanimura
512824f8f7 - Implement selwakeuppri() which allows raising the priority of a
thread being waken up.  The thread waken up can run at a priority as
  high as after tsleep().

- Replace selwakeup()s with selwakeuppri()s and pass appropriate
  priorities.

- Add cv_broadcastpri() which raises the priority of the broadcast
  threads.  Used by selwakeuppri() if collision occurs.

Not objected in:	-arch, -current
2003-11-09 09:17:26 +00:00
Josef Karthauser
cd719b55bd Make it easier to run this code on RELENG_4.
Submitted by:	luoqi
2003-10-04 21:41:01 +00:00
Poul-Henning Kamp
ed692400eb I don't know from where the notion that device driver should or
even could call VOP_REVOKE() on vnodes associated with its dev_t's
has originated, but it stops right here.

If there are things people belive destroy_dev() needs to learn how to
do, please tell me about it, preferably with a reproducible test case.

Include <sys/uio.h> in bluetooth code rather than rely on <sys/vnode.h>
to do so.

The fact that some of the USB code needs to include <sys/vnode.h>
still disturbs me greatly, but I do not have time to chase that.
2003-09-28 20:48:13 +00:00
Josef Karthauser
219b479f9f Fix the cdevsw compatibility for -stable. 2003-08-25 22:01:06 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Josef Karthauser
8695068f27 Make note that we already have these NetBSD patches. 2003-07-14 20:19:21 +00:00
Josef Karthauser
d4322278fa MFNetBSD:
date: 2002/09/23 05:51:20;  author: simonb;
    Remove breaks after returns, unreachable returns and returns after
    returns(!).
2003-07-14 18:25:47 +00:00
John-Mark Gurney
c97325b0c8 WARNING: white space diff
This code reduces the number of trailing white space to be more in line
w/ NetBSD.  I don't regenerate usbdevs, saving that for when it really
changes.
2003-07-04 01:50:39 +00:00
Matthew N. Dodd
17d7127c64 Set pointers to NULL after free() to prevent multiple free().
PR:		 kern/48808
Submitted by:	 Eugene Grosbein <eugen@grosbein.pp.ru>
2003-06-25 19:58:38 +00:00
Matthew N. Dodd
efddc6c820 At least pretend to handle USB_GET_REPORT_ID. 2003-04-09 08:43:01 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Josef Karthauser
3b7efc56d0 Use the hw.usb sysctl tree instead of debug.usb.
Requested by:	imp
2002-08-08 12:05:51 +00:00
Josef Karthauser
528d1a7fbc Replace the FOO_DEBUG definitions with USB_DEBUG, and switch the
debugging levels to off by default.  Now that debug levels can be
tweaked by sysctl we don't need to go through hoops to get the
different usb parts to produce debug data.
2002-07-31 14:34:36 +00:00
Josef Karthauser
0e6b196686 Get bored with hard coded debug level variables and introduce a debug.usb
sysctl tree for tweaking them real-time.

Reviewed by:	iedowse
2002-07-31 13:33:55 +00:00
Josef Karthauser
8c8cd21069 MFNetBSD: uhid.c (1.45), ums.c (1.49), usbdi_util.c (1.35), usbdi_util.h (1.23)
date: 2001/10/26 17:58:21;  author: augustss;
    s/usbd_alloc_report_desc/usbd_read_report_desc/
2002-04-07 17:13:00 +00:00
Josef Karthauser
5de3d8b11f MFNetBSD:
revision 1.44
    date: 2001/09/15 16:16:28;  author: yamt;  state: Exp;  lines: +3 -3
    correct debug messages.
2002-04-07 17:05:50 +00:00
Josef Karthauser
a0864e3a2a MFNetBSD: uhid.c (1.42 & 1.43), ugraphire_rdesc.h (1.1)
date: 2000/12/29 01:47:49;  author: augustss;
    Supply our own report descriptor (from Nick Hibma) for the Wacom Graphire.
    The descriptor it reports is broken.
    XXX Not tested, because I don't have the device.

    date: 2001/08/15 00:06:49;  author: augustss;  state: Exp;  lines: +3 -1
    If there was a vendor+product locator match return a higher match value.
    Rationale, if you have a device (e.g., a mouse) with a more specific
    driver but want to recognize it with the more generic driver you can
    do that by supplying vendor and product locators for the generic one.
2002-04-07 17:04:01 +00:00
Josef Karthauser
9aee8efbeb MFNetBSD:
revision 1.40
    date: 2000/10/10 12:37:01;  author: augustss;  state: Exp;  lines: +4 -3
    Don't free unallocated pointer in detach (can happen if detach happens
    before attach has finished).
2002-04-01 20:32:50 +00:00
Josef Karthauser
174ea84839 Use ANSI prototypes and declarations.
Update $NetBSD$ idents to better reflect reality.
2002-04-01 19:01:09 +00:00
Josef Karthauser
be036866cf Be more specific about when block major numbers disappeared from
the cdev switch.
2002-03-11 16:22:15 +00:00
Alfred Perlstein
5bcd0580d7 Prefix structure members to protect them against clashes with eg.
c++ keywords.

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

Ok'd by: lennard
2002-02-20 20:47:21 +00:00
Josef Karthauser
c67fd26e98 Re-add bmaj to the cdevsw's, but don't compile it in on -current.
This makes the code more portable between -current, -stable and the
other BSDs.
2002-02-15 22:54:10 +00:00
Josef Karthauser
5440b9801c Sync with NetBSD:
date: 2000/02/29 21:37:01;  author: augustss;  state: Exp;
	Distinguish between device and interface classes.
	(I finally found a document that said that they were different.)
2002-01-02 18:28:45 +00:00
Josef Karthauser
44ae5917e2 NetBSD have introduced usb_proc_ptr for us (they'll be needing it soon too)
to hide the distinction between struct proc and struct thread.
2002-01-02 16:33:53 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

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

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

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Nick Hibma
aa75eeda2f Only clear endpoint stall if status was USBD_STALLED.
This avoids panicing the system by unplugging a hub. The interrupt transfer
would sometimes arrive after the driver had been removed.
2001-09-02 09:26:14 +00:00
Nick Hibma
0bea5808a1 Don't free memory that has been freed already.
Null the pointer after freeing the memory.

PR:		27370
Submitted by:	Alec Barea <alec@barea.org>
MFC after:	5 days
2001-06-30 10:57:37 +00:00
Mark Murray
fb919e4d5a Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

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

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

OK'ed by:	bde (with reservations)
2001-05-01 08:13:21 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
John Baldwin
19eb87d22a Grab the process lock while calling psignal and before calling psignal. 2001-03-07 03:37:06 +00:00
Garrett Wollman
0a2c3d48c6 select() DKI is now in <sys/selinfo.h>. 2001-01-09 04:33:49 +00:00
Nick Hibma
b37ba10824 Remove unneeded includes (phk) 2000-10-10 10:56:53 +00:00
Nick Hibma
4f04f78215 Remove __P prototypes to reduce diffs between the NetBSD and FreeBSD
versions.
2000-07-17 18:41:20 +00:00
Nick Hibma
23f027a0bc Sync with NetBSD:
Add USB_SET_REPORT ioctl.
Add FIOASYNC, TIOCSPGRP ioctl.
Change some debugging output
2000-05-14 17:43:59 +00:00
Nick Hibma
128aa3af3c Change Lennart's e-mail address. 2000-05-14 16:43:10 +00:00
Nick Hibma
cdb51d12a6 OpenBSD has a broken debugger that does not grok static. Use a
#define Static  static

that the OpenBSD folks can define it to be empty if they like.
2000-04-03 20:58:30 +00:00