aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r--drivers/net/s2io.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index df70657260dd..f155928bf14e 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -79,6 +79,7 @@
79#include <linux/tcp.h> 79#include <linux/tcp.h>
80#include <linux/uaccess.h> 80#include <linux/uaccess.h>
81#include <linux/io.h> 81#include <linux/io.h>
82#include <linux/slab.h>
82#include <net/tcp.h> 83#include <net/tcp.h>
83 84
84#include <asm/system.h> 85#include <asm/system.h>
@@ -2399,7 +2400,7 @@ static struct sk_buff *s2io_txdl_getskb(struct fifo_info *fifo_data,
2399 return NULL; 2400 return NULL;
2400 } 2401 }
2401 pci_unmap_single(nic->pdev, (dma_addr_t)txds->Buffer_Pointer, 2402 pci_unmap_single(nic->pdev, (dma_addr_t)txds->Buffer_Pointer,
2402 skb->len - skb->data_len, PCI_DMA_TODEVICE); 2403 skb_headlen(skb), PCI_DMA_TODEVICE);
2403 frg_cnt = skb_shinfo(skb)->nr_frags; 2404 frg_cnt = skb_shinfo(skb)->nr_frags;
2404 if (frg_cnt) { 2405 if (frg_cnt) {
2405 txds++; 2406 txds++;
@@ -4201,7 +4202,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4201 txdp->Control_2 |= TXD_VLAN_TAG(vlan_tag); 4202 txdp->Control_2 |= TXD_VLAN_TAG(vlan_tag);
4202 } 4203 }
4203 4204
4204 frg_len = skb->len - skb->data_len; 4205 frg_len = skb_headlen(skb);
4205 if (offload_type == SKB_GSO_UDP) { 4206 if (offload_type == SKB_GSO_UDP) {
4206 int ufo_size; 4207 int ufo_size;
4207 4208
@@ -4964,7 +4965,7 @@ static struct net_device_stats *s2io_get_stats(struct net_device *dev)
4964static void s2io_set_multicast(struct net_device *dev) 4965static void s2io_set_multicast(struct net_device *dev)
4965{ 4966{
4966 int i, j, prev_cnt; 4967 int i, j, prev_cnt;
4967 struct dev_mc_list *mclist; 4968 struct netdev_hw_addr *ha;
4968 struct s2io_nic *sp = netdev_priv(dev); 4969 struct s2io_nic *sp = netdev_priv(dev);
4969 struct XENA_dev_config __iomem *bar0 = sp->bar0; 4970 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4970 u64 val64 = 0, multi_mac = 0x010203040506ULL, mask = 4971 u64 val64 = 0, multi_mac = 0x010203040506ULL, mask =
@@ -5093,12 +5094,12 @@ static void s2io_set_multicast(struct net_device *dev)
5093 5094
5094 /* Create the new Rx filter list and update the same in H/W. */ 5095 /* Create the new Rx filter list and update the same in H/W. */
5095 i = 0; 5096 i = 0;
5096 netdev_for_each_mc_addr(mclist, dev) { 5097 netdev_for_each_mc_addr(ha, dev) {
5097 memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr, 5098 memcpy(sp->usr_addrs[i].addr, ha->addr,
5098 ETH_ALEN); 5099 ETH_ALEN);
5099 mac_addr = 0; 5100 mac_addr = 0;
5100 for (j = 0; j < ETH_ALEN; j++) { 5101 for (j = 0; j < ETH_ALEN; j++) {
5101 mac_addr |= mclist->dmi_addr[j]; 5102 mac_addr |= ha->addr[j];
5102 mac_addr <<= 8; 5103 mac_addr <<= 8;
5103 } 5104 }
5104 mac_addr >>= 8; 5105 mac_addr >>= 8;
@@ -5819,10 +5820,8 @@ static void s2io_vpd_read(struct s2io_nic *nic)
5819 } 5820 }
5820 } 5821 }
5821 5822
5822 if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) { 5823 if ((!fail) && (vpd_data[1] < VPD_STRING_LEN))
5823 memset(nic->product_name, 0, vpd_data[1]);
5824 memcpy(nic->product_name, &vpd_data[3], vpd_data[1]); 5824 memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);
5825 }
5826 kfree(vpd_data); 5825 kfree(vpd_data);
5827 swstats->mem_freed += 256; 5826 swstats->mem_freed += 256;
5828} 5827}