forked from espressif/esp-idf
NimBLE : Sync porting files
This commit is contained in:
committed by
Rahul Tank
parent
e0b98b75e7
commit
a41f5387c1
@@ -34,8 +34,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BLE_HCI_MAX_DATA_LEN (MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE) - \
|
#define BLE_HCI_MAX_DATA_LEN (MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE) - \
|
||||||
sizeof(struct ble_hci_ev))
|
sizeof(struct ble_hci_ev))
|
||||||
|
|
||||||
/* Generic command header */
|
/* Generic command header */
|
||||||
struct ble_hci_cmd {
|
struct ble_hci_cmd {
|
||||||
@@ -490,20 +490,20 @@ struct ble_hci_le_rd_resolv_list_size_rp {
|
|||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
#define BLE_HCI_OCF_LE_RD_PEER_RESOLV_ADDR (0x002B)
|
#define BLE_HCI_OCF_LE_RD_PEER_RESOLV_ADDR (0x002B)
|
||||||
struct ble_hci_le_rd_peer_recolv_addr_cp {
|
struct ble_hci_le_rd_peer_resolv_addr_cp {
|
||||||
uint8_t peer_addr_type;
|
uint8_t peer_addr_type;
|
||||||
uint8_t peer_id_addr[6];
|
uint8_t peer_id_addr[6];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
struct ble_hci_le_rd_peer_recolv_addr_rp {
|
struct ble_hci_le_rd_peer_resolv_addr_rp {
|
||||||
uint8_t rpa[6];
|
uint8_t rpa[6];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
#define BLE_HCI_OCF_LE_RD_LOCAL_RESOLV_ADDR (0x002C)
|
#define BLE_HCI_OCF_LE_RD_LOCAL_RESOLV_ADDR (0x002C)
|
||||||
struct ble_hci_le_rd_local_recolv_addr_cp {
|
struct ble_hci_le_rd_local_resolv_addr_cp {
|
||||||
uint8_t peer_addr_type;
|
uint8_t peer_addr_type;
|
||||||
uint8_t peer_id_addr[6];
|
uint8_t peer_id_addr[6];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
struct ble_hci_le_rd_local_recolv_addr_rp {
|
struct ble_hci_le_rd_local_resolv_addr_rp {
|
||||||
uint8_t rpa[6];
|
uint8_t rpa[6];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
@@ -1129,8 +1129,9 @@ struct ble_hci_le_subrate_req_cp {
|
|||||||
uint16_t supervision_tmo;
|
uint16_t supervision_tmo;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
/* --- Vendor specific commands (OGF 0x00FF) */
|
/* --- Vendor specific commands (OGF 0x003F) */
|
||||||
#define BLE_HCI_OCF_VS_RD_STATIC_ADDR (0x0001)
|
/* Read Random Static Address */
|
||||||
|
#define BLE_HCI_OCF_VS_RD_STATIC_ADDR (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0001))
|
||||||
struct ble_hci_vs_rd_static_addr_rp {
|
struct ble_hci_vs_rd_static_addr_rp {
|
||||||
uint8_t addr[6];
|
uint8_t addr[6];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
@@ -1520,8 +1521,8 @@ struct ble_hci_ev_auth_pyld_tmo {
|
|||||||
|
|
||||||
#define BLE_HCI_EVCODE_SAM_STATUS_CHG (0x58)
|
#define BLE_HCI_EVCODE_SAM_STATUS_CHG (0x58)
|
||||||
|
|
||||||
#define BLE_HCI_EVCODE_VENDOR_DEBUG (0xFF)
|
#define BLE_HCI_EVCODE_VS_DEBUG (0xFF)
|
||||||
struct ble_hci_ev_vendor_debug {
|
struct ble_hci_ev_vs_debug {
|
||||||
uint8_t id;
|
uint8_t id;
|
||||||
uint8_t data[0];
|
uint8_t data[0];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
@@ -1959,7 +1960,9 @@ struct ble_hci_ev_le_subev_subrate_change {
|
|||||||
#elif MYNEWT_VAL(BLE_VERSION) == 52
|
#elif MYNEWT_VAL(BLE_VERSION) == 52
|
||||||
#define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_2
|
#define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_2
|
||||||
#define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_2
|
#define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_2
|
||||||
|
#elif MYNEWT_VAL(BLE_VERSION) == 53
|
||||||
|
#define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_3
|
||||||
|
#define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BLE_HCI_DATA_HDR_SZ 4
|
#define BLE_HCI_DATA_HDR_SZ 4
|
||||||
@@ -1967,7 +1970,8 @@ struct ble_hci_ev_le_subev_subrate_change {
|
|||||||
#define BLE_HCI_DATA_PB(handle_pb_bc) (((handle_pb_bc) & 0x3000) >> 12)
|
#define BLE_HCI_DATA_PB(handle_pb_bc) (((handle_pb_bc) & 0x3000) >> 12)
|
||||||
#define BLE_HCI_DATA_BC(handle_pb_bc) (((handle_pb_bc) & 0xc000) >> 14)
|
#define BLE_HCI_DATA_BC(handle_pb_bc) (((handle_pb_bc) & 0xc000) >> 14)
|
||||||
|
|
||||||
struct hci_data_hdr {
|
struct hci_data_hdr
|
||||||
|
{
|
||||||
uint16_t hdh_handle_pb_bc;
|
uint16_t hdh_handle_pb_bc;
|
||||||
uint16_t hdh_len;
|
uint16_t hdh_len;
|
||||||
};
|
};
|
||||||
|
@@ -38,15 +38,6 @@ extern "C" {
|
|||||||
#define static_assert _Static_assert
|
#define static_assert _Static_assert
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
#define min(a, b) ((a)<(b)?(a):(b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef max
|
|
||||||
#define max(a, b) ((a)>(b)?(a):(b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "soc/soc_caps.h"
|
|
||||||
#include "nimble/nimble_npl.h"
|
#include "nimble/nimble_npl.h"
|
||||||
|
|
||||||
#define OS_ALIGN(__n, __a) ( \
|
#define OS_ALIGN(__n, __a) ( \
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#ifndef H_OS_ERROR_
|
#ifndef H_OS_ERROR_
|
||||||
#define H_OS_ERROR_
|
#define H_OS_ERROR_
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include "os/os.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#ifndef _OS_MBUF_H
|
#ifndef _OS_MBUF_H
|
||||||
#define _OS_MBUF_H
|
#define _OS_MBUF_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include "os/os.h"
|
#include "os/os.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -141,11 +140,11 @@ struct os_mqueue {
|
|||||||
|
|
||||||
/** Get a packet header pointer given an mbuf pointer */
|
/** Get a packet header pointer given an mbuf pointer */
|
||||||
#define OS_MBUF_PKTHDR(__om) ((struct os_mbuf_pkthdr *) \
|
#define OS_MBUF_PKTHDR(__om) ((struct os_mbuf_pkthdr *) \
|
||||||
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
|
(void *)((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
|
||||||
|
|
||||||
/** Given a mbuf packet header pointer, return a pointer to the mbuf */
|
/** Given a mbuf packet header pointer, return a pointer to the mbuf */
|
||||||
#define OS_MBUF_PKTHDR_TO_MBUF(__hdr) \
|
#define OS_MBUF_PKTHDR_TO_MBUF(__hdr) \
|
||||||
(struct os_mbuf *)((uint8_t *)(__hdr) - sizeof(struct os_mbuf))
|
(struct os_mbuf *)(void *)((uint8_t *)(__hdr) - sizeof(struct os_mbuf))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the length of an entire mbuf chain. The specified mbuf must have a
|
* Gets the length of an entire mbuf chain. The specified mbuf must have a
|
||||||
|
@@ -148,7 +148,6 @@ struct os_mempool_info {
|
|||||||
struct os_mempool *os_mempool_info_get_next(struct os_mempool *,
|
struct os_mempool *os_mempool_info_get_next(struct os_mempool *,
|
||||||
struct os_mempool_info *);
|
struct os_mempool_info *);
|
||||||
|
|
||||||
|
|
||||||
#if (OS_ALIGNMENT == 4)
|
#if (OS_ALIGNMENT == 4)
|
||||||
typedef uint32_t os_membuf_t;
|
typedef uint32_t os_membuf_t;
|
||||||
#elif (OS_ALIGNMENT == 8)
|
#elif (OS_ALIGNMENT == 8)
|
||||||
|
@@ -66,7 +66,7 @@ static struct os_mempool os_msys_init_2_mempool;
|
|||||||
|
|
||||||
#define OS_MSYS_SANITY_ENABLED \
|
#define OS_MSYS_SANITY_ENABLED \
|
||||||
(OS_MSYS_1_SANITY_MIN_COUNT > 0 || \
|
(OS_MSYS_1_SANITY_MIN_COUNT > 0 || \
|
||||||
OS_MSYS_1_SANITY_MIN_COUNT > 0)
|
OS_MSYS_2_SANITY_MIN_COUNT > 0)
|
||||||
|
|
||||||
#if OS_MSYS_SANITY_ENABLED
|
#if OS_MSYS_SANITY_ENABLED
|
||||||
static struct os_sanity_check os_msys_sc;
|
static struct os_sanity_check os_msys_sc;
|
||||||
@@ -91,7 +91,7 @@ IRAM_ATTR os_msys_sanity_min_count(int idx)
|
|||||||
return OS_MSYS_1_SANITY_MIN_COUNT;
|
return OS_MSYS_1_SANITY_MIN_COUNT;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
return OS_MSYS_1_SANITY_MIN_COUNT;
|
return OS_MSYS_2_SANITY_MIN_COUNT;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BLE_LL_ASSERT(0);
|
BLE_LL_ASSERT(0);
|
||||||
|
Reference in New Issue
Block a user