2 ******************************************************************************
6 * @brief VHT Beamformer function declarations
8 * Copyright (C) ESWIN 2015-2020
10 ******************************************************************************
13 #ifndef _ECRNX_BFMER_H_
14 #define _ECRNX_BFMER_H_
18 ******************************************************************************
21 #include "ecrnx_defs.h"
25 ******************************************************************************
28 /// Maximal supported report length (in bytes)
29 #define ECRNX_BFMER_REPORT_MAX_LEN 2048
31 /// Size of the allocated report space (twice the maximum report length)
32 #define ECRNX_BFMER_REPORT_SPACE_SIZE (ECRNX_BFMER_REPORT_MAX_LEN * 2)
36 ******************************************************************************
40 * Structure used to store a beamforming report.
42 struct ecrnx_bfmer_report {
43 dma_addr_t dma_addr; /* Virtual address provided to MAC for
44 DMA transfer of the Beamforming Report */
45 unsigned int length; /* Report Length */
46 u8 report[1]; /* Report to be used for VHT TX Beamforming */
50 * FUNCTION DECLARATIONS
51 ******************************************************************************
55 ******************************************************************************
56 * @brief Allocate memory aiming to contains the Beamforming Report received
57 * from a Beamformee capable capable.
58 * The providing length shall be large enough to contain the VHT Compressed
59 * Beaforming Report and the MU Exclusive part.
60 * It also perform a DMA Mapping providing an address to be provided to the HW
61 * responsible for the DMA transfer of the report.
62 * If successful a struct ecrnx_bfmer_report object is allocated, it's address
63 * is stored in ecrnx_sta->bfm_report.
65 * @param[in] ecrnx_hw PHY Information
66 * @param[in] ecrnx_sta Peer STA Information
67 * @param[in] length Memory size to be allocated
69 * @return 0 if operation is successful, else -1.
70 ******************************************************************************
72 int ecrnx_bfmer_report_add(struct ecrnx_hw *ecrnx_hw, struct ecrnx_sta *ecrnx_sta,
76 ******************************************************************************
77 * @brief Free a previously allocated memory intended to be used for
78 * Beamforming Reports.
80 * @param[in] ecrnx_hw PHY Information
81 * @param[in] ecrnx_sta Peer STA Information
83 ******************************************************************************
85 void ecrnx_bfmer_report_del(struct ecrnx_hw *ecrnx_hw, struct ecrnx_sta *ecrnx_sta);
87 #ifdef CONFIG_ECRNX_FULLMAC
89 ******************************************************************************
90 * @brief Parse a Rx VHT-MCS map in order to deduce the maximum number of
91 * Spatial Streams supported by a beamformee.
93 * @param[in] vht_capa Received VHT Capability field.
95 ******************************************************************************
97 u8 ecrnx_bfmer_get_rx_nss(const struct ieee80211_vht_cap *vht_capa);
98 #endif /* CONFIG_ECRNX_FULLMAC */
100 #endif /* _ECRNX_BFMER_H_ */