2023-05-03 14:01:32 +03:00
|
|
|
|
/*
|
|
|
|
|
* eth_tx_flow.hpp
|
|
|
|
|
*
|
2023-06-08 12:27:49 +03:00
|
|
|
|
* Created on: 7 <EFBFBD><EFBFBD><EFBFBD>. 2023 <EFBFBD>.
|
2023-05-03 14:01:32 +03:00
|
|
|
|
* Author: sychev
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef FREE_RTOS_ETHERNET_ETH_TX_FLOW_HPP_
|
|
|
|
|
#define FREE_RTOS_ETHERNET_ETH_TX_FLOW_HPP_
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <networking/enet/core/include/core/enet_dma.h>
|
|
|
|
|
|
|
|
|
|
#include "ethernet/eth_tx_flow_iface.hpp"
|
2023-06-08 12:27:49 +03:00
|
|
|
|
#include "handler_store/handler_store.hpp"
|
2023-05-03 14:01:32 +03:00
|
|
|
|
|
|
|
|
|
namespace free_rtos {
|
|
|
|
|
|
|
|
|
|
class EthTxFlow : public EthTxFlowIface {
|
|
|
|
|
public:
|
|
|
|
|
EthTxFlow();
|
|
|
|
|
|
|
|
|
|
bool open(uint32_t id, int32_t enetDmaTxChId);
|
|
|
|
|
|
|
|
|
|
bool is_open() {return open_;}
|
|
|
|
|
|
|
|
|
|
void enable(TEthMacPorts port_id);
|
|
|
|
|
|
|
|
|
|
void disable(TEthMacPorts port_id);
|
|
|
|
|
|
|
|
|
|
virtual bool send(TEthMacPorts port_id, uint8_t * p_data, uint32_t len) override;
|
2023-06-08 12:27:49 +03:00
|
|
|
|
virtual bool send(TEthMacPorts port_id, Handler * handler, uint32_t numScatterSegments) override;
|
2023-05-03 14:01:32 +03:00
|
|
|
|
private:
|
|
|
|
|
struct PortData {
|
|
|
|
|
bool tx_enable;
|
|
|
|
|
uint32_t tx_pkt_counter;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
uint32_t id_;
|
|
|
|
|
bool open_;
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------
|
|
|
|
|
uint32_t tx_ch_num_;
|
2023-06-08 12:27:49 +03:00
|
|
|
|
EnetDma_TxChHandle dma_handle_; /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> DMA
|
|
|
|
|
EnetDma_PktQ tx_free_pktq_; /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2023-05-03 14:01:32 +03:00
|
|
|
|
|
|
|
|
|
PortData port_data_[e_ethMacTotal];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* FREE_RTOS_ETHERNET_ETH_TX_FLOW_HPP_ */
|