projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ar71xx: ag71xx: fix section mismatch warnings
[openwrt.git]
/
target
/
linux
/
ar71xx
/
files
/
drivers
/
net
/
ag71xx
/
ag71xx_main.c
diff --git
a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
index
4e597eb
..
2b28faa
100644
(file)
--- a/
target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
+++ b/
target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
@@
-14,14
+14,14
@@
#include "ag71xx.h"
#define AG71XX_DEFAULT_MSG_ENABLE \
#include "ag71xx.h"
#define AG71XX_DEFAULT_MSG_ENABLE \
- (
NETIF_MSG_DRV
\
+ (
NETIF_MSG_DRV
\
| NETIF_MSG_PROBE \
| NETIF_MSG_LINK \
| NETIF_MSG_TIMER \
| NETIF_MSG_IFDOWN \
| NETIF_MSG_IFUP \
| NETIF_MSG_RX_ERR \
| NETIF_MSG_PROBE \
| NETIF_MSG_LINK \
| NETIF_MSG_TIMER \
| NETIF_MSG_IFDOWN \
| NETIF_MSG_IFUP \
| NETIF_MSG_RX_ERR \
- | NETIF_MSG_TX_ERR
)
+ | NETIF_MSG_TX_ERR)
static int ag71xx_msg_level = -1;
static int ag71xx_msg_level = -1;
@@
-119,14
+119,15
@@
static int ag71xx_ring_alloc(struct ag71xx_ring *ring, unsigned int size)
}
for (i = 0; i < size; i++) {
}
for (i = 0; i < size; i++) {
- ring->buf[i].desc = (struct ag71xx_desc *)&ring->descs_cpu[i * ring->desc_size];
+ int idx = i * ring->desc_size;
+ ring->buf[i].desc = (struct ag71xx_desc *)&ring->descs_cpu[idx];
DBG("ag71xx: ring %p, desc %d at %p\n",
ring, i, ring->buf[i].desc);
}
return 0;
DBG("ag71xx: ring %p, desc %d at %p\n",
ring, i, ring->buf[i].desc);
}
return 0;
-
err:
+err:
return err;
}
return err;
}
@@
-579,8
+580,6
@@
static int ag71xx_open(struct net_device *dev)
if (ret)
goto err;
if (ret)
goto err;
- ag71xx_hw_init(ag);
-
napi_enable(&ag->napi);
netif_carrier_off(dev);
napi_enable(&ag->napi);
netif_carrier_off(dev);
@@
-597,7
+596,7
@@
static int ag71xx_open(struct net_device *dev)
return 0;
return 0;
-
err:
+err:
ag71xx_rings_cleanup(ag);
return ret;
}
ag71xx_rings_cleanup(ag);
return ret;
}
@@
-653,6
+652,7
@@
static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb,
DMA_TO_DEVICE);
ring->buf[i].skb = skb;
DMA_TO_DEVICE);
ring->buf[i].skb = skb;
+ ring->buf[i].timestamp = jiffies;
/* setup descriptor fields */
desc->data = (u32) dma_addr;
/* setup descriptor fields */
desc->data = (u32) dma_addr;
@@
-674,7
+674,7
@@
static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;
return NETDEV_TX_OK;
-
err_drop:
+err_drop:
dev->stats.tx_dropped++;
dev_kfree_skb(skb);
dev->stats.tx_dropped++;
dev_kfree_skb(skb);
@@
-683,7
+683,6
@@
static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb,
static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
- struct mii_ioctl_data *data = (struct mii_ioctl_data *) &ifr->ifr_data;
struct ag71xx *ag = netdev_priv(dev);
int ret;
struct ag71xx *ag = netdev_priv(dev);
int ret;
@@
-715,7
+714,7
@@
static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (ag->phy_dev == NULL)
break;
if (ag->phy_dev == NULL)
break;
- return phy_mii_ioctl(ag->phy_dev,
data
, cmd);
+ return phy_mii_ioctl(ag->phy_dev,
ifr
, cmd);
default:
break;
default:
break;
@@
-745,8
+744,13
@@
static void ag71xx_tx_timeout(struct net_device *dev)
static void ag71xx_restart_work_func(struct work_struct *work)
{
struct ag71xx *ag = container_of(work, struct ag71xx, restart_work);
static void ag71xx_restart_work_func(struct work_struct *work)
{
struct ag71xx *ag = container_of(work, struct ag71xx, restart_work);
+ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
ag71xx_stop(ag->dev);
ag71xx_stop(ag->dev);
+
+ if (pdata->is_ar724x)
+ ag71xx_hw_init(ag);
+
ag71xx_open(ag->dev);
}
ag71xx_open(ag->dev);
}
@@
-907,12
+911,12
@@
static int ag71xx_poll(struct napi_struct *napi, int limit)
return rx_done;
}
return rx_done;
}
-
more:
+more:
DBG("%s: stay in polling mode, rx=%d, tx=%d, limit=%d\n",
dev->name, rx_done, tx_done, limit);
return rx_done;
DBG("%s: stay in polling mode, rx=%d, tx=%d, limit=%d\n",
dev->name, rx_done, tx_done, limit);
return rx_done;
-
oom:
+oom:
if (netif_msg_rx_err(ag))
printk(KERN_DEBUG "%s: out of memory\n", dev->name);
if (netif_msg_rx_err(ag))
printk(KERN_DEBUG "%s: out of memory\n", dev->name);
@@
-989,7
+993,7
@@
static const struct net_device_ops ag71xx_netdev_ops = {
#endif
};
#endif
};
-static int __init ag71xx_probe(struct platform_device *pdev)
+static int __
dev
init ag71xx_probe(struct platform_device *pdev)
{
struct net_device *dev;
struct resource *res;
{
struct net_device *dev;
struct resource *res;
@@
-1056,7
+1060,7
@@
static int __init ag71xx_probe(struct platform_device *pdev)
dev->irq = platform_get_irq(pdev, 0);
err = request_irq(dev->irq, ag71xx_interrupt,
dev->irq = platform_get_irq(pdev, 0);
err = request_irq(dev->irq, ag71xx_interrupt,
- IRQF_DISABLED
| IRQF_SAMPLE_RANDOM
,
+ IRQF_DISABLED,
dev->name, dev);
if (err) {
dev_err(&pdev->dev, "unable to request IRQ %d\n", dev->irq);
dev->name, dev);
if (err) {
dev_err(&pdev->dev, "unable to request IRQ %d\n", dev->irq);
@@
-1104,24
+1108,24
@@
static int __init ag71xx_probe(struct platform_device *pdev)
return 0;
return 0;
-
err_phy_disconnect:
+err_phy_disconnect:
ag71xx_phy_disconnect(ag);
ag71xx_phy_disconnect(ag);
-
err_unregister_netdev:
+err_unregister_netdev:
unregister_netdev(dev);
unregister_netdev(dev);
-
err_free_irq:
+err_free_irq:
free_irq(dev->irq, dev);
free_irq(dev->irq, dev);
-
err_unmap_mii_ctrl:
+err_unmap_mii_ctrl:
iounmap(ag->mii_ctrl);
iounmap(ag->mii_ctrl);
-
err_unmap_base:
+err_unmap_base:
iounmap(ag->mac_base);
iounmap(ag->mac_base);
-
err_free_dev:
+err_free_dev:
kfree(dev);
kfree(dev);
-
err_out:
+err_out:
platform_set_drvdata(pdev, NULL);
return err;
}
platform_set_drvdata(pdev, NULL);
return err;
}
-static int __exit ag71xx_remove(struct platform_device *pdev)
+static int __
dev
exit ag71xx_remove(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
{
struct net_device *dev = platform_get_drvdata(pdev);
@@
-1167,11
+1171,11
@@
static int __init ag71xx_module_init(void)
return 0;
return 0;
-
err_mdio_exit:
+err_mdio_exit:
ag71xx_mdio_driver_exit();
ag71xx_mdio_driver_exit();
-
err_debugfs_exit:
+err_debugfs_exit:
ag71xx_debugfs_root_exit();
ag71xx_debugfs_root_exit();
-
err_out:
+err_out:
return ret;
}
return ret;
}
This page took
0.033924 seconds
and
4
git commands to generate.