2 HIDP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2 as
7 published by the Free Software Foundation;
9 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED.
26 #include <linux/types.h>
27 #include <net/bluetooth/bluetooth.h>
29 /* HIDP ioctl defines */
30 #define HIDPCONNADD _IOW('H', 200, int)
31 #define HIDPCONNDEL _IOW('H', 201, int)
32 #define HIDPGETCONNLIST _IOR('H', 210, int)
33 #define HIDPGETCONNINFO _IOR('H', 211, int)
35 #define HIDP_VIRTUAL_CABLE_UNPLUG 0
36 #define HIDP_BOOT_PROTOCOL_MODE 1
37 #define HIDP_BLUETOOTH_VENDOR_ID 9
39 struct hidp_connadd_req {
40 int ctrl_sock; // Connected control socket
41 int intr_sock; // Connteted interrupt socket
55 struct hidp_conndel_req {
60 struct hidp_conninfo {
70 struct hidp_connlist_req {
72 struct hidp_conninfo __user *ci;
75 int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock);
76 int hidp_del_connection(struct hidp_conndel_req *req);
77 int hidp_get_connlist(struct hidp_connlist_req *req);
78 int hidp_get_conninfo(struct hidp_conninfo *ci);
80 /* HIDP session defines */
82 struct list_head list;
84 struct socket *ctrl_sock;
85 struct socket *intr_sock;
91 unsigned long idle_to;
98 unsigned char keys[8];
101 struct input_dev *input;
103 struct timer_list timer;
105 struct sk_buff_head ctrl_transmit;
106 struct sk_buff_head intr_transmit;
109 static inline void hidp_schedule(struct hidp_session *session)
111 struct sock *ctrl_sk = session->ctrl_sock->sk;
112 struct sock *intr_sk = session->intr_sock->sk;
114 wake_up_interruptible(ctrl_sk->sk_sleep);
115 wake_up_interruptible(intr_sk->sk_sleep);
118 /* HIDP init defines */
119 extern int __init hidp_init_sockets(void);
120 extern void __exit hidp_cleanup_sockets(void);
122 #endif /* __HIDP_H */