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
210 #define BT_ISO_PHY_1M 0x01
211 #define BT_ISO_PHY_2M 0x02
212 #define BT_ISO_PHY_CODED 0x04
213 #define BT_ISO_PHY_ANY (BT_ISO_PHY_1M | BT_ISO_PHY_2M | \
216 #define BT_CODEC 19
219 __u8 len; member
236 #define BT_CODEC_CVSD 0x02
237 #define BT_CODEC_TRANSPARENT 0x03
238 #define BT_CODEC_MSBC 0x05
240 #define BT_ISO_BASE 20
259 #define BT_INFO(fmt, ...) bt_info(fmt "\n", ##__VA_ARGS__)
260 #define BT_WARN(fmt, ...) bt_warn(fmt "\n", ##__VA_ARGS__)
261 #define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__)
264 #define BT_DBG(fmt, ...) bt_dbg(fmt "\n", ##__VA_ARGS__)
266 #define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__)
269 #define bt_dev_name(hdev) ((hdev) ? (hdev)->name : "null")
271 #define bt_dev_info(hdev, fmt, ...) \
273 #define bt_dev_warn(hdev, fmt, ...) \
275 #define bt_dev_err(hdev, fmt, ...) \
277 #define bt_dev_dbg(hdev, fmt, ...) \
280 #define bt_dev_warn_ratelimited(hdev, fmt, ...) \
282 #define bt_dev_err_ratelimited(hdev, fmt, ...) \
331 #define BDADDR_BREDR 0x00
332 #define BDADDR_LE_PUBLIC 0x01
333 #define BDADDR_LE_RANDOM 0x02
358 #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
359 #define BDADDR_NONE (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}})
375 #define bt_sk(__sk) ((struct bt_sock *) __sk)
406 int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
409 size_t len, int flags);
442 #define HCI_REQ_START BIT(0)
443 #define HCI_REQ_SKB BIT(1)
474 #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
476 #define hci_skb_pkt_type(skb) bt_cb((skb))->pkt_type
477 #define hci_skb_pkt_status(skb) bt_cb((skb))->pkt_status
478 #define hci_skb_expect(skb) bt_cb((skb))->expect
479 #define hci_skb_opcode(skb) bt_cb((skb))->hci.opcode
480 #define hci_skb_event(skb) bt_cb((skb))->hci.req_event
481 #define hci_skb_sk(skb) bt_cb((skb))->hci.sk
483 static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) in bt_skb_alloc() argument
487 skb = alloc_skb(len + BT_SKB_RESERVE, how); in bt_skb_alloc()
494 unsigned long len, int nb, int *err) in bt_skb_send_alloc() argument
498 skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err); in bt_skb_send_alloc()
509 if (sk->sk_shutdown) { in bt_skb_send_alloc()
510 *err = -ECONNRESET; in bt_skb_send_alloc()
524 size_t len, size_t mtu, in bt_skb_sendmsg() argument
528 size_t size = min_t(size_t, len, mtu); in bt_skb_sendmsg()
532 msg->msg_flags & MSG_DONTWAIT, &err); in bt_skb_sendmsg()
539 if (!copy_from_iter_full(skb_put(skb, size), size, &msg->msg_iter)) { in bt_skb_sendmsg()
541 return ERR_PTR(-EFAULT); in bt_skb_sendmsg()
544 skb->priority = READ_ONCE(sk->sk_priority); in bt_skb_sendmsg()
554 size_t len, size_t mtu, in bt_skb_sendmmsg() argument
559 skb = bt_skb_sendmsg(sk, msg, len, mtu, headroom, tailroom); in bt_skb_sendmmsg()
563 len -= skb->len; in bt_skb_sendmmsg()
564 if (!len) in bt_skb_sendmmsg()
568 frag = &skb_shinfo(skb)->frag_list; in bt_skb_sendmmsg()
569 while (len) { in bt_skb_sendmmsg()
572 tmp = bt_skb_sendmsg(sk, msg, len, mtu, headroom, tailroom); in bt_skb_sendmmsg()
577 len -= tmp->len; in bt_skb_sendmmsg()
580 frag = &(*frag)->next; in bt_skb_sendmmsg()