Lines Matching +full:len +full:- +full:or +full:- +full:define
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated
8 This program is free software; you can redistribute it and/or modify
13 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
17 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
27 #define __BLUETOOTH_H
33 #define BT_SUBSYS_VERSION 2
34 #define BT_SUBSYS_REVISION 22
37 #define AF_BLUETOOTH 31
38 #define PF_BLUETOOTH AF_BLUETOOTH
42 #define BLUETOOTH_VER_1_1 1
43 #define BLUETOOTH_VER_1_2 2
44 #define BLUETOOTH_VER_2_0 3
45 #define BLUETOOTH_VER_2_1 4
46 #define BLUETOOTH_VER_4_0 6
49 #define BT_SKB_RESERVE 8
51 #define BTPROTO_L2CAP 0
52 #define BTPROTO_HCI 1
53 #define BTPROTO_SCO 2
54 #define BTPROTO_RFCOMM 3
55 #define BTPROTO_BNEP 4
56 #define BTPROTO_CMTP 5
57 #define BTPROTO_HIDP 6
58 #define BTPROTO_AVDTP 7
59 #define BTPROTO_ISO 8
60 #define BTPROTO_LAST BTPROTO_ISO
62 #define SOL_HCI 0
63 #define SOL_L2CAP 6
64 #define SOL_SCO 17
65 #define SOL_RFCOMM 18
67 #define BT_SECURITY 4
72 #define BT_SECURITY_SDP 0
73 #define BT_SECURITY_LOW 1
74 #define BT_SECURITY_MEDIUM 2
75 #define BT_SECURITY_HIGH 3
76 #define BT_SECURITY_FIPS 4
78 #define BT_DEFER_SETUP 7
80 #define BT_FLUSHABLE 8
82 #define BT_FLUSHABLE_OFF 0
83 #define BT_FLUSHABLE_ON 1
85 #define BT_POWER 9
89 #define BT_POWER_FORCE_ACTIVE_OFF 0
90 #define BT_POWER_FORCE_ACTIVE_ON 1
92 #define BT_CHANNEL_POLICY 10
99 #define BT_CHANNEL_POLICY_BREDR_ONLY 0
106 #define BT_CHANNEL_POLICY_BREDR_PREFERRED 1
117 #define BT_CHANNEL_POLICY_AMP_PREFERRED 2
119 #define BT_VOICE 11
124 #define BT_VOICE_TRANSPARENT 0x0003
125 #define BT_VOICE_CVSD_16BIT 0x0060
127 #define BT_SNDMTU 12
128 #define BT_RCVMTU 13
129 #define BT_PHY 14
131 #define BT_PHY_BR_1M_1SLOT 0x00000001
132 #define BT_PHY_BR_1M_3SLOT 0x00000002
133 #define BT_PHY_BR_1M_5SLOT 0x00000004
134 #define BT_PHY_EDR_2M_1SLOT 0x00000008
135 #define BT_PHY_EDR_2M_3SLOT 0x00000010
136 #define BT_PHY_EDR_2M_5SLOT 0x00000020
137 #define BT_PHY_EDR_3M_1SLOT 0x00000040
138 #define BT_PHY_EDR_3M_3SLOT 0x00000080
139 #define BT_PHY_EDR_3M_5SLOT 0x00000100
140 #define BT_PHY_LE_1M_TX 0x00000200
141 #define BT_PHY_LE_1M_RX 0x00000400
142 #define BT_PHY_LE_2M_TX 0x00000800
143 #define BT_PHY_LE_2M_RX 0x00001000
144 #define BT_PHY_LE_CODED_TX 0x00002000
145 #define BT_PHY_LE_CODED_RX 0x00004000
147 #define BT_MODE 15
149 #define BT_MODE_BASIC 0x00
150 #define BT_MODE_ERTM 0x01
151 #define BT_MODE_STREAMING 0x02
152 #define BT_MODE_LE_FLOWCTL 0x03
153 #define BT_MODE_EXT_FLOWCTL 0x04
155 #define BT_PKT_STATUS 16
157 #define BT_SCM_PKT_STATUS 0x03
159 #define BT_ISO_QOS 17
161 #define BT_ISO_QOS_CIG_UNSET 0xff
162 #define BT_ISO_QOS_CIS_UNSET 0xff
164 #define BT_ISO_QOS_BIG_UNSET 0xff
165 #define BT_ISO_QOS_BIS_UNSET 0xff
167 #define BT_ISO_SYNC_TIMEOUT 0x07d0 /* 20 secs */
212 #define BT_ISO_PHY_1M 0x01
213 #define BT_ISO_PHY_2M 0x02
214 #define BT_ISO_PHY_CODED 0x04
215 #define BT_ISO_PHY_ANY (BT_ISO_PHY_1M | BT_ISO_PHY_2M | \
218 #define BT_CODEC 19
221 __u8 len; member
238 #define BT_CODEC_CVSD 0x02
239 #define BT_CODEC_TRANSPARENT 0x03
240 #define BT_CODEC_MSBC 0x05
242 #define BT_ISO_BASE 20
261 #define BT_INFO(fmt, ...) bt_info(fmt "\n", ##__VA_ARGS__)
262 #define BT_WARN(fmt, ...) bt_warn(fmt "\n", ##__VA_ARGS__)
263 #define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__)
266 #define BT_DBG(fmt, ...) bt_dbg(fmt "\n", ##__VA_ARGS__)
268 #define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__)
271 #define bt_dev_name(hdev) ((hdev) ? (hdev)->name : "null")
273 #define bt_dev_info(hdev, fmt, ...) \
275 #define bt_dev_warn(hdev, fmt, ...) \
277 #define bt_dev_err(hdev, fmt, ...) \
279 #define bt_dev_dbg(hdev, fmt, ...) \
282 #define bt_dev_warn_ratelimited(hdev, fmt, ...) \
284 #define bt_dev_err_ratelimited(hdev, fmt, ...) \
333 #define BDADDR_BREDR 0x00
334 #define BDADDR_LE_PUBLIC 0x01
335 #define BDADDR_LE_RANDOM 0x02
360 #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
361 #define BDADDR_NONE (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}})
377 #define bt_sk(__sk) ((struct bt_sock *) __sk)
409 int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
412 size_t len, int flags);
449 #define HCI_REQ_START BIT(0)
450 #define HCI_REQ_SKB BIT(1)
481 #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
483 #define hci_skb_pkt_type(skb) bt_cb((skb))->pkt_type
484 #define hci_skb_pkt_status(skb) bt_cb((skb))->pkt_status
485 #define hci_skb_expect(skb) bt_cb((skb))->expect
486 #define hci_skb_opcode(skb) bt_cb((skb))->hci.opcode
487 #define hci_skb_event(skb) bt_cb((skb))->hci.req_event
488 #define hci_skb_sk(skb) bt_cb((skb))->hci.sk
490 static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) in bt_skb_alloc() argument
494 skb = alloc_skb(len + BT_SKB_RESERVE, how); in bt_skb_alloc()
501 unsigned long len, int nb, int *err) in bt_skb_send_alloc() argument
505 skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err); in bt_skb_send_alloc()
516 if (sk->sk_shutdown) { in bt_skb_send_alloc()
517 *err = -ECONNRESET; in bt_skb_send_alloc()
531 size_t len, size_t mtu, in bt_skb_sendmsg() argument
535 size_t size = min_t(size_t, len, mtu); in bt_skb_sendmsg()
539 msg->msg_flags & MSG_DONTWAIT, &err); in bt_skb_sendmsg()
546 if (!copy_from_iter_full(skb_put(skb, size), size, &msg->msg_iter)) { in bt_skb_sendmsg()
548 return ERR_PTR(-EFAULT); in bt_skb_sendmsg()
551 skb->priority = READ_ONCE(sk->sk_priority); in bt_skb_sendmsg()
561 size_t len, size_t mtu, in bt_skb_sendmmsg() argument
566 skb = bt_skb_sendmsg(sk, msg, len, mtu, headroom, tailroom); in bt_skb_sendmmsg()
570 len -= skb->len; in bt_skb_sendmmsg()
571 if (!len) in bt_skb_sendmmsg()
575 frag = &skb_shinfo(skb)->frag_list; in bt_skb_sendmmsg()
576 while (len) { in bt_skb_sendmmsg()
579 tmp = bt_skb_sendmsg(sk, msg, len, mtu, headroom, tailroom); in bt_skb_sendmmsg()
584 len -= tmp->len; in bt_skb_sendmmsg()
587 frag = &(*frag)->next; in bt_skb_sendmmsg()
597 return -EINVAL; in bt_copy_from_sockptr()