Commit Graph

82 Commits

Author SHA1 Message Date
bouyer 73920b4161 More printf format fixes. 2009-02-13 23:31:23 +00:00
cube 3624455eba Split device_t and softc for all USB device drivers, and related cosmetic
changes.

Matthias Drochner kindly reviewed this patch, and tested ums, ubt, uaudio
and ral.  I tested umass myself.
2008-05-24 16:40:58 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
gdt 1424adf410 Support FIONBIO.
Support non-blocking reads from USB printers.  With this, escputil can
query the printer model, and I can print a test page with gutenprint
5.1 and cups.   Add many comments explaining why the support is not
quite right.  (This change is quite a bit less invasive than a
"correct" fix, and thus more reasonable to pull up to netbsd-4.)

Rototill debugging, so that all DPRINTFN have a level, and so that the
message is printed if the debug level is >= the number in the source
code.  Document debug level plan.

Fix bug where only one status change would be printed (by inspection,
not tested).

Document scheme for reading/discarding data when ulpt(4) is opened for
write only.

Delete dead code.

Plan and patch posted on tech-kern without objections.
2008-01-08 00:58:09 +00:00
drochner 8258b792b7 Introduce different autoconf interface attributes for USB drivers
matching (and handling) a whole device and those which match an
interface only. This will allow to enforce some rules, eg that
the former don't use interface information for matching or that the
latter don't modify global device state.
The previous way left too much freedom do the drivers which led to
inconsistencies and abuse.
For now, I've not changed locators and submatch rules, this will
happen later.
There should not be any change in behaviour, except in the case of
some drivers which did behave inconsistently:
if_atu, if_axe, uep: matched the configured device in the interface
 stage, but did configuration again. I've converted them to match
 in the device stage.
ustir, utoppy: matched in the interface stage, but only against
 vendor/device information, and used any configuration/interface
 without checking. Changed to match in device stage, and added
 some simple code to configure and use the first interface.
If you have one of those devices, please test!
2007-03-13 13:51:53 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +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 b231088be0 add missing initializer 2006-09-03 21:16:09 +00:00
elad 2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
rpaulo 585daa639d Fix a long standing typo noticed by Alex Pivovarov on PR/32061.
When people use variables like 'flag' and 'flags' in the same function
(one local and one passed as a parameter) this is prone to happen..
2005-11-13 10:47:39 +00:00
christos a9cf21849d - const poisoning
- eliminate variable shadowing
2005-05-30 04:21:39 +00:00
soren 5350b653c5 Sync 1284 id printing with the devinfo change, but leave it disabled for now. 2005-05-23 16:35:26 +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
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
augustss 4430265c68 Use new functions for getting descriptors. 2004-10-23 13:28:26 +00:00
mycroft 81ff095ed7 Remove the call to ulpt_reset(). Although this *shouldn't* cause printers to
disconnect, it does, and this is *not* what the "prime" behavior was for in
lpt.
2004-07-03 19:33:15 +00:00
augustss 79295fa58d Remove change accidentally committed by tls. 2004-06-14 13:52:55 +00:00
itojun 300aa0dcd5 use bounded string ops (snprintf, strl*) 2004-04-23 17:25:25 +00:00
tls 05e1bf3ec9 MAXBSIZE->MAXPHYS -- this mysteriously broke all *kinds* of stuff when
MAXBSIZE had been reduced by the user (e.g. transfers from umass disks).
2004-03-22 14:55:42 +00:00
augustss 1c24ba42ab Several changes:
* Implement read for ulpt.
 * If the device is not opened for reading, occasionally drain any
   data the printer might have (but don't hammer the printer with reads).
 * Lower the buffer size to one page.
The driver seems to work with more printers now.
2003-10-04 21:19:50 +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
scw 584c708e83 When detaching a ulpt device, call vdevgone() for the corresponding
NOPRIME minor device too.
2003-01-05 10:19:42 +00:00
augustss 0ac88e0baf Don't try to use 1284 mode. 2003-01-01 16:32:58 +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
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +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 bbe21e45f5 Move a quirk tests so the message printed about directionality is right. 2002-08-15 09:32:50 +00:00
augustss 86650920c9 Get rid of trailing white space. 2002-07-11 21:14:24 +00:00
augustss 97e6cc6f72 Fix an uninitilized request. From Alfred Perlstein <bright@mu.org>. 2002-02-25 22:39:01 +00:00
augustss 319f13f6ef Give usbd_do_request_flags() an extra argument for the timeout. 2002-02-11 15:11:49 +00:00
augustss 1b221b1c9b Some updates for FreeBSD. 2002-02-11 10:04:28 +00:00
augustss 152efb1a0e Make a typedef for struct proc to make portingeasier. 2001-12-31 12:15:21 +00:00
augustss c01e71bac5 Plug a memory leak in an error case. 2001-11-29 11:07:12 +00:00
lukem 667807e40c add RCSIDs 2001-11-13 06:24:53 +00:00
nathanw 48bdb0d067 Match printers that report their interface as IEEE 1284 in addition to
bidirectional.
2001-10-19 15:30:25 +00:00
augustss bafbeaf802 Use the bi-directional protocol if the printer supports it.
This is the way that e.g. HP recommends (but then some of their printers
have a bug that makes the input pipe useless anyway).
Also try reset both the 1.0 and 1.1 ways.
2001-04-16 00:18:06 +00:00
augustss 5b6d98341e Try both the old (wrong) and new SOFT_RESET request type. 2001-01-07 14:26:19 +00:00
augustss 79f0bd6e1f Update many URLs. 2000-12-29 01:24:55 +00:00
augustss f680fa762c Make sure to increment reference count while the (lengthy) opening
operation is happening so we don't lose on disconnect.
2000-12-05 14:01:33 +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
augustss 30c20f930f Change my email address. 2000-04-27 15:26:44 +00:00
augustss eaaf682603 Fix a typo in a comment. 2000-04-14 14:12:11 +00:00
augustss a25e27e1eb Some OpenBSD portability fixes. 2000-03-29 18:24:52 +00:00
augustss fc72e72d7d 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.
2000-03-27 12:33:53 +00:00
augustss 119a2a3a80 Remove irrelevant comment. 2000-03-06 20:58:39 +00:00