| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2010-2011 Calxeda, Inc. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 5 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 6 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 9 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 10 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 11 | | - * more details. |
|---|
| 12 | | - * |
|---|
| 13 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 14 | | - * this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | #include <linux/module.h> |
|---|
| 17 | 6 | #include <linux/mod_devicetable.h> |
|---|
| .. | .. |
|---|
| 1115 | 1104 | for (i = 0; i < nfrags; i++) { |
|---|
| 1116 | 1105 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
|---|
| 1117 | 1106 | |
|---|
| 1118 | | - len = frag->size; |
|---|
| 1107 | + len = skb_frag_size(frag); |
|---|
| 1119 | 1108 | |
|---|
| 1120 | 1109 | paddr = skb_frag_dma_map(priv->device, frag, 0, len, |
|---|
| 1121 | 1110 | DMA_TO_DEVICE); |
|---|
| .. | .. |
|---|
| 1257 | 1246 | /** |
|---|
| 1258 | 1247 | * xgmac_tx_timeout |
|---|
| 1259 | 1248 | * @dev : Pointer to net device structure |
|---|
| 1249 | + * @txqueue: index of the hung transmit queue |
|---|
| 1250 | + * |
|---|
| 1260 | 1251 | * Description: this function is called when a packet transmission fails to |
|---|
| 1261 | 1252 | * complete within a reasonable tmrate. The driver will mark the error in the |
|---|
| 1262 | 1253 | * netdev structure and arrange for the device to be reset to a sane state |
|---|
| 1263 | 1254 | * in order to transmit a new packet. |
|---|
| 1264 | 1255 | */ |
|---|
| 1265 | | -static void xgmac_tx_timeout(struct net_device *dev) |
|---|
| 1256 | +static void xgmac_tx_timeout(struct net_device *dev, unsigned int txqueue) |
|---|
| 1266 | 1257 | { |
|---|
| 1267 | 1258 | struct xgmac_priv *priv = netdev_priv(dev); |
|---|
| 1268 | 1259 | schedule_work(&priv->tx_timeout_work); |
|---|
| .. | .. |
|---|
| 1866 | 1857 | |
|---|
| 1867 | 1858 | static int xgmac_suspend(struct device *dev) |
|---|
| 1868 | 1859 | { |
|---|
| 1869 | | - struct net_device *ndev = platform_get_drvdata(to_platform_device(dev)); |
|---|
| 1860 | + struct net_device *ndev = dev_get_drvdata(dev); |
|---|
| 1870 | 1861 | struct xgmac_priv *priv = netdev_priv(ndev); |
|---|
| 1871 | 1862 | u32 value; |
|---|
| 1872 | 1863 | |
|---|
| .. | .. |
|---|
| 1892 | 1883 | |
|---|
| 1893 | 1884 | static int xgmac_resume(struct device *dev) |
|---|
| 1894 | 1885 | { |
|---|
| 1895 | | - struct net_device *ndev = platform_get_drvdata(to_platform_device(dev)); |
|---|
| 1886 | + struct net_device *ndev = dev_get_drvdata(dev); |
|---|
| 1896 | 1887 | struct xgmac_priv *priv = netdev_priv(ndev); |
|---|
| 1897 | 1888 | void __iomem *ioaddr = priv->base; |
|---|
| 1898 | 1889 | |
|---|
| .. | .. |
|---|
| 1925 | 1916 | .driver = { |
|---|
| 1926 | 1917 | .name = "calxedaxgmac", |
|---|
| 1927 | 1918 | .of_match_table = xgmac_of_match, |
|---|
| 1919 | + .pm = &xgmac_pm_ops, |
|---|
| 1928 | 1920 | }, |
|---|
| 1929 | 1921 | .probe = xgmac_probe, |
|---|
| 1930 | 1922 | .remove = xgmac_remove, |
|---|
| 1931 | | - .driver.pm = &xgmac_pm_ops, |
|---|
| 1932 | 1923 | }; |
|---|
| 1933 | 1924 | |
|---|
| 1934 | 1925 | module_platform_driver(xgmac_driver); |
|---|