# ME
[UMAC]

Declaration of all functions used for the initialization of the UMAC ME modules. More...

Collaboration diagram for ME:

## Data Structures
struct | me_env_tag
| ME environment structure. More...
struct | mobility_domain
| Mobility Domain IE. More...
struct | me_bss_info
| Information related to the BSS a VIF is linked to. More...
## Modules
| MGMTFRAME

| Declaration of all structures and functions used by the MGMT Frames.
| TASK_ME

| Declaration of all structures and functions used by the ME module.
| UTILS

| All utility functions manipulating rates, etc.
| MIC_CALC

| The MIC Calculator's structure and methods declarations.
## Defines
#define | DEFAULT_ASSOCRSP_TIMEOUT (200 * TU_DURATION)
| Association response timeout (in us).
#define | DEFAULT_AUTHRSP_TIMEOUT (200 * TU_DURATION)
| Authentication response timeout (in us).
#define | LOCAL_CAPA(type) ((me_env.capa_flags & ME_##type##_CAPA) != 0)
| Test whether the specified capability is supported locally.
#define | LOCAL_CAPA_SET(type) (me_env.capa_flags |= ME_##type##_CAPA)
| Set the specified local capability.
#define | LOCAL_CAPA_CLR(type) (me_env.capa_flags &= ~ME_##type##_CAPA)
| Clear the specified local capability.
#define | BSS_CAPA(bss, type) (((bss)->capa_flags & BSS_##type##_CAPA) != 0)
| Test whether the specified capability is supported by the BSS.
#define | BSS_CAPA_SET(bss, type) ((bss)->capa_flags |= BSS_##type##_CAPA)
| Set the specified BSS capability.
#define | BSS_CAPA_CLR(bss, type) ((bss)->capa_flags &= ~BSS_##type##_CAPA)
| Clear the specified BSS capability.
#define | BSS_CAPA_RESET(bss) ((bss)->capa_flags = 0)
| Reset (i.e.
## Enumerations
enum | { ME_HT_CAPA = CO_BIT(0), ME_VHT_CAPA = CO_BIT(1), ME_HE_CAPA = CO_BIT(2), ME_OFDMA_UL_CAPA = CO_BIT(3) }
| Local capability flags. More...
enum | { BSS_QOS_CAPA = CO_BIT(0), BSS_HT_CAPA = CO_BIT(1), BSS_VHT_CAPA = CO_BIT(2), BSS_HE_CAPA = CO_BIT(3), BSS_VALID_CAPA = CO_BIT(31) }
| BSS capability flags. More...
## Functions
static void | me_env_init (void)
| Initialize content of the ME environment.
void | me_init (void)
| Initialize the ME modules.
struct mac_chan_def * | me_freq_to_chan_ptr (uint8_t band, uint16_t freq)
| Search the channel structure corresponding to the parameters, and returns a a pointer to this structure.
void | me_init_chan (struct mac_chan_op *chan)
| Initialize channel TX power and flags from regulatory data base.
__INLINE uint16_t | me_tx_lft_get (void)
| This function returns the TX lifetime of packets sent under BlockAck agreement.
__INLINE void | me_credits_update_ind (uint8_t sta_idx, uint8_t tid, int8_t credits)
| This function updates the host about the number of credits allocated/deallocated to a peer STA/TID pair.
## Variables
struct me_env_tag | me_env
| ME module environment variable.
struct me_env_tag | me_env
| ME module environment variable.

## Detailed Description

Declaration of all functions used for the initialization of the UMAC ME modules.

## Define Documentation

#define BSS_CAPA | ( | bss,
|  | type |  | ) | (((bss)->capa_flags & BSS_##type##_CAPA) != 0)

Test whether the specified capability is supported by the BSS.

Parameters:

  `[in]` | bss | Pointer to the BSS information structure
  `[in]` | type | Capability type (QOS, HT, VHT or HE)

Returns:
  true if supported, false otherwise

Definition at line 230 of file me.h.

Referenced by me_beacon_check(), me_build_associate_req(), mm_sta_add_cfm_handler(), scanu_join_cfm_handler(), and scanu_join_frame_handler().

#define BSS_CAPA_CLR | ( | bss,
|  | type |  | ) | ((bss)->capa_flags &= ~BSS_##type##_CAPA)

Clear the specified BSS capability.

Parameters:

  `[out]` | bss | Pointer to the BSS information structure
  `[in]` | type | Capability type (QOS, HT, VHT or HE)

Definition at line 248 of file me.h.

Referenced by scanu_join_cfm_handler().

#define BSS_CAPA_RESET | ( | bss |  | ) | ((bss)->capa_flags = 0)

Reset (i.e.

put all 0) the BSS capabilities

Parameters:

  `[out]` | bss | Pointer to the BSS information structure

Definition at line 256 of file me.h.

Referenced by me_set_active_cfm_handler(), scanu_join_frame_handler(), and scanu_join_req_handler().

#define BSS_CAPA_SET | ( | bss,
|  | type |  | ) | ((bss)->capa_flags |= BSS_##type##_CAPA)

Set the specified BSS capability.

Parameters:

  `[out]` | bss | Pointer to the BSS information structure
  `[in]` | type | Capability type (QOS, HT, VHT or HE)

Definition at line 239 of file me.h.

Referenced by scanu_join_frame_handler().

#define LOCAL_CAPA | ( | type |  | ) | ((me_env.capa_flags & ME_##type##_CAPA) != 0)

Test whether the specified capability is supported locally.

Parameters:

  `[in]` | type | Capability type (HT, VHT or HE)

Returns:
  true if supported, false otherwise

Definition at line 204 of file me.h.

Referenced by me_beacon_check(), me_build_associate_req(), me_config_req_handler(), me_pol_tbl_bw_upd(), me_sta_add_req_handler(), me_sta_bw_nss_max_upd(), scanu_build_ie(), and scanu_join_frame_handler().

#define LOCAL_CAPA_CLR | ( | type |  | ) | (me_env.capa_flags &= ~ME_##type##_CAPA)

Clear the specified local capability.

Parameters:

  `[in]` | type | Capability type (HT, VHT or HE)

Definition at line 220 of file me.h.

#define LOCAL_CAPA_SET | ( | type |  | ) | (me_env.capa_flags |= ME_##type##_CAPA)

Set the specified local capability.

Parameters:

  `[in]` | type | Capability type (HT, VHT or HE)

Definition at line 212 of file me.h.

Referenced by me_config_req_handler().

## Enumeration Type Documentation

anonymous enum

Local capability flags.

Enumerator:

  ME_HT_CAPA | Bit indicating that HT is supported by local device.
  ME_VHT_CAPA | Bit indicating that VHT is supported by local device.
  ME_HE_CAPA | Bit indicating that HE is supported by local device.
  ME_OFDMA_UL_CAPA | Bit indicating that HE OFDMA UL is enabled in the local device.

Definition at line 54 of file me.h.

anonymous enum

BSS capability flags.

Enumerator:

  BSS_QOS_CAPA | BSS is QoS capable.
  BSS_HT_CAPA | BSS is HT capable.
  BSS_VHT_CAPA | BSS is VHT capable.
  BSS_HE_CAPA | BSS is HE capable.
  BSS_VALID_CAPA | Information about the BSS are valid.

Definition at line 67 of file me.h.

## Function Documentation

__INLINE void me_credits_update_ind | ( | uint8_t | sta_idx,
|  | uint8_t | tid,
|  | int8_t | credits |
| ) |  |  |

This function updates the host about the number of credits allocated/deallocated to a peer STA/TID pair.

Parameters:

  `[in]` | sta_idx | Index of the peer device whose credits are updated
  `[in]` | tid | TID
  `[in]` | credits | Number of credits allocated/deallocated

Definition at line 286 of file me.h.

References me_tx_credits_update_ind::credits, KE_MSG_ALLOC, ke_msg_send(), ME_TX_CREDITS_UPDATE_IND, me_tx_credits_update_ind::sta_idx, TASK_ME, and me_tx_credits_update_ind::tid.

Referenced by mm_ba_add_cfm_handler(), and mm_ba_del_cfm_handler().

static void me_env_init | ( | void |  | ) | `[static]`

Initialize content of the ME environment.

State of the ME task is set to idle.

Definition at line 58 of file me.c.

References ke_state_set(), me_env, ME_IDLE, and TASK_ME.

struct mac_chan_def * me_freq_to_chan_ptr | ( | uint8_t | band,
|  | uint16_t | freq |
| ) |  |  | `[read]`

Search the channel structure corresponding to the parameters, and returns a a pointer to this structure.

Parameters:

  `[in]` | band | PHY band (PHY_BAND_2G4 or PHY_BAND_5G)
  `[in]` | freq | Frequency of the channel (in MHz)

Returns:
  The pointer to the channel structure found if available, NULL otherwise

Referenced by scanu_scan_frame_handler().

void me_init | ( | void |  | ) |

Initialize the ME modules.

Referenced by mm_reset_req_handler().

void me_init_chan | ( | struct mac_chan_op * | chan | ) |

Initialize channel TX power and flags from regulatory data base.

Using primary channel frequency and band (that then must be valid) this function initializes the maximum tx power and flags for this channel using its internal data base.

Parameters:

  `[in,out]` | chan | Channel to initialize

Referenced by me_extract_csa().

__INLINE uint16_t me_tx_lft_get | ( | void |  | ) |

This function returns the TX lifetime of packets sent under BlockAck agreement.

Returns:
  The lifetime that was configured by the upper layers

Definition at line 271 of file me.h.

References me_env, and me_env_tag::tx_lft.