PCI: Change all drivers to use pci_device->revision
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / drivers / net / atl1 / atl1_main.c
index d28f88bbdd5fcd43634104f6d228c0ab874ed83e..501919eb7f5eab6242f28c682448f6f348839ecd 100644 (file)
@@ -118,10 +118,6 @@ static int __devinit atl1_sw_init(struct atl1_adapter *adapter)
 {
        struct atl1_hw *hw = &adapter->hw;
        struct net_device *netdev = adapter->netdev;
-       struct pci_dev *pdev = adapter->pdev;
-
-       /* PCI config space info */
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
 
        hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
        hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
@@ -634,14 +630,13 @@ static void atl1_intr_tx(struct atl1_adapter *adapter)
        struct atl1_buffer *buffer_info;
        u16 sw_tpd_next_to_clean;
        u16 cmb_tpd_next_to_clean;
-       u8 update = 0;
 
        sw_tpd_next_to_clean = atomic_read(&tpd_ring->next_to_clean);
        cmb_tpd_next_to_clean = le16_to_cpu(adapter->cmb.cmb->tpd_cons_idx);
 
        while (cmb_tpd_next_to_clean != sw_tpd_next_to_clean) {
                struct tx_packet_desc *tpd;
-               update = 1;
+
                tpd = ATL1_TPD_DESC(tpd_ring, sw_tpd_next_to_clean);
                buffer_info = &tpd_ring->buffer_info[sw_tpd_next_to_clean];
                if (buffer_info->dma) {
@@ -1229,39 +1224,9 @@ static void atl1_vlan_rx_register(struct net_device *netdev,
        spin_unlock_irqrestore(&adapter->lock, flags);
 }
 
-/* FIXME: justify or remove -- CHS */
-static void atl1_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
-{
-       /* We don't do Vlan filtering */
-       return;
-}
-
-/* FIXME: this looks wrong too -- CHS */
-static void atl1_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
-{
-       struct atl1_adapter *adapter = netdev_priv(netdev);
-       unsigned long flags;
-
-       spin_lock_irqsave(&adapter->lock, flags);
-       /* atl1_irq_disable(adapter); */
-       vlan_group_set_device(adapter->vlgrp, vid, NULL);
-       /* atl1_irq_enable(adapter); */
-       spin_unlock_irqrestore(&adapter->lock, flags);
-       /* We don't do Vlan filtering */
-       return;
-}
-
 static void atl1_restore_vlan(struct atl1_adapter *adapter)
 {
        atl1_vlan_rx_register(adapter->netdev, adapter->vlgrp);
-       if (adapter->vlgrp) {
-               u16 vid;
-               for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
-                       if (!vlan_group_get_device(adapter->vlgrp, vid))
-                               continue;
-                       atl1_vlan_rx_add_vid(adapter->netdev, vid);
-               }
-       }
 }
 
 static u16 tpd_avail(struct atl1_tpd_ring *tpd_ring)
@@ -2038,6 +2003,15 @@ static int atl1_close(struct net_device *netdev)
        return 0;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void atl1_poll_controller(struct net_device *netdev)
+{
+       disable_irq(netdev->irq);
+       atl1_intr(netdev->irq, netdev);
+       enable_irq(netdev->irq);
+}
+#endif
+
 /*
  * If TPD Buffer size equal to 0, PCIE DMAR_TO_INT
  * will assert. We do soft reset <0x1400=1> according
@@ -2190,9 +2164,11 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
        netdev->do_ioctl = &atl1_ioctl;
        netdev->tx_timeout = &atl1_tx_timeout;
        netdev->watchdog_timeo = 5 * HZ;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       netdev->poll_controller = atl1_poll_controller;
+#endif
        netdev->vlan_rx_register = atl1_vlan_rx_register;
-       netdev->vlan_rx_add_vid = atl1_vlan_rx_add_vid;
-       netdev->vlan_rx_kill_vid = atl1_vlan_rx_kill_vid;
+
        netdev->ethtool_ops = &atl1_ethtool_ops;
        adapter->bd_number = cards_found;
        adapter->pci_using_64 = pci_using_64;