Commit Graph

89 Commits

Author SHA1 Message Date
pavel 9b8e4189e5 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@.
2006-12-03 22:34:58 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
xtraeme 7455ba536b sigh, another missing __unused. 2006-10-12 17:50:07 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos 92a6344549 add missing initializer 2006-09-03 07:14:47 +00:00
gdt f9f3dc0a85 Add UGEN_BULK_RA_WB, which allows users of ugen(4) to request read
ahead and write behind, improving performance for the Universal
Software Radio Peripheral (USRP) used with GNU Radio.

Enable UGEN_BULK_RA_WB in GENERIC and GENERIC_LAPTOP; behavior is
unchanged unless the new ioctl is called.

This code was written by Joanne Mikkelson under funding from DARPA's
ACERT program.

ok'd by christos@, tested by Berndt Josef Wulf
2006-07-24 14:24:48 +00:00
christos f96931bf10 stack police: Don't allocate large buffers on the stack for I/O. Put the
buffer in the softc instead.
2006-06-09 21:34:19 +00:00
christos a2b69f5e33 Coverity CID 1354: Add a KASSERT to convince coverity that there is no NULL
pointer dereference.
2006-04-14 16:41:53 +00:00
christos 457f653f3f Coverity CID 1355: Add a KASSERT to convince coverity that this is not NULL. 2006-04-14 16:39:33 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
augustss 5d74925cbe Add a new match level, UMATCH_HIGHEST. 2005-11-28 13:14:48 +00:00
augustss cf1de1bda0 Normally a ugen device only attaches if no other driver wants the device.
Add the ability to force ugen to attach with very high priority if "flags 1"
is specified.  This can be used with the vendor and product locators to
force ugen to be used for certain devices.
Similarly, uhid only attaches if no other HID driver (ums or ukbd) wants it.
Again, "flags 1" will force uhid to attach anyway.
2005-11-23 08:54:47 +00:00
ws 9d78e0cf36 PR-30566: Poll must not return <sys/errno.h> values.
Start with those places I can easily test.
2005-06-21 14:01:11 +00:00
christos a9cf21849d - const poisoning
- eliminate variable shadowing
2005-05-30 04:21:39 +00:00
augustss 36e939eaa1 Allow multiple opens of the control endpoint. This is unproblematic since
the control endpoint is in some sense always open to the device.

From wulf@ping.net.au.
2005-05-17 14:53:06 +00:00
augustss 834327c847 Don't keep the devinfo string on the stack, instead use malloc/free.
This should cure some rare stack overflows.
2005-05-11 10:02:28 +00:00
mycroft 2d562a01e2 Copyright maintenance. 2005-03-02 11:37:27 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
augustss 708bb1bb5a Allow interrupt output devices. From FreeBSD. 2004-12-03 08:53:40 +00:00
mycroft ef77780b63 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.
2004-06-23 02:30:52 +00:00
itojun 300aa0dcd5 use bounded string ops (snprintf, strl*) 2004-04-23 17:25:25 +00:00
mycroft aea8e885f0 Cast a printf() arg so that USB_DEBUG compiles on multiple platforms. 2003-09-04 03:47:03 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
christos 514f7047e4 si_ -> sel_ 2002-11-26 18:49:40 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
simonb 4e3613273b Remove breaks after returns, unreachable returns and returns after
returns(!).
2002-09-23 05:51:10 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
augustss 86650920c9 Get rid of trailing white space. 2002-07-11 21:14:24 +00:00
christos 6728d906e9 Prefix structure members to protect them against clashes with eg. c++ keywords.
Suggested by Alfred Perlstein, from FreeBSD, ok'd by augustss
2002-02-20 20:30:12 +00:00
augustss 319f13f6ef Give usbd_do_request_flags() an extra argument for the timeout. 2002-02-11 15:11:49 +00:00
augustss b99cd0e9f5 More whitespace fixes from FreeBSD. 2002-01-02 16:20:14 +00:00
augustss 0498c38d3d Whitespace fixes (from FreeBSD). 2001-12-31 12:37:13 +00:00
augustss 152efb1a0e Make a typedef for struct proc to make portingeasier. 2001-12-31 12:15:21 +00:00
augustss d14e739b92 Don't allow setting the configuration when an endpoint is open. From
FreeBSD.
2001-12-31 11:56:37 +00:00
augustss 0a3269865e Only clear stall if endpoint is stalled. From FreeBSD. 2001-12-31 11:54:06 +00:00
augustss d6e38a1474 More test for NULL pipes. 2001-11-13 07:59:32 +00:00
lukem 667807e40c add RCSIDs 2001-11-13 06:24:53 +00:00
augustss 8c7d06c6f9 Add commented out match level feature. 2001-10-24 22:31:04 +00:00
yamt 4242cee2bd make ugen use updated frlengths. 2001-09-16 18:06:32 +00:00
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
yamt 46f9dd9228 correct debug messages. 2001-09-15 16:16:27 +00:00
augustss 34bb7b9a35 Don't try to access a device that is being disconnected when generating
the detach event.  Fixes (I hope) PR 11713 from itohy@netbsd.org (ITOH Yasufumi).
2000-12-13 04:05:14 +00:00
augustss 7ec52ba411 Improve a debug message. 2000-11-26 21:05:02 +00:00
augustss 94e36acb29 Tell usbd_set_config_no() to be verbose. It's nice to know whyit fails. 2000-10-24 14:53:59 +00:00
augustss 19f36696bc ANSIfy last patch. 2000-09-08 01:27:12 +00:00
augustss 96d1acf3d6 Add isoc support. From FreeBSD via Berndt Josef Wulf <wulf@ping.net.au> 2000-09-08 00:55:26 +00:00
augustss ed9486e158 Bring the coding style into the 80s, i.e., get rid of __P and use
ANSI prototypes and declarations.
2000-06-01 14:28:57 +00:00