"struct callout" -> callout_t

don't use callout_reset()
do use callout_destroy()
This commit is contained in:
plunky 2007-11-03 17:20:17 +00:00
parent 57eb1519a2
commit 644e69cd47
8 changed files with 33 additions and 22 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hci.h,v 1.14 2007/11/02 20:27:14 plunky Exp $ */
/* $NetBSD: hci.h,v 1.15 2007/11/03 17:20:17 plunky 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.14 2007/11/02 20:27:14 plunky Exp $
* $Id: hci.h,v 1.15 2007/11/03 17:20:17 plunky Exp $
* $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $
*/
@ -2059,7 +2059,7 @@ struct hci_link {
TAILQ_HEAD(,l2cap_pdu) hl_txq; /* queue of outgoing PDUs */
int hl_txqlen; /* number of fragments */
struct mbuf *hl_rxp; /* incoming PDU (accumulating)*/
struct callout hl_expire; /* connection expiry timer */
callout_t hl_expire; /* connection expiry timer */
TAILQ_HEAD(,l2cap_req) hl_reqs; /* pending requests */
/* SCO link info */

View File

@ -1,4 +1,4 @@
/* $NetBSD: hci_link.c,v 1.14 2007/09/16 19:59:30 plunky Exp $ */
/* $NetBSD: hci_link.c,v 1.15 2007/11/03 17:20:17 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hci_link.c,v 1.14 2007/09/16 19:59:30 plunky Exp $");
__KERNEL_RCSID(0, "$NetBSD: hci_link.c,v 1.15 2007/11/03 17:20:17 plunky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -990,6 +990,8 @@ hci_link_free(struct hci_link *link, int err)
if (callout_invoking(&link->hl_expire))
return;
callout_destroy(&link->hl_expire);
/*
* If we made a note of clock offset, keep it in a memo
* to facilitate reconnections to this device

View File

@ -1,4 +1,4 @@
/* $NetBSD: l2cap.h,v 1.5 2007/04/21 06:15:23 plunky Exp $ */
/* $NetBSD: l2cap.h,v 1.6 2007/11/03 17:20:17 plunky 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.5 2007/04/21 06:15:23 plunky Exp $
* $Id: l2cap.h,v 1.6 2007/11/03 17:20:17 plunky Exp $
* $FreeBSD: src/sys/netgraph/bluetooth/include/l2cap.h,v 1.4 2005/08/31 18:13:23 emax Exp $
*/
@ -420,7 +420,7 @@ struct l2cap_req {
struct l2cap_channel *lr_chan; /* channel pointer */
uint8_t lr_code; /* request code */
uint8_t lr_id; /* request id */
struct callout lr_rtx; /* response timer */
callout_t lr_rtx; /* response timer */
TAILQ_ENTRY(l2cap_req) lr_next; /* next request on link */
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: l2cap_misc.c,v 1.4 2007/07/09 21:11:10 ad Exp $ */
/* $NetBSD: l2cap_misc.c,v 1.5 2007/11/03 17:20:17 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: l2cap_misc.c,v 1.4 2007/07/09 21:11:10 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: l2cap_misc.c,v 1.5 2007/11/03 17:20:17 plunky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -131,7 +131,8 @@ l2cap_request_alloc(struct l2cap_channel *chan, uint8_t code)
req->lr_link = link;
callout_init(&req->lr_rtx, 0);
callout_reset(&req->lr_rtx, l2cap_response_timeout*hz, l2cap_rtx, req);
callout_setfunc(&req->lr_rtx, l2cap_rtx, req);
callout_schedule(&req->lr_rtx, l2cap_response_timeout * hz);
TAILQ_INSERT_TAIL(&link->hl_reqs, req, lr_next);
@ -166,6 +167,8 @@ l2cap_request_free(struct l2cap_req *req)
if (callout_invoking(&req->lr_rtx))
return;
callout_destroy(&req->lr_rtx);
TAILQ_REMOVE(&link->hl_reqs, req, lr_next);
pool_put(&l2cap_req_pool, req);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rfcomm.h,v 1.3 2007/04/21 06:15:23 plunky Exp $ */
/* $NetBSD: rfcomm.h,v 1.4 2007/11/03 17:20:17 plunky 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.3 2007/04/21 06:15:23 plunky Exp $
* $Id: rfcomm.h,v 1.4 2007/11/03 17:20:17 plunky Exp $
* $FreeBSD: src/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h,v 1.4 2005/01/11 01:39:53 emax Exp $
*/
@ -287,7 +287,7 @@ struct rfcomm_session {
SIMPLEQ_HEAD(,rfcomm_credit) rs_credits; /* credit notes */
LIST_HEAD(,rfcomm_dlc) rs_dlcs; /* DLC list */
struct callout rs_timeout; /* timeout */
callout_t rs_timeout; /* timeout */
LIST_ENTRY(rfcomm_session) rs_next; /* next session */
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: rfcomm_dlc.c,v 1.3 2007/04/21 06:15:23 plunky Exp $ */
/* $NetBSD: rfcomm_dlc.c,v 1.4 2007/11/03 17:20:17 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rfcomm_dlc.c,v 1.3 2007/04/21 06:15:23 plunky Exp $");
__KERNEL_RCSID(0, "$NetBSD: rfcomm_dlc.c,v 1.4 2007/11/03 17:20:17 plunky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -202,8 +202,10 @@ rfcomm_dlc_timeout(void *arg)
if (dlc->rd_state != RFCOMM_DLC_CLOSED)
rfcomm_dlc_close(dlc, ETIMEDOUT);
else if (dlc->rd_flags & RFCOMM_DLC_DETACH)
else if (dlc->rd_flags & RFCOMM_DLC_DETACH) {
callout_destroy(&dlc->rd_timeout);
free(dlc, M_BLUETOOTH);
}
splx(s);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rfcomm_session.c,v 1.10 2007/07/09 21:11:10 ad Exp $ */
/* $NetBSD: rfcomm_session.c,v 1.11 2007/11/03 17:20:17 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.10 2007/07/09 21:11:10 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.11 2007/11/03 17:20:17 plunky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -228,6 +228,8 @@ rfcomm_session_free(struct rfcomm_session *rs)
rs->rs_flags |= RFCOMM_SESSION_FREE;
callout_destroy(&rs->rs_timeout);
/* throw away any remaining credit notes */
while ((credit = SIMPLEQ_FIRST(&rs->rs_credits)) != NULL) {
SIMPLEQ_REMOVE_HEAD(&rs->rs_credits, rc_next);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rfcomm_upper.c,v 1.7 2007/07/09 21:11:10 ad Exp $ */
/* $NetBSD: rfcomm_upper.c,v 1.8 2007/11/03 17:20:17 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rfcomm_upper.c,v 1.7 2007/07/09 21:11:10 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: rfcomm_upper.c,v 1.8 2007/11/03 17:20:17 plunky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -292,8 +292,10 @@ rfcomm_detach(struct rfcomm_dlc **handle)
*/
if (callout_invoking(&dlc->rd_timeout))
dlc->rd_flags |= RFCOMM_DLC_DETACH;
else
else {
callout_destroy(&dlc->rd_timeout);
free(dlc, M_BLUETOOTH);
}
return 0;
}