forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/net/ethernet/ti/cpmac.c
....@@ -1,19 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * Copyright (C) 2006, 2007 Eugene Konev
34 *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, write to the Free Software
16
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
175 */
186
197 #include <linux/module.h>
....@@ -544,7 +532,7 @@
544532
545533 }
546534
547
-static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
535
+static netdev_tx_t cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
548536 {
549537 int queue;
550538 unsigned int len;
....@@ -608,7 +596,7 @@
608596 netdev_dbg(dev, "sent 0x%p, len=%d\n",
609597 desc->skb, desc->skb->len);
610598
611
- dev_kfree_skb_irq(desc->skb);
599
+ dev_consume_skb_irq(desc->skb);
612600 desc->skb = NULL;
613601 if (__netif_subqueue_stopped(dev, queue))
614602 netif_wake_subqueue(dev, queue);
....@@ -809,7 +797,7 @@
809797 return IRQ_HANDLED;
810798 }
811799
812
-static void cpmac_tx_timeout(struct net_device *dev)
800
+static void cpmac_tx_timeout(struct net_device *dev, unsigned int txqueue)
813801 {
814802 struct cpmac_priv *priv = netdev_priv(dev);
815803
....@@ -826,16 +814,6 @@
826814 atomic_dec(&priv->reset_pending);
827815
828816 netif_tx_wake_all_queues(priv->dev);
829
-}
830
-
831
-static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
832
-{
833
- if (!(netif_running(dev)))
834
- return -EINVAL;
835
- if (!dev->phydev)
836
- return -EINVAL;
837
-
838
- return phy_mii_ioctl(dev->phydev, ifr, cmd);
839817 }
840818
841819 static void cpmac_get_ringparam(struct net_device *dev,
....@@ -991,7 +969,6 @@
991969 cpmac_hw_start(dev);
992970
993971 napi_enable(&priv->napi);
994
- dev->phydev->state = PHY_CHANGELINK;
995972 phy_start(dev->phydev);
996973
997974 return 0;
....@@ -1067,7 +1044,7 @@
10671044 .ndo_start_xmit = cpmac_start_xmit,
10681045 .ndo_tx_timeout = cpmac_tx_timeout,
10691046 .ndo_set_rx_mode = cpmac_set_multicast_list,
1070
- .ndo_do_ioctl = cpmac_ioctl,
1047
+ .ndo_do_ioctl = phy_do_ioctl_running,
10711048 .ndo_validate_addr = eth_validate_addr,
10721049 .ndo_set_mac_address = eth_mac_addr,
10731050 };