diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/s2io.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r-- | drivers/net/s2io.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 0dd7839322bc..92ae8d3de39b 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> |
@@ -523,7 +524,7 @@ module_param_array(rts_frm_len, uint, NULL, 0); | |||
523 | * S2IO device table. | 524 | * S2IO device table. |
524 | * This table lists all the devices that this driver supports. | 525 | * This table lists all the devices that this driver supports. |
525 | */ | 526 | */ |
526 | static struct pci_device_id s2io_tbl[] __devinitdata = { | 527 | static DEFINE_PCI_DEVICE_TABLE(s2io_tbl) = { |
527 | {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_WIN, | 528 | {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_WIN, |
528 | PCI_ANY_ID, PCI_ANY_ID}, | 529 | PCI_ANY_ID, PCI_ANY_ID}, |
529 | {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_UNI, | 530 | {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_UNI, |
@@ -923,8 +924,8 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
923 | tmp_v_addr = mac_control->stats_mem; | 924 | tmp_v_addr = mac_control->stats_mem; |
924 | mac_control->stats_info = (struct stat_block *)tmp_v_addr; | 925 | mac_control->stats_info = (struct stat_block *)tmp_v_addr; |
925 | memset(tmp_v_addr, 0, size); | 926 | memset(tmp_v_addr, 0, size); |
926 | DBG_PRINT(INIT_DBG, "%s: Ring Mem PHY: 0x%llx\n", dev->name, | 927 | DBG_PRINT(INIT_DBG, "%s: Ring Mem PHY: 0x%llx\n", |
927 | (unsigned long long)tmp_p_addr); | 928 | dev_name(&nic->pdev->dev), (unsigned long long)tmp_p_addr); |
928 | mac_control->stats_info->sw_stat.mem_allocated += mem_allocated; | 929 | mac_control->stats_info->sw_stat.mem_allocated += mem_allocated; |
929 | return SUCCESS; | 930 | return SUCCESS; |
930 | } | 931 | } |
@@ -3238,7 +3239,7 @@ static u64 s2io_mdio_read(u32 mmd_type, u64 addr, struct net_device *dev) | |||
3238 | 3239 | ||
3239 | /** | 3240 | /** |
3240 | * s2io_chk_xpak_counter - Function to check the status of the xpak counters | 3241 | * s2io_chk_xpak_counter - Function to check the status of the xpak counters |
3241 | * @counter : couter value to be updated | 3242 | * @counter : counter value to be updated |
3242 | * @flag : flag to indicate the status | 3243 | * @flag : flag to indicate the status |
3243 | * @type : counter type | 3244 | * @type : counter type |
3244 | * Description: | 3245 | * Description: |
@@ -3421,7 +3422,7 @@ static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit, | |||
3421 | break; | 3422 | break; |
3422 | } | 3423 | } |
3423 | } else { | 3424 | } else { |
3424 | if (!(val64 & busy_bit)) { | 3425 | if (val64 & busy_bit) { |
3425 | ret = SUCCESS; | 3426 | ret = SUCCESS; |
3426 | break; | 3427 | break; |
3427 | } | 3428 | } |
@@ -3480,7 +3481,7 @@ static void s2io_reset(struct s2io_nic *sp) | |||
3480 | struct swStat *swstats; | 3481 | struct swStat *swstats; |
3481 | 3482 | ||
3482 | DBG_PRINT(INIT_DBG, "%s: Resetting XFrame card %s\n", | 3483 | DBG_PRINT(INIT_DBG, "%s: Resetting XFrame card %s\n", |
3483 | __func__, sp->dev->name); | 3484 | __func__, pci_name(sp->pdev)); |
3484 | 3485 | ||
3485 | /* Back up the PCI-X CMD reg, dont want to lose MMRBC, OST settings */ | 3486 | /* Back up the PCI-X CMD reg, dont want to lose MMRBC, OST settings */ |
3486 | pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, &(pci_cmd)); | 3487 | pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, &(pci_cmd)); |
@@ -5055,8 +5056,8 @@ static void s2io_set_multicast(struct net_device *dev) | |||
5055 | } | 5056 | } |
5056 | 5057 | ||
5057 | /* Update individual M_CAST address list */ | 5058 | /* Update individual M_CAST address list */ |
5058 | if ((!sp->m_cast_flg) && dev->mc_count) { | 5059 | if ((!sp->m_cast_flg) && netdev_mc_count(dev)) { |
5059 | if (dev->mc_count > | 5060 | if (netdev_mc_count(dev) > |
5060 | (config->max_mc_addr - config->max_mac_addr)) { | 5061 | (config->max_mc_addr - config->max_mac_addr)) { |
5061 | DBG_PRINT(ERR_DBG, | 5062 | DBG_PRINT(ERR_DBG, |
5062 | "%s: No more Rx filters can be added - " | 5063 | "%s: No more Rx filters can be added - " |
@@ -5066,7 +5067,7 @@ static void s2io_set_multicast(struct net_device *dev) | |||
5066 | } | 5067 | } |
5067 | 5068 | ||
5068 | prev_cnt = sp->mc_addr_count; | 5069 | prev_cnt = sp->mc_addr_count; |
5069 | sp->mc_addr_count = dev->mc_count; | 5070 | sp->mc_addr_count = netdev_mc_count(dev); |
5070 | 5071 | ||
5071 | /* Clear out the previous list of Mc in the H/W. */ | 5072 | /* Clear out the previous list of Mc in the H/W. */ |
5072 | for (i = 0; i < prev_cnt; i++) { | 5073 | for (i = 0; i < prev_cnt; i++) { |
@@ -5092,8 +5093,8 @@ static void s2io_set_multicast(struct net_device *dev) | |||
5092 | } | 5093 | } |
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 | for (i = 0, mclist = dev->mc_list; i < dev->mc_count; | 5096 | i = 0; |
5096 | i++, mclist = mclist->next) { | 5097 | netdev_for_each_mc_addr(mclist, dev) { |
5097 | memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr, | 5098 | memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr, |
5098 | ETH_ALEN); | 5099 | ETH_ALEN); |
5099 | mac_addr = 0; | 5100 | mac_addr = 0; |
@@ -5121,6 +5122,7 @@ static void s2io_set_multicast(struct net_device *dev) | |||
5121 | dev->name); | 5122 | dev->name); |
5122 | return; | 5123 | return; |
5123 | } | 5124 | } |
5125 | i++; | ||
5124 | } | 5126 | } |
5125 | } | 5127 | } |
5126 | } | 5128 | } |
@@ -5818,10 +5820,8 @@ static void s2io_vpd_read(struct s2io_nic *nic) | |||
5818 | } | 5820 | } |
5819 | } | 5821 | } |
5820 | 5822 | ||
5821 | if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) { | 5823 | if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) |
5822 | memset(nic->product_name, 0, vpd_data[1]); | ||
5823 | memcpy(nic->product_name, &vpd_data[3], vpd_data[1]); | 5824 | memcpy(nic->product_name, &vpd_data[3], vpd_data[1]); |
5824 | } | ||
5825 | kfree(vpd_data); | 5825 | kfree(vpd_data); |
5826 | swstats->mem_freed += 256; | 5826 | swstats->mem_freed += 256; |
5827 | } | 5827 | } |