Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d67369e authored by Chris Manton's avatar Chris Manton
Browse files

Remove unused #defs stack/smp::

Towards flattening SMP

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ic9d5cca65372dcf73fd44dfdacac8b92d59e3f33
parent 6d07bcac
Loading
Loading
Loading
Loading
+0 −40
Original line number Diff line number Diff line
@@ -21,9 +21,6 @@

#include "bt_target.h"

#define SMP_PIN_CODE_LEN_MAX PIN_CODE_LEN
#define SMP_PIN_CODE_LEN_MIN 6

/* SMP command code */
#define SMP_OPCODE_PAIRING_REQ 0x01
#define SMP_OPCODE_PAIRING_RSP 0x02
@@ -84,13 +81,10 @@ typedef uint8_t tSMP_EVT;
/* Unknown IO capability, unable to decide association model */
#define SMP_UNKNOWN_IO_CAP (SMP_MAX_FAIL_RSN_PER_SPEC + 0x02) /* 0x10 */

#define SMP_INIT_FAIL (SMP_MAX_FAIL_RSN_PER_SPEC + 0x03)     /* 0x11 */
#define SMP_CONFIRM_FAIL (SMP_MAX_FAIL_RSN_PER_SPEC + 0x04)  /* 0x12 */
#define SMP_BUSY (SMP_MAX_FAIL_RSN_PER_SPEC + 0x05)          /* 0x13 */
#define SMP_ENC_FAIL (SMP_MAX_FAIL_RSN_PER_SPEC + 0x06)      /* 0x14 */
#define SMP_STARTED (SMP_MAX_FAIL_RSN_PER_SPEC + 0x07)       /* 0x15 */
#define SMP_RSP_TIMEOUT (SMP_MAX_FAIL_RSN_PER_SPEC + 0x08)   /* 0x16 */
#define SMP_DIV_NOT_AVAIL (SMP_MAX_FAIL_RSN_PER_SPEC + 0x09) /* 0x17 */

/* Unspecified failure reason */
#define SMP_FAIL (SMP_MAX_FAIL_RSN_PER_SPEC + 0x0A) /* 0x18 */
@@ -101,10 +95,7 @@ typedef uint8_t tSMP_EVT;
typedef uint8_t tSMP_STATUS;

/* Device IO capability */
#define SMP_IO_CAP_OUT BTM_IO_CAP_OUT       /* DisplayOnly */
#define SMP_IO_CAP_IO BTM_IO_CAP_IO         /* DisplayYesNo */
#define SMP_IO_CAP_IN BTM_IO_CAP_IN         /* KeyboardOnly */
#define SMP_IO_CAP_NONE BTM_IO_CAP_NONE     /* NoInputNoOutput */
#define SMP_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* Keyboard Display */
#define SMP_IO_CAP_MAX BTM_IO_CAP_MAX
typedef uint8_t tSMP_IO_CAP;
@@ -133,34 +124,13 @@ typedef uint8_t tSMP_OOB_DATA_TYPE;
/* no MITM, No Bonding, encryption only */
#define SMP_AUTH_NB_ENC_ONLY 0x00  //(SMP_AUTH_MASK | BTM_AUTH_SP_NO)

/* MITM, No Bonding, Use IO Capability to determine authentication procedure */
#define SMP_AUTH_NB_IOCAP (SMP_AUTH_NO_BOND | SMP_AUTH_YN_BIT)

/* No MITM, General Bonding, Encryption only */
#define SMP_AUTH_GB_ENC_ONLY SMP_AUTH_BOND

/* MITM, General Bonding, Use IO Capability to determine authentication
 * procedure */
#define SMP_AUTH_GB_IOCAP (SMP_AUTH_BOND | SMP_AUTH_YN_BIT)

/* Secure Connections, no MITM, no Bonding */
#define SMP_AUTH_SC_ENC_ONLY (SMP_H7_SUPPORT_BIT | SMP_SC_SUPPORT_BIT)

/* Secure Connections, no MITM, Bonding */
#define SMP_AUTH_SC_GB (SMP_H7_SUPPORT_BIT | SMP_SC_SUPPORT_BIT | SMP_AUTH_BOND)

/* Secure Connections, MITM, no Bonding */
#define SMP_AUTH_SC_MITM_NB \
  (SMP_H7_SUPPORT_BIT | SMP_SC_SUPPORT_BIT | SMP_AUTH_YN_BIT | SMP_AUTH_NO_BOND)

/* Secure Connections, MITM, Bonding */
#define SMP_AUTH_SC_MITM_GB \
  (SMP_H7_SUPPORT_BIT | SMP_SC_SUPPORT_BIT | SMP_AUTH_YN_BIT | SMP_AUTH_BOND)

/* All AuthReq RFU bits are set to 1 - NOTE: reserved bit in Bonding_Flags is
 * not set */
#define SMP_AUTH_ALL_RFU_SET 0xF8

typedef uint8_t tSMP_AUTH_REQ;

#define SMP_SEC_NONE 0
@@ -187,11 +157,6 @@ typedef uint8_t tSMP_KEYS;
  (SMP_SEC_KEY_TYPE_ENC | SMP_SEC_KEY_TYPE_ID | SMP_SEC_KEY_TYPE_CSRK | \
   SMP_SEC_KEY_TYPE_LK)

#define SMP_SC_KEY_STARTED 0      /* passkey entry started */
#define SMP_SC_KEY_ENTERED 1      /* passkey digit entered */
#define SMP_SC_KEY_ERASED 2       /* passkey digit erased */
#define SMP_SC_KEY_CLEARED 3      /* passkey cleared */
#define SMP_SC_KEY_COMPLT 4       /* passkey entry completed */
#define SMP_SC_KEY_OUT_OF_RANGE 5 /* out of range */
typedef uint8_t tSMP_SC_KEY_TYPE;

@@ -265,9 +230,4 @@ typedef struct {
typedef uint8_t(tSMP_CALLBACK)(tSMP_EVT event, const RawAddress& bd_addr,
                               tSMP_EVT_DATA* p_data);

/* callback function for CMAC algorithm
*/
typedef void(tCMAC_CMPL_CBACK)(uint8_t* p_mac, uint16_t tlen,
                               uint32_t sign_counter);

#endif  // SMP_API_TYPES_H