Commit Graph

55 Commits

Author SHA1 Message Date
Shunsuke Akiyama
1f41d5d83a Fix USB serial device stalled after tcflush() was called.
PR:		kern/65769
MFC after:	3 days
2005-01-19 15:18:00 +00:00
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
ae59037978 Use generic infrastructure for the ucom driver instead of local stuff.
This changes the naming of USB serial devices to: /dev/ttyU%d and
/dev/cuaU%d for call-in and call-out devices respectively.  (Please
notice: capital 'U')

Please also note that we now have .init and .lock devices for USB
serial ports.  These are not persistent across device removal.  devd(8)
can be used to configure them on attachment time.

These changes also improve the chances of the system surviving if
the USB device is unplugged at an inconvenient time.  At least we
do not rip things apart while there are any threads in the device
driver anymore.

	Remove cdevsw, rely on the tty generic one.

	Don't make_dev(), use ttycreate() which does all the magic.

	In detach, do close procesing if we ripped things apart
	while the device was open.  Call ttyfree() once we're done
	cleaning up.
2004-09-28 20:23:49 +00:00
Poul-Henning Kamp
dfcb390b5b Fix compilation again. 2004-09-17 19:24:58 +00:00
Poul-Henning Kamp
d75207f145 Overhaul ucom serial driver by using generic stuff instead of homerolled
all over the place.
2004-09-17 11:53:45 +00:00
Poul-Henning Kamp
672c05d49c Preparation commit for the tty cleanups that will follow in the near
future:

rename ttyopen() -> tty_open() and ttyclose() -> tty_close().

We need the ttyopen() and ttyclose() for the new generic cdevsw
functions for tty devices in order to have consistent naming.
2004-07-15 20:47:41 +00:00
Warner Losh
d1458cfdf4 MFp4: First batch of dev/usb/usbdevs.h -> usbdevs.h changes. 2004-06-27 12:41:44 +00:00
Poul-Henning Kamp
cb9ea5f4cb Pick the hotchar out of the tty structure instead of caching private
copies.

No current line disciplines have a dynamically changing hotchar, and
expecting to receive anything sensible during a change in ldisc is
insane so no locking of the hotchar field is necessary.
2004-06-26 09:20:07 +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
Poul-Henning Kamp
1930e303cf Deorbit COMPAT_SUNOS.
We inherited this from the sparc32 port of BSD4.4-Lite1.  We have neither
a sparc32 port nor a SunOS4.x compatibility desire these days.
2004-06-11 11:16:26 +00:00
Poul-Henning Kamp
13e84a71e0 Centralize the line discipline optimization determination in a function
called ttyldoptim().

Use this function from all the relevant drivers.

I belive no drivers finger linesw[] directly anymore, paving the way for
locking and refcounting.
2004-06-04 21:55:55 +00:00
Poul-Henning Kamp
fe3ec6224a Manual edits to change linesw[]-frobbing to ttyld_*() calls. 2004-06-04 20:04:52 +00:00
Poul-Henning Kamp
2140d01b27 Machine generated patch which changes linedisc calls from accessing
linesw[] directly to using the ttyld...() functions

The ttyld...() functions ar inline so there is no performance hit.
2004-06-04 16:02:56 +00:00
Poul-Henning Kamp
e451f9b758 Make the remaining serial drivers call ttyioctl() rather than calling
the linedisc directly.
2004-06-04 08:02:37 +00:00
Poul-Henning Kamp
a1cda79464 There is no need to explicitly call ttwakeup() and ttwwakeup() after
ttyclose() has been called.  It's already been done once by ttyclose,
and probably once by the line-discipline too.
2004-06-01 11:38:06 +00:00
Poul-Henning Kamp
bda4474a59 ttyclose() increments t_gen. Remove redundant increments in drivers. 2004-06-01 10:15:56 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +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
8e1f1df080 Device megapatch 3/6:
Add missing D_TTY flags to various drivers.

Complete asserts that dev_t's passed to ttyread(), ttywrite(),
ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty
pointer.

Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default
cdevsw methods for D_TTY drivers and remove the explicit initializations
in various drivers cdevsw structures.
2004-02-21 20:41:11 +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
Warner Losh
65a690ef74 It appears that we don't need sys/vnode.h, which is a layering violation... 2004-01-02 05:16:01 +00:00
Shunsuke Akiyama
2fbe4b5149 Add missing ioctl functions.
MFC after:	1 week
2003-11-16 11:58:21 +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
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
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
Shunsuke Akiyama
4e6f1adc6b Fix page fault with FTDI's USB serial device.
Fix lost characters counting.
Move setting receiver state to proper place on ucomstopread().
2003-03-09 11:33:26 +00:00
Poul-Henning Kamp
182a9f7455 Make nokqfilter() return the correct return value.
Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
2003-03-03 16:24:47 +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
Scott Long
1a3a935b84 Fix 'bulk in' and 'bulk out' being reversed in a couple of error messages. 2003-03-02 02:35:00 +00:00
Josef Karthauser
263de9cd60 Fix a typo in a console message.
Submitted by:	akiyama
MFC after:	3 days
2002-11-17 13:33:55 +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
Hajimu UMEMOTO
767f578267 Correct module name of my previous commit. 2002-07-15 11:22:37 +00:00
Hajimu UMEMOTO
ad85ae6de1 When usb is kld, ucom and uplcom were failed to load because of
usbd_abort_pipe undefined.
2002-07-13 10:41:35 +00:00
Josef Karthauser
04b401aa8a It's not "usio" anymore, it's "ucom".
Submitted by:	nsayer
2002-07-10 01:42:25 +00:00
Josef Karthauser
f411925536 Improve detach operation.
Submitted by:	akiyama
2002-07-10 00:52:16 +00:00
Josef Karthauser
d365977464 Include the bmaj entry in the cdevsw for versions of FreeBSD that need it. 2002-07-10 00:46:44 +00:00
John Baldwin
44731cab3b Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
Josef Karthauser
916e6e02e5 Add a USB comm driver.
Ported from NetBSD by:	akiyama
2002-03-18 18:23:42 +00:00
Nick Hibma
20f81fcbbc Remove the stub driver. It's useless. 1999-06-01 07:18:53 +00:00
Peter Wemm
6182fdbda8 Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core
1999-04-16 21:22:55 +00:00
Nick Hibma
67aa00a71b 1) Make debugging more selective.
2) create function usbd_errstr which turns a usbd_status into a sensible
   error message
3) Change the printf in DPRINTF to logprintf which is a define for
   log(KERN_DEBUG, x)
1999-04-11 20:50:33 +00:00
Matthew Dillon
0a5e03dda5 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-28 01:59:53 +00:00
Nick Hibma
235dddd4ea Textual changes 1999-01-22 00:51:12 +00:00
Nick Hibma
1c8fa23724 Corrected the latent fact that the uhub driver was providing a driver for
the usb device class instead of the uhub devclass. Only a problem with more
than one USB host controller.
1999-01-14 01:28:15 +00:00
Nick Hibma
bc2093747f Changed 'xxxdebug = 0' to '...= 1' (Brian Feldman) 1999-01-13 01:09:14 +00:00
Nick Hibma
53809e8652 Sync with NetBSD sources. Almost there. Mostly style fixes. 1999-01-10 18:42:54 +00:00