1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved. */
3 
4 #ifndef _HCI_PACKET_H_
5 #define _HCI_PACKET_H_
6 
7 #define HCI_HEADER_SIZE 4
8 
9 /*
10  * The NIC type definition:
11  * For backward compatibility, lower 16 bits used as they were.
12  * Lower 16 bit: NIC_TYPE values
13  * Uppoer 16 bit: NIC_TYPE Flags
14  */
15 #define NIC_TYPE_NIC0		0x00000010
16 #define NIC_TYPE_NIC1		0x00000011
17 #define NIC_TYPE_NIC2		0x00000012
18 #define NIC_TYPE_NIC3		0x00000013
19 #define NIC_TYPE_ARP		0x00000100
20 #define NIC_TYPE_ICMPV6		0x00000200
21 #define NIC_TYPE_MASK		0x0000FFFF
22 #define NIC_TYPE_F_IPV4		0x00010000
23 #define NIC_TYPE_F_IPV6		0x00020000
24 #define NIC_TYPE_F_DHCP		0x00040000
25 #define NIC_TYPE_F_NDP		0x00080000
26 #define NIC_TYPE_F_VLAN		0x00100000
27 
28 struct hci_packet {
29 	__dev16 cmd_evt;
30 	__dev16 len;
31 	u8 data[];
32 } __packed;
33 
34 struct tlv {
35 	u8 type;
36 	u8 len;
37 	u8 *data[];
38 } __packed;
39 
40 struct sdu_header {
41 	__dev16 cmd_evt;
42 	__dev16 len;
43 	__dev32 dft_eps_id;
44 	__dev32 bearer_ID;
45 	__dev32 nic_type;
46 } __packed;
47 
48 struct sdu {
49 	__dev16 cmd_evt;
50 	__dev16 len;
51 	__dev32 dft_eps_ID;
52 	__dev32 bearer_ID;
53 	__dev32 nic_type;
54 	u8 data[];
55 } __packed;
56 
57 struct multi_sdu {
58 	__dev16 cmd_evt;
59 	__dev16 len;
60 	__dev16 num_packet;
61 	__dev16 reserved;
62 	u8 data[];
63 } __packed;
64 
65 struct hci_pdn_table_ind {
66 	__dev16 cmd_evt;
67 	__dev16 len;
68 	u8 activate;
69 	__dev32 dft_eps_id;
70 	__dev32 nic_type;
71 	u8 pdn_type;
72 	u8 ipv4_addr[4];
73 	u8 ipv6_intf_id[8];
74 } __packed;
75 
76 struct hci_connect_ind {
77 	__dev16 cmd_evt;
78 	__dev16 len;
79 	__dev32 connect;
80 } __packed;
81 
82 #endif /* _HCI_PACKET_H_ */
83