ethernet: support flow control

This commit is contained in:
shangke
2017-01-06 13:49:42 +08:00
parent a3f6728797
commit 0e701e1cac
11 changed files with 211 additions and 60 deletions

View File

@@ -72,6 +72,9 @@ struct emac_config_data {
eth_phy_check_init_func emac_phy_check_init;
eth_phy_get_speed_mode_func emac_phy_get_speed_mode;
eth_phy_get_duplex_mode_func emac_phy_get_duplex_mode;
bool emac_flow_ctrl_enable;
bool emac_flow_ctrl_partner_support;
eth_phy_get_partner_pause_enable_func emac_phy_get_partner_pause_enable;
};
enum emac_post_type {
@@ -109,6 +112,13 @@ struct emac_close_cmd {
#define DMA_RX_BUF_SIZE 1600
#define DMA_TX_BUF_SIZE 1600
//rest buf num
#define FLOW_CONTROL_HIGH_WATERMARK 3
//used buf num
#define FLOW_CONTROL_LOW_WATERMARK 6
#define PHY_LINK_CHECK_NUM 5
#define EMAC_CMD_OK 0
#define EMAC_CMD_FAIL -1