hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/net/ethernet/ethoc.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/net/ethernet/ethoc.c
34 *
45 * Copyright (C) 2007-2008 Avionic Design Development GmbH
56 * Copyright (C) 2008-2009 Avionic Design GmbH
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 *
118 * Written by Thierry Reding <thierry.reding@avionic-design.de>
129 */
....@@ -180,6 +177,7 @@
180177 * struct ethoc - driver-private device structure
181178 * @iobase: pointer to I/O memory region
182179 * @membase: pointer to buffer memory region
180
+ * @big_endian: just big or little (endian)
183181 * @num_bd: number of buffer descriptors
184182 * @num_tx: number of send buffers
185183 * @cur_tx: last send buffer written
....@@ -192,7 +190,10 @@
192190 * @msg_enable: device state flags
193191 * @lock: device lock
194192 * @mdio: MDIO bus for PHY access
193
+ * @clk: clock
195194 * @phy_id: address of attached PHY
195
+ * @old_link: previous link info
196
+ * @old_duplex: previous duplex info
196197 */
197198 struct ethoc {
198199 void __iomem *iobase;
....@@ -721,10 +722,7 @@
721722 return err;
722723 }
723724
724
- phy->advertising &= ~(ADVERTISED_1000baseT_Full |
725
- ADVERTISED_1000baseT_Half);
726
- phy->supported &= ~(SUPPORTED_1000baseT_Full |
727
- SUPPORTED_1000baseT_Half);
725
+ phy_set_max_speed(phy, SPEED_100);
728726
729727 return 0;
730728 }
....@@ -875,7 +873,7 @@
875873 return -ENOSYS;
876874 }
877875
878
-static void ethoc_tx_timeout(struct net_device *dev)
876
+static void ethoc_tx_timeout(struct net_device *dev, unsigned int txqueue)
879877 {
880878 struct ethoc *priv = netdev_priv(dev);
881879 u32 pending = ethoc_read(priv, INT_SOURCE);
....@@ -1021,7 +1019,7 @@
10211019
10221020 /**
10231021 * ethoc_probe - initialize OpenCores ethernet MAC
1024
- * pdev: platform device
1022
+ * @pdev: platform device
10251023 */
10261024 static int ethoc_probe(struct platform_device *pdev)
10271025 {
....@@ -1093,7 +1091,7 @@
10931091 priv = netdev_priv(netdev);
10941092 priv->netdev = netdev;
10951093
1096
- priv->iobase = devm_ioremap_nocache(&pdev->dev, netdev->base_addr,
1094
+ priv->iobase = devm_ioremap(&pdev->dev, netdev->base_addr,
10971095 resource_size(mmio));
10981096 if (!priv->iobase) {
10991097 dev_err(&pdev->dev, "cannot remap I/O memory space\n");
....@@ -1102,7 +1100,7 @@
11021100 }
11031101
11041102 if (netdev->mem_end) {
1105
- priv->membase = devm_ioremap_nocache(&pdev->dev,
1103
+ priv->membase = devm_ioremap(&pdev->dev,
11061104 netdev->mem_start, resource_size(mem));
11071105 if (!priv->membase) {
11081106 dev_err(&pdev->dev, "cannot remap memory space\n");
....@@ -1156,7 +1154,7 @@
11561154 const void *mac;
11571155
11581156 mac = of_get_mac_address(pdev->dev.of_node);
1159
- if (mac)
1157
+ if (!IS_ERR(mac))
11601158 ether_addr_copy(netdev->dev_addr, mac);
11611159 priv->phy_id = -1;
11621160 }