42 lines
823 B
C
42 lines
823 B
C
/*
|
|
* Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef __MAC_H__
|
|
#define __MAC_H__
|
|
|
|
#include <stdbool.h>
|
|
|
|
#define MAC_ADDR_LEN 6
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
enum MacSpeed {
|
|
MAC_SPEED_UNUSED,
|
|
MAC_SPEED_10M,
|
|
MAC_SPEED_100M,
|
|
MAC_SPEED_1000M,
|
|
MAC_SPEED_2500M
|
|
};
|
|
|
|
void vMacGetHwAddr(uint8_t *hwaddr);
|
|
bool xMacInit(void);
|
|
int xMacRecv(uint8_t **packetp);
|
|
int xMacFreePkt(uint8_t *packet);
|
|
void vMacSendTo(uint8_t *dst, uint8_t *src, uint16_t type, void *payload, int length);
|
|
void vMacSend(void *packet, int length);
|
|
void vMacDeinit(void);
|
|
int xMdioRead(uint8_t phyAddr, uint8_t regAddr);
|
|
int xMdioWrite(uint8_t phyAddr, uint8_t regAddr, uint16_t value);
|
|
void vMacSpeedSelect(enum MacSpeed speed);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAC_H__ */
|