0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef __CMTP_H
0024 #define __CMTP_H
0025
0026 #include <linux/types.h>
0027 #include <net/bluetooth/bluetooth.h>
0028
0029 #define BTNAMSIZ 21
0030
0031
0032 #define CMTPCONNADD _IOW('C', 200, int)
0033 #define CMTPCONNDEL _IOW('C', 201, int)
0034 #define CMTPGETCONNLIST _IOR('C', 210, int)
0035 #define CMTPGETCONNINFO _IOR('C', 211, int)
0036
0037 #define CMTP_LOOPBACK 0
0038
0039 struct cmtp_connadd_req {
0040 int sock;
0041 __u32 flags;
0042 };
0043
0044 struct cmtp_conndel_req {
0045 bdaddr_t bdaddr;
0046 __u32 flags;
0047 };
0048
0049 struct cmtp_conninfo {
0050 bdaddr_t bdaddr;
0051 __u32 flags;
0052 __u16 state;
0053 int num;
0054 };
0055
0056 struct cmtp_connlist_req {
0057 __u32 cnum;
0058 struct cmtp_conninfo __user *ci;
0059 };
0060
0061 int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock);
0062 int cmtp_del_connection(struct cmtp_conndel_req *req);
0063 int cmtp_get_connlist(struct cmtp_connlist_req *req);
0064 int cmtp_get_conninfo(struct cmtp_conninfo *ci);
0065
0066
0067 #define CMTP_INTEROP_TIMEOUT (HZ * 5)
0068 #define CMTP_INITIAL_MSGNUM 0xff00
0069
0070 struct cmtp_session {
0071 struct list_head list;
0072
0073 struct socket *sock;
0074
0075 bdaddr_t bdaddr;
0076
0077 unsigned long state;
0078 unsigned long flags;
0079
0080 uint mtu;
0081
0082 char name[BTNAMSIZ];
0083
0084 atomic_t terminate;
0085 struct task_struct *task;
0086
0087 wait_queue_head_t wait;
0088
0089 int ncontroller;
0090 int num;
0091 struct capi_ctr ctrl;
0092
0093 struct list_head applications;
0094
0095 unsigned long blockids;
0096 int msgnum;
0097
0098 struct sk_buff_head transmit;
0099
0100 struct sk_buff *reassembly[16];
0101 };
0102
0103 struct cmtp_application {
0104 struct list_head list;
0105
0106 unsigned long state;
0107 int err;
0108
0109 __u16 appl;
0110 __u16 mapping;
0111
0112 __u16 msgnum;
0113 };
0114
0115 struct cmtp_scb {
0116 int id;
0117 int data;
0118 };
0119
0120 int cmtp_attach_device(struct cmtp_session *session);
0121 void cmtp_detach_device(struct cmtp_session *session);
0122
0123 void cmtp_recv_capimsg(struct cmtp_session *session, struct sk_buff *skb);
0124
0125
0126 int cmtp_init_sockets(void);
0127 void cmtp_cleanup_sockets(void);
0128
0129 #endif