# /space/home/slher/rel/Beken/v6_4_5/macsw/modules/mac/src/mac.h File Reference

MAC related definitions. More...

`#include "co_int.h"`
`#include "co_bool.h"`
`#include "co_math.h"`
`#include "co_utils.h"`
`#include "compiler.h"`
`#include "mac_types.h"`
`#include <string.h>`

Go to the source code of this file.

## Data Structures
struct | mac_frame
| MAC Frame structure. More...
struct | key_info_tag
| Structure containing the information about a key. More...
struct | mac_htoprnelmt
| MAC HT operation element. More...
struct | mac_mu_edca_param_set
| MU EDCA Parameter Set Element. More...
struct | mac_edca_param_set
| EDCA Parameter Set Element. More...
## Defines
#define | TU_DURATION 1024
| duration of a Time Unit in microseconds
#define | MAC_BASIC_RATE 0x80
| Mask to test if it's a basic rate - BIT(7).
#define | WORD_ALIGN 3
| Mask for extracting/checking word alignment.
#define | MAC_ADDR_CMP(addr1_ptr, addr2_ptr)
| Compare two MAC addresses.
#define | MAC_ADDR_CMP_PACKED(__a1, __a2) (memcmp(__a1, __a2, MAC_ADDR_LEN) == 0)
| Compare two MAC addresses whose alignment is not known.
#define | MAC_ADDR_CPY(addr1_ptr, addr2_ptr)
| Copy a MAC address.
#define | MAC_SSID_CMP(ssid1_ptr, ssid2_ptr)
| Compare two SSID.
#define | MAC_ADDR_GROUP(mac_addr_ptr) ((*((uint8_t *)(mac_addr_ptr))) & 1)
| Check if MAC address is a group address: test the multicast bit.
#define | MAC_FRAME_LEN 512
| Maximum size of the frame body for frames that are internally carried.
#define | MAC_DEFAULT_KEY_COUNT 4
| Max number of default keys for given VIF.
#define | MAC_DEFAULT_MFP_KEY_COUNT 6
| Max number of MFP key for given VIF.
#define | MAC_QOS_INFO_STA_UAPSD_ENABLED_VO CO_BIT(0)
| UAPSD enabled on VO.
#define | MAC_QOS_INFO_STA_UAPSD_ENABLED_VI CO_BIT(1)
| UAPSD enabled on VI.
#define | MAC_QOS_INFO_STA_UAPSD_ENABLED_BK CO_BIT(2)
| UAPSD enabled on BK.
#define | MAC_QOS_INFO_STA_UAPSD_ENABLED_BE CO_BIT(3)
| UAPSD enabled on BE.
#define | MAC_QOS_INFO_STA_UAPSD_ENABLED_ALL 0x0F
| UAPSD enabled on all access categories.
#define | MAC_QOS_INFO_AP_UAPSD_ENABLED CO_BIT(7)
| UAPSD enabled in AP.
#define | MAC_PROT_NONERP_PRESENT_BIT CO_BIT(0)
| Non-ERP stations are present.
#define | MAC_PROT_USE_PROTECTION_BIT CO_BIT(1)
| ERP protection shall be used.
#define | MAC_PROT_BARKER_PREAMB_BIT CO_BIT(2)
| Barker preamble protection shall be used.
#define | MAC_PROT_ERP_STATUS_MASK
| ERP protection status mask.
#define | HE_MAC_CAPA_VAL_GET(he_cap, field)
| Get the value of a bit field in the HE MAC capability element.
#define | HE_MAC_CAPA_VAL_SET(he_cap, field, val)
| Set the value of a bit field in the HE MAC capability element.
#define | HE_MAC_CAPA_BIT_IS_SET(he_cap, bit)
| Test if a bit in the HE MAC capability element is set.
#define | HE_MAC_CAPA_BIT_SET(he_cap, bit)
| Set a bit in the HE MAC capability element.
#define | HE_MAC_CAPA_BIT_CLR(he_cap, bit)
| Clear a bit in the HE MAC capability element.
#define | HE_PHY_CAPA_VAL_GET(he_cap, field)
| Get the value of a bit field in the HE PHY capability element.
#define | HE_PHY_CAPA_VAL_SET(he_cap, field, val)
| Set the value of a bit field in the HE PHY capability element.
#define | HE_PHY_CAPA_BIT_IS_SET(he_cap, bit)
| Test if a bit in the HE PHY capability element is set.
#define | HE_PHY_CAPA_BIT_SET(he_cap, bit)
| Set a bit in the HE PHY capability element.
#define | HE_PHY_CAPA_BIT_CLR(he_cap, bit)
| Clear a bit in the HE PHY capability element.
## Functions
__INLINE bool | mac_nontxed_bssid_get (uint8_t bssid_index, uint8_t max_bssid_ind, struct mac_addr const *ref_bssid, struct mac_addr *bssid)
| Get the value of the nonTransmitted BSSID, based on the reference BSSID, the nonTransmitted BSSID index and the Maximum BSSID indicator.
__INLINE void | mac_ref_bssid_get (uint8_t bssid_index, uint8_t max_bssid_ind, struct mac_addr const *bssid, struct mac_addr *ref_bssid)
| Get the value of the refernec BSSID, based on the nonTransmitted BSSID, the nonTransmitted BSSID index and the Maximum BSSID indicator.
uint32_t | mac_paid_gid_sta_compute (struct mac_addr const *mac_addr)
| Compute the PAID/GID to be put in the THD for frames that need to be sent to an AP or a Mesh peer.
uint32_t | mac_paid_gid_ap_compute (struct mac_addr const *mac_addr, uint16_t aid)
| Compute the PAID/GID to be put in the THD for frames that need to be sent to a STA connected to an AP or a TDLS peer.
enum mac_akm_suite | mac_akm_suite_value (uint32_t akm_suite)
| Convert IEE802.11 AKM suite into enum mac_akm_suite.
enum mac_cipher_suite | mac_cipher_suite_value (uint32_t cipher_suite)
| Convert IEE802.11 Cipher suite into enum mac_cipher_suite.
## Variables
const uint8_t | mac_tid2ac []
| Array converting a TID to its associated AC.
const uint8_t | mac_ac2uapsd []
| Array converting an AC to its corresponding bit in the QoS Information field.
const uint8_t | mac_aci2ac []
| Array converting an ACI to its corresponding AC. See Table 9-136 in 802.11-2016.
const uint8_t | mac_ac2aci []
| Array converting an AC to its corresponding ACI. See Table 9-136 in 802.11-2016.
const uint8_t | mac_id2rate []
| Array converting a MAC HW rate id into its corresponding standard rate value.
struct mac_addr | mac_addr_bcst
| Constant value corresponding to the Broadcast MAC address.

## Detailed Description

MAC related definitions.

Copyright (C) RivieraWaves 2011-2019

Definition in file mac.h.