Commit Graph

130 Commits

Author SHA1 Message Date
nonaka fa5e93a153 Added quirk for ELECOM M-XG2BB. 2014-12-13 19:28:55 +00:00
ozaki-r 433c9fcdef Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.

Discussed with martin@ and riastradh@.
2014-11-16 16:20:00 +00:00
rtr 651e5bd3f8 split PRU_SEND function out of pr_generic() usrreq switches and put into
separate functions

   xxx_send(struct socket *, struct mbuf *, struct mbuf *,
       struct mbuf *, struct lwp *)

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_SEND with calls to
    pr_send()

rename existing functions that operate on PCB for consistency (and to
free up their names for xxx_send() PRUs

  - l2cap_send() -> l2cap_send_pcb()
  - sco_send() -> sco_send_pcb()
  - rfcomm_send() -> rfcomm_send_pcb()

patch reviewed by rmind
2014-08-05 07:55:31 +00:00
rtr 892163b8e9 split PRU_DISCONNECT, PRU_SHUTDOWN and PRU_ABORT function out of
pr_generic() usrreq switches and put into separate functions

   xxx_disconnect(struct socket *)
   xxx_shutdown(struct socket *)
   xxx_abort(struct socket *)

   - always KASSERT(solocked(so)) even if not implemented
   - replace calls to pr_generic() with req =
PRU_{DISCONNECT,SHUTDOWN,ABORT}
     with calls to pr_{disconnect,shutdown,abort}() respectively

rename existing internal functions used to implement above functionality
to permit use of the names for xxx_{disconnect,shutdown,abort}().

   - {l2cap,sco,rfcomm}_disconnect() ->
{l2cap,sco,rfcomm}_disconnect_pcb()
   - {unp,rip,tcp}_disconnect() -> {unp,rip,tcp}_disconnect1()
   - unp_shutdown() -> unp_shutdown1()

patch reviewed by rmind
2014-07-31 03:39:35 +00:00
rtr ad6ae402db split PRU_CONNECT function out of pr_generic() usrreq switches and put
into seaparate functions

  xxx_listen(struct socket *, struct mbuf *)

  - always KASSERT(solocked(so)) and KASSERT(nam != NULL)
  - replace calls to pr_generic() with req = PRU_CONNECT with
    pr_connect()
  - rename existin {l2cap,sco,rfcomm}_connect() to
    {l2cap,sco,rfcomm}_connect_pcb() respectively to permit
    naming consistency with other protocols functions.
  - drop struct lwp * parameter from unp_connect() and at_pcbconnect()
    and use curlwp instead where appropriate.

patch reviewed by rmind
2014-07-30 10:04:25 +00:00
dholland f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
rtr 6dd8eef044 split PRU_BIND and PRU_LISTEN function out of pr_generic() usrreq
switches and put into separate functions
  xxx_bind(struct socket *, struct mbuf *)
  xxx_listen(struct socket *)

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_BIND with call to
    pr_bind()

  - replace calls to pr_generic() with req = PRU_LISTEN with call to
    pr_listen()

  - drop struct lwp * parameter from at_pcbsetaddr(), in_pcbbind() and
    unp_bind() and always use curlwp.

rename existing functions that operate on PCB for consistency (and to
free up their names for xxx_{bind,listen}() PRUs

  - l2cap_{bind,listen}() -> l2cap_{bind,listen}_pcb()
  - sco_{bind,listen}() -> sco_{bind,listen}_pcb()
  - rfcomm_{bind,listen}() -> rfcomm_{bind,listen}_pcb()

patch reviewed by rmind

welcome to netbsd 6.99.48
2014-07-24 15:12:03 +00:00
rmind 56a73a7d30 netbt: rename some attach/detach functions to have _pcb suffix, so
we could use standard attach/detach naming for pr_usrreq functions.
No functional change.
2014-05-20 18:25:54 +00:00
dholland a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
pooka 4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
christos abf8e02e90 add __USE for debugging variables 2013-10-17 21:22:01 +00:00
martin 3f88fce981 #ifdef the "npress" variable, so it is only defined (and initialized) when
it is also used.
2013-09-12 12:20:01 +00:00
plunky f99a352229 increase some diagnostics 2012-12-20 11:17:47 +00:00
plunky 6ea27368df when no link-mode is specified, explicitly set a mode of (int)0
otherwise l2cap_setmode() will fail during connection setup

for bthidev.c, this fixes a problem with Microsoft Wedge Touch
mouse (which may not be able to authenticate)

for btmagic.c, include this fix in case somebody tries that

related to PR/47286
2012-12-20 11:13:53 +00:00
chs cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
dsl e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
plunky 7e98c91dc1 register/deregister pmf(9) NULL handlers for bthub(4) and
bluetooth devices which attach there, to fix PR/39006
2012-04-03 09:32:53 +00:00
mrg 9a1921b3ca don't use mutex_spin*() on an IPL_NONE mutex. fixes PR#46120. 2012-03-26 06:49:15 +00:00
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