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