summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Stockhausen2025-05-02 08:53:10 +0000
committerStijn Tintel2025-05-12 13:09:19 +0000
commit7f16a379f698fb7546811f76962875254b1e7293 (patch)
tree1732c16aad83602e903bd8c094643f957e2e4864
parentbd808cf3ca92d25e8351fd88dad05ebd2dda9908 (diff)
downloadopenwrt-7f16a379f698fb7546811f76962875254b1e7293.tar.gz
realtek: add mdio prefix to defines
Inside the ethernet driver lives the mdio bus. It is not always clear what belongs where. Prefix some leftovers from the kernel 6.6 refactor to clearly state what belongs to the bus. Group all defines together in one place. This commit has no functional changes. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/18402 Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
-rw-r--r--target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c
index e7297ca151..29c7529469 100644
--- a/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c
@@ -48,11 +48,18 @@ extern struct rtl83xx_soc_info soc_info;
#define TX_PAD_EN_838X BIT(5)
#define TX_DO 0x2
#define WRAP 0x2
-#define MAX_PORTS 57
-#define MAX_SMI_BUSSES 4
-
#define RING_BUFFER 1600
+#define RTMDIO_MAX_PORT 57
+#define RTMDIO_MAX_SMI_BUS 4
+#define RTMDIO_PAGE_SELECT 0x1f
+#define RTMDIO_PORT_SELECT 0x2000
+
+#define RTMDIO_READ BIT(0)
+#define RTMDIO_WRITE BIT(1)
+#define RTMDIO_ABS BIT(2)
+#define RTMDIO_PKG BIT(3)
+
struct p_hdr {
uint8_t *buf;
uint16_t reserved;
@@ -195,12 +202,12 @@ struct rtl838x_eth_priv {
u32 lastEvent;
u16 rxrings;
u16 rxringlen;
- int smi_bus[MAX_PORTS];
- u8 smi_addr[MAX_PORTS];
- u32 sds_id[MAX_PORTS];
- bool smi_bus_isc45[MAX_SMI_BUSSES];
- bool phy_is_internal[MAX_PORTS];
- phy_interface_t interfaces[MAX_PORTS];
+ int smi_bus[RTMDIO_MAX_PORT];
+ u8 smi_addr[RTMDIO_MAX_PORT];
+ u32 sds_id[RTMDIO_MAX_PORT];
+ bool smi_bus_isc45[RTMDIO_MAX_SMI_BUS];
+ bool phy_is_internal[RTMDIO_MAX_PORT];
+ phy_interface_t interfaces[RTMDIO_MAX_PORT];
};
extern int rtl838x_phy_init(struct rtl838x_eth_priv *priv);
@@ -1700,13 +1707,6 @@ static int rtl838x_set_link_ksettings(struct net_device *ndev,
* reimplemented. For now it should be sufficient.
*/
-#define RTMDIO_PAGE_SELECT 0x1f
-#define RTMDIO_PORT_SELECT 0x2000
-#define RTMDIO_READ 0x1
-#define RTMDIO_WRITE 0x2
-#define RTMDIO_ABS 0x4
-#define RTMDIO_PKG 0x8
-
/*
* Provide a generic read/write function so we can access arbitrary ports on the bus.
* E.g. other ports of a PHY package on the bus. This basically resembles the kernel
@@ -2286,7 +2286,7 @@ static int rtl838x_mdio_init(struct rtl838x_eth_priv *priv)
if (of_property_read_u32(dn, "reg", &pn))
continue;
- if (pn >= MAX_PORTS) {
+ if (pn >= RTMDIO_MAX_PORT) {
pr_err("%s: illegal port number %d\n", __func__, pn);
return -ENODEV;
}
@@ -2304,7 +2304,7 @@ static int rtl838x_mdio_init(struct rtl838x_eth_priv *priv)
priv->smi_addr[pn] = smi_addr[1];
}
- if (priv->smi_bus[pn] >= MAX_SMI_BUSSES) {
+ if (priv->smi_bus[pn] >= RTMDIO_MAX_SMI_BUS) {
pr_err("%s: illegal SMI bus number %d\n", __func__, priv->smi_bus[pn]);
return -ENODEV;
}