summaryrefslogtreecommitdiff
path: root/sys/dev/bluetooth
diff options
context:
space:
mode:
authorrmind <rmind@NetBSD.org>2014-05-20 18:25:54 +0000
committerrmind <rmind@NetBSD.org>2014-05-20 18:25:54 +0000
commit8db4ab2614a04d2f5be56bde4655dfbda0a0d672 (patch)
tree83b980d0b22d0796f263673c580ed102ad1e0b9e /sys/dev/bluetooth
parent4a74c3c14eb9e24d5578260dfdda603be72733fb (diff)
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.
Diffstat (limited to 'sys/dev/bluetooth')
-rw-r--r--sys/dev/bluetooth/bcsp.c8
-rw-r--r--sys/dev/bluetooth/bthidev.c34
-rw-r--r--sys/dev/bluetooth/btmagic.c30
-rw-r--r--sys/dev/bluetooth/btsco.c34
-rw-r--r--sys/dev/bluetooth/btuart.c8
5 files changed, 57 insertions, 57 deletions
diff --git a/sys/dev/bluetooth/bcsp.c b/sys/dev/bluetooth/bcsp.c
index 73920fd810d..61057a63384 100644
--- a/sys/dev/bluetooth/bcsp.c
+++ b/sys/dev/bluetooth/bcsp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bcsp.c,v 1.23 2014/02/25 18:30:09 pooka Exp $ */
+/* $NetBSD: bcsp.c,v 1.24 2014/05/20 18:25:54 rmind Exp $ */
/*
* Copyright (c) 2007 KIYOHARA Takashi
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.23 2014/02/25 18:30:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.24 2014/05/20 18:25:54 rmind Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -285,7 +285,7 @@ bcsp_attach(device_t parent __unused, device_t self, void *aux __unused)
MBUFQ_INIT(&sc->sc_scoq);
/* Attach Bluetooth unit */
- sc->sc_unit = hci_attach(&bcsp_hci, self, 0);
+ sc->sc_unit = hci_attach_pcb(&bcsp_hci, self, 0);
if ((rc = sysctl_createv(&sc->sc_log, 0, NULL, &node,
0, CTLTYPE_NODE, device_xname(self),
@@ -345,7 +345,7 @@ bcsp_detach(device_t self, int flags __unused)
struct bcsp_softc *sc = device_private(self);
if (sc->sc_unit != NULL) {
- hci_detach(sc->sc_unit);
+ hci_detach_pcb(sc->sc_unit);
sc->sc_unit = NULL;
}
diff --git a/sys/dev/bluetooth/bthidev.c b/sys/dev/bluetooth/bthidev.c
index e4ddf232253..fbbf81184d5 100644
--- a/sys/dev/bluetooth/bthidev.c
+++ b/sys/dev/bluetooth/bthidev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bthidev.c,v 1.24 2012/12/20 11:17:47 plunky Exp $ */
+/* $NetBSD: bthidev.c,v 1.25 2014/05/20 18:25:54 rmind Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.24 2012/12/20 11:17:47 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.25 2014/05/20 18:25:54 rmind Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -358,27 +358,27 @@ bthidev_detach(device_t self, int flags)
/* release interrupt listen */
if (sc->sc_int_l != NULL) {
- l2cap_detach(&sc->sc_int_l);
+ l2cap_detach_pcb(&sc->sc_int_l);
sc->sc_int_l = NULL;
}
/* release control listen */
if (sc->sc_ctl_l != NULL) {
- l2cap_detach(&sc->sc_ctl_l);
+ l2cap_detach_pcb(&sc->sc_ctl_l);
sc->sc_ctl_l = NULL;
}
/* close interrupt channel */
if (sc->sc_int != NULL) {
l2cap_disconnect(sc->sc_int, 0);
- l2cap_detach(&sc->sc_int);
+ l2cap_detach_pcb(&sc->sc_int);
sc->sc_int = NULL;
}
/* close control channel */
if (sc->sc_ctl != NULL) {
l2cap_disconnect(sc->sc_ctl, 0);
- l2cap_detach(&sc->sc_ctl);
+ l2cap_detach_pcb(&sc->sc_ctl);
sc->sc_ctl = NULL;
}
@@ -499,7 +499,7 @@ bthidev_listen(struct bthidev_softc *sc)
/*
* Listen on control PSM
*/
- err = l2cap_attach(&sc->sc_ctl_l, &bthidev_ctl_proto, sc);
+ err = l2cap_attach_pcb(&sc->sc_ctl_l, &bthidev_ctl_proto, sc);
if (err)
return err;
@@ -519,7 +519,7 @@ bthidev_listen(struct bthidev_softc *sc)
/*
* Listen on interrupt PSM
*/
- err = l2cap_attach(&sc->sc_int_l, &bthidev_int_proto, sc);
+ err = l2cap_attach_pcb(&sc->sc_int_l, &bthidev_int_proto, sc);
if (err)
return err;
@@ -556,7 +556,7 @@ bthidev_connect(struct bthidev_softc *sc)
sa.bt_len = sizeof(sa);
sa.bt_family = AF_BLUETOOTH;
- err = l2cap_attach(&sc->sc_ctl, &bthidev_ctl_proto, sc);
+ err = l2cap_attach_pcb(&sc->sc_ctl, &bthidev_ctl_proto, sc);
if (err) {
aprint_error_dev(sc->sc_dev, "l2cap_attach failed (%d)\n", err);
return err;
@@ -679,14 +679,14 @@ bthidev_process_one(struct bthidev_softc *sc, struct mbuf *m)
/* close interrupt channel */
if (sc->sc_int != NULL) {
l2cap_disconnect(sc->sc_int, 0);
- l2cap_detach(&sc->sc_int);
+ l2cap_detach_pcb(&sc->sc_int);
sc->sc_int = NULL;
}
/* close control channel */
if (sc->sc_ctl != NULL) {
l2cap_disconnect(sc->sc_ctl, 0);
- l2cap_detach(&sc->sc_ctl);
+ l2cap_detach_pcb(&sc->sc_ctl);
sc->sc_ctl = NULL;
}
mutex_exit(bt_lock);
@@ -734,7 +734,7 @@ bthidev_ctl_connected(void *arg)
if (sc->sc_flags & BTHID_CONNECTING) {
/* initiate connect on interrupt PSM */
- err = l2cap_attach(&sc->sc_int, &bthidev_int_proto, sc);
+ err = l2cap_attach_pcb(&sc->sc_int, &bthidev_int_proto, sc);
if (err)
goto fail;
@@ -762,7 +762,7 @@ bthidev_ctl_connected(void *arg)
return;
fail:
- l2cap_detach(&sc->sc_ctl);
+ l2cap_detach_pcb(&sc->sc_ctl);
sc->sc_ctl = NULL;
aprint_error_dev(sc->sc_dev, "connect failed (%d)\n", err);
@@ -799,7 +799,7 @@ bthidev_ctl_disconnected(void *arg, int err)
struct bthidev_softc *sc = arg;
if (sc->sc_ctl != NULL) {
- l2cap_detach(&sc->sc_ctl);
+ l2cap_detach_pcb(&sc->sc_ctl);
sc->sc_ctl = NULL;
}
@@ -831,7 +831,7 @@ bthidev_int_disconnected(void *arg, int err)
struct bthidev_softc *sc = arg;
if (sc->sc_int != NULL) {
- l2cap_detach(&sc->sc_int);
+ l2cap_detach_pcb(&sc->sc_int);
sc->sc_int = NULL;
}
@@ -884,7 +884,7 @@ bthidev_ctl_newconn(void *arg, struct sockaddr_bt *laddr,
return NULL;
}
- l2cap_attach(&sc->sc_ctl, &bthidev_ctl_proto, sc);
+ l2cap_attach_pcb(&sc->sc_ctl, &bthidev_ctl_proto, sc);
return sc->sc_ctl;
}
@@ -910,7 +910,7 @@ bthidev_int_newconn(void *arg, struct sockaddr_bt *laddr,
return NULL;
}
- l2cap_attach(&sc->sc_int, &bthidev_int_proto, sc);
+ l2cap_attach_pcb(&sc->sc_int, &bthidev_int_proto, sc);
return sc->sc_int;
}
diff --git a/sys/dev/bluetooth/btmagic.c b/sys/dev/bluetooth/btmagic.c
index dcd9ffbee95..4038c7a193c 100644
--- a/sys/dev/bluetooth/btmagic.c
+++ b/sys/dev/bluetooth/btmagic.c
@@ -1,4 +1,4 @@
-/* $NetBSD: btmagic.c,v 1.6 2014/02/25 18:30:09 pooka Exp $ */
+/* $NetBSD: btmagic.c,v 1.7 2014/05/20 18:25:54 rmind Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btmagic.c,v 1.6 2014/02/25 18:30:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btmagic.c,v 1.7 2014/05/20 18:25:54 rmind Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -401,27 +401,27 @@ btmagic_detach(device_t self, int flags)
/* release interrupt listen */
if (sc->sc_int_l != NULL) {
- l2cap_detach(&sc->sc_int_l);
+ l2cap_detach_pcb(&sc->sc_int_l);
sc->sc_int_l = NULL;
}
/* release control listen */
if (sc->sc_ctl_l != NULL) {
- l2cap_detach(&sc->sc_ctl_l);
+ l2cap_detach_pcb(&sc->sc_ctl_l);
sc->sc_ctl_l = NULL;
}
/* close interrupt channel */
if (sc->sc_int != NULL) {
l2cap_disconnect(sc->sc_int, 0);
- l2cap_detach(&sc->sc_int);
+ l2cap_detach_pcb(&sc->sc_int);
sc->sc_int = NULL;
}
/* close control channel */
if (sc->sc_ctl != NULL) {
l2cap_disconnect(sc->sc_ctl, 0);
- l2cap_detach(&sc->sc_ctl);
+ l2cap_detach_pcb(&sc->sc_ctl);
sc->sc_ctl = NULL;
}
@@ -463,7 +463,7 @@ btmagic_listen(struct btmagic_softc *sc)
/*
* Listen on control PSM
*/
- err = l2cap_attach(&sc->sc_ctl_l, &btmagic_ctl_proto, sc);
+ err = l2cap_attach_pcb(&sc->sc_ctl_l, &btmagic_ctl_proto, sc);
if (err)
return err;
@@ -483,7 +483,7 @@ btmagic_listen(struct btmagic_softc *sc)
/*
* Listen on interrupt PSM
*/
- err = l2cap_attach(&sc->sc_int_l, &btmagic_int_proto, sc);
+ err = l2cap_attach_pcb(&sc->sc_int_l, &btmagic_int_proto, sc);
if (err)
return err;
@@ -519,7 +519,7 @@ btmagic_connect(struct btmagic_softc *sc)
sa.bt_len = sizeof(sa);
sa.bt_family = AF_BLUETOOTH;
- err = l2cap_attach(&sc->sc_ctl, &btmagic_ctl_proto, sc);
+ err = l2cap_attach_pcb(&sc->sc_ctl, &btmagic_ctl_proto, sc);
if (err) {
printf("%s: l2cap_attach failed (%d)\n",
device_xname(sc->sc_dev), err);
@@ -811,7 +811,7 @@ btmagic_ctl_connected(void *arg)
if (ISSET(sc->sc_flags, BTMAGIC_CONNECTING)) {
/* initiate connect on interrupt PSM */
- err = l2cap_attach(&sc->sc_int, &btmagic_int_proto, sc);
+ err = l2cap_attach_pcb(&sc->sc_int, &btmagic_int_proto, sc);
if (err)
goto fail;
@@ -839,7 +839,7 @@ btmagic_ctl_connected(void *arg)
return;
fail:
- l2cap_detach(&sc->sc_ctl);
+ l2cap_detach_pcb(&sc->sc_ctl);
sc->sc_ctl = NULL;
printf("%s: connect failed (%d)\n", device_xname(sc->sc_dev), err);
@@ -877,7 +877,7 @@ btmagic_ctl_disconnected(void *arg, int err)
struct btmagic_softc *sc = arg;
if (sc->sc_ctl != NULL) {
- l2cap_detach(&sc->sc_ctl);
+ l2cap_detach_pcb(&sc->sc_ctl);
sc->sc_ctl = NULL;
}
@@ -903,7 +903,7 @@ btmagic_int_disconnected(void *arg, int err)
struct btmagic_softc *sc = arg;
if (sc->sc_int != NULL) {
- l2cap_detach(&sc->sc_int);
+ l2cap_detach_pcb(&sc->sc_int);
sc->sc_int = NULL;
}
@@ -950,7 +950,7 @@ btmagic_ctl_newconn(void *arg, struct sockaddr_bt *laddr,
return NULL;
}
- l2cap_attach(&sc->sc_ctl, &btmagic_ctl_proto, sc);
+ l2cap_attach_pcb(&sc->sc_ctl, &btmagic_ctl_proto, sc);
return sc->sc_ctl;
}
@@ -976,7 +976,7 @@ btmagic_int_newconn(void *arg, struct sockaddr_bt *laddr,
return NULL;
}
- l2cap_attach(&sc->sc_int, &btmagic_int_proto, sc);
+ l2cap_attach_pcb(&sc->sc_int, &btmagic_int_proto, sc);
return sc->sc_int;
}
diff --git a/sys/dev/bluetooth/btsco.c b/sys/dev/bluetooth/btsco.c
index 34fb2e29c58..6ecea36e744 100644
--- a/sys/dev/bluetooth/btsco.c
+++ b/sys/dev/bluetooth/btsco.c
@@ -1,4 +1,4 @@
-/* $NetBSD: btsco.c,v 1.28 2012/04/03 09:32:53 plunky Exp $ */
+/* $NetBSD: btsco.c,v 1.29 2014/05/20 18:25:54 rmind Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.28 2012/04/03 09:32:53 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.29 2014/05/20 18:25:54 rmind Exp $");
#include <sys/param.h>
#include <sys/audioio.h>
@@ -360,13 +360,13 @@ btsco_detach(device_t self, int flags)
if (sc->sc_sco != NULL) {
DPRINTF("sc_sco=%p\n", sc->sc_sco);
sco_disconnect(sc->sc_sco, 0);
- sco_detach(&sc->sc_sco);
+ sco_detach_pcb(&sc->sc_sco);
sc->sc_sco = NULL;
}
if (sc->sc_sco_l != NULL) {
DPRINTF("sc_sco_l=%p\n", sc->sc_sco_l);
- sco_detach(&sc->sc_sco_l);
+ sco_detach_pcb(&sc->sc_sco_l);
sc->sc_sco_l = NULL;
}
mutex_exit(bt_lock);
@@ -430,7 +430,7 @@ btsco_sco_connected(void *arg)
* If we are listening, no more need
*/
if (sc->sc_sco_l != NULL)
- sco_detach(&sc->sc_sco_l);
+ sco_detach_pcb(&sc->sc_sco_l);
sc->sc_state = BTSCO_OPEN;
cv_broadcast(&sc->sc_connect);
@@ -446,7 +446,7 @@ btsco_sco_disconnected(void *arg, int err)
KASSERT(sc->sc_sco != NULL);
sc->sc_err = err;
- sco_detach(&sc->sc_sco);
+ sco_detach_pcb(&sc->sc_sco);
switch (sc->sc_state) {
case BTSCO_CLOSED: /* dont think this can happen */
@@ -494,7 +494,7 @@ btsco_sco_newconn(void *arg, struct sockaddr_bt *laddr,
|| sc->sc_sco != NULL)
return NULL;
- sco_attach(&sc->sc_sco, &btsco_sco_proto, sc);
+ sco_attach_pcb(&sc->sc_sco, &btsco_sco_proto, sc);
return sc->sc_sco;
}
@@ -588,38 +588,38 @@ btsco_open(void *hdl, int flags)
bdaddr_copy(&sa.bt_bdaddr, &sc->sc_laddr);
if (sc->sc_flags & BTSCO_LISTEN) {
- err = sco_attach(&sc->sc_sco_l, &btsco_sco_proto, sc);
+ err = sco_attach_pcb(&sc->sc_sco_l, &btsco_sco_proto, sc);
if (err)
goto done;
err = sco_bind(sc->sc_sco_l, &sa);
if (err) {
- sco_detach(&sc->sc_sco_l);
+ sco_detach_pcb(&sc->sc_sco_l);
goto done;
}
err = sco_listen(sc->sc_sco_l);
if (err) {
- sco_detach(&sc->sc_sco_l);
+ sco_detach_pcb(&sc->sc_sco_l);
goto done;
}
timo = 0; /* no timeout */
} else {
- err = sco_attach(&sc->sc_sco, &btsco_sco_proto, sc);
+ err = sco_attach_pcb(&sc->sc_sco, &btsco_sco_proto, sc);
if (err)
goto done;
err = sco_bind(sc->sc_sco, &sa);
if (err) {
- sco_detach(&sc->sc_sco);
+ sco_detach_pcb(&sc->sc_sco);
goto done;
}
bdaddr_copy(&sa.bt_bdaddr, &sc->sc_raddr);
err = sco_connect(sc->sc_sco, &sa);
if (err) {
- sco_detach(&sc->sc_sco);
+ sco_detach_pcb(&sc->sc_sco);
goto done;
}
@@ -637,10 +637,10 @@ btsco_open(void *hdl, int flags)
/* fall through to */
case BTSCO_WAIT_CONNECT: /* error */
if (sc->sc_sco != NULL)
- sco_detach(&sc->sc_sco);
+ sco_detach_pcb(&sc->sc_sco);
if (sc->sc_sco_l != NULL)
- sco_detach(&sc->sc_sco_l);
+ sco_detach_pcb(&sc->sc_sco_l);
break;
@@ -673,11 +673,11 @@ btsco_close(void *hdl)
if (sc->sc_sco != NULL) {
sco_disconnect(sc->sc_sco, 0);
- sco_detach(&sc->sc_sco);
+ sco_detach_pcb(&sc->sc_sco);
}
if (sc->sc_sco_l != NULL) {
- sco_detach(&sc->sc_sco_l);
+ sco_detach_pcb(&sc->sc_sco_l);
}
if (sc->sc_rx_mbuf != NULL) {
diff --git a/sys/dev/bluetooth/btuart.c b/sys/dev/bluetooth/btuart.c
index ba6d052b28c..f08642fe1b0 100644
--- a/sys/dev/bluetooth/btuart.c
+++ b/sys/dev/bluetooth/btuart.c
@@ -1,4 +1,4 @@
-/* $NetBSD: btuart.c,v 1.26 2011/07/31 13:51:53 uebayasi Exp $ */
+/* $NetBSD: btuart.c,v 1.27 2014/05/20 18:25:54 rmind Exp $ */
/*-
* Copyright (c) 2006, 2007 KIYOHARA Takashi
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.26 2011/07/31 13:51:53 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.27 2014/05/20 18:25:54 rmind Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -188,7 +188,7 @@ btuart_attach(device_t parent __unused, device_t self, void *aux __unused)
MBUFQ_INIT(&sc->sc_scoq);
/* Attach Bluetooth unit */
- sc->sc_unit = hci_attach(&btuart_hci, self, 0);
+ sc->sc_unit = hci_attach_pcb(&btuart_hci, self, 0);
if (sc->sc_unit == NULL)
aprint_error_dev(self, "HCI attach failed\n");
}
@@ -205,7 +205,7 @@ btuart_detach(device_t self, int flags __unused)
btuart_disable(self);
if (sc->sc_unit) {
- hci_detach(sc->sc_unit);
+ hci_detach_pcb(sc->sc_unit);
sc->sc_unit = NULL;
}