Files
kunlun/plc/halmac/inc/sw_sched.h
2024-09-28 14:24:04 +08:00

101 lines
3.6 KiB
C
Executable File

/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
#ifndef SW_SCHED_H
#define SW_SCHED_H
#include "iot_queue.h"
#include "os_types.h"
#include "plc_utils.h"
#include "mac_stream.h"
#include "mac_hwq_mgr.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _mac_swq {
uint32_t q_depth; /* number of streams */
iot_list_head_t stream_list; // stream list head
} mac_swq_t;
extern mac_swq_t * g_mac_swq[];
uint32_t mac_swsch_del_stream(void *stream);
uint32_t mac_swsch_append(mac_swq_t *swq, phase_t phase, mac_stream_t *node);
/* send the trigger msg */
uint32_t mac_swsch_trigger_tx(pdevid_t pdev_id, vdevid_t vdev_id);
/* send the msdu to hwq */
uint32_t mac_swsch_post_msdu(pdevid_t pdev_id, vdevid_t vdev_id);
uint32_t mac_swsch_init();
/**
*@brief : mac_swsch_get_g_swq get swsch swq of assigned swq id and type
*@param : swq_id swq id
*@param : is_rf is rf type, 1 means RF, 0 means PLC
*@return : swq pointer of assigned type of swq_id
*/
mac_swq_t * mac_swsch_get_g_swq(uint32_t swq_id, uint32_t is_rf);
#if HPLC_RF_DEV_SUPPORT
/**
*@brief : mac_rf_swsch_init rf swsch swq init
*@param : none
*@return : 0
*/
uint32_t mac_rf_swsch_init();
/**
*@brief : mac_rf_swsch_trigger_tx rf swsch trigger tx
*@param : pdev_id pdev id
*@param : vdev_id rf vdev id
*@return : trigger tx ok return ERR_OK else ERR_XXX
*/
uint32_t mac_rf_swsch_trigger_tx(pdevid_t pdev_id, vdevid_t vdev_id);
#else /* HPLC_RF_DEV_SUPPORT */
#define mac_rf_swsch_init() (void)ERR_NOSUPP;
#define mac_rf_swsch_trigger_tx(pdev_id, vdev_id) ERR_NOSUPP; \
do { \
(void)(pdev_id); \
(void)(vdev_id); \
} while(0);
#define mac_rf_swsch_tx_msdu(rf_pdev, msdu, delimiter_type, dtei, lid, \
is_bcast) \
ERR_NOSUPP; \
do { \
(void)(rf_pdev); \
(void)(msdu); \
(void)(delimiter_type); \
(void)(dtei); \
(void)(lid); \
(void)(is_bcast); \
} while(0);
#endif /* HPLC_RF_DEV_SUPPORT */
#ifdef __cplusplus
}
#endif
#endif //SW_SCHED_H