]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/s2io.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[linux-2.6-omap-h63xx.git] / drivers / net / s2io.c
index 62369341cb2c24a65519596d48ddf820b9d8cbab..f5c57c059bca15c7d9e35f0b26c39fb0551bc718 100644 (file)
@@ -352,9 +352,10 @@ static void do_s2io_copy_mac_addr(struct s2io_nic *sp, int offset, u64 mac_addr)
        sp->def_mac_addr[offset].mac_addr[1] = (u8) (mac_addr >> 32);
        sp->def_mac_addr[offset].mac_addr[0] = (u8) (mac_addr >> 40);
 }
+
 /* Add the vlan */
 static void s2io_vlan_rx_register(struct net_device *dev,
-                                       struct vlan_group *grp)
+                                 struct vlan_group *grp)
 {
        int i;
        struct s2io_nic *nic = netdev_priv(dev);
@@ -372,7 +373,7 @@ static void s2io_vlan_rx_register(struct net_device *dev,
 }
 
 /* Unregister the vlan */
-static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid)
+static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 {
        int i;
        struct s2io_nic *nic = netdev_priv(dev);
@@ -2851,7 +2852,7 @@ static int s2io_poll_msix(struct napi_struct *napi, int budget)
        s2io_chk_rx_buffers(nic, ring);
 
        if (pkts_processed < budget_org) {
-               netif_rx_complete(dev, napi);
+               netif_rx_complete(napi);
                /*Re Enable MSI-Rx Vector*/
                addr = (u8 __iomem *)&bar0->xmsi_mask_reg;
                addr += 7 - ring->ring_no;
@@ -2865,7 +2866,6 @@ static int s2io_poll_inta(struct napi_struct *napi, int budget)
 {
        struct s2io_nic *nic = container_of(napi, struct s2io_nic, napi);
        struct ring_info *ring;
-       struct net_device *dev = nic->dev;
        struct config_param *config;
        struct mac_info *mac_control;
        int pkts_processed = 0;
@@ -2889,7 +2889,7 @@ static int s2io_poll_inta(struct napi_struct *napi, int budget)
                        break;
        }
        if (pkts_processed < budget_org) {
-               netif_rx_complete(dev, napi);
+               netif_rx_complete(napi);
                /* Re enable the Rx interrupts for the ring */
                writeq(0, &bar0->rx_traffic_mask);
                readl(&bar0->rx_traffic_mask);
@@ -4329,7 +4329,6 @@ static irqreturn_t s2io_msix_ring_handle(int irq, void *dev_id)
        struct ring_info *ring = (struct ring_info *)dev_id;
        struct s2io_nic *sp = ring->nic;
        struct XENA_dev_config __iomem *bar0 = sp->bar0;
-       struct net_device *dev = sp->dev;
 
        if (unlikely(!is_s2io_card_up(sp)))
                return IRQ_HANDLED;
@@ -4343,7 +4342,7 @@ static irqreturn_t s2io_msix_ring_handle(int irq, void *dev_id)
                val8 = (ring->ring_no == 0) ? 0x7f : 0xff;
                writeb(val8, addr);
                val8 = readb(addr);
-               netif_rx_schedule(dev, &ring->napi);
+               netif_rx_schedule(&ring->napi);
        } else {
                rx_intr_handler(ring, 0);
                s2io_chk_rx_buffers(sp, ring);
@@ -4790,7 +4789,7 @@ static irqreturn_t s2io_isr(int irq, void *dev_id)
 
                if (config->napi) {
                        if (reason & GEN_INTR_RXTRAFFIC) {
-                               netif_rx_schedule(dev, &sp->napi);
+                               netif_rx_schedule(&sp->napi);
                                writeq(S2IO_MINUS_ONE, &bar0->rx_traffic_mask);
                                writeq(S2IO_MINUS_ONE, &bar0->rx_traffic_int);
                                readl(&bar0->rx_traffic_int);
@@ -5112,7 +5111,7 @@ static void s2io_set_multicast(struct net_device *dev)
 /* read from CAM unicast & multicast addresses and store it in
  * def_mac_addr structure
  */
-void do_s2io_store_unicast_mc(struct s2io_nic *sp)
+static void do_s2io_store_unicast_mc(struct s2io_nic *sp)
 {
        int offset;
        u64 mac_addr = 0x0;
@@ -7366,7 +7365,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)
        int ring_no = ring_data->ring_no;
        u16 l3_csum, l4_csum;
        unsigned long long err = rxdp->Control_1 & RXD_T_CODE;
-       struct lro *lro;
+       struct lro *uninitialized_var(lro);
        u8 err_mask;
 
        skb->dev = dev;
@@ -7717,6 +7716,24 @@ static int rts_ds_steer(struct s2io_nic *nic, u8 ds_codepoint, u8 ring)
                                S2IO_BIT_RESET);
 }
 
+static const struct net_device_ops s2io_netdev_ops = {
+       .ndo_open               = s2io_open,
+       .ndo_stop               = s2io_close,
+       .ndo_get_stats          = s2io_get_stats,
+       .ndo_start_xmit         = s2io_xmit,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_multicast_list = s2io_set_multicast,
+       .ndo_do_ioctl           = s2io_ioctl,
+       .ndo_set_mac_address    = s2io_set_mac_addr,
+       .ndo_change_mtu         = s2io_change_mtu,
+       .ndo_vlan_rx_register   = s2io_vlan_rx_register,
+       .ndo_vlan_rx_kill_vid   = s2io_vlan_rx_kill_vid,
+       .ndo_tx_timeout         = s2io_tx_watchdog,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = s2io_netpoll,
+#endif
+};
+
 /**
  *  s2io_init_nic - Initialization of the adapter .
  *  @pdev : structure containing the PCI related information of the device.
@@ -7942,26 +7959,9 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
        }
 
        /*  Driver entry points */
-       dev->open = &s2io_open;
-       dev->stop = &s2io_close;
-       dev->hard_start_xmit = &s2io_xmit;
-       dev->get_stats = &s2io_get_stats;
-       dev->set_multicast_list = &s2io_set_multicast;
-       dev->do_ioctl = &s2io_ioctl;
-       dev->set_mac_address = &s2io_set_mac_addr;
-       dev->change_mtu = &s2io_change_mtu;
+       dev->netdev_ops = &s2io_netdev_ops;
        SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
        dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-       dev->vlan_rx_register = s2io_vlan_rx_register;
-       dev->vlan_rx_kill_vid = (void *)s2io_vlan_rx_kill_vid;
-
-       /*
-        * will use eth_mac_addr() for  dev->set_mac_address
-        * mac address will be set every time dev->open() is called
-        */
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = s2io_netpoll;
-#endif
 
        dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
        if (sp->high_dma_flag == TRUE)
@@ -7972,7 +7972,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
                dev->features |= NETIF_F_UFO;
                dev->features |= NETIF_F_HW_CSUM;
        }
-       dev->tx_timeout = &s2io_tx_watchdog;
        dev->watchdog_timeo = WATCH_DOG_TIMEOUT;
        INIT_WORK(&sp->rst_timer_task, s2io_restart_nic);
        INIT_WORK(&sp->set_link_task, s2io_set_link);