Update IDF to 9a26296

This commit is contained in:
me-no-dev
2017-09-12 09:40:52 +03:00
parent 0bce98e72c
commit ba929be27a
232 changed files with 6316 additions and 2105 deletions

View File

@ -37,8 +37,6 @@
#include "sdkconfig.h"
#include "bt_types.h" /* This must be defined AFTER buildcfg.h */
/* Include common GKI definitions used by this platform */
#include "gki_target.h"
#include "dyn_mem.h" /* defines static and/or dynamic memory for components */
#if CONFIG_CLASSIC_BT_ENABLED
@ -177,15 +175,6 @@
#define BTA_DISABLE_DELAY 200 /* in milliseconds */
#endif
// If the next wakeup time is less than this threshold, we should acquire
// a wakelock instead of setting a wake alarm so we're not bouncing in
// and out of suspend frequently.
// in millisecond
// TODO(zachoverflow): reinstate in alarm code
#ifndef GKI_TIMER_INTERVAL_FOR_WAKELOCK
#define GKI_TIMER_INTERVAL_FOR_WAKELOCK 3000
#endif
#ifndef BTA_SYS_TIMER_PERIOD
#define BTA_SYS_TIMER_PERIOD 100
#endif
@ -266,66 +255,63 @@
/******************************************************************************
**
** GKI Buffer Pools
** Buffer Size
**
******************************************************************************/
#ifndef BT_DEFAULT_BUFFER_SIZE
#define BT_DEFAULT_BUFFER_SIZE (4096 + 16)
#endif
#ifndef BT_SMALL_BUFFER_SIZE
#define BT_SMALL_BUFFER_SIZE 660
#endif
/* Receives HCI events from the lower-layer. */
#ifndef HCI_CMD_POOL_ID
#define HCI_CMD_POOL_ID GKI_POOL_ID_2
#endif
#ifndef HCI_CMD_POOL_BUF_SIZE
#define HCI_CMD_POOL_BUF_SIZE GKI_BUF2_SIZE
#endif
/* Receives ACL data packets from thelower-layer. */
#ifndef HCI_ACL_POOL_ID
#define HCI_ACL_POOL_ID GKI_POOL_ID_3
#endif
/* Maximum number of buffers available for ACL receive data. */
#ifndef HCI_ACL_BUF_MAX
#define HCI_ACL_BUF_MAX GKI_BUF3_MAX
#endif
/* Receives SCO data packets from the lower-layer. */
#ifndef HCI_SCO_POOL_ID
#define HCI_SCO_POOL_ID GKI_POOL_ID_6
#ifndef HCI_CMD_BUF_SIZE
#define HCI_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
#endif
/* Sends SDP data packets. */
#ifndef SDP_POOL_ID
#define SDP_POOL_ID 3
#ifndef SDP_DATA_BUF_SIZE
#define SDP_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* Sends RFCOMM command packets. */
#ifndef RFCOMM_CMD_POOL_ID
#define RFCOMM_CMD_POOL_ID GKI_POOL_ID_2
#ifndef RFCOMM_CMD_BUF_SIZE
#define RFCOMM_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
#endif
/* Sends RFCOMM data packets. */
#ifndef RFCOMM_DATA_POOL_ID
#define RFCOMM_DATA_POOL_ID GKI_POOL_ID_3
#endif
#ifndef RFCOMM_DATA_POOL_BUF_SIZE
#define RFCOMM_DATA_POOL_BUF_SIZE GKI_BUF3_SIZE
#ifndef RFCOMM_DATA_BUF_SIZE
#define RFCOMM_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* Sends L2CAP packets to the peer and HCI messages to the controller. */
#ifndef L2CAP_CMD_POOL_ID
#define L2CAP_CMD_POOL_ID GKI_POOL_ID_2
#ifndef L2CAP_CMD_BUF_SIZE
#define L2CAP_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
#endif
#ifndef L2CAP_USER_TX_BUF_SIZE
#define L2CAP_USER_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
#ifndef L2CAP_USER_RX_BUF_SIZE
#define L2CAP_USER_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* Sends L2CAP segmented packets in ERTM mode */
#ifndef L2CAP_FCR_TX_POOL_ID
#define L2CAP_FCR_TX_POOL_ID HCI_ACL_POOL_ID
#ifndef L2CAP_FCR_TX_BUF_SIZE
#define L2CAP_FCR_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* Receives L2CAP segmented packets in ERTM mode */
#ifndef L2CAP_FCR_RX_POOL_ID
#define L2CAP_FCR_RX_POOL_ID HCI_ACL_POOL_ID
#ifndef L2CAP_FCR_RX_BUF_SIZE
#define L2CAP_FCR_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
#ifndef L2CAP_FCR_ERTM_BUF_SIZE
#define L2CAP_FCR_ERTM_BUF_SIZE (10240 + 24)
#endif
/* Number of ACL buffers to assign to LE
@ -335,114 +321,72 @@
#endif
/* Used by BTM when it sends HCI commands to the controller. */
#ifndef BTM_CMD_POOL_ID
#define BTM_CMD_POOL_ID GKI_POOL_ID_2
#ifndef BTM_CMD_BUF_SIZE
#define BTM_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
#endif
#ifndef OBX_LRG_DATA_POOL_SIZE
#define OBX_LRG_DATA_POOL_SIZE GKI_BUF4_SIZE
#ifndef OBX_LRG_DATA_BUF_SIZE
#define OBX_LRG_DATA_BUF_SIZE (8080 + 26)
#endif
#ifndef OBX_LRG_DATA_POOL_ID
#define OBX_LRG_DATA_POOL_ID GKI_POOL_ID_4
#endif
/* Used to send data to L2CAP. */
#ifndef GAP_DATA_POOL_ID
#define GAP_DATA_POOL_ID GKI_POOL_ID_3
#endif
#ifndef SPP_DB_SIZE
#define SPP_DB_SIZE GKI_BUF3_SIZE
#ifndef GAP_DATA_BUF_SIZE
#define GAP_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* BNEP data and protocol messages. */
#ifndef BNEP_POOL_ID
#define BNEP_POOL_ID GKI_POOL_ID_3
#ifndef BNEP_BUF_SIZE
#define BNEP_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* RPC pool for temporary trace message buffers. */
#ifndef RPC_SCRATCH_POOL_ID
#define RPC_SCRATCH_POOL_ID GKI_POOL_ID_2
/* AVDTP buffer size for protocol messages */
#ifndef AVDT_CMD_BUF_SIZE
#define AVDT_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
#endif
/* AVDTP pool for protocol messages */
#ifndef AVDT_CMD_POOL_ID
#define AVDT_CMD_POOL_ID GKI_POOL_ID_2
/* AVDTP buffer size for media packets in case of fragmentation */
#ifndef AVDT_DATA_BUF_SIZE
#define AVDT_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* AVDTP pool size for media packets in case of fragmentation */
#ifndef AVDT_DATA_POOL_SIZE
#define AVDT_DATA_POOL_SIZE GKI_BUF3_SIZE
#ifndef PAN_BUF_SIZE
#define PAN_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
#ifndef PAN_POOL_ID
#define PAN_POOL_ID GKI_POOL_ID_3
/* Maximum amount of the shared buffer to allocate for PAN */
#define PAN_POOL_MAX (GKI_BUF3_MAX / 4)
/* Maximum number of buffers to allocate for PAN */
#ifndef PAN_BUF_MAX
#define PAN_BUF_MAX 100
#endif
/* AVCTP pool for protocol messages */
#ifndef AVCT_CMD_POOL_ID
#define AVCT_CMD_POOL_ID GKI_POOL_ID_1
/* AVCTP buffer size for protocol messages */
#ifndef AVCT_CMD_BUF_SIZE
#define AVCT_CMD_BUF_SIZE 288
#endif
/* AVRCP pool for protocol messages */
#ifndef AVRC_CMD_POOL_ID
#define AVRC_CMD_POOL_ID GKI_POOL_ID_1
/* AVRCP buffer size for protocol messages */
#ifndef AVRC_CMD_BUF_SIZE
#define AVRC_CMD_BUF_SIZE 288
#endif
/* AVRCP pool size for protocol messages */
#ifndef AVRC_CMD_POOL_SIZE
#define AVRC_CMD_POOL_SIZE GKI_BUF1_SIZE
/* AVRCP Metadata buffer size for protocol messages */
#ifndef AVRC_META_CMD_BUF_SIZE
#define AVRC_META_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
#endif
/* AVRCP Metadata pool for protocol messages */
#ifndef AVRC_META_CMD_POOL_ID
#define AVRC_META_CMD_POOL_ID GKI_POOL_ID_2
#ifndef BTA_HL_LRG_DATA_BUF_SIZE
#define BTA_HL_LRG_DATA_BUF_SIZE (10240 + 24)
#endif
/* AVRCP Metadata pool size for protocol messages */
#ifndef AVRC_META_CMD_POOL_SIZE
#define AVRC_META_CMD_POOL_SIZE GKI_BUF2_SIZE
/* GATT Server Database buffer size */
#ifndef GATT_DB_BUF_SIZE
#define GATT_DB_BUF_SIZE 128
#endif
/* AVRCP buffer size for browsing channel messages */
#ifndef AVRC_BROWSE_POOL_SIZE
#define AVRC_BROWSE_POOL_SIZE GKI_MAX_BUF_SIZE
/* GATT Data sending buffer size */
#ifndef GATT_DATA_BUF_SIZE
#define GATT_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
#ifndef BTA_HL_LRG_DATA_POOL_ID
#define BTA_HL_LRG_DATA_POOL_ID GKI_POOL_ID_7
#endif
/* GATT Server Database pool ID */
#ifndef GATT_DB_POOL_ID
#define GATT_DB_POOL_ID GKI_POOL_ID_8
#endif
/* GATT Data sending buffer pool ID, use default ACL pool for fix channel data */
#ifndef GATT_BUF_POOL_ID
#define GATT_BUF_POOL_ID HCI_ACL_POOL_ID
#endif
/******************************************************************************
**
** Lower Layer Interface
**
******************************************************************************/
/* Macro for allocating buffer for HCI commands */
#ifndef HCI_GET_CMD_BUF
#if (!defined(HCI_USE_VARIABLE_SIZE_CMD_BUF) || (HCI_USE_VARIABLE_SIZE_CMD_BUF == FALSE))
/* Allocate fixed-size buffer from HCI_CMD_POOL (default case) */
#define HCI_GET_CMD_BUF(paramlen) ((BT_HDR *)GKI_getpoolbuf (HCI_CMD_POOL_ID))
#else
/* Allocate smallest possible buffer (for platforms with limited RAM) */
#define HCI_GET_CMD_BUF(paramlen) ((BT_HDR *)GKI_getbuf ((UINT16)(BT_HDR_SIZE + HCIC_PREAMBLE_SIZE + (paramlen))))
#endif
#endif /* HCI_GET_CMD_BUF */
/******************************************************************************
**
** HCI Services (H4)
@ -1267,68 +1211,41 @@
#define PORT_CREDIT_RX_LOW 8
#endif
/* if application like BTA, Java or script test engine is running on other than BTU thread, */
/* PORT_SCHEDULE_LOCK shall be defined as GKI_sched_lock() or GKI_disable() */
#ifndef PORT_SCHEDULE_LOCK
#define PORT_SCHEDULE_LOCK GKI_disable()
#endif
/* if application like BTA, Java or script test engine is running on other than BTU thread, */
/* PORT_SCHEDULE_LOCK shall be defined as GKI_sched_unlock() or GKI_enable() */
#ifndef PORT_SCHEDULE_UNLOCK
#define PORT_SCHEDULE_UNLOCK GKI_enable()
#endif
/******************************************************************************
**
** OBEX
**
******************************************************************************/
#define OBX_14_INCLUDED FALSE
/* The maximum number of registered servers. */
#ifndef OBX_NUM_SERVERS
#define OBX_NUM_SERVERS 12
/*
* Buffer size to reassemble the SDU.
* It will allow buffers to be used that are larger than the L2CAP_MAX_MTU.
*/
#ifndef OBX_USER_RX_BUF_SIZE
#define OBX_USER_RX_BUF_SIZE OBX_LRG_DATA_BUF_SIZE
#endif
/* The maximum number of active clients. */
#ifndef OBX_NUM_CLIENTS
#define OBX_NUM_CLIENTS 8
/*
* Buffer size to hold the SDU.
* It will allow buffers to be used that are larger than the L2CAP_MAX_MTU.
*/
#ifndef OBX_USER_TX_BUF_SIZE
#define OBX_USER_TX_BUF_SIZE OBX_LRG_DATA_BUF_SIZE
#endif
/* This option is application when OBX_14_INCLUDED=TRUE
Pool ID where to reassemble the SDU.
This Pool will allow buffers to be used that are larger than
the L2CAP_MAX_MTU. */
#ifndef OBX_USER_RX_POOL_ID
#define OBX_USER_RX_POOL_ID OBX_LRG_DATA_POOL_ID
/* Buffer size used to hold MPS segments during SDU reassembly. */
#ifndef OBX_FCR_RX_BUF_SIZE
#define OBX_FCR_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* This option is application when OBX_14_INCLUDED=TRUE
Pool ID where to hold the SDU.
This Pool will allow buffers to be used that are larger than
the L2CAP_MAX_MTU. */
#ifndef OBX_USER_TX_POOL_ID
#define OBX_USER_TX_POOL_ID OBX_LRG_DATA_POOL_ID
#endif
/* This option is application when OBX_14_INCLUDED=TRUE
GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
*/
#ifndef OBX_FCR_RX_POOL_ID
#define OBX_FCR_RX_POOL_ID HCI_ACL_POOL_ID
#endif
/* This option is application when OBX_14_INCLUDED=TRUE
GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
Note: This pool needs to have enough buffers to hold two times the window size negotiated
in the L2CA_SetFCROptions (2 * tx_win_size) to allow for retransmissions.
The size of each buffer must be able to hold the maximum MPS segment size passed in
L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
*/
#ifndef OBX_FCR_TX_POOL_ID
#define OBX_FCR_TX_POOL_ID HCI_ACL_POOL_ID
/*
* Buffer size used to hold MPS segments used in (re)transmissions.
* The size of each buffer must be able to hold the maximum MPS segment size
* passed in L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) +
* L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
*/
#ifndef OBX_FCR_TX_BUF_SIZE
#define OBX_FCR_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* This option is application when OBX_14_INCLUDED=TRUE
@ -1623,16 +1540,12 @@ Range: 2 octets
**
******************************************************************************/
#ifndef HID_DEV_SUBCLASS
#define HID_DEV_SUBCLASS COD_MINOR_POINTING
#ifndef HID_CONTROL_BUF_SIZE
#define HID_CONTROL_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
#ifndef HID_CONTROL_POOL_ID
#define HID_CONTROL_POOL_ID 2
#endif
#ifndef HID_INTERRUPT_POOL_ID
#define HID_INTERRUPT_POOL_ID 2
#ifndef HID_INTERRUPT_BUF_SIZE
#define HID_INTERRUPT_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/*************************************************************************
@ -1767,33 +1680,31 @@ Range: 2 octets
#define MCA_NUM_MDLS 4
#endif
/* Pool ID where to reassemble the SDU. */
#ifndef MCA_USER_RX_POOL_ID
#define MCA_USER_RX_POOL_ID HCI_ACL_POOL_ID
/* Buffer size to reassemble the SDU. */
#ifndef MCA_USER_RX_BUF_SIZE
#define MCA_USER_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* Pool ID where to hold the SDU. */
#ifndef MCA_USER_TX_POOL_ID
#define MCA_USER_TX_POOL_ID HCI_ACL_POOL_ID
/* Buffer size to hold the SDU. */
#ifndef MCA_USER_TX_BUF_SIZE
#define MCA_USER_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/*
GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
*/
#ifndef MCA_FCR_RX_POOL_ID
#define MCA_FCR_RX_POOL_ID HCI_ACL_POOL_ID
* Buffer size used to hold MPS segments during SDU reassembly
*/
#ifndef MCA_FCR_RX_BUF_SIZE
#define MCA_FCR_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/*
GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
Note: This pool needs to have enough buffers to hold two times the window size negotiated
in the tL2CAP_FCR_OPTIONS (2 * tx_win_size) to allow for retransmissions.
The size of each buffer must be able to hold the maximum MPS segment size passed in
tL2CAP_FCR_OPTIONS plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
*/
#ifndef MCA_FCR_TX_POOL_ID
#define MCA_FCR_TX_POOL_ID HCI_ACL_POOL_ID
* Default buffer size used to hold MPS segments used in (re)transmissions.
* The size of each buffer must be able to hold the maximum MPS segment size
* passed in tL2CAP_FCR_OPTIONS plus BT_HDR (8) + HCI preamble (4) +
* L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
*/
#ifndef MCA_FCR_TX_BUF_SIZE
#define MCA_FCR_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* MCAP control channel FCR Option: