Commit 0c61ed5f authored by Ramkrishna Vepa's avatar Ramkrishna Vepa Committed by Jeff Garzik

S2io: Remove unused variables

- Remove unused variables from s2io_nic structure

- Changed the memory failure printk messages to print only in debug mode

- Updated the copyright messages

(Resending; due to patch being corrupted)
Signed-off-by: default avatarSantosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 1e2b980f
/************************************************************************ /************************************************************************
* regs.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC * regs.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC
* Copyright(c) 2002-2005 Neterion Inc. * Copyright(c) 2002-2007 Neterion Inc.
* This software may be used and distributed according to the terms of * This software may be used and distributed according to the terms of
* the GNU General Public License (GPL), incorporated herein by reference. * the GNU General Public License (GPL), incorporated herein by reference.
......
/************************************************************************ /************************************************************************
* s2io.c: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC * s2io.c: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC
* Copyright(c) 2002-2005 Neterion Inc. * Copyright(c) 2002-2007 Neterion Inc.
* This software may be used and distributed according to the terms of * This software may be used and distributed according to the terms of
* the GNU General Public License (GPL), incorporated herein by reference. * the GNU General Public License (GPL), incorporated herein by reference.
...@@ -516,7 +516,7 @@ static int init_shared_mem(struct s2io_nic *nic) ...@@ -516,7 +516,7 @@ static int init_shared_mem(struct s2io_nic *nic)
mac_control->fifos[i].list_info = kmalloc(list_holder_size, mac_control->fifos[i].list_info = kmalloc(list_holder_size,
GFP_KERNEL); GFP_KERNEL);
if (!mac_control->fifos[i].list_info) { if (!mac_control->fifos[i].list_info) {
DBG_PRINT(ERR_DBG, DBG_PRINT(INFO_DBG,
"Malloc failed for list_info\n"); "Malloc failed for list_info\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -542,9 +542,9 @@ static int init_shared_mem(struct s2io_nic *nic) ...@@ -542,9 +542,9 @@ static int init_shared_mem(struct s2io_nic *nic)
tmp_v = pci_alloc_consistent(nic->pdev, tmp_v = pci_alloc_consistent(nic->pdev,
PAGE_SIZE, &tmp_p); PAGE_SIZE, &tmp_p);
if (!tmp_v) { if (!tmp_v) {
DBG_PRINT(ERR_DBG, DBG_PRINT(INFO_DBG,
"pci_alloc_consistent "); "pci_alloc_consistent ");
DBG_PRINT(ERR_DBG, "failed for TxDL\n"); DBG_PRINT(INFO_DBG, "failed for TxDL\n");
return -ENOMEM; return -ENOMEM;
} }
/* If we got a zero DMA address(can happen on /* If we got a zero DMA address(can happen on
...@@ -561,9 +561,9 @@ static int init_shared_mem(struct s2io_nic *nic) ...@@ -561,9 +561,9 @@ static int init_shared_mem(struct s2io_nic *nic)
tmp_v = pci_alloc_consistent(nic->pdev, tmp_v = pci_alloc_consistent(nic->pdev,
PAGE_SIZE, &tmp_p); PAGE_SIZE, &tmp_p);
if (!tmp_v) { if (!tmp_v) {
DBG_PRINT(ERR_DBG, DBG_PRINT(INFO_DBG,
"pci_alloc_consistent "); "pci_alloc_consistent ");
DBG_PRINT(ERR_DBG, "failed for TxDL\n"); DBG_PRINT(INFO_DBG, "failed for TxDL\n");
return -ENOMEM; return -ENOMEM;
} }
} }
...@@ -2187,7 +2187,7 @@ static int fill_rxd_3buf(struct s2io_nic *nic, struct RxD_t *rxdp, struct \ ...@@ -2187,7 +2187,7 @@ static int fill_rxd_3buf(struct s2io_nic *nic, struct RxD_t *rxdp, struct \
/* skb_shinfo(skb)->frag_list will have L4 data payload */ /* skb_shinfo(skb)->frag_list will have L4 data payload */
skb_shinfo(skb)->frag_list = dev_alloc_skb(dev->mtu + ALIGN_SIZE); skb_shinfo(skb)->frag_list = dev_alloc_skb(dev->mtu + ALIGN_SIZE);
if (skb_shinfo(skb)->frag_list == NULL) { if (skb_shinfo(skb)->frag_list == NULL) {
DBG_PRINT(ERR_DBG, "%s: dev_alloc_skb failed\n ", dev->name); DBG_PRINT(INFO_DBG, "%s: dev_alloc_skb failed\n ", dev->name);
return -ENOMEM ; return -ENOMEM ;
} }
frag_list = skb_shinfo(skb)->frag_list; frag_list = skb_shinfo(skb)->frag_list;
...@@ -2314,8 +2314,8 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) ...@@ -2314,8 +2314,8 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
/* allocate skb */ /* allocate skb */
skb = dev_alloc_skb(size); skb = dev_alloc_skb(size);
if(!skb) { if(!skb) {
DBG_PRINT(ERR_DBG, "%s: Out of ", dev->name); DBG_PRINT(INFO_DBG, "%s: Out of ", dev->name);
DBG_PRINT(ERR_DBG, "memory to allocate SKBs\n"); DBG_PRINT(INFO_DBG, "memory to allocate SKBs\n");
if (first_rxdp) { if (first_rxdp) {
wmb(); wmb();
first_rxdp->Control_1 |= RXD_OWN_XENA; first_rxdp->Control_1 |= RXD_OWN_XENA;
...@@ -2581,8 +2581,8 @@ static int s2io_poll(struct net_device *dev, int *budget) ...@@ -2581,8 +2581,8 @@ static int s2io_poll(struct net_device *dev, int *budget)
for (i = 0; i < config->rx_ring_num; i++) { for (i = 0; i < config->rx_ring_num; i++) {
if (fill_rx_buffers(nic, i) == -ENOMEM) { if (fill_rx_buffers(nic, i) == -ENOMEM) {
DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name); DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name);
DBG_PRINT(ERR_DBG, " in Rx Poll!!\n"); DBG_PRINT(INFO_DBG, " in Rx Poll!!\n");
break; break;
} }
} }
...@@ -2598,8 +2598,8 @@ no_rx: ...@@ -2598,8 +2598,8 @@ no_rx:
for (i = 0; i < config->rx_ring_num; i++) { for (i = 0; i < config->rx_ring_num; i++) {
if (fill_rx_buffers(nic, i) == -ENOMEM) { if (fill_rx_buffers(nic, i) == -ENOMEM) {
DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name); DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name);
DBG_PRINT(ERR_DBG, " in Rx Poll!!\n"); DBG_PRINT(INFO_DBG, " in Rx Poll!!\n");
break; break;
} }
} }
...@@ -2648,8 +2648,8 @@ static void s2io_netpoll(struct net_device *dev) ...@@ -2648,8 +2648,8 @@ static void s2io_netpoll(struct net_device *dev)
for (i = 0; i < config->rx_ring_num; i++) { for (i = 0; i < config->rx_ring_num; i++) {
if (fill_rx_buffers(nic, i) == -ENOMEM) { if (fill_rx_buffers(nic, i) == -ENOMEM) {
DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name); DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name);
DBG_PRINT(ERR_DBG, " in Rx Netpoll!!\n"); DBG_PRINT(INFO_DBG, " in Rx Netpoll!!\n");
break; break;
} }
} }
...@@ -3673,7 +3673,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic) ...@@ -3673,7 +3673,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
nic->entries = kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct msix_entry), nic->entries = kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct msix_entry),
GFP_KERNEL); GFP_KERNEL);
if (nic->entries == NULL) { if (nic->entries == NULL) {
DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", __FUNCTION__); DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
memset(nic->entries, 0, MAX_REQUESTED_MSI_X * sizeof(struct msix_entry)); memset(nic->entries, 0, MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
...@@ -3682,7 +3682,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic) ...@@ -3682,7 +3682,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry), kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry),
GFP_KERNEL); GFP_KERNEL);
if (nic->s2io_entries == NULL) { if (nic->s2io_entries == NULL) {
DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", __FUNCTION__); DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", __FUNCTION__);
kfree(nic->entries); kfree(nic->entries);
return -ENOMEM; return -ENOMEM;
} }
...@@ -4033,7 +4033,7 @@ static int s2io_chk_rx_buffers(struct s2io_nic *sp, int rng_n) ...@@ -4033,7 +4033,7 @@ static int s2io_chk_rx_buffers(struct s2io_nic *sp, int rng_n)
DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__); DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__);
DBG_PRINT(INTR_DBG, "PANIC levels\n"); DBG_PRINT(INTR_DBG, "PANIC levels\n");
if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) { if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) {
DBG_PRINT(ERR_DBG, "Out of memory in %s", DBG_PRINT(INFO_DBG, "Out of memory in %s",
__FUNCTION__); __FUNCTION__);
clear_bit(0, (&sp->tasklet_status)); clear_bit(0, (&sp->tasklet_status));
return -1; return -1;
...@@ -4043,8 +4043,8 @@ static int s2io_chk_rx_buffers(struct s2io_nic *sp, int rng_n) ...@@ -4043,8 +4043,8 @@ static int s2io_chk_rx_buffers(struct s2io_nic *sp, int rng_n)
tasklet_schedule(&sp->task); tasklet_schedule(&sp->task);
} else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) { } else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) {
DBG_PRINT(ERR_DBG, "%s:Out of memory", sp->dev->name); DBG_PRINT(INFO_DBG, "%s:Out of memory", sp->dev->name);
DBG_PRINT(ERR_DBG, " in Rx Intr!!\n"); DBG_PRINT(INFO_DBG, " in Rx Intr!!\n");
} }
return 0; return 0;
} }
...@@ -5961,12 +5961,12 @@ static void s2io_tasklet(unsigned long dev_addr) ...@@ -5961,12 +5961,12 @@ static void s2io_tasklet(unsigned long dev_addr)
for (i = 0; i < config->rx_ring_num; i++) { for (i = 0; i < config->rx_ring_num; i++) {
ret = fill_rx_buffers(sp, i); ret = fill_rx_buffers(sp, i);
if (ret == -ENOMEM) { if (ret == -ENOMEM) {
DBG_PRINT(ERR_DBG, "%s: Out of ", DBG_PRINT(INFO_DBG, "%s: Out of ",
dev->name); dev->name);
DBG_PRINT(ERR_DBG, "memory in tasklet\n"); DBG_PRINT(ERR_DBG, "memory in tasklet\n");
break; break;
} else if (ret == -EFILL) { } else if (ret == -EFILL) {
DBG_PRINT(ERR_DBG, DBG_PRINT(INFO_DBG,
"%s: Rx Ring %d is full\n", "%s: Rx Ring %d is full\n",
dev->name, i); dev->name, i);
break; break;
...@@ -6077,8 +6077,8 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, ...@@ -6077,8 +6077,8 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
} else { } else {
*skb = dev_alloc_skb(size); *skb = dev_alloc_skb(size);
if (!(*skb)) { if (!(*skb)) {
DBG_PRINT(ERR_DBG, "%s: Out of ", dev->name); DBG_PRINT(INFO_DBG, "%s: Out of ", dev->name);
DBG_PRINT(ERR_DBG, "memory to allocate SKBs\n"); DBG_PRINT(INFO_DBG, "memory to allocate SKBs\n");
return -ENOMEM ; return -ENOMEM ;
} }
/* storing the mapped addr in a temp variable /* storing the mapped addr in a temp variable
...@@ -6100,7 +6100,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, ...@@ -6100,7 +6100,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
} else { } else {
*skb = dev_alloc_skb(size); *skb = dev_alloc_skb(size);
if (!(*skb)) { if (!(*skb)) {
DBG_PRINT(ERR_DBG, "%s: dev_alloc_skb failed\n", DBG_PRINT(INFO_DBG, "%s: dev_alloc_skb failed\n",
dev->name); dev->name);
return -ENOMEM; return -ENOMEM;
} }
...@@ -6127,7 +6127,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, ...@@ -6127,7 +6127,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
} else { } else {
*skb = dev_alloc_skb(size); *skb = dev_alloc_skb(size);
if (!(*skb)) { if (!(*skb)) {
DBG_PRINT(ERR_DBG, "%s: dev_alloc_skb failed\n", DBG_PRINT(INFO_DBG, "%s: dev_alloc_skb failed\n",
dev->name); dev->name);
return -ENOMEM; return -ENOMEM;
} }
...@@ -6628,7 +6628,6 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp) ...@@ -6628,7 +6628,6 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)
/* Updating statistics */ /* Updating statistics */
rxdp->Host_Control = 0; rxdp->Host_Control = 0;
sp->rx_pkt_count++;
sp->stats.rx_packets++; sp->stats.rx_packets++;
if (sp->rxd_mode == RXD_MODE_1) { if (sp->rxd_mode == RXD_MODE_1) {
int len = RXD_GET_BUFFER0_SIZE_1(rxdp->Control_2); int len = RXD_GET_BUFFER0_SIZE_1(rxdp->Control_2);
...@@ -7264,7 +7263,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) ...@@ -7264,7 +7263,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
goto register_failed; goto register_failed;
} }
s2io_vpd_read(sp); s2io_vpd_read(sp);
DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2005 Neterion Inc.\n"); DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2007 Neterion Inc.\n");
DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name, DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name,
sp->product_name, get_xena_rev_id(sp->pdev)); sp->product_name, get_xena_rev_id(sp->pdev));
DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name,
......
/************************************************************************ /************************************************************************
* s2io.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC * s2io.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC
* Copyright(c) 2002-2005 Neterion Inc. * Copyright(c) 2002-2007 Neterion Inc.
* This software may be used and distributed according to the terms of * This software may be used and distributed according to the terms of
* the GNU General Public License (GPL), incorporated herein by reference. * the GNU General Public License (GPL), incorporated herein by reference.
...@@ -760,7 +760,6 @@ struct s2io_nic { ...@@ -760,7 +760,6 @@ struct s2io_nic {
#define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED #define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED
struct mac_addr def_mac_addr[MAX_MAC_SUPPORTED]; struct mac_addr def_mac_addr[MAX_MAC_SUPPORTED];
struct mac_addr pre_mac_addr[MAX_MAC_SUPPORTED];
struct net_device_stats stats; struct net_device_stats stats;
int high_dma_flag; int high_dma_flag;
...@@ -794,11 +793,6 @@ struct s2io_nic { ...@@ -794,11 +793,6 @@ struct s2io_nic {
u16 all_multi_pos; u16 all_multi_pos;
u16 promisc_flg; u16 promisc_flg;
u16 tx_pkt_count;
u16 rx_pkt_count;
u16 tx_err_count;
u16 rx_err_count;
/* Id timer, used to blink NIC to physically identify NIC. */ /* Id timer, used to blink NIC to physically identify NIC. */
struct timer_list id_timer; struct timer_list id_timer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment