[mv643xx] Add pci device table for auto module loading.
[firefly-linux-kernel-4.4.55.git] / drivers / net / mv643xx_eth.c
index 59de3e74d2d7662de775790ac43bb1542ae041e8..a4f861bf32d6dcbc3657cba409f25d2a5840e439 100644 (file)
@@ -74,7 +74,7 @@ static int ethernet_phy_detect(unsigned int eth_port_num);
 static int mv643xx_mdio_read(struct net_device *dev, int phy_id, int location);
 static void mv643xx_mdio_write(struct net_device *dev, int phy_id, int location, int val);
 static int mv643xx_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
-static struct ethtool_ops mv643xx_ethtool_ops;
+static const struct ethtool_ops mv643xx_ethtool_ops;
 
 static char mv643xx_driver_name[] = "mv643xx_eth";
 static char mv643xx_driver_version[] = "1.0";
@@ -507,8 +507,7 @@ static void mv643xx_eth_update_pscr(struct net_device *dev,
  * Output :    N/A
  */
 
-static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id,
-                                               struct pt_regs *regs)
+static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *)dev_id;
        struct mv643xx_private *mp = netdev_priv(dev);
@@ -1147,7 +1146,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
        desc->byte_cnt = length;
        desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);
 
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                BUG_ON(skb->protocol != ETH_P_IP);
 
                cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
@@ -1252,7 +1251,7 @@ static void mv643xx_netpoll(struct net_device *netdev)
        /* wait for previous write to complete */
        mv_read(MV643XX_ETH_INTERRUPT_MASK_REG(port_num));
 
-       mv643xx_eth_int_handler(netdev->irq, netdev, NULL);
+       mv643xx_eth_int_handler(netdev->irq, netdev);
 
        mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), ETH_INT_UNMASK_ALL);
 }
@@ -1558,6 +1557,12 @@ static void __exit mv643xx_cleanup_module(void)
 module_init(mv643xx_init_module);
 module_exit(mv643xx_cleanup_module);
 
+static struct pci_device_id pci_marvell_mv64360[] = {
+       { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_MV64360) },
+       {}
+};
+MODULE_DEVICE_TABLE(pci, pci_marvell_mv64360);
+
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR( "Rabeeh Khoury, Assaf Hoffman, Matthew Dharm, Manish Lachwani"
                " and Dale Farnsworth");
@@ -2156,7 +2161,7 @@ static void eth_update_mib_counters(struct mv643xx_private *mp)
        for (offset = ETH_MIB_BAD_OCTETS_RECEIVED;
                        offset <= ETH_MIB_FRAMES_1024_TO_MAX_OCTETS;
                        offset += 4)
-               *(u32 *)((char *)p + offset) = read_mib(mp, offset);
+               *(u32 *)((char *)p + offset) += read_mib(mp, offset);
 
        p->good_octets_sent += read_mib(mp, ETH_MIB_GOOD_OCTETS_SENT_LOW);
        p->good_octets_sent +=
@@ -2165,7 +2170,7 @@ static void eth_update_mib_counters(struct mv643xx_private *mp)
        for (offset = ETH_MIB_GOOD_FRAMES_SENT;
                        offset <= ETH_MIB_LATE_COLLISION;
                        offset += 4)
-               *(u32 *)((char *)p + offset) = read_mib(mp, offset);
+               *(u32 *)((char *)p + offset) += read_mib(mp, offset);
 }
 
 /*
@@ -2723,7 +2728,7 @@ static void mv643xx_get_ethtool_stats(struct net_device *netdev,
        eth_update_mib_counters(mp);
 
        for (i = 0; i < MV643XX_STATS_LEN; i++) {
-               char *p = (char *)mp+mv643xx_gstrings_stats[i].stat_offset;     
+               char *p = (char *)mp+mv643xx_gstrings_stats[i].stat_offset;
                data[i] = (mv643xx_gstrings_stats[i].sizeof_stat ==
                        sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p;
        }
@@ -2766,7 +2771,7 @@ static int mv643xx_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr, int c
        return generic_mii_ioctl(&mp->mii, if_mii(ifr), cmd, NULL);
 }
 
-static struct ethtool_ops mv643xx_ethtool_ops = {
+static const struct ethtool_ops mv643xx_ethtool_ops = {
        .get_settings           = mv643xx_get_settings,
        .set_settings           = mv643xx_set_settings,
        .get_drvinfo            = mv643xx_get_drvinfo,