Skip to content

Commit

Permalink
Merge branch 'bugfix/sync_reporting_files' into 'master'
Browse files Browse the repository at this point in the history
NimBLE : Sync common porting and nimble submodule files

See merge request espressif/esp-idf!23655
  • Loading branch information
rahult-github committed Jun 7, 2023
2 parents cbddae6 + 27dc6d9 commit 6ace246
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 29 deletions.
28 changes: 16 additions & 12 deletions components/bt/porting/nimble/include/nimble/hci_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
extern "C" {
#endif

#define BLE_HCI_MAX_DATA_LEN (MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE) - \
sizeof(struct ble_hci_ev))
#define BLE_HCI_MAX_DATA_LEN (MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE) - \
sizeof(struct ble_hci_ev))

/* Generic command header */
struct ble_hci_cmd {
Expand Down Expand Up @@ -490,20 +490,20 @@ struct ble_hci_le_rd_resolv_list_size_rp {
} __attribute__((packed));

#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_id_addr[6];
} __attribute__((packed));
struct ble_hci_le_rd_peer_recolv_addr_rp {
struct ble_hci_le_rd_peer_resolv_addr_rp {
uint8_t rpa[6];
} __attribute__((packed));

#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_id_addr[6];
} __attribute__((packed));
struct ble_hci_le_rd_local_recolv_addr_rp {
struct ble_hci_le_rd_local_resolv_addr_rp {
uint8_t rpa[6];
} __attribute__((packed));

Expand Down Expand Up @@ -1129,8 +1129,9 @@ struct ble_hci_le_subrate_req_cp {
uint16_t supervision_tmo;
} __attribute__((packed));

/* --- Vendor specific commands (OGF 0x00FF) */
#define BLE_HCI_OCF_VS_RD_STATIC_ADDR (0x0001)
/* --- Vendor specific commands (OGF 0x003F) */
/* 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 {
uint8_t addr[6];
} __attribute__((packed));
Expand Down Expand Up @@ -1520,8 +1521,8 @@ struct ble_hci_ev_auth_pyld_tmo {

#define BLE_HCI_EVCODE_SAM_STATUS_CHG (0x58)

#define BLE_HCI_EVCODE_VENDOR_DEBUG (0xFF)
struct ble_hci_ev_vendor_debug {
#define BLE_HCI_EVCODE_VS_DEBUG (0xFF)
struct ble_hci_ev_vs_debug {
uint8_t id;
uint8_t data[0];
} __attribute__((packed));
Expand Down Expand Up @@ -1959,15 +1960,18 @@ struct ble_hci_ev_le_subev_subrate_change {
#elif MYNEWT_VAL(BLE_VERSION) == 52
#define BLE_HCI_VER_BCS BLE_HCI_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

#define BLE_HCI_DATA_HDR_SZ 4
#define BLE_HCI_DATA_HANDLE(handle_pb_bc) (((handle_pb_bc) & 0x0fff) >> 0)
#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)

struct hci_data_hdr {
struct hci_data_hdr
{
uint16_t hdh_handle_pb_bc;
uint16_t hdh_len;
};
Expand Down
9 changes: 0 additions & 9 deletions components/bt/porting/nimble/include/os/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ extern "C" {
#define static_assert _Static_assert
#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"

#define OS_ALIGN(__n, __a) ( \
Expand Down
2 changes: 1 addition & 1 deletion components/bt/porting/nimble/include/os/os_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#ifndef H_OS_ERROR_
#define H_OS_ERROR_

#include <stdbool.h>
#include "os/os.h"

#ifdef __cplusplus
extern "C" {
Expand Down
5 changes: 2 additions & 3 deletions components/bt/porting/nimble/include/os/os_mbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#ifndef _OS_MBUF_H
#define _OS_MBUF_H

#include <stdbool.h>
#include "os/os.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -141,11 +140,11 @@ struct os_mqueue {

/** Get a packet header pointer given an mbuf pointer */
#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 */
#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
Expand Down
1 change: 0 additions & 1 deletion components/bt/porting/nimble/include/os/os_mempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ struct os_mempool_info {
struct os_mempool *os_mempool_info_get_next(struct os_mempool *,
struct os_mempool_info *);


#if (OS_ALIGNMENT == 4)
typedef uint32_t os_membuf_t;
#elif (OS_ALIGNMENT == 8)
Expand Down
4 changes: 2 additions & 2 deletions components/bt/porting/nimble/src/os_msys_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static struct os_mempool os_msys_init_2_mempool;

#define OS_MSYS_SANITY_ENABLED \
(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
static struct os_sanity_check os_msys_sc;
Expand All @@ -91,7 +91,7 @@ IRAM_ATTR os_msys_sanity_min_count(int idx)
return OS_MSYS_1_SANITY_MIN_COUNT;

case 1:
return OS_MSYS_1_SANITY_MIN_COUNT;
return OS_MSYS_2_SANITY_MIN_COUNT;

default:
BLE_LL_ASSERT(0);
Expand Down

0 comments on commit 6ace246

Please sign in to comment.