igb: convert to net_device_ops
[deliverable/linux.git] / drivers / net / igb / igb_main.c
index 1f397cd99414dd51293b5d5dadfec1905c52fa19..1026ef402d47d562d5467e717c9325ff43e44996 100644 (file)
@@ -950,6 +950,24 @@ static int igb_is_need_ioport(struct pci_dev *pdev)
        }
 }
 
+static const struct net_device_ops igb_netdev_ops = {
+       .ndo_open               = igb_open,
+       .ndo_stop               = igb_close,
+       .ndo_get_stats          = igb_get_stats,
+       .ndo_set_multicast_list = igb_set_multi,
+       .ndo_set_mac_address    = igb_set_mac,
+       .ndo_change_mtu         = igb_change_mtu,
+       .ndo_do_ioctl           = igb_ioctl,
+       .ndo_tx_timeout         = igb_tx_timeout,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_vlan_rx_register   = igb_vlan_rx_register,
+       .ndo_vlan_rx_add_vid    = igb_vlan_rx_add_vid,
+       .ndo_vlan_rx_kill_vid   = igb_vlan_rx_kill_vid,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = igb_netpoll,
+#endif
+};
+
 /**
  * igb_probe - Device Initialization Routine
  * @pdev: PCI device information struct
@@ -1019,10 +1037,9 @@ static int __devinit igb_probe(struct pci_dev *pdev,
                        state &= ~PCIE_LINK_STATE_L0S;
                        pci_write_config_word(us_dev, pos + PCI_EXP_LNKCTL,
                                              state);
-                       printk(KERN_INFO "Disabling ASPM L0s upstream switch "
-                              "port %x:%x.%x\n", us_dev->bus->number,
-                              PCI_SLOT(us_dev->devfn),
-                              PCI_FUNC(us_dev->devfn));
+                       dev_info(&pdev->dev,
+                                "Disabling ASPM L0s upstream switch port %s\n",
+                                pci_name(us_dev));
                }
        default:
                break;
@@ -1060,22 +1077,9 @@ static int __devinit igb_probe(struct pci_dev *pdev,
        if (!adapter->hw.hw_addr)
                goto err_ioremap;
 
-       netdev->open = &igb_open;
-       netdev->stop = &igb_close;
-       netdev->get_stats = &igb_get_stats;
-       netdev->set_multicast_list = &igb_set_multi;
-       netdev->set_mac_address = &igb_set_mac;
-       netdev->change_mtu = &igb_change_mtu;
-       netdev->do_ioctl = &igb_ioctl;
+       netdev->netdev_ops = &igb_netdev_ops;
        igb_set_ethtool_ops(netdev);
-       netdev->tx_timeout = &igb_tx_timeout;
        netdev->watchdog_timeo = 5 * HZ;
-       netdev->vlan_rx_register = igb_vlan_rx_register;
-       netdev->vlan_rx_add_vid = igb_vlan_rx_add_vid;
-       netdev->vlan_rx_kill_vid = igb_vlan_rx_kill_vid;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       netdev->poll_controller = igb_netpoll;
-#endif
        netdev->hard_start_xmit = &igb_xmit_frame_adv;
 
        strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
@@ -1244,6 +1248,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 
        /* initialize the wol settings based on the eeprom settings */
        adapter->wol = adapter->eeprom_wol;
+       device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
 
        /* reset the hardware with the new settings */
        igb_reset(adapter);
@@ -1275,16 +1280,14 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 
        dev_info(&pdev->dev, "Intel(R) Gigabit Ethernet Network Connection\n");
        /* print bus type/speed/width info */
-       dev_info(&pdev->dev,
-                "%s: (PCIe:%s:%s) %02x:%02x:%02x:%02x:%02x:%02x\n",
+       dev_info(&pdev->dev, "%s: (PCIe:%s:%s) %pM\n",
                 netdev->name,
                 ((hw->bus.speed == e1000_bus_speed_2500)
                  ? "2.5Gb/s" : "unknown"),
                 ((hw->bus.width == e1000_bus_width_pcie_x4)
                  ? "Width x4" : (hw->bus.width == e1000_bus_width_pcie_x1)
                  ? "Width x1" : "unknown"),
-                netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
-                netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
+                netdev->dev_addr);
 
        igb_read_part_num(hw, &part_num);
        dev_info(&pdev->dev, "%s: PBA No: %06x-%03x\n", netdev->name,
@@ -3942,8 +3945,6 @@ send_up:
 
                igb_receive_skb(rx_ring, staterr, rx_desc, skb);
 
-               netdev->last_rx = jiffies;
-
 next_desc:
                rx_desc->wb.upper.status_error = 0;
 
This page took 0.026343 seconds and 5 git commands to generate.