hci.h (d504181a0a0dc3adf4402033a03ffb9662500358) | hci.h (fc6cde64da1ae59d3297ec16f431290c45445678) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 77 unchanged lines hidden (view full) --- 86#ifdef ENABLE_CLASSIC 87#define HCI_CMD_BUFFER_SIZE (HCI_CMD_HEADER_SIZE + HCI_CMD_PAYLOAD_SIZE) 88#else 89#define HCI_CMD_BUFFER_SIZE (HCI_CMD_HEADER_SIZE + HCI_CMD_PAYLOAD_SIZE_LE) 90#endif 91 92#define HCI_ACL_BUFFER_SIZE (HCI_ACL_HEADER_SIZE + HCI_ACL_PAYLOAD_SIZE) 93 | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 77 unchanged lines hidden (view full) --- 86#ifdef ENABLE_CLASSIC 87#define HCI_CMD_BUFFER_SIZE (HCI_CMD_HEADER_SIZE + HCI_CMD_PAYLOAD_SIZE) 88#else 89#define HCI_CMD_BUFFER_SIZE (HCI_CMD_HEADER_SIZE + HCI_CMD_PAYLOAD_SIZE_LE) 90#endif 91 92#define HCI_ACL_BUFFER_SIZE (HCI_ACL_HEADER_SIZE + HCI_ACL_PAYLOAD_SIZE) 93 |
94// size of hci buffers, big enough for command, event, or acl packet without H4 packet type 95// @note cmd buffer is bigger than event buffer 96#ifdef HCI_PACKET_BUFFER_SIZE 97 #if HCI_PACKET_BUFFER_SIZE < HCI_ACL_BUFFER_SIZE 98 #error HCI_PACKET_BUFFER_SIZE must be equal or larger than HCI_ACL_BUFFER_SIZE | 94// size of hci incoming buffer, big enough for event or acl packet without H4 packet type 95#ifdef HCI_INCOMING_PACKET_BUFFER_SIZE 96 #if HCI_INCOMING_PACKET_BUFFER_SIZE < HCI_ACL_BUFFER_SIZE 97 #error HCI_INCOMING_PACKET_BUFFER_SIZE must be equal or larger than HCI_ACL_BUFFER_SIZE |
99 #endif | 98 #endif |
100 #if HCI_PACKET_BUFFER_SIZE < HCI_CMD_BUFFER_SIZE 101 #error HCI_PACKET_BUFFER_SIZE must be equal or larger than HCI_CMD_BUFFER_SIZE | 99 #if HCI_INCOMING_PACKET_BUFFER_SIZE < HCI_EVENT_BUFFER_SIZE 100 #error HCI_INCOMING_PACKET_BUFFER_SIZE must be equal or larger than HCI_EVENT_BUFFER_SIZE |
102 #endif 103#else | 101 #endif 102#else |
103 #if HCI_ACL_BUFFER_SIZE > HCI_EVENT_BUFFER_SIZE 104 #define HCI_INCOMING_PACKET_BUFFER_SIZE HCI_ACL_BUFFER_SIZE 105 #else 106 #define HCI_INCOMING_PACKET_BUFFER_SIZE HCI_EVENT_BUFFER_SIZE 107 #endif 108#endif 109 110// size of hci outgoing buffer, big enough for command or acl packet without H4 packet type 111#ifdef HCI_OUTGOING_PACKET_BUFFER_SIZE 112 #if HCI_OUTGOING_PACKET_BUFFER_SIZE < HCI_ACL_BUFFER_SIZE 113 #error HCI_OUTGOING_PACKET_BUFFER_SIZE must be equal or larger than HCI_ACL_BUFFER_SIZE 114 #endif 115 #if HCI_OUTGOING_PACKET_BUFFER_SIZE < HCI_CMD_BUFFER_SIZE 116 #error HCI_OUTGOING_PACKET_BUFFER_SIZE must be equal or larger than HCI_CMD_BUFFER_SIZE 117 #endif 118#else |
|
104 #if HCI_ACL_BUFFER_SIZE > HCI_CMD_BUFFER_SIZE | 119 #if HCI_ACL_BUFFER_SIZE > HCI_CMD_BUFFER_SIZE |
105 #define HCI_PACKET_BUFFER_SIZE HCI_ACL_BUFFER_SIZE | 120 #define HCI_OUTGOING_PACKET_BUFFER_SIZE HCI_ACL_BUFFER_SIZE |
106 #else | 121 #else |
107 #define HCI_PACKET_BUFFER_SIZE HCI_CMD_BUFFER_SIZE | 122 #define HCI_OUTGOING_PACKET_BUFFER_SIZE HCI_CMD_BUFFER_SIZE |
108 #endif 109#endif 110 111// additional pre-buffer space for packets to Bluetooth module, for now, used for HCI Transport H4 DMA 112#ifndef HCI_OUTGOING_PRE_BUFFER_SIZE 113#ifdef HAVE_HOST_CONTROLLER_API 114#define HCI_OUTGOING_PRE_BUFFER_SIZE 0 115#else --- 567 unchanged lines hidden (view full) --- 683 uint8_t ssp_enable; 684 uint8_t ssp_io_capability; 685 uint8_t ssp_authentication_requirement; 686 uint8_t ssp_auto_accept; 687 inquiry_mode_t inquiry_mode; 688 689 // single buffer for HCI packet assembly + additional prebuffer for H4 drivers 690 uint8_t * hci_packet_buffer; | 123 #endif 124#endif 125 126// additional pre-buffer space for packets to Bluetooth module, for now, used for HCI Transport H4 DMA 127#ifndef HCI_OUTGOING_PRE_BUFFER_SIZE 128#ifdef HAVE_HOST_CONTROLLER_API 129#define HCI_OUTGOING_PRE_BUFFER_SIZE 0 130#else --- 567 unchanged lines hidden (view full) --- 698 uint8_t ssp_enable; 699 uint8_t ssp_io_capability; 700 uint8_t ssp_authentication_requirement; 701 uint8_t ssp_auto_accept; 702 inquiry_mode_t inquiry_mode; 703 704 // single buffer for HCI packet assembly + additional prebuffer for H4 drivers 705 uint8_t * hci_packet_buffer; |
691 uint8_t hci_packet_buffer_data[HCI_OUTGOING_PRE_BUFFER_SIZE + HCI_PACKET_BUFFER_SIZE]; | 706 uint8_t hci_packet_buffer_data[HCI_OUTGOING_PRE_BUFFER_SIZE + HCI_OUTGOING_PACKET_BUFFER_SIZE]; |
692 uint8_t hci_packet_buffer_reserved; 693 uint16_t acl_fragmentation_pos; 694 uint16_t acl_fragmentation_total_size; 695 696 /* host to controller flow control */ 697 uint8_t num_cmd_packets; 698 uint8_t acl_packets_total_num; 699 uint16_t acl_data_packet_length; --- 457 unchanged lines hidden --- | 707 uint8_t hci_packet_buffer_reserved; 708 uint16_t acl_fragmentation_pos; 709 uint16_t acl_fragmentation_total_size; 710 711 /* host to controller flow control */ 712 uint8_t num_cmd_packets; 713 uint8_t acl_packets_total_num; 714 uint16_t acl_data_packet_length; --- 457 unchanged lines hidden --- |