Virtio_Balloon implementation for DragonFly
[dragonfly.git] / sys / netbt / sco.h
1 /* $DragonFly: src/sys/netbt/sco.h,v 1.2 2008/03/18 13:41:42 hasso Exp $ */
2 /* $OpenBSD: sco.h,v 1.2 2007/06/01 02:46:12 uwe Exp $ */
3 /* $NetBSD: sco.h,v 1.2 2006/07/26 10:20:56 tron Exp $ */
4
5 /*-
6  * Copyright (c) 2006 Itronix Inc.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. The name of Itronix Inc. may not be used to endorse
18  *    or promote products derived from this software without specific
19  *    prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
25  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28  * ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #ifndef _NETBT_SCO_H_
35 #define _NETBT_SCO_H_
36
37 #define SO_SCO_MTU              1
38 #define SO_SCO_HANDLE           2
39
40 #ifdef _KERNEL
41 /*
42  * SCO protocol control block
43  */
44 struct sco_pcb {
45         struct hci_link         *sp_link;       /* SCO link */
46         unsigned int             sp_flags;      /* flags */
47         bdaddr_t                 sp_laddr;      /* local address */
48         bdaddr_t                 sp_raddr;      /* remote address */
49         unsigned int             sp_mtu;        /* link MTU */
50         int                      sp_pending;    /* number of packets pending */
51
52         const struct btproto    *sp_proto;      /* upper layer protocol */
53         void                    *sp_upper;      /* upper layer argument */
54
55         LIST_ENTRY(sco_pcb)      sp_next;
56 };
57
58 LIST_HEAD(sco_pcb_list, sco_pcb);
59 extern struct sco_pcb_list sco_pcb;
60
61 /* sp_flags */
62 #define SP_LISTENING            (1<<0)          /* is listening pcb */
63
64 /* sco_socket.c */
65 struct socket;
66 union netmsg;
67
68 extern struct pr_usrreqs sco_usrreqs;
69 extern int sco_sendspace;
70 extern int sco_recvspace;
71 int sco_usrreq(struct socket *, int, struct mbuf *,
72                 struct mbuf *, struct mbuf *);
73 void sco_ctloutput(union netmsg *);
74
75 /* sco_upper.c */
76 int sco_attach(struct sco_pcb **, const struct btproto *, void *);
77 int sco_bind(struct sco_pcb *, struct sockaddr_bt *);
78 int sco_sockaddr(struct sco_pcb *, struct sockaddr_bt *);
79 int sco_connect(struct sco_pcb *, struct sockaddr_bt *);
80 int sco_peeraddr(struct sco_pcb *, struct sockaddr_bt *);
81 int sco_disconnect(struct sco_pcb *, int);
82 int sco_detach(struct sco_pcb **);
83 int sco_listen(struct sco_pcb *);
84 int sco_send(struct sco_pcb *, struct mbuf *);
85 int sco_setopt(struct sco_pcb *, int, void *);
86 int sco_getopt(struct sco_pcb *, int, void *);
87
88 #endif  /* _KERNEL */
89
90 #endif  /* _NETBT_SCO_H_ */