hci_packet.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _HCI_PACKET_H_
  14. #define _HCI_PACKET_H_
  15. #define HCI_HEADER_SIZE 4
  16. /*
  17. * The NIC type definition:
  18. * For backward compatibility, lower 16 bits used as they were.
  19. * Lower 16 bit: NIC_TYPE values
  20. * Uppoer 16 bit: NIC_TYPE Flags
  21. */
  22. #define NIC_TYPE_NIC0 0x00000010
  23. #define NIC_TYPE_NIC1 0x00000011
  24. #define NIC_TYPE_NIC2 0x00000012
  25. #define NIC_TYPE_NIC3 0x00000013
  26. #define NIC_TYPE_ARP 0x00000100
  27. #define NIC_TYPE_ICMPV6 0x00000200
  28. #define NIC_TYPE_MASK 0x0000FFFF
  29. #define NIC_TYPE_F_IPV4 0x00010000
  30. #define NIC_TYPE_F_IPV6 0x00020000
  31. #define NIC_TYPE_F_DHCP 0x00040000
  32. #define NIC_TYPE_F_NDP 0x00080000
  33. #define NIC_TYPE_F_VLAN 0x00100000
  34. struct hci_packet {
  35. u16 cmd_evt;
  36. u16 len;
  37. u8 data[0];
  38. } __packed;
  39. struct tlv {
  40. u8 type;
  41. u8 len;
  42. u8 *data[1];
  43. } __packed;
  44. struct sdu_header {
  45. u16 cmd_evt;
  46. u16 len;
  47. u32 dftEpsId;
  48. u32 bearer_ID;
  49. u32 nic_type;
  50. } __packed;
  51. struct sdu {
  52. u16 cmd_evt;
  53. u16 len;
  54. u32 dftEpsId;
  55. u32 bearer_ID;
  56. u32 nic_type;
  57. u8 data[0];
  58. } __packed;
  59. struct multi_sdu {
  60. u16 cmd_evt;
  61. u16 len;
  62. u16 num_packet;
  63. u16 reserved;
  64. u8 data[0];
  65. } __packed;
  66. struct hci_pdn_table_ind {
  67. u16 cmd_evt;
  68. u16 len;
  69. u8 activate;
  70. u32 dft_eps_id;
  71. u32 nic_type;
  72. u8 pdn_type;
  73. u8 ipv4_addr[4];
  74. u8 ipv6_intf_id[8];
  75. } __packed;
  76. struct hci_connect_ind {
  77. u16 cmd_evt;
  78. u16 len;
  79. u32 connect;
  80. } __packed;
  81. #endif /* _HCI_PACKET_H_ */