Commit Graph

65 Commits

Author SHA1 Message Date
kiyohara
6410e0f367 No need to check the NULL, m_gethdr() calls always with M_WAIT. 2007-09-03 12:38:27 +00:00
kiyohara
a73632e439 Remove BTUART_DEBUG. 2007-08-15 16:48:31 +00:00
kiyohara
83f023eb3d Remove printf for debugging. 2007-07-23 03:45:27 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
plunky
f5db72e7b7 Add 'service level' security for L2CAP and RFCOMM connections, following
the Linux (BlueZ) API.

    - L2CAP or RFCOMM connections can require the baseband radio link
    mode be any of:
	authenticated (devices are paired)
	encrypted (implies authentication)
	secured (encryption, plus generate new link key)

    - for sockets, the mode is set using setsockopt(2) and the socket
    connection will be aborted if the mode change fails.

    - mode settings will be applied during connection establishment, and
    for safety, we enter a wait state and will only proceed when the mode
    settings are successfuly set.

    - It is possible to change the mode on already open connections, but
    not possible to guarantee that data already queued (from either end)
    will not be delivered. (this is a feature, not a bug)

    - bthidev(4) and rfcomm_sppd(1) support "auth", "encrypt" and
    "secure" options

    - btdevctl(8) by default enables "auth" for HIDs, and "encrypt" for
    keyboards (which are required to support it)
2007-04-21 06:15:22 +00:00
plunky
07ed1bdaa3 remove extraneous whitespace 2007-03-13 19:26:06 +00:00
kiyohara
4ecba574db Not KAUTH_DEVICE_TTY_OPEN but KAUTH_GENERIC_ISSUSER is used. 2007-03-12 14:12:13 +00:00
plunky
fdf9144e1f fix typo 2007-03-06 19:50:28 +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
briggs
d298894138 Install sys/dev/bluetooth/btuart.h.
Descend into and build/install usr.sbin/btuartd.
Install etc/rc.d/btuartd.
2007-02-20 21:29:08 +00:00
kiyohara
10abd6f2e2 Supprot Bluetooth HCI UART (H4) driver and daemon. 2007-02-20 16:53:20 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
plunky
57c0199dcf Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
2006-11-12 19:00:42 +00:00
plunky
e500250b17 enable 'Application Control Pan' in Consumer usage group as an equivalent
to the Z direction since some mice (Apple Mighty Mouse) provide horizontal
scrolling direction with that report.
2006-10-31 19:17:04 +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
plunky
c1ad03adbe Internally, use the service name as the identifier for matching 2006-10-04 19:23:59 +00:00
christos
a40b878b67 fix incomplete initializer 2006-10-04 15:38:14 +00:00
plunky
4eabff54a3 utilise auconv_set_converter() to handle the filter setup, so that its
done properly.
2006-09-24 10:19:55 +00:00
plunky
75521932f7 adjust indentation 2006-09-24 10:16:21 +00:00
plunky
d197e1ae6b guard against possible race conditions when detaching SCO pcb's 2006-09-23 16:11:07 +00:00
plunky
35e1b8aa38 return ENOTCONN when not connected, rather than EINVAL 2006-09-23 16:08:43 +00:00
thorpej
6cf1ffe998 Alter the protocol impemented by prop_kern to allow for bi-directional
plist-based messages and to eliminate looping previously required to
receive a plist from the kernel:

- prop_dictionary_copyin_ioctl() and prop_dictionary_copyout_ioctl()
  now take the cmd argument rather than the file open flag.  The
  read-ness or write-ness of an ioctl command is checked by these
  routines to ensure that information is being passed to/from the
  userland component properly.

- prop_dictionary_copyout_ioctl() now allocates the memory for the
  XML plist on behalf of the userland component by way of uvm_mmap().
  The XML plist is copied out to the newly-mapped anonymous region,
  and the pointer returned via the plistref.

- prop_dictionary_recv_ioctl() is responsible for munmap()'ing the
  region after parsing the XML plist into internal represenatation.

- A new prop_dictionary_sendrecv_ioctl() is added, allowing user space
  code to send a dictionary to the kernel and receive one back as a
  reply.


Update users of prop_kern for the API changes (Bluetooth).

This constitutes an ABI / protocol change -- but this will also be put
into NetBSD 4.0 so that the first proplib release will implement the new
scheme.
2006-09-22 04:20:23 +00:00
plunky
ad28493ad1 guard against a possible situation where the list of l2cap channels is changed
when the bluetooth code is not expecting it to be. During a disconnect, we can
detach the channel that is being disconnected, but its not really safe to detach
any others.
2006-09-12 18:18:01 +00:00
plunky
4b5125cac5 btsco.c:
- sco_getopt(..., SO_SCO_MTU, ...) expects the address of a uint16_t,
   not an int. So change sc_mtu's type to uint16_t.
 - Try a little harder to ensure btsco_round_blocksize() does not
   return zero. Prevents a subsequent panic in audio_init_ringbuffer().

	from scw@
2006-09-11 21:59:09 +00:00
plunky
ed4d8d47a0 also include service name in dictionary being sent to kernel.
(this is not used just yet, but it might be in the future and it will
be easier if we dont have to provide code to handle its absence)
2006-09-11 18:30:27 +00:00
plunky
4f1cbddc12 update to bluetooth device attachment:
remove pseudo-device btdev(4) and inherent limitations

add bthub(4) which autoconfigures at bluetooth controllers as they
are enabled. bluetooth devices now attach here.

btdevctl(8) and its cache is updated to handle new semantics

etc/rc.d/btdevctl is updated to configure devices from a list
in /etc/bluetooth/btdevctl.conf
2006-09-10 15:45:55 +00:00
plunky
ac9c65b377 Halt the callout on detach 2006-09-05 18:14:57 +00:00
christos
f7db588ec4 add missing initializer. 2006-08-28 00:14:50 +00:00
plunky
c980b109dd BluetootH SCO Audio update.
Provide an ioctl to set the SCO mtu value in the controller and
place limits in the SCO code such that only packets of this size
may be sent.

Move the mtu option from btsco(4) and btdevctl(8), to the
btconfig(8) program.

Remove temporary BLUETOOTH_SCO kernel option, and enable SCO
socket access.

Fix incoming connection handling for btsco(4) and SCO sockets.

Fix documentation to reflect the new world order.
2006-08-27 11:41:58 +00:00
plunky
066074b94f Make btdev default count explicit 2006-08-20 07:06:57 +00:00
plunky
6232d01b2d Remove obsolete file from repository 2006-08-13 13:59:45 +00:00
tron
30d6332135 Bluetooth fixes by Iain Hibbert:
Remove bthset(4) device and add btsco(4) in its place. This is an
improved version which is not just for headsets, as it can receive
incoming connections (eg for Hands Free Profile). Update bthset(1)
control utlitiy to relate to new device.
2006-07-26 10:43:01 +00:00
tron
5d67049004 Bluetooth fixes by Iain Hibbert:
- Update bthidev(4) to use property lists for configuration.
2006-07-26 10:40:50 +00:00
tron
4241fec1bf Bluetooth fixes by Iain Hibbert:
Change the way in which bluetooth devices attach to system. The
new way is for devices to attach directly to a btdevN device via
its own control file /dev/btdevN.
- bthub(4) is replaced by btdev(4).
- /dev/bthubctl is replaced by /dev/btdevN.
- configuration now uses proplib(3) property lists.
- btcontrol(8) updated to use new API, and now uses private
- XML config file /var/db/btdev.xml.
2006-07-26 10:30:59 +00:00
drochner
f7c7c95eb6 make some bluetooth devices just devices, not interface attributes 2006-06-21 17:14:13 +00:00
gdamore
a5c89047c0 Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.)  This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
2006-06-19 15:44:33 +00:00
thorpej
39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
thorpej
3ddf26777f Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
2006-02-20 16:50:36 +00:00
xtraeme
8810e90b32 Make this build again (ktrace-lwp branch changes). 2005-12-17 13:18:28 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
dsainty
9c7c838ae3 bthcipoll must not return <sys/errno.h> error codes, return POLLERR/POLLHUP
instead.  Fixes a small part of PR/30566.

Also check for a set 'dying' flag here, and include it in the POLLHUP
case.
2005-07-02 07:50:34 +00:00
soren
1e4090e3e1 Make ubt build; bluetooth.c is btbus code, not bthcidrv. 2004-06-22 10:37:00 +00:00
dsainty
232d108953 Kill the flow control interface. Bluetooth devices are not equipped to deal
with flow control being applied.  It is simpler and no more problematic to
accept the data and drop it if we hit a resource limit than to expect the
Bluetooth device to do anything about it (which it won't).
2004-01-04 05:47:43 +00:00
dsainty
ea1feca1de Don't (ab)use the device driver flow control interface to prevent incoming
data.  We should be prepared to buffer that data here (though we currently
don't do that either).
2004-01-04 05:39:35 +00:00
nathanw
f943b64f73 A little printf-casting to make the DIAGNOSTIC sections of this
compile on LP64.
2003-07-24 19:19:42 +00:00
lukem
365cbd9428 add missing __KERNEL_RCSID() 2003-07-14 15:47:00 +00:00
itojun
7f6ed16ef4 function prototype must not have variable name 2003-07-08 10:06:28 +00:00
dsainty
e648b82855 Changed the interface for passing output data between the bthci driver
and the back end Bluetooth device driver.  The device driver now
allocates a suitable buffer on behalf of the bthci driver, and bthci
fills the buffer before despatch.

This saves an ugly temporary allocation (in bthci) and memory copy (in
the USB driver) per write, and also works better with the
sockets-based interface I'm experimenting with.
2003-01-11 06:12:09 +00:00
dsainty
48dd536ca4 Add bthci_util.c 2003-01-11 05:46:11 +00:00
dsainty
23127acc05 Bluetooth HCI protocol constants 2003-01-11 05:44:08 +00:00