1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2014-2017 Broadcom.
6 #ifndef _BCM_SF2_ETH_H_
7 #define _BCM_SF2_ETH_H_
11 #define RX_BUF_SIZE 2048
12 /* RX_BUF_NUM must be power of 2 */
15 #define TX_BUF_SIZE 2048
16 /* TX_BUF_NUM must be power of 2 */
19 /* Support 2 Ethernet ports now */
20 #define BCM_ETH_MAX_PORT_NUM 2
28 void *tx_desc_aligned;
29 void *rx_desc_aligned;
37 int (*tx_packet)(struct eth_dma *dma, void *packet, int length);
38 bool (*check_tx_done)(struct eth_dma *dma);
40 int (*check_rx_done)(struct eth_dma *dma, uint8_t *buf);
42 int (*enable_dma)(struct eth_dma *dma, int dir);
43 int (*disable_dma)(struct eth_dma *dma, int dir);
48 phy_interface_t phy_interface;
49 struct phy_device *port[BCM_ETH_MAX_PORT_NUM];
52 int (*miiphy_read)(struct mii_dev *bus, int phyaddr, int devad,
54 int (*miiphy_write)(struct mii_dev *bus, int phyaddr, int devad,
57 int (*mac_init)(struct eth_device *dev);
58 int (*enable_mac)(void);
59 int (*disable_mac)(void);
60 int (*set_mac_addr)(unsigned char *mac);
61 int (*set_mac_speed)(int speed, int duplex);
65 #endif /* _BCM_SF2_ETH_H_ */