firmware/sniffer: Make all global variables 'static'

None of those variables are used outside sniffer.c, so they can all be
static.

Change-Id: I8946acb6189d5ade57214295f0ba87f0608bad92
This commit is contained in:
Harald Welte
2022-11-16 11:17:58 +01:00
committed by laforge
parent db1e37b93b
commit 432c7b5058

View File

@@ -141,47 +141,47 @@ static struct Usart_info sniff_usart = {
static struct ringbuf sniff_buffer; static struct ringbuf sniff_buffer;
/* Flags to know is the card status changed (see SIMTRACE_MSGT_DT_SNIFF_CHANGE flags) */ /* Flags to know is the card status changed (see SIMTRACE_MSGT_DT_SNIFF_CHANGE flags) */
volatile uint32_t change_flags = 0; static volatile uint32_t change_flags = 0;
/* ISO 7816 variables */ /* ISO 7816 variables */
/*! ISO 7816-3 state */ /*! ISO 7816-3 state */
enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET; static enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET;
/*! ATR state */ /*! ATR state */
enum atr_sniff_state atr_state; static enum atr_sniff_state atr_state;
/*! ATR data /*! ATR data
* @remark can be used to check later protocol changes * @remark can be used to check later protocol changes
*/ */
uint8_t atr[MAX_ATR_SIZE]; static uint8_t atr[MAX_ATR_SIZE];
/*! Current index in the ATR data */ /*! Current index in the ATR data */
uint8_t atr_i = 0; static uint8_t atr_i = 0;
/*! If convention conversion is needed */ /*! If convention conversion is needed */
bool convention_convert = false; static bool convention_convert = false;
/*! The supported T protocols */ /*! The supported T protocols */
uint16_t t_protocol_support = 0; static uint16_t t_protocol_support = 0;
/*! PPS state /*! PPS state
* @remark it is shared between request and response since they aren't simultaneous but follow the same procedure * @remark it is shared between request and response since they aren't simultaneous but follow the same procedure
*/ */
enum pps_sniff_state pps_state; static enum pps_sniff_state pps_state;
/*! PPS request data /*! PPS request data
* @remark can be used to check PPS response * @remark can be used to check PPS response
*/ */
uint8_t pps_req[MAX_PPS_SIZE]; static uint8_t pps_req[MAX_PPS_SIZE];
/*! PPS response data */ /*! PPS response data */
uint8_t pps_rsp[MAX_PPS_SIZE]; static uint8_t pps_rsp[MAX_PPS_SIZE];
/*! TPDU state */ /*! TPDU state */
enum tpdu_sniff_state tpdu_state; static enum tpdu_sniff_state tpdu_state;
/*! Final TPDU packet /*! Final TPDU packet
* @note this is the complete command+response TPDU, including header, data, and status words * @note this is the complete command+response TPDU, including header, data, and status words
* @remark this does not include the procedure bytes * @remark this does not include the procedure bytes
*/ */
uint8_t tpdu_packet[5+256+2]; static uint8_t tpdu_packet[5+256+2];
/*! Current index in TPDU packet */ /*! Current index in TPDU packet */
uint16_t tpdu_packet_i = 0; static uint16_t tpdu_packet_i = 0;
/*! Waiting Time (WT) /*! Waiting Time (WT)
* @note defined in ISO/IEC 7816-3:2006(E) section 8.1 and 10.2 * @note defined in ISO/IEC 7816-3:2006(E) section 8.1 and 10.2
*/ */
uint32_t wt = 9600; static uint32_t wt = 9600;
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Internal functions * Internal functions