Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[pandora-kernel.git] / drivers / net / s2io.c
index df0d2c8..277d48b 100644 (file)
@@ -356,56 +356,6 @@ static void do_s2io_copy_mac_addr(struct s2io_nic *sp, int offset, u64 mac_addr)
        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)
-{
-       int i;
-       struct s2io_nic *nic = netdev_priv(dev);
-       unsigned long flags[MAX_TX_FIFOS];
-       struct config_param *config = &nic->config;
-       struct mac_info *mac_control = &nic->mac_control;
-
-       for (i = 0; i < config->tx_fifo_num; i++) {
-               struct fifo_info *fifo = &mac_control->fifos[i];
-
-               spin_lock_irqsave(&fifo->tx_lock, flags[i]);
-       }
-
-       nic->vlgrp = grp;
-
-       for (i = config->tx_fifo_num - 1; i >= 0; i--) {
-               struct fifo_info *fifo = &mac_control->fifos[i];
-
-               spin_unlock_irqrestore(&fifo->tx_lock, flags[i]);
-       }
-}
-
-/* Unregister the vlan */
-static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
-{
-       int i;
-       struct s2io_nic *nic = netdev_priv(dev);
-       unsigned long flags[MAX_TX_FIFOS];
-       struct config_param *config = &nic->config;
-       struct mac_info *mac_control = &nic->mac_control;
-
-       for (i = 0; i < config->tx_fifo_num; i++) {
-               struct fifo_info *fifo = &mac_control->fifos[i];
-
-               spin_lock_irqsave(&fifo->tx_lock, flags[i]);
-       }
-
-       if (nic->vlgrp)
-               vlan_group_set_device(nic->vlgrp, vid, NULL);
-
-       for (i = config->tx_fifo_num - 1; i >= 0; i--) {
-               struct fifo_info *fifo = &mac_control->fifos[i];
-
-               spin_unlock_irqrestore(&fifo->tx_lock, flags[i]);
-       }
-}
-
 /*
  * Constants to be programmed into the Xena's registers, to configure
  * the XAUI.
@@ -841,7 +791,7 @@ static int init_shared_mem(struct s2io_nic *nic)
                        tmp_p_addr = ring->rx_blocks[j].block_dma_addr;
                        tmp_p_addr_next = ring->rx_blocks[next].block_dma_addr;
 
-                       pre_rxd_blk = (struct RxD_block *)tmp_v_addr;
+                       pre_rxd_blk = tmp_v_addr;
                        pre_rxd_blk->reserved_2_pNext_RxD_block =
                                (unsigned long)tmp_v_addr_next;
                        pre_rxd_blk->pNext_RxD_Blk_physical =
@@ -918,7 +868,7 @@ static int init_shared_mem(struct s2io_nic *nic)
        mac_control->stats_mem_sz = size;
 
        tmp_v_addr = mac_control->stats_mem;
-       mac_control->stats_info = (struct stat_block *)tmp_v_addr;
+       mac_control->stats_info = tmp_v_addr;
        memset(tmp_v_addr, 0, size);
        DBG_PRINT(INIT_DBG, "%s: Ring Mem PHY: 0x%llx\n",
                dev_name(&nic->pdev->dev), (unsigned long long)tmp_p_addr);
@@ -2439,7 +2389,7 @@ static void free_tx_buffers(struct s2io_nic *nic)
 
                spin_lock_irqsave(&fifo->tx_lock, flags);
                for (j = 0; j < tx_cfg->fifo_len; j++) {
-                       txdp = (struct TxD *)fifo->list_info[j].list_virt_addr;
+                       txdp = fifo->list_info[j].list_virt_addr;
                        skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j);
                        if (skb) {
                                swstats->mem_freed += skb->truesize;
@@ -3075,8 +3025,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
 
        get_info = fifo_data->tx_curr_get_info;
        memcpy(&put_info, &fifo_data->tx_curr_put_info, sizeof(put_info));
-       txdlp = (struct TxD *)
-               fifo_data->list_info[get_info.offset].list_virt_addr;
+       txdlp = fifo_data->list_info[get_info.offset].list_virt_addr;
        while ((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) &&
               (get_info.offset != put_info.offset) &&
               (txdlp->Host_Control)) {
@@ -3129,8 +3078,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
                get_info.offset++;
                if (get_info.offset == get_info.fifo_len + 1)
                        get_info.offset = 0;
-               txdlp = (struct TxD *)
-                       fifo_data->list_info[get_info.offset].list_virt_addr;
+               txdlp = fifo_data->list_info[get_info.offset].list_virt_addr;
                fifo_data->tx_curr_get_info.offset = get_info.offset;
        }
 
@@ -4111,7 +4059,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
                        struct tcphdr *th;
                        ip = ip_hdr(skb);
 
-                       if ((ip->frag_off & htons(IP_OFFSET|IP_MF)) == 0) {
+                       if (!ip_is_fragment(ip)) {
                                th = (struct tcphdr *)(((unsigned char *)ip) +
                                                       ip->ihl*4);
 
@@ -4163,7 +4111,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
 
        put_off = (u16)fifo->tx_curr_put_info.offset;
        get_off = (u16)fifo->tx_curr_get_info.offset;
-       txdp = (struct TxD *)fifo->list_info[put_off].list_virt_addr;
+       txdp = fifo->list_info[put_off].list_virt_addr;
 
        queue_len = fifo->tx_curr_put_info.fifo_len + 1;
        /* Avoid "put" pointer going beyond "get" pointer */
@@ -7739,8 +7687,6 @@ static const struct net_device_ops s2io_netdev_ops = {
        .ndo_set_mac_address    = s2io_set_mac_addr,
        .ndo_change_mtu         = s2io_change_mtu,
        .ndo_set_features       = s2io_set_features,
-       .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,
@@ -7972,9 +7918,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
 
        /* Initializing the BAR1 address as the start of the FIFO pointer. */
        for (j = 0; j < MAX_TX_FIFOS; j++) {
-               mac_control->tx_FIFO_start[j] =
-                       (struct TxFIFO_element __iomem *)
-                       (sp->bar1 + (j * 0x00020000));
+               mac_control->tx_FIFO_start[j] = sp->bar1 + (j * 0x00020000);
        }
 
        /*  Driver entry points */
@@ -8621,18 +8565,12 @@ static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag)
        struct s2io_nic *sp = netdev_priv(dev);
 
        skb->protocol = eth_type_trans(skb, dev);
-       if (sp->vlgrp && vlan_tag && (sp->vlan_strip_flag)) {
-               /* Queueing the vlan frame to the upper layer */
-               if (sp->config.napi)
-                       vlan_hwaccel_receive_skb(skb, sp->vlgrp, vlan_tag);
-               else
-                       vlan_hwaccel_rx(skb, sp->vlgrp, vlan_tag);
-       } else {
-               if (sp->config.napi)
-                       netif_receive_skb(skb);
-               else
-                       netif_rx(skb);
-       }
+       if (vlan_tag && sp->vlan_strip_flag)
+               __vlan_hwaccel_put_tag(skb, vlan_tag);
+       if (sp->config.napi)
+               netif_receive_skb(skb);
+       else
+               netif_rx(skb);
 }
 
 static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro,