summaryrefslogtreecommitdiff
path: root/hal/phy/maximus/inc/maximus_phy_ctx.h
diff options
context:
space:
mode:
Diffstat (limited to 'hal/phy/maximus/inc/maximus_phy_ctx.h')
-rw-r--r--hal/phy/maximus/inc/maximus_phy_ctx.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/hal/phy/maximus/inc/maximus_phy_ctx.h b/hal/phy/maximus/inc/maximus_phy_ctx.h
index f67be3d71b..6b241780ae 100644
--- a/hal/phy/maximus/inc/maximus_phy_ctx.h
+++ b/hal/phy/maximus/inc/maximus_phy_ctx.h
@@ -18,6 +18,8 @@
#include "hal/phy/forward.h"
#include "hal/phy/pbdma.h"
#include "hal/phy/phy.h"
+#include "host/station.h"
+#include "maximus/common/types/phy_types.h"
/** Phy access structure for Maximus */
struct maximus_phy_access_t
@@ -74,6 +76,8 @@ struct maximus_phy_ctrl_t
phy_fc_mode_t fc_mode;
/** Argument 'flag' of 'phy_rx_activate'. 'true' to activate. */
bool activate_rx;
+ /** Station context. */
+ station_ctx_t *station;
};
typedef struct maximus_phy_ctrl_t maximus_phy_ctrl_t;
@@ -131,6 +135,54 @@ struct phy_t
};
/* Forward declaration in hal/phy/forward.h. */
+
+/**
+ * Maximus Phy init called during station context creation.
+ * \param station pointer to the station context.
+ * \return 0 if ok, -1 if failed, with errno = EINVAL if station is NULL
+ */
+int maximus_phy_init (station_ctx_t *station);
+
+/**
+ * Maximus Phy context init.
+ */
+void maximus_phy_ctx_init (void);
+
+/**
+ * fill a blank phy header
+ * \param phy current phy context
+ * \param msg pointer to sci message to fill header
+ * \param type type of message (FC_HYBRID_MODE, FC_AV_ONLY_MODE, PRS, MPDU_PAYLOAD, TONEMAP, NOISE, SPECTRUM)
+ * \param mpdu_format MPDU format of message (BEACON, SOF, SACK, RTS_CTS, SOUND, RSOF)
+ * \param pb_nb number of PBs into message
+ * \param tonemap_index tone map index used for message
+ * \param flags flags of message
+ * \param nek nek used for message
+ * \param pb_measurement ber, halfit and crc measured for each PB of message
+ * \param pb_header PB header for each PB of message
+ * \return 0 if ok, -1 if failed with errno = EINVAL if msg is NULL
+ */
+int
+maximus_phy_fill_hdr(phy_t *phy,
+ sci_msg_t *msg,
+ uint8_t type,
+ uint8_t mpdu_format,
+ uint8_t pb_nb,
+ uint8_t tonemap_index,
+ uint8_t flags,
+ uint32_t nek[4],
+ uint32_t pb_measurement[PHY_PB_MAX_NB],
+ uint32_t pb_header[PHY_PB_MAX_NB]);
+
+/**
+ * Process phy message received by the sci layer.
+ * This function must be registred to SCI layer with SCI_MSG_TYPE_PHY type.
+ * \param msg message to process
+ * \param phy phy current context
+ * \return 0 if ok, -1 if failed, with errno = EINVAL if phy or msg is NULL, or errno from sci_send() call
+ */
+int maximus_phy_recv (sci_msg_t *msg, void *phy);
+
/**
* Maximus TX frame first callback called when the corresponding netclock message is received.
* \param data pointer to 'maximus_tx_fc_t' structure, containing argument 'want_conf' of 'phy_tx_frame'.