Commit Graph

10 Commits

Author SHA1 Message Date
plunky 34ca69b754 When the special L2CAP_PSM_ANY value is used for listening sockets,
select the next unused PSM from the dynamic range (0x1001->)
2009-09-25 19:44:57 +00:00
plunky 0b799668fb use more device_t and device_xxx() accessors
make bluetooth stack keep device_t instead of softc pointer as
device is not necessarily part of softc, and pass device_t to
driver callbacks. hci_devname is no longer required.
2007-11-10 23:12:22 +00:00
plunky 539d75b79d use the sizeof the header, not the pointer to the header
(this fixes a problem with architectures where a pointer is not 4 octets)
2007-05-16 18:34:49 +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 298d20388c remove C++ style comments 2007-03-15 19:47:50 +00:00
plunky f42c04d48d clean up the mess that is the channel state, now
lc_state is channel state
	lc_flags is channel flags
2007-03-12 20:34:46 +00:00
plunky 78a5a02263 add extra validity check for inbound requests 2007-03-05 19:04:46 +00:00
plunky 24f1ec09dc Do not use the output buffer to store data unless we mean it to go in
the packet, as there is a problem with overwriting information while we
still need it (opt->length in particular) which causes connections to
fail.
2006-12-07 21:36:27 +00:00
plunky 264c79359e Endian issues:
hci_event.c:
 - Convert memo->response.clock_offset to host-endian.

hci_ioctl.c:
 - printf format tweak (size_t)

hci_link.c:
 - Convert memo->response.clock_offset from host-endian.
 - Tweak a DIAGNOSTIC message.

l2cap_signal.c:
 - In l2cap_recv_config_req(), rp->scid is little-endian so make sure
   we convert from host-endian.

	from scw@
2006-09-11 22:12:39 +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