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.
Been running in my tree for over a month at least.
Reviewed and okay yamt@, and special thanks to him as well as rittera@
for making this possible through fixing NDIS to not call fork1() with
l1 != curlwp.
- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
Based on a patch from Garrett D'Amore and several tweaks by me.
Compile tested only, but reviewed by joerg@ and
no objection from scw@ on port-mvme68k.
wierd timing issues on non-timecounter ports (tested on sbmips, and
omap ARM by Marty Fouts).
Also move the microtime() inside the splclock() block in the same
function - it may be possible for the "time" variable to be updated
after the call to microtime() but before we use it to calculate the
offset from mono_time.