Commit Graph

112 Commits

Author SHA1 Message Date
plunky 269b0ae7be offset processing of input reports to a kernel thread, to avoid
locking issues when a child device needs to call back into the
Bluetooth stack (eg when caps-lock is pressed, and wskbd wants
to change a LED)

(as discussed with Radoslaw Kujawa)
2012-01-11 17:27:45 +00:00
rkujawa 3bfeb95c96 Fix panic triggered by pressing the caps lock key:
http://c0ff33.net/drop/bt_caps_panic.jpg

OK'd mrg.
2011-12-31 01:16:09 +00:00
jmcneill 5b074fdc34 no need to acquire thread lock in btsco_open / btsco_close, as they are
already held by MI audio when these methods are called
2011-12-10 16:16:11 +00:00
jmcneill 8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
uebayasi c8c01f2329 Put back #include "ioconf.h" per popular demand. 2011-07-31 13:51:53 +00:00
jakllsch 5dd9fe36b5 Add config(5) fragment for MI bluetooth(4) drivers. 2011-07-20 22:42:59 +00:00
uebayasi 3f383b9dd4 Declare cfdrivers using extern rather than including ioconf.h. 2011-05-25 16:33:37 +00:00
plunky 2e4ce7a95f use C99 style for variadic macro arguments 2011-03-16 21:35:30 +00:00
plunky b1c545a2cf add Magic Mouse driver and manpage btmagic(4) 2010-05-22 18:56:00 +00:00
plunky 0f7dbb350e allow for vendor-id and product-id properties, passing them
through to child devices
2010-04-28 06:13:51 +00:00
kiyohara 23849e1fa6 Remove unnecessary line-feed. 2010-02-18 07:24:16 +00:00
plunky d97471da96 I had a complaint that it was difficult to reconnect a device after
system crashes and reboots and I wonder if the reason was that we
were rejecting the connection for some reason. So, notify the console
if that happens.
2009-08-21 10:01:25 +00:00
cegger 32c4940900 struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
elad b853042065 Introduce actions/requests to handle authorization for ppp(4), sl(4),
strip(4), btuart(4) and bcsp(4) network interfaces and devices.

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004955.html
2009-05-07 18:01:56 +00:00
elad 03d23b4d6b Authorizing actions from the generic scope using a device scope wrapper
is a big no-no.

As painful as it is, use kauth_authorize_generic() for now.
2009-04-26 07:53:43 +00:00
cegger f7d20361b0 ansify function definitions 2009-03-15 15:40:33 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
cube 65ce35522e Redde Caesari quae sunt Caesaris. Or rather, in this particular case,
those that are Lennart's.

Eventually there should only be one set of HID drivers.
2008-09-09 03:54:56 +00:00
plunky fd7356a917 Convert socket options code to use a sockopt structure
instead of laying everything into an mbuf.

approved by core
2008-08-06 15:01:23 +00:00
plunky 3b18cdef88 hold bt_lock when sending data via sco_send() 2008-06-23 12:34:38 +00:00
cegger 17dbee905c use device_lookup_private to get softc 2008-06-12 21:46:21 +00:00
drochner 1f0a423884 use new "defpseudodev" where appropriate, and remove dummy interface
attribute definitions which were only to trick config(8)
2008-06-10 12:49:16 +00:00
ad 15e29e981b Merge the socket locking patch:
- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.
2008-04-24 11:38:36 +00:00
plunky 486e4624e5 some changes to serial bluetooth host controller interfaces
btuartd(8) should be named btattach(8) for consistency
with other parts of NetBSD

make btattach(8) a single-use tool for less complexity

device specicific initialisation (from btuart(4)) is carried
out prior to activating the line discipline (in btattach(8)),
which simplifies the API somewhat and means that the user
tool and the kernel do not need to be kept in sync.

btuart(4) driver is much reduced; naming is made consistent
and all tsleep() and delay() are removed to userland
2008-04-15 11:17:47 +00:00
plunky 5281276341 Use deviter API to search for child devices.
As all identifying information is stored in the device
properties, this removes the need for child devices to
have a reserved area (struct btdev) in the softc, and
bthub(4) does no longer need to have a softc at all.
2008-03-28 21:17:36 +00:00
plunky 220e536f69 remove unnecessary include file 2008-03-22 17:20:31 +00:00
perry 9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
plunky d8436629a8 initialize loop variable as loop is not necessarily undertaken 2007-12-03 10:41:59 +00:00
kiyohara 13aed8da30 Print name of firmware on fail for firmware_open(). 2007-12-02 02:06:30 +00:00
kiyohara 6119aca096 Add support bgb2xx. (not test X-)
Add configuration rate with ericsson.
Change initialization at stlc2500.
Obsolate BTUART_HCITYPE_BT2000C.
2007-12-02 00:09:49 +00:00
plunky 736a9db087 Clean up the way that bluetooth drivers attach to the bluetooth stack,
to remove the frobbing that drivers must do in the hci_unit structure.

- driver provides a static const interface descriptor
- hci_unit is allocated by hci_attach() rather than part of softc
- statistics are compiled by driver and provided on request
- driver provides output methods and is responsible for output queue
- stack provides input methods and is responsible for input queue
- mutex is used to arbitrate device queue access
2007-11-28 20:16:11 +00:00
kiyohara b8e760f970 + Use device_t.
+ Increment rptr if send the ESCAPE char.
+ Use m_pkthdr.len for pktlen.
2007-11-28 01:31:55 +00:00
plunky 2bafcfdd48 improve visibility of [dis]connected messages 2007-11-12 19:19:32 +00:00
plunky 7cca9485cc convert device printf() usages to aprint_xxxx() 2007-11-11 12:59:02 +00:00
plunky 8658057a5d bluetooth stack now keeps a device_t and passes it to device callbacks,
update bcsp to new reality
2007-11-11 12:54:23 +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
ad 0f8b0df960 Call ttyflush() with tty_lock held. 2007-11-10 18:29:36 +00:00
ad d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
plunky faccfc336c 'struct callout' => callout_t
don't use callout_reset()
do use callout_destroy()
2007-11-03 18:24:00 +00:00
plunky edb74239aa switch devices to using CFATTACH_DECL_NEW()
softc no longer contains 'struct device' by default
use 'device_t' instead of 'struct device *'
use device_xxx() accessor functions
remove casting of 'xxx_softc *' & 'struct device *'
use aprint_xxx_dev() routines
2007-11-03 17:41:03 +00:00
plunky baebd7699a remove unnecessary cast (shortens long line) 2007-10-28 18:49:52 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
kiyohara eb89d5dad9 + Add #ifdef DPRINTF{,N} before #undef.
+ Initialize m_pkthdr.len, and increment if not escape charactor.
+ Call bcsp_start() if there is no transmitted packet.
+ Call m_adj() after debug print.
+ Reset the values of the Sequencing layer if link reset it.
2007-10-14 18:13:49 +00:00
ad 46ed8f7d77 Use the softint API. 2007-10-08 16:18:02 +00:00
kiyohara 97cc00811e Fix some bugs.
* Cast to integer the 2nd args of m_adj().
  * Move test/set flag BTF_XMIT to bcsp_start().
  * The initialization of the array was clarified.
2007-10-04 14:43:06 +00:00
junyoung 24ae586ea3 Use __packed rather than __attribute__ ((__packed__)). 2007-10-02 05:40:10 +00:00
kiyohara 09fa5a563a Add bcsp(4). However, it is debuging state. 2007-09-30 04:07:41 +00:00
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