aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c14
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c13
-rw-r--r--drivers/net/ethernet/marvell/skge.c15
-rw-r--r--drivers/net/ethernet/marvell/sky2.c39
4 files changed, 42 insertions, 39 deletions
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index e93be7954a19..80aab4e5d695 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -1502,10 +1502,12 @@ mv643xx_eth_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1502static void mv643xx_eth_get_drvinfo(struct net_device *dev, 1502static void mv643xx_eth_get_drvinfo(struct net_device *dev,
1503 struct ethtool_drvinfo *drvinfo) 1503 struct ethtool_drvinfo *drvinfo)
1504{ 1504{
1505 strncpy(drvinfo->driver, mv643xx_eth_driver_name, 32); 1505 strlcpy(drvinfo->driver, mv643xx_eth_driver_name,
1506 strncpy(drvinfo->version, mv643xx_eth_driver_version, 32); 1506 sizeof(drvinfo->driver));
1507 strncpy(drvinfo->fw_version, "N/A", 32); 1507 strlcpy(drvinfo->version, mv643xx_eth_driver_version,
1508 strncpy(drvinfo->bus_info, "platform", 32); 1508 sizeof(drvinfo->version));
1509 strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
1510 strlcpy(drvinfo->bus_info, "platform", sizeof(drvinfo->bus_info));
1509 drvinfo->n_stats = ARRAY_SIZE(mv643xx_eth_stats); 1511 drvinfo->n_stats = ARRAY_SIZE(mv643xx_eth_stats);
1510} 1512}
1511 1513
@@ -1578,10 +1580,10 @@ mv643xx_eth_set_ringparam(struct net_device *dev, struct ethtool_ringparam *er)
1578 1580
1579 1581
1580static int 1582static int
1581mv643xx_eth_set_features(struct net_device *dev, u32 features) 1583mv643xx_eth_set_features(struct net_device *dev, netdev_features_t features)
1582{ 1584{
1583 struct mv643xx_eth_private *mp = netdev_priv(dev); 1585 struct mv643xx_eth_private *mp = netdev_priv(dev);
1584 u32 rx_csum = features & NETIF_F_RXCSUM; 1586 bool rx_csum = features & NETIF_F_RXCSUM;
1585 1587
1586 wrlp(mp, PORT_CONFIG, rx_csum ? 0x02000000 : 0x00000000); 1588 wrlp(mp, PORT_CONFIG, rx_csum ? 0x02000000 : 0x00000000);
1587 1589
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index d17d0624c5e6..5ec409e3da09 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1645,18 +1645,7 @@ static struct platform_driver pxa168_eth_driver = {
1645 }, 1645 },
1646}; 1646};
1647 1647
1648static int __init pxa168_init_module(void) 1648module_platform_driver(pxa168_eth_driver);
1649{
1650 return platform_driver_register(&pxa168_eth_driver);
1651}
1652
1653static void __exit pxa168_cleanup_module(void)
1654{
1655 platform_driver_unregister(&pxa168_eth_driver);
1656}
1657
1658module_init(pxa168_init_module);
1659module_exit(pxa168_cleanup_module);
1660 1649
1661MODULE_LICENSE("GPL"); 1650MODULE_LICENSE("GPL");
1662MODULE_DESCRIPTION("Ethernet driver for Marvell PXA168"); 1651MODULE_DESCRIPTION("Ethernet driver for Marvell PXA168");
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index c7b60839ac99..18a87a57fc0a 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -394,10 +394,10 @@ static void skge_get_drvinfo(struct net_device *dev,
394{ 394{
395 struct skge_port *skge = netdev_priv(dev); 395 struct skge_port *skge = netdev_priv(dev);
396 396
397 strcpy(info->driver, DRV_NAME); 397 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
398 strcpy(info->version, DRV_VERSION); 398 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
399 strcpy(info->fw_version, "N/A"); 399 strlcpy(info->bus_info, pci_name(skge->hw->pdev),
400 strcpy(info->bus_info, pci_name(skge->hw->pdev)); 400 sizeof(info->bus_info));
401} 401}
402 402
403static const struct skge_stat { 403static const struct skge_stat {
@@ -2606,6 +2606,9 @@ static int skge_up(struct net_device *dev)
2606 spin_unlock_irq(&hw->hw_lock); 2606 spin_unlock_irq(&hw->hw_lock);
2607 2607
2608 napi_enable(&skge->napi); 2608 napi_enable(&skge->napi);
2609
2610 skge_set_multicast(dev);
2611
2609 return 0; 2612 return 0;
2610 2613
2611 free_tx_ring: 2614 free_tx_ring:
@@ -4039,7 +4042,7 @@ static void __devexit skge_remove(struct pci_dev *pdev)
4039 pci_set_drvdata(pdev, NULL); 4042 pci_set_drvdata(pdev, NULL);
4040} 4043}
4041 4044
4042#ifdef CONFIG_PM 4045#ifdef CONFIG_PM_SLEEP
4043static int skge_suspend(struct device *dev) 4046static int skge_suspend(struct device *dev)
4044{ 4047{
4045 struct pci_dev *pdev = to_pci_dev(dev); 4048 struct pci_dev *pdev = to_pci_dev(dev);
@@ -4101,7 +4104,7 @@ static SIMPLE_DEV_PM_OPS(skge_pm_ops, skge_suspend, skge_resume);
4101#else 4104#else
4102 4105
4103#define SKGE_PM_OPS NULL 4106#define SKGE_PM_OPS NULL
4104#endif 4107#endif /* CONFIG_PM_SLEEP */
4105 4108
4106static void skge_shutdown(struct pci_dev *pdev) 4109static void skge_shutdown(struct pci_dev *pdev)
4107{ 4110{
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 7803efa46eb2..760c2b17dfd3 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -1110,6 +1110,7 @@ static void tx_init(struct sky2_port *sky2)
1110 sky2->tx_prod = sky2->tx_cons = 0; 1110 sky2->tx_prod = sky2->tx_cons = 0;
1111 sky2->tx_tcpsum = 0; 1111 sky2->tx_tcpsum = 0;
1112 sky2->tx_last_mss = 0; 1112 sky2->tx_last_mss = 0;
1113 netdev_reset_queue(sky2->netdev);
1113 1114
1114 le = get_tx_le(sky2, &sky2->tx_prod); 1115 le = get_tx_le(sky2, &sky2->tx_prod);
1115 le->addr = 0; 1116 le->addr = 0;
@@ -1284,7 +1285,7 @@ static const uint32_t rss_init_key[10] = {
1284}; 1285};
1285 1286
1286/* Enable/disable receive hash calculation (RSS) */ 1287/* Enable/disable receive hash calculation (RSS) */
1287static void rx_set_rss(struct net_device *dev, u32 features) 1288static void rx_set_rss(struct net_device *dev, netdev_features_t features)
1288{ 1289{
1289 struct sky2_port *sky2 = netdev_priv(dev); 1290 struct sky2_port *sky2 = netdev_priv(dev);
1290 struct sky2_hw *hw = sky2->hw; 1291 struct sky2_hw *hw = sky2->hw;
@@ -1402,7 +1403,7 @@ static int sky2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1402 1403
1403#define SKY2_VLAN_OFFLOADS (NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO) 1404#define SKY2_VLAN_OFFLOADS (NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO)
1404 1405
1405static void sky2_vlan_mode(struct net_device *dev, u32 features) 1406static void sky2_vlan_mode(struct net_device *dev, netdev_features_t features)
1406{ 1407{
1407 struct sky2_port *sky2 = netdev_priv(dev); 1408 struct sky2_port *sky2 = netdev_priv(dev);
1408 struct sky2_hw *hw = sky2->hw; 1409 struct sky2_hw *hw = sky2->hw;
@@ -1971,6 +1972,7 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
1971 if (tx_avail(sky2) <= MAX_SKB_TX_LE) 1972 if (tx_avail(sky2) <= MAX_SKB_TX_LE)
1972 netif_stop_queue(dev); 1973 netif_stop_queue(dev);
1973 1974
1975 netdev_sent_queue(dev, skb->len);
1974 sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod); 1976 sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod);
1975 1977
1976 return NETDEV_TX_OK; 1978 return NETDEV_TX_OK;
@@ -2002,7 +2004,8 @@ mapping_error:
2002static void sky2_tx_complete(struct sky2_port *sky2, u16 done) 2004static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
2003{ 2005{
2004 struct net_device *dev = sky2->netdev; 2006 struct net_device *dev = sky2->netdev;
2005 unsigned idx; 2007 u16 idx;
2008 unsigned int bytes_compl = 0, pkts_compl = 0;
2006 2009
2007 BUG_ON(done >= sky2->tx_ring_size); 2010 BUG_ON(done >= sky2->tx_ring_size);
2008 2011
@@ -2017,10 +2020,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
2017 netif_printk(sky2, tx_done, KERN_DEBUG, dev, 2020 netif_printk(sky2, tx_done, KERN_DEBUG, dev,
2018 "tx done %u\n", idx); 2021 "tx done %u\n", idx);
2019 2022
2020 u64_stats_update_begin(&sky2->tx_stats.syncp); 2023 pkts_compl++;
2021 ++sky2->tx_stats.packets; 2024 bytes_compl += skb->len;
2022 sky2->tx_stats.bytes += skb->len;
2023 u64_stats_update_end(&sky2->tx_stats.syncp);
2024 2025
2025 re->skb = NULL; 2026 re->skb = NULL;
2026 dev_kfree_skb_any(skb); 2027 dev_kfree_skb_any(skb);
@@ -2031,6 +2032,13 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
2031 2032
2032 sky2->tx_cons = idx; 2033 sky2->tx_cons = idx;
2033 smp_mb(); 2034 smp_mb();
2035
2036 netdev_completed_queue(dev, pkts_compl, bytes_compl);
2037
2038 u64_stats_update_begin(&sky2->tx_stats.syncp);
2039 sky2->tx_stats.packets += pkts_compl;
2040 sky2->tx_stats.bytes += bytes_compl;
2041 u64_stats_update_end(&sky2->tx_stats.syncp);
2034} 2042}
2035 2043
2036static void sky2_tx_reset(struct sky2_hw *hw, unsigned port) 2044static void sky2_tx_reset(struct sky2_hw *hw, unsigned port)
@@ -3643,10 +3651,10 @@ static void sky2_get_drvinfo(struct net_device *dev,
3643{ 3651{
3644 struct sky2_port *sky2 = netdev_priv(dev); 3652 struct sky2_port *sky2 = netdev_priv(dev);
3645 3653
3646 strcpy(info->driver, DRV_NAME); 3654 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
3647 strcpy(info->version, DRV_VERSION); 3655 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
3648 strcpy(info->fw_version, "N/A"); 3656 strlcpy(info->bus_info, pci_name(sky2->hw->pdev),
3649 strcpy(info->bus_info, pci_name(sky2->hw->pdev)); 3657 sizeof(info->bus_info));
3650} 3658}
3651 3659
3652static const struct sky2_stat { 3660static const struct sky2_stat {
@@ -4311,7 +4319,8 @@ static int sky2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom
4311 return sky2_vpd_write(sky2->hw, cap, data, eeprom->offset, eeprom->len); 4319 return sky2_vpd_write(sky2->hw, cap, data, eeprom->offset, eeprom->len);
4312} 4320}
4313 4321
4314static u32 sky2_fix_features(struct net_device *dev, u32 features) 4322static netdev_features_t sky2_fix_features(struct net_device *dev,
4323 netdev_features_t features)
4315{ 4324{
4316 const struct sky2_port *sky2 = netdev_priv(dev); 4325 const struct sky2_port *sky2 = netdev_priv(dev);
4317 const struct sky2_hw *hw = sky2->hw; 4326 const struct sky2_hw *hw = sky2->hw;
@@ -4335,13 +4344,13 @@ static u32 sky2_fix_features(struct net_device *dev, u32 features)
4335 return features; 4344 return features;
4336} 4345}
4337 4346
4338static int sky2_set_features(struct net_device *dev, u32 features) 4347static int sky2_set_features(struct net_device *dev, netdev_features_t features)
4339{ 4348{
4340 struct sky2_port *sky2 = netdev_priv(dev); 4349 struct sky2_port *sky2 = netdev_priv(dev);
4341 u32 changed = dev->features ^ features; 4350 netdev_features_t changed = dev->features ^ features;
4342 4351
4343 if (changed & NETIF_F_RXCSUM) { 4352 if (changed & NETIF_F_RXCSUM) {
4344 u32 on = features & NETIF_F_RXCSUM; 4353 bool on = features & NETIF_F_RXCSUM;
4345 sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR), 4354 sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
4346 on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); 4355 on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM);
4347 } 4356 }