From 56a73a7d3045792a48b5fdfe5796af88a0b7ca8b Mon Sep 17 00:00:00 2001 From: rmind Date: Tue, 20 May 2014 18:25:54 +0000 Subject: [PATCH] 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. --- sys/dev/bluetooth/bcsp.c | 8 ++++---- sys/dev/bluetooth/bthidev.c | 34 +++++++++++++++++----------------- sys/dev/bluetooth/btmagic.c | 30 +++++++++++++++--------------- sys/dev/bluetooth/btsco.c | 34 +++++++++++++++++----------------- sys/dev/bluetooth/btuart.c | 8 ++++---- sys/dev/pcmcia/bt3c.c | 12 ++++++------ sys/dev/pcmcia/btbc.c | 12 ++++++------ sys/dev/sdmmc/sbt.c | 8 ++++---- sys/dev/usb/ubt.c | 14 +++++++------- sys/netbt/hci.h | 8 ++++---- sys/netbt/hci_link.c | 6 +++--- sys/netbt/hci_socket.c | 16 +++++++++------- sys/netbt/hci_unit.c | 8 ++++---- sys/netbt/l2cap.h | 8 ++++---- sys/netbt/l2cap_socket.c | 20 +++++++++++--------- sys/netbt/l2cap_upper.c | 12 ++++++------ sys/netbt/rfcomm.h | 8 ++++---- sys/netbt/rfcomm_session.c | 8 ++++---- sys/netbt/rfcomm_socket.c | 22 ++++++++++++---------- sys/netbt/rfcomm_upper.c | 12 ++++++------ sys/netbt/sco.h | 6 +++--- sys/netbt/sco_socket.c | 20 +++++++++++--------- sys/netbt/sco_upper.c | 12 ++++++------ 23 files changed, 167 insertions(+), 159 deletions(-) diff --git a/sys/dev/bluetooth/bcsp.c b/sys/dev/bluetooth/bcsp.c index 73920fd810da..61057a633844 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 -__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 #include @@ -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 e4ddf2322531..fbbf81184d54 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 -__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 #include @@ -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 dcd9ffbee95b..4038c7a193c1 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 -__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 #include @@ -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 34fb2e29c584..6ecea36e7442 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 -__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 #include @@ -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 ba6d052b28c2..f08642fe1b05 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 -__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 #include @@ -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; } diff --git a/sys/dev/pcmcia/bt3c.c b/sys/dev/pcmcia/bt3c.c index e94790fb3d39..ebe1d2a632bc 100644 --- a/sys/dev/pcmcia/bt3c.c +++ b/sys/dev/pcmcia/bt3c.c @@ -1,4 +1,4 @@ -/* $NetBSD: bt3c.c,v 1.22 2012/01/14 21:38:00 plunky Exp $ */ +/* $NetBSD: bt3c.c,v 1.23 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2005 Iain D. Hibbert, @@ -69,7 +69,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bt3c.c,v 1.22 2012/01/14 21:38:00 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bt3c.c,v 1.23 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -976,7 +976,7 @@ bt3c_attach(device_t parent, device_t self, void *aux) } /* Attach Bluetooth unit */ - sc->sc_unit = hci_attach(&bt3c_hci, self, BTF_POWER_UP_NOOP); + sc->sc_unit = hci_attach_pcb(&bt3c_hci, self, BTF_POWER_UP_NOOP); if (sc->sc_unit == NULL) aprint_error_dev(self, "HCI attach failed\n"); @@ -1003,7 +1003,7 @@ bt3c_detach(device_t self, int flags) bt3c_disable(self); if (sc->sc_unit) { - hci_detach(sc->sc_unit); + hci_detach_pcb(sc->sc_unit); sc->sc_unit = NULL; } @@ -1022,7 +1022,7 @@ bt3c_suspend(device_t self, const pmf_qual_t *qual) struct bt3c_softc *sc = device_private(self); if (sc->sc_unit) { - hci_detach(sc->sc_unit); + hci_detach_pcb(sc->sc_unit); sc->sc_unit = NULL; } @@ -1036,7 +1036,7 @@ bt3c_resume(device_t self, const pmf_qual_t *qual) KASSERT(sc->sc_unit == NULL); - sc->sc_unit = hci_attach(&bt3c_hci, self, BTF_POWER_UP_NOOP); + sc->sc_unit = hci_attach_pcb(&bt3c_hci, self, BTF_POWER_UP_NOOP); if (sc->sc_unit == NULL) return false; diff --git a/sys/dev/pcmcia/btbc.c b/sys/dev/pcmcia/btbc.c index 6e6fc3d5d146..00af57bfd351 100644 --- a/sys/dev/pcmcia/btbc.c +++ b/sys/dev/pcmcia/btbc.c @@ -1,4 +1,4 @@ -/* $NetBSD: btbc.c,v 1.15 2010/02/24 22:38:08 dyoung Exp $ */ +/* $NetBSD: btbc.c,v 1.16 2014/05/20 18:25:54 rmind Exp $ */ /* * Copyright (c) 2007 KIYOHARA Takashi * All rights reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: btbc.c,v 1.15 2010/02/24 22:38:08 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: btbc.c,v 1.16 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -187,7 +187,7 @@ btbc_attach(device_t parent, device_t self, void *aux) sc->sc_pcioh = cfe->iospace[0].handle; /* Attach Bluetooth unit */ - sc->sc_unit = hci_attach(&btbc_hci, self, 0); + sc->sc_unit = hci_attach_pcb(&btbc_hci, self, 0); if (sc->sc_unit == NULL) aprint_error_dev(self, "HCI attach failed\n"); @@ -214,7 +214,7 @@ btbc_detach(device_t self, int flags) callout_destroy(&sc->sc_ledch); if (sc->sc_unit) { - hci_detach(sc->sc_unit); + hci_detach_pcb(sc->sc_unit); sc->sc_unit = NULL; } @@ -229,7 +229,7 @@ btbc_suspend(device_t self, const pmf_qual_t *qual) struct btbc_softc *sc = device_private(self); if (sc->sc_unit) { - hci_detach(sc->sc_unit); + hci_detach_pcb(sc->sc_unit); sc->sc_unit = NULL; } @@ -244,7 +244,7 @@ btbc_resume(device_t self, const pmf_qual_t *qual) KASSERT(sc->sc_unit == NULL); - sc->sc_unit = hci_attach(&btbc_hci, sc->sc_dev, 0); + sc->sc_unit = hci_attach_pcb(&btbc_hci, sc->sc_dev, 0); if (sc->sc_unit == NULL) return false; diff --git a/sys/dev/sdmmc/sbt.c b/sys/dev/sdmmc/sbt.c index fa1cd44b4345..de5acf0eb67f 100644 --- a/sys/dev/sdmmc/sbt.c +++ b/sys/dev/sdmmc/sbt.c @@ -1,4 +1,4 @@ -/* $NetBSD: sbt.c,v 1.3 2012/10/27 17:18:38 chs Exp $ */ +/* $NetBSD: sbt.c,v 1.4 2014/05/20 18:25:54 rmind Exp $ */ /* $OpenBSD: sbt.c,v 1.9 2007/06/19 07:59:57 uwe Exp $ */ /* @@ -20,7 +20,7 @@ /* Driver for Type-A/B SDIO Bluetooth cards */ #include -__KERNEL_RCSID(0, "$NetBSD: sbt.c,v 1.3 2012/10/27 17:18:38 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sbt.c,v 1.4 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -202,7 +202,7 @@ sbt_attach(device_t parent, device_t self, void *aux) /* * Attach Bluetooth unit (machine-independent HCI). */ - sc->sc_unit = hci_attach(&sbt_hci, self, 0); + sc->sc_unit = hci_attach_pcb(&sbt_hci, self, 0); } static int @@ -213,7 +213,7 @@ sbt_detach(device_t self, int flags) sc->sc_dying = 1; if (sc->sc_unit) { - hci_detach(sc->sc_unit); + hci_detach_pcb(sc->sc_unit); sc->sc_unit = NULL; } diff --git a/sys/dev/usb/ubt.c b/sys/dev/usb/ubt.c index 04c8fe0c3de2..28d99169ac68 100644 --- a/sys/dev/usb/ubt.c +++ b/sys/dev/usb/ubt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ubt.c,v 1.50 2014/02/25 18:30:10 pooka Exp $ */ +/* $NetBSD: ubt.c,v 1.51 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.50 2014/02/25 18:30:10 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.51 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -471,7 +471,7 @@ ubt_attach(device_t parent, device_t self, void *aux) } /* Attach HCI */ - sc->sc_unit = hci_attach(&ubt_hci, sc->sc_dev, 0); + sc->sc_unit = hci_attach_pcb(&ubt_hci, sc->sc_dev, 0); usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev); @@ -552,16 +552,16 @@ ubt_detach(device_t self, int flags) /* Detach HCI interface */ if (sc->sc_unit) { - hci_detach(sc->sc_unit); + hci_detach_pcb(sc->sc_unit); sc->sc_unit = NULL; } /* * Abort all pipes. Causes processes waiting for transfer to wake. * - * Actually, hci_detach() above will call ubt_disable() which may - * call ubt_abortdealloc(), but lets be sure since doing it twice - * wont cause an error. + * Actually, hci_detach_pcb() above will call ubt_disable() which + * may call ubt_abortdealloc(), but lets be sure since doing it + * twice wont cause an error. */ ubt_abortdealloc(sc); diff --git a/sys/netbt/hci.h b/sys/netbt/hci.h index 1191099c799f..180cbfc701c3 100644 --- a/sys/netbt/hci.h +++ b/sys/netbt/hci.h @@ -1,4 +1,4 @@ -/* $NetBSD: hci.h,v 1.36 2014/05/18 14:46:16 rmind Exp $ */ +/* $NetBSD: hci.h,v 1.37 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -54,7 +54,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: hci.h,v 1.36 2014/05/18 14:46:16 rmind Exp $ + * $Id: hci.h,v 1.37 2014/05/20 18:25:54 rmind Exp $ * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $ */ @@ -2571,8 +2571,8 @@ int hci_ctloutput(int, struct socket *, struct sockopt *); void hci_mtap(struct mbuf *, struct hci_unit *); /* hci_unit.c */ -struct hci_unit *hci_attach(const struct hci_if *, device_t, uint16_t); -void hci_detach(struct hci_unit *); +struct hci_unit *hci_attach_pcb(const struct hci_if *, device_t, uint16_t); +void hci_detach_pcb(struct hci_unit *); int hci_enable(struct hci_unit *); void hci_disable(struct hci_unit *); struct hci_unit *hci_unit_lookup(const bdaddr_t *); diff --git a/sys/netbt/hci_link.c b/sys/netbt/hci_link.c index 59b5b385c36e..b2f24d3deee9 100644 --- a/sys/netbt/hci_link.c +++ b/sys/netbt/hci_link.c @@ -1,4 +1,4 @@ -/* $NetBSD: hci_link.c,v 1.23 2011/07/27 10:25:09 plunky Exp $ */ +/* $NetBSD: hci_link.c,v 1.24 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hci_link.c,v 1.23 2011/07/27 10:25:09 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hci_link.c,v 1.24 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -799,7 +799,7 @@ hci_sco_newconn(struct hci_unit *unit, bdaddr_t *bdaddr) sco = hci_link_alloc(unit, bdaddr, HCI_LINK_SCO); if (sco == NULL) { - sco_detach(&new); + sco_detach_pcb(&new); return NULL; } diff --git a/sys/netbt/hci_socket.c b/sys/netbt/hci_socket.c index 4491f77bfdd4..24f2ffca5857 100644 --- a/sys/netbt/hci_socket.c +++ b/sys/netbt/hci_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: hci_socket.c,v 1.22 2014/05/19 02:51:24 rmind Exp $ */ +/* $NetBSD: hci_socket.c,v 1.23 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.22 2014/05/19 02:51:24 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.23 2014/05/20 18:25:54 rmind Exp $"); /* load symbolic names */ #ifdef BLUETOOTH_DEBUG @@ -427,7 +427,7 @@ bad: } static int -hci_attach1(struct socket *so, int proto) +hci_attach(struct socket *so, int proto) { struct hci_pcb *pcb; int error; @@ -465,7 +465,7 @@ hci_attach1(struct socket *so, int proto) } static void -hci_detach1(struct socket *so) +hci_detach(struct socket *so) { struct hci_pcb *pcb; @@ -542,7 +542,7 @@ hci_usrreq(struct socket *up, int req, struct mbuf *m, case PRU_ABORT: soisdisconnected(up); - hci_detach1(up); + hci_detach(up); return 0; case PRU_BIND: @@ -866,10 +866,12 @@ hci_mtap(struct mbuf *m, struct hci_unit *unit) PR_WRAP_USRREQ(hci_usrreq) +//#define hci_attach hci_attach_wrapper +//#define hci_detach hci_detach_wrapper #define hci_usrreq hci_usrreq_wrapper const struct pr_usrreqs hci_usrreqs = { - .pr_attach = hci_attach1, - .pr_detach = hci_detach1, + .pr_attach = hci_attach, + .pr_detach = hci_detach, .pr_generic = hci_usrreq, }; diff --git a/sys/netbt/hci_unit.c b/sys/netbt/hci_unit.c index b4367aab4fea..2024ccfc371d 100644 --- a/sys/netbt/hci_unit.c +++ b/sys/netbt/hci_unit.c @@ -1,4 +1,4 @@ -/* $NetBSD: hci_unit.c,v 1.13 2011/09/17 08:23:37 plunky Exp $ */ +/* $NetBSD: hci_unit.c,v 1.14 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hci_unit.c,v 1.13 2011/09/17 08:23:37 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hci_unit.c,v 1.14 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -81,7 +81,7 @@ static const uint8_t hci_cmds_v10[HCI_COMMANDS_SIZE] = { static void hci_intr (void *); struct hci_unit * -hci_attach(const struct hci_if *hci_if, device_t dev, uint16_t flags) +hci_attach_pcb(const struct hci_if *hci_if, device_t dev, uint16_t flags) { struct hci_unit *unit; @@ -120,7 +120,7 @@ hci_attach(const struct hci_if *hci_if, device_t dev, uint16_t flags) } void -hci_detach(struct hci_unit *unit) +hci_detach_pcb(struct hci_unit *unit) { mutex_enter(bt_lock); diff --git a/sys/netbt/l2cap.h b/sys/netbt/l2cap.h index 33d15735a92b..0afc7e1ea1d3 100644 --- a/sys/netbt/l2cap.h +++ b/sys/netbt/l2cap.h @@ -1,4 +1,4 @@ -/* $NetBSD: l2cap.h,v 1.12 2014/05/19 02:51:24 rmind Exp $ */ +/* $NetBSD: l2cap.h,v 1.13 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -54,7 +54,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: l2cap.h,v 1.12 2014/05/19 02:51:24 rmind Exp $ + * $Id: l2cap.h,v 1.13 2014/05/20 18:25:54 rmind Exp $ * $FreeBSD: src/sys/netgraph/bluetooth/include/l2cap.h,v 1.4 2005/08/31 18:13:23 emax Exp $ */ @@ -461,13 +461,13 @@ int l2cap_send_connect_rsp(struct hci_link *, uint8_t, uint16_t, uint16_t, uint1 int l2cap_ctloutput(int, struct socket *, struct sockopt *); /* l2cap_upper.c */ -int l2cap_attach(struct l2cap_channel **, const struct btproto *, void *); +int l2cap_attach_pcb(struct l2cap_channel **, const struct btproto *, void *); int l2cap_bind(struct l2cap_channel *, struct sockaddr_bt *); int l2cap_sockaddr(struct l2cap_channel *, struct sockaddr_bt *); int l2cap_connect(struct l2cap_channel *, struct sockaddr_bt *); int l2cap_peeraddr(struct l2cap_channel *, struct sockaddr_bt *); int l2cap_disconnect(struct l2cap_channel *, int); -void l2cap_detach(struct l2cap_channel **); +void l2cap_detach_pcb(struct l2cap_channel **); int l2cap_listen(struct l2cap_channel *); int l2cap_send(struct l2cap_channel *, struct mbuf *); int l2cap_setopt(struct l2cap_channel *, const struct sockopt *); diff --git a/sys/netbt/l2cap_socket.c b/sys/netbt/l2cap_socket.c index 021dff6e4c95..60c1284cd8f4 100644 --- a/sys/netbt/l2cap_socket.c +++ b/sys/netbt/l2cap_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: l2cap_socket.c,v 1.13 2014/05/19 03:18:57 rmind Exp $ */ +/* $NetBSD: l2cap_socket.c,v 1.14 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: l2cap_socket.c,v 1.13 2014/05/19 03:18:57 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: l2cap_socket.c,v 1.14 2014/05/20 18:25:54 rmind Exp $"); /* load symbolic names */ #ifdef BLUETOOTH_DEBUG @@ -83,7 +83,7 @@ int l2cap_sendspace = 4096; int l2cap_recvspace = 4096; static int -l2cap_attach1(struct socket *so, int proto) +l2cap_attach(struct socket *so, int proto) { int error; @@ -104,15 +104,15 @@ l2cap_attach1(struct socket *so, int proto) if (error) return error; - return l2cap_attach((struct l2cap_channel **)&so->so_pcb, + return l2cap_attach_pcb((struct l2cap_channel **)&so->so_pcb, &l2cap_proto, so); } static void -l2cap_detach1(struct socket *so) +l2cap_detach(struct socket *so) { KASSERT(so->so_pcb != NULL); - l2cap_detach((struct l2cap_channel **)&so->so_pcb); + l2cap_detach_pcb((struct l2cap_channel **)&so->so_pcb); KASSERT(so->so_pcb == NULL); } @@ -168,7 +168,7 @@ l2cap_usrreq(struct socket *up, int req, struct mbuf *m, case PRU_ABORT: l2cap_disconnect(pcb, 0); soisdisconnected(up); - l2cap_detach1(up); + l2cap_detach(up); return 0; case PRU_BIND: @@ -413,10 +413,12 @@ l2cap_input(void *arg, struct mbuf *m) PR_WRAP_USRREQ(l2cap_usrreq) +//#define l2cap_attach l2cap_attach_wrapper +//#define l2cap_detach l2cap_detach_wrapper #define l2cap_usrreq l2cap_usrreq_wrapper const struct pr_usrreqs l2cap_usrreqs = { - .pr_attach = l2cap_attach1, - .pr_detach = l2cap_detach1, + .pr_attach = l2cap_attach, + .pr_detach = l2cap_detach, .pr_generic = l2cap_usrreq, }; diff --git a/sys/netbt/l2cap_upper.c b/sys/netbt/l2cap_upper.c index 46ffc43f3e1d..d0d55b724d38 100644 --- a/sys/netbt/l2cap_upper.c +++ b/sys/netbt/l2cap_upper.c @@ -1,4 +1,4 @@ -/* $NetBSD: l2cap_upper.c,v 1.12 2014/05/19 02:51:24 rmind Exp $ */ +/* $NetBSD: l2cap_upper.c,v 1.13 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: l2cap_upper.c,v 1.12 2014/05/19 02:51:24 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: l2cap_upper.c,v 1.13 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -52,13 +52,13 @@ __KERNEL_RCSID(0, "$NetBSD: l2cap_upper.c,v 1.12 2014/05/19 02:51:24 rmind Exp $ */ /* - * l2cap_attach(handle, btproto, upper) + * l2cap_attach_pcb(handle, btproto, upper) * * attach new l2cap_channel to handle, populate * with reasonable defaults */ int -l2cap_attach(struct l2cap_channel **handle, +l2cap_attach_pcb(struct l2cap_channel **handle, const struct btproto *proto, void *upper) { struct l2cap_channel *chan; @@ -260,12 +260,12 @@ l2cap_disconnect(struct l2cap_channel *chan, int linger) } /* - * l2cap_detach(handle) + * l2cap_detach_pcb(handle) * * Detach l2cap channel from handle & close it down */ void -l2cap_detach(struct l2cap_channel **handle) +l2cap_detach_pcb(struct l2cap_channel **handle) { struct l2cap_channel *chan; diff --git a/sys/netbt/rfcomm.h b/sys/netbt/rfcomm.h index 8b14a2039c30..b6d2923203d0 100644 --- a/sys/netbt/rfcomm.h +++ b/sys/netbt/rfcomm.h @@ -1,4 +1,4 @@ -/* $NetBSD: rfcomm.h,v 1.11 2014/05/19 02:51:24 rmind Exp $ */ +/* $NetBSD: rfcomm.h,v 1.12 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -55,7 +55,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: rfcomm.h,v 1.11 2014/05/19 02:51:24 rmind Exp $ + * $Id: rfcomm.h,v 1.12 2014/05/20 18:25:54 rmind Exp $ * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h,v 1.4 2005/01/11 01:39:53 emax Exp $ */ @@ -407,13 +407,13 @@ void rfcomm_init(void); int rfcomm_ctloutput(int, struct socket *, struct sockopt *); /* rfcomm_upper.c */ -int rfcomm_attach(struct rfcomm_dlc **, const struct btproto *, void *); +int rfcomm_attach_pcb(struct rfcomm_dlc **, const struct btproto *, void *); int rfcomm_bind(struct rfcomm_dlc *, struct sockaddr_bt *); int rfcomm_sockaddr(struct rfcomm_dlc *, struct sockaddr_bt *); int rfcomm_connect(struct rfcomm_dlc *, struct sockaddr_bt *); int rfcomm_peeraddr(struct rfcomm_dlc *, struct sockaddr_bt *); int rfcomm_disconnect(struct rfcomm_dlc *, int); -void rfcomm_detach(struct rfcomm_dlc **); +void rfcomm_detach_pcb(struct rfcomm_dlc **); int rfcomm_listen(struct rfcomm_dlc *); int rfcomm_send(struct rfcomm_dlc *, struct mbuf *); int rfcomm_rcvd(struct rfcomm_dlc *, size_t); diff --git a/sys/netbt/rfcomm_session.c b/sys/netbt/rfcomm_session.c index 9ab03c327778..42856defca5b 100644 --- a/sys/netbt/rfcomm_session.c +++ b/sys/netbt/rfcomm_session.c @@ -1,4 +1,4 @@ -/* $NetBSD: rfcomm_session.c,v 1.18 2011/07/27 10:25:09 plunky Exp $ */ +/* $NetBSD: rfcomm_session.c,v 1.19 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.18 2011/07/27 10:25:09 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.19 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -185,7 +185,7 @@ rfcomm_session_alloc(struct rfcomm_session_list *list, SIMPLEQ_INIT(&rs->rs_credits); LIST_INIT(&rs->rs_dlcs); - err = l2cap_attach(&rs->rs_l2cap, &rfcomm_session_proto, rs); + err = l2cap_attach_pcb(&rs->rs_l2cap, &rfcomm_session_proto, rs); if (err) { free(rs, M_BLUETOOTH); return NULL; @@ -250,7 +250,7 @@ rfcomm_session_free(struct rfcomm_session *rs) /* Goodbye! */ LIST_REMOVE(rs, rs_next); - l2cap_detach(&rs->rs_l2cap); + l2cap_detach_pcb(&rs->rs_l2cap); callout_destroy(&rs->rs_timeout); free(rs, M_BLUETOOTH); } diff --git a/sys/netbt/rfcomm_socket.c b/sys/netbt/rfcomm_socket.c index 0f892e5f2e6c..4194432ac686 100644 --- a/sys/netbt/rfcomm_socket.c +++ b/sys/netbt/rfcomm_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: rfcomm_socket.c,v 1.14 2014/05/19 15:44:04 martin Exp $ */ +/* $NetBSD: rfcomm_socket.c,v 1.15 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rfcomm_socket.c,v 1.14 2014/05/19 15:44:04 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rfcomm_socket.c,v 1.15 2014/05/20 18:25:54 rmind Exp $"); /* load symbolic names */ #ifdef BLUETOOTH_DEBUG @@ -82,7 +82,7 @@ int rfcomm_sendspace = 4096; int rfcomm_recvspace = 4096; static int -rfcomm_attach1(struct socket *so, int proto) +rfcomm_attach(struct socket *so, int proto) { int error; @@ -103,24 +103,24 @@ rfcomm_attach1(struct socket *so, int proto) if (error) return error; - error = rfcomm_attach((struct rfcomm_dlc **)&so->so_pcb, + error = rfcomm_attach_pcb((struct rfcomm_dlc **)&so->so_pcb, &rfcomm_proto, so); if (error) return error; error = rfcomm_rcvd(so->so_pcb, sbspace(&so->so_rcv)); if (error) { - rfcomm_detach((struct rfcomm_dlc **)&so->so_pcb); + rfcomm_detach_pcb((struct rfcomm_dlc **)&so->so_pcb); return error; } return 0; } static void -rfcomm_detach1(struct socket *so) +rfcomm_detach(struct socket *so) { KASSERT(so->so_pcb != NULL); - rfcomm_detach((struct rfcomm_dlc **)&so->so_pcb); + rfcomm_detach_pcb((struct rfcomm_dlc **)&so->so_pcb); KASSERT(so->so_pcb == NULL); } @@ -175,7 +175,7 @@ rfcomm_usrreq(struct socket *up, int req, struct mbuf *m, case PRU_ABORT: rfcomm_disconnect(pcb, 0); soisdisconnected(up); - rfcomm_detach1(up); + rfcomm_detach(up); return 0; case PRU_BIND: @@ -426,10 +426,12 @@ rfcomm_input(void *arg, struct mbuf *m) PR_WRAP_USRREQ(rfcomm_usrreq) +//#define rfcomm_attach rfcomm_attach_wrapper +//#define rfcomm_detach rfcomm_detach_wrapper #define rfcomm_usrreq rfcomm_usrreq_wrapper const struct pr_usrreqs rfcomm_usrreqs = { - .pr_attach = rfcomm_attach1, - .pr_detach = rfcomm_detach1, + .pr_attach = rfcomm_attach, + .pr_detach = rfcomm_detach, .pr_generic = rfcomm_usrreq, }; diff --git a/sys/netbt/rfcomm_upper.c b/sys/netbt/rfcomm_upper.c index f318b8fa91e6..231dcf2bf707 100644 --- a/sys/netbt/rfcomm_upper.c +++ b/sys/netbt/rfcomm_upper.c @@ -1,4 +1,4 @@ -/* $NetBSD: rfcomm_upper.c,v 1.14 2014/05/19 02:51:24 rmind Exp $ */ +/* $NetBSD: rfcomm_upper.c,v 1.15 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rfcomm_upper.c,v 1.14 2014/05/19 02:51:24 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rfcomm_upper.c,v 1.15 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -56,12 +56,12 @@ __KERNEL_RCSID(0, "$NetBSD: rfcomm_upper.c,v 1.14 2014/05/19 02:51:24 rmind Exp */ /* - * rfcomm_attach(handle, proto, upper) + * rfcomm_attach_pcb(handle, proto, upper) * * attach a new RFCOMM DLC to handle, populate with reasonable defaults */ int -rfcomm_attach(struct rfcomm_dlc **handle, +rfcomm_attach_pcb(struct rfcomm_dlc **handle, const struct btproto *proto, void *upper) { struct rfcomm_dlc *dlc; @@ -268,12 +268,12 @@ rfcomm_disconnect(struct rfcomm_dlc *dlc, int linger) } /* - * rfcomm_detach(handle) + * rfcomm_detach_pcb(handle) * * detach RFCOMM DLC from handle */ void -rfcomm_detach(struct rfcomm_dlc **handle) +rfcomm_detach_pcb(struct rfcomm_dlc **handle) { struct rfcomm_dlc *dlc = *handle; diff --git a/sys/netbt/sco.h b/sys/netbt/sco.h index b194fdebcda7..d9732b34ddb6 100644 --- a/sys/netbt/sco.h +++ b/sys/netbt/sco.h @@ -1,4 +1,4 @@ -/* $NetBSD: sco.h,v 1.5 2014/05/19 02:51:24 rmind Exp $ */ +/* $NetBSD: sco.h,v 1.6 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -68,13 +68,13 @@ extern int sco_recvspace; int sco_ctloutput(int, struct socket *, struct sockopt *); /* sco_upper.c */ -int sco_attach(struct sco_pcb **, const struct btproto *, void *); +int sco_attach_pcb(struct sco_pcb **, const struct btproto *, void *); int sco_bind(struct sco_pcb *, struct sockaddr_bt *); int sco_sockaddr(struct sco_pcb *, struct sockaddr_bt *); int sco_connect(struct sco_pcb *, struct sockaddr_bt *); int sco_peeraddr(struct sco_pcb *, struct sockaddr_bt *); int sco_disconnect(struct sco_pcb *, int); -void sco_detach(struct sco_pcb **); +void sco_detach_pcb(struct sco_pcb **); int sco_listen(struct sco_pcb *); int sco_send(struct sco_pcb *, struct mbuf *); int sco_setopt(struct sco_pcb *, const struct sockopt *); diff --git a/sys/netbt/sco_socket.c b/sys/netbt/sco_socket.c index c65702810800..6aeb925d2f88 100644 --- a/sys/netbt/sco_socket.c +++ b/sys/netbt/sco_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: sco_socket.c,v 1.15 2014/05/19 15:44:04 martin Exp $ */ +/* $NetBSD: sco_socket.c,v 1.16 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sco_socket.c,v 1.15 2014/05/19 15:44:04 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sco_socket.c,v 1.16 2014/05/20 18:25:54 rmind Exp $"); /* load symbolic names */ #ifdef BLUETOOTH_DEBUG @@ -79,7 +79,7 @@ int sco_sendspace = 4096; int sco_recvspace = 4096; static int -sco_attach1(struct socket *so, int proto) +sco_attach(struct socket *so, int proto) { int error; @@ -96,14 +96,14 @@ sco_attach1(struct socket *so, int proto) if (error) { return error; } - return sco_attach((struct sco_pcb **)&so->so_pcb, &sco_proto, so); + return sco_attach_pcb((struct sco_pcb **)&so->so_pcb, &sco_proto, so); } static void -sco_detach1(struct socket *so) +sco_detach(struct socket *so) { KASSERT(so->so_pcb != NULL); - sco_detach((struct sco_pcb **)&so->so_pcb); + sco_detach_pcb((struct sco_pcb **)&so->so_pcb); KASSERT(so->so_pcb == NULL); } @@ -157,7 +157,7 @@ sco_usrreq(struct socket *up, int req, struct mbuf *m, case PRU_ABORT: sco_disconnect(pcb, 0); soisdisconnected(up); - sco_detach1(up); + sco_detach(up); return 0; case PRU_BIND: @@ -381,10 +381,12 @@ sco_input(void *arg, struct mbuf *m) PR_WRAP_USRREQ(sco_usrreq) +//#define sco_attach sco_attach_wrapper +//#define sco_detach sco_detach_wrapper #define sco_usrreq sco_usrreq_wrapper const struct pr_usrreqs sco_usrreqs = { - .pr_attach = sco_attach1, - .pr_detach = sco_detach1, + .pr_attach = sco_attach, + .pr_detach = sco_detach, .pr_generic = sco_usrreq, }; diff --git a/sys/netbt/sco_upper.c b/sys/netbt/sco_upper.c index 9f313e881f72..1bcbe2def316 100644 --- a/sys/netbt/sco_upper.c +++ b/sys/netbt/sco_upper.c @@ -1,4 +1,4 @@ -/* $NetBSD: sco_upper.c,v 1.10 2014/05/19 02:51:24 rmind Exp $ */ +/* $NetBSD: sco_upper.c,v 1.11 2014/05/20 18:25:54 rmind Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sco_upper.c,v 1.10 2014/05/19 02:51:24 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sco_upper.c,v 1.11 2014/05/20 18:25:54 rmind Exp $"); #include #include @@ -53,12 +53,12 @@ __KERNEL_RCSID(0, "$NetBSD: sco_upper.c,v 1.10 2014/05/19 02:51:24 rmind Exp $") struct sco_pcb_list sco_pcb = LIST_HEAD_INITIALIZER(sco_pcb); /* - * sco_attach(handle, proto, upper) + * sco_attach_pcb(handle, proto, upper) * * Attach a new instance of SCO pcb to handle */ int -sco_attach(struct sco_pcb **handle, +sco_attach_pcb(struct sco_pcb **handle, const struct btproto *proto, void *upper) { struct sco_pcb *pcb; @@ -222,12 +222,12 @@ sco_disconnect(struct sco_pcb *pcb, int linger) } /* - * sco_detach(handle) + * sco_detach_pcb(handle) * * Detach SCO pcb from handle and clear up */ void -sco_detach(struct sco_pcb **handle) +sco_detach_pcb(struct sco_pcb **handle) { struct sco_pcb *pcb;