xref: /linux/drivers/net/dsa/mxl862xx/mxl862xx-phylink.h (revision b2128290c29902315e632ea59e0504d6bc9e9b42)
1c1034332SDaniel Golle /* SPDX-License-Identifier: GPL-2.0-or-later */
2c1034332SDaniel Golle 
3c1034332SDaniel Golle #ifndef __MXL862XX_PHYLINK_H
4c1034332SDaniel Golle #define __MXL862XX_PHYLINK_H
5c1034332SDaniel Golle 
6c1034332SDaniel Golle #include <linux/phylink.h>
7c1034332SDaniel Golle 
8c1034332SDaniel Golle #include "mxl862xx.h"
9c1034332SDaniel Golle 
10*13ea4d48SDaniel Golle #define MXL862XX_SERDES_SLOT(port) \
11*13ea4d48SDaniel Golle 	(((port) - MXL862XX_FIRST_SERDES_PORT) % MXL862XX_SERDES_SLOTS)
12*13ea4d48SDaniel Golle #define MXL862XX_SERDES_PORT_ID(port) \
13*13ea4d48SDaniel Golle 	(((port) - MXL862XX_FIRST_SERDES_PORT) / MXL862XX_SERDES_SLOTS)
14*13ea4d48SDaniel Golle 
15c1034332SDaniel Golle extern const struct phylink_mac_ops mxl862xx_phylink_mac_ops;
16c1034332SDaniel Golle void mxl862xx_phylink_get_caps(struct dsa_switch *ds, int port,
17c1034332SDaniel Golle 			       struct phylink_config *config);
18*13ea4d48SDaniel Golle void mxl862xx_setup_pcs(struct mxl862xx_priv *priv, struct mxl862xx_pcs *pcs,
19*13ea4d48SDaniel Golle 			int port);
20c1034332SDaniel Golle 
21c1034332SDaniel Golle #endif /* __MXL862XX_PHYLINK_H */
22