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