| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2006, 2007 Eugene Konev |
|---|
| 3 | 4 | * |
|---|
| 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 |
|---|
| 17 | 5 | */ |
|---|
| 18 | 6 | |
|---|
| 19 | 7 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 544 | 532 | |
|---|
| 545 | 533 | } |
|---|
| 546 | 534 | |
|---|
| 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) |
|---|
| 548 | 536 | { |
|---|
| 549 | 537 | int queue; |
|---|
| 550 | 538 | unsigned int len; |
|---|
| .. | .. |
|---|
| 608 | 596 | netdev_dbg(dev, "sent 0x%p, len=%d\n", |
|---|
| 609 | 597 | desc->skb, desc->skb->len); |
|---|
| 610 | 598 | |
|---|
| 611 | | - dev_kfree_skb_irq(desc->skb); |
|---|
| 599 | + dev_consume_skb_irq(desc->skb); |
|---|
| 612 | 600 | desc->skb = NULL; |
|---|
| 613 | 601 | if (__netif_subqueue_stopped(dev, queue)) |
|---|
| 614 | 602 | netif_wake_subqueue(dev, queue); |
|---|
| .. | .. |
|---|
| 809 | 797 | return IRQ_HANDLED; |
|---|
| 810 | 798 | } |
|---|
| 811 | 799 | |
|---|
| 812 | | -static void cpmac_tx_timeout(struct net_device *dev) |
|---|
| 800 | +static void cpmac_tx_timeout(struct net_device *dev, unsigned int txqueue) |
|---|
| 813 | 801 | { |
|---|
| 814 | 802 | struct cpmac_priv *priv = netdev_priv(dev); |
|---|
| 815 | 803 | |
|---|
| .. | .. |
|---|
| 826 | 814 | atomic_dec(&priv->reset_pending); |
|---|
| 827 | 815 | |
|---|
| 828 | 816 | 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); |
|---|
| 839 | 817 | } |
|---|
| 840 | 818 | |
|---|
| 841 | 819 | static void cpmac_get_ringparam(struct net_device *dev, |
|---|
| .. | .. |
|---|
| 991 | 969 | cpmac_hw_start(dev); |
|---|
| 992 | 970 | |
|---|
| 993 | 971 | napi_enable(&priv->napi); |
|---|
| 994 | | - dev->phydev->state = PHY_CHANGELINK; |
|---|
| 995 | 972 | phy_start(dev->phydev); |
|---|
| 996 | 973 | |
|---|
| 997 | 974 | return 0; |
|---|
| .. | .. |
|---|
| 1067 | 1044 | .ndo_start_xmit = cpmac_start_xmit, |
|---|
| 1068 | 1045 | .ndo_tx_timeout = cpmac_tx_timeout, |
|---|
| 1069 | 1046 | .ndo_set_rx_mode = cpmac_set_multicast_list, |
|---|
| 1070 | | - .ndo_do_ioctl = cpmac_ioctl, |
|---|
| 1047 | + .ndo_do_ioctl = phy_do_ioctl_running, |
|---|
| 1071 | 1048 | .ndo_validate_addr = eth_validate_addr, |
|---|
| 1072 | 1049 | .ndo_set_mac_address = eth_mac_addr, |
|---|
| 1073 | 1050 | }; |
|---|