diff options
author | Ramkrishna Vepa <ram.vepa@neterion.com> | 2007-03-09 21:28:32 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 11:01:01 -0400 |
commit | 0c61ed5fe2c36b502a716a2ea3dd24e846029287 (patch) | |
tree | d840f706be1e43f13b85a1d7f8759eda32b7c1ef | |
parent | 1e2b980fdfb6189baa779ba7de93f7dba70aa3fd (diff) |
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: Santosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/s2io-regs.h | 2 | ||||
-rw-r--r-- | drivers/net/s2io.c | 55 | ||||
-rw-r--r-- | drivers/net/s2io.h | 8 |
3 files changed, 29 insertions, 36 deletions
diff --git a/drivers/net/s2io-regs.h b/drivers/net/s2io-regs.h index 33fb7f3b7041..4cb710bbe729 100644 --- a/drivers/net/s2io-regs.h +++ b/drivers/net/s2io-regs.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /************************************************************************ | 1 | /************************************************************************ |
2 | * regs.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC | 2 | * regs.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC |
3 | * Copyright(c) 2002-2005 Neterion Inc. | 3 | * Copyright(c) 2002-2007 Neterion Inc. |
4 | 4 | ||
5 | * This software may be used and distributed according to the terms of | 5 | * This software may be used and distributed according to the terms of |
6 | * the GNU General Public License (GPL), incorporated herein by reference. | 6 | * the GNU General Public License (GPL), incorporated herein by reference. |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 049060cb6a05..983f38313d87 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /************************************************************************ | 1 | /************************************************************************ |
2 | * s2io.c: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC | 2 | * s2io.c: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC |
3 | * Copyright(c) 2002-2005 Neterion Inc. | 3 | * Copyright(c) 2002-2007 Neterion Inc. |
4 | 4 | ||
5 | * This software may be used and distributed according to the terms of | 5 | * This software may be used and distributed according to the terms of |
6 | * the GNU General Public License (GPL), incorporated herein by reference. | 6 | * the GNU General Public License (GPL), incorporated herein by reference. |
@@ -516,7 +516,7 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
516 | mac_control->fifos[i].list_info = kmalloc(list_holder_size, | 516 | mac_control->fifos[i].list_info = kmalloc(list_holder_size, |
517 | GFP_KERNEL); | 517 | GFP_KERNEL); |
518 | if (!mac_control->fifos[i].list_info) { | 518 | if (!mac_control->fifos[i].list_info) { |
519 | DBG_PRINT(ERR_DBG, | 519 | DBG_PRINT(INFO_DBG, |
520 | "Malloc failed for list_info\n"); | 520 | "Malloc failed for list_info\n"); |
521 | return -ENOMEM; | 521 | return -ENOMEM; |
522 | } | 522 | } |
@@ -542,9 +542,9 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
542 | tmp_v = pci_alloc_consistent(nic->pdev, | 542 | tmp_v = pci_alloc_consistent(nic->pdev, |
543 | PAGE_SIZE, &tmp_p); | 543 | PAGE_SIZE, &tmp_p); |
544 | if (!tmp_v) { | 544 | if (!tmp_v) { |
545 | DBG_PRINT(ERR_DBG, | 545 | DBG_PRINT(INFO_DBG, |
546 | "pci_alloc_consistent "); | 546 | "pci_alloc_consistent "); |
547 | DBG_PRINT(ERR_DBG, "failed for TxDL\n"); | 547 | DBG_PRINT(INFO_DBG, "failed for TxDL\n"); |
548 | return -ENOMEM; | 548 | return -ENOMEM; |
549 | } | 549 | } |
550 | /* If we got a zero DMA address(can happen on | 550 | /* If we got a zero DMA address(can happen on |
@@ -561,9 +561,9 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
561 | tmp_v = pci_alloc_consistent(nic->pdev, | 561 | tmp_v = pci_alloc_consistent(nic->pdev, |
562 | PAGE_SIZE, &tmp_p); | 562 | PAGE_SIZE, &tmp_p); |
563 | if (!tmp_v) { | 563 | if (!tmp_v) { |
564 | DBG_PRINT(ERR_DBG, | 564 | DBG_PRINT(INFO_DBG, |
565 | "pci_alloc_consistent "); | 565 | "pci_alloc_consistent "); |
566 | DBG_PRINT(ERR_DBG, "failed for TxDL\n"); | 566 | DBG_PRINT(INFO_DBG, "failed for TxDL\n"); |
567 | return -ENOMEM; | 567 | return -ENOMEM; |
568 | } | 568 | } |
569 | } | 569 | } |
@@ -2187,7 +2187,7 @@ static int fill_rxd_3buf(struct s2io_nic *nic, struct RxD_t *rxdp, struct \ | |||
2187 | /* skb_shinfo(skb)->frag_list will have L4 data payload */ | 2187 | /* skb_shinfo(skb)->frag_list will have L4 data payload */ |
2188 | skb_shinfo(skb)->frag_list = dev_alloc_skb(dev->mtu + ALIGN_SIZE); | 2188 | skb_shinfo(skb)->frag_list = dev_alloc_skb(dev->mtu + ALIGN_SIZE); |
2189 | if (skb_shinfo(skb)->frag_list == NULL) { | 2189 | if (skb_shinfo(skb)->frag_list == NULL) { |
2190 | DBG_PRINT(ERR_DBG, "%s: dev_alloc_skb failed\n ", dev->name); | 2190 | DBG_PRINT(INFO_DBG, "%s: dev_alloc_skb failed\n ", dev->name); |
2191 | return -ENOMEM ; | 2191 | return -ENOMEM ; |
2192 | } | 2192 | } |
2193 | frag_list = skb_shinfo(skb)->frag_list; | 2193 | frag_list = skb_shinfo(skb)->frag_list; |
@@ -2314,8 +2314,8 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) | |||
2314 | /* allocate skb */ | 2314 | /* allocate skb */ |
2315 | skb = dev_alloc_skb(size); | 2315 | skb = dev_alloc_skb(size); |
2316 | if(!skb) { | 2316 | if(!skb) { |
2317 | DBG_PRINT(ERR_DBG, "%s: Out of ", dev->name); | 2317 | DBG_PRINT(INFO_DBG, "%s: Out of ", dev->name); |
2318 | DBG_PRINT(ERR_DBG, "memory to allocate SKBs\n"); | 2318 | DBG_PRINT(INFO_DBG, "memory to allocate SKBs\n"); |
2319 | if (first_rxdp) { | 2319 | if (first_rxdp) { |
2320 | wmb(); | 2320 | wmb(); |
2321 | first_rxdp->Control_1 |= RXD_OWN_XENA; | 2321 | first_rxdp->Control_1 |= RXD_OWN_XENA; |
@@ -2581,8 +2581,8 @@ static int s2io_poll(struct net_device *dev, int *budget) | |||
2581 | 2581 | ||
2582 | for (i = 0; i < config->rx_ring_num; i++) { | 2582 | for (i = 0; i < config->rx_ring_num; i++) { |
2583 | if (fill_rx_buffers(nic, i) == -ENOMEM) { | 2583 | if (fill_rx_buffers(nic, i) == -ENOMEM) { |
2584 | DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name); | 2584 | DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name); |
2585 | DBG_PRINT(ERR_DBG, " in Rx Poll!!\n"); | 2585 | DBG_PRINT(INFO_DBG, " in Rx Poll!!\n"); |
2586 | break; | 2586 | break; |
2587 | } | 2587 | } |
2588 | } | 2588 | } |
@@ -2598,8 +2598,8 @@ no_rx: | |||
2598 | 2598 | ||
2599 | for (i = 0; i < config->rx_ring_num; i++) { | 2599 | for (i = 0; i < config->rx_ring_num; i++) { |
2600 | if (fill_rx_buffers(nic, i) == -ENOMEM) { | 2600 | if (fill_rx_buffers(nic, i) == -ENOMEM) { |
2601 | DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name); | 2601 | DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name); |
2602 | DBG_PRINT(ERR_DBG, " in Rx Poll!!\n"); | 2602 | DBG_PRINT(INFO_DBG, " in Rx Poll!!\n"); |
2603 | break; | 2603 | break; |
2604 | } | 2604 | } |
2605 | } | 2605 | } |
@@ -2648,8 +2648,8 @@ static void s2io_netpoll(struct net_device *dev) | |||
2648 | 2648 | ||
2649 | for (i = 0; i < config->rx_ring_num; i++) { | 2649 | for (i = 0; i < config->rx_ring_num; i++) { |
2650 | if (fill_rx_buffers(nic, i) == -ENOMEM) { | 2650 | if (fill_rx_buffers(nic, i) == -ENOMEM) { |
2651 | DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name); | 2651 | DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name); |
2652 | DBG_PRINT(ERR_DBG, " in Rx Netpoll!!\n"); | 2652 | DBG_PRINT(INFO_DBG, " in Rx Netpoll!!\n"); |
2653 | break; | 2653 | break; |
2654 | } | 2654 | } |
2655 | } | 2655 | } |
@@ -3673,7 +3673,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic) | |||
3673 | nic->entries = kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct msix_entry), | 3673 | nic->entries = kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct msix_entry), |
3674 | GFP_KERNEL); | 3674 | GFP_KERNEL); |
3675 | if (nic->entries == NULL) { | 3675 | if (nic->entries == NULL) { |
3676 | DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", __FUNCTION__); | 3676 | DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", __FUNCTION__); |
3677 | return -ENOMEM; | 3677 | return -ENOMEM; |
3678 | } | 3678 | } |
3679 | memset(nic->entries, 0, MAX_REQUESTED_MSI_X * sizeof(struct msix_entry)); | 3679 | 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 | kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry), | 3682 | kmalloc(MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry), |
3683 | GFP_KERNEL); | 3683 | GFP_KERNEL); |
3684 | if (nic->s2io_entries == NULL) { | 3684 | if (nic->s2io_entries == NULL) { |
3685 | DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", __FUNCTION__); | 3685 | DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", __FUNCTION__); |
3686 | kfree(nic->entries); | 3686 | kfree(nic->entries); |
3687 | return -ENOMEM; | 3687 | return -ENOMEM; |
3688 | } | 3688 | } |
@@ -4033,7 +4033,7 @@ static int s2io_chk_rx_buffers(struct s2io_nic *sp, int rng_n) | |||
4033 | DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__); | 4033 | DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__); |
4034 | DBG_PRINT(INTR_DBG, "PANIC levels\n"); | 4034 | DBG_PRINT(INTR_DBG, "PANIC levels\n"); |
4035 | if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) { | 4035 | if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) { |
4036 | DBG_PRINT(ERR_DBG, "Out of memory in %s", | 4036 | DBG_PRINT(INFO_DBG, "Out of memory in %s", |
4037 | __FUNCTION__); | 4037 | __FUNCTION__); |
4038 | clear_bit(0, (&sp->tasklet_status)); | 4038 | clear_bit(0, (&sp->tasklet_status)); |
4039 | return -1; | 4039 | return -1; |
@@ -4043,8 +4043,8 @@ static int s2io_chk_rx_buffers(struct s2io_nic *sp, int rng_n) | |||
4043 | tasklet_schedule(&sp->task); | 4043 | tasklet_schedule(&sp->task); |
4044 | 4044 | ||
4045 | } else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) { | 4045 | } else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) { |
4046 | DBG_PRINT(ERR_DBG, "%s:Out of memory", sp->dev->name); | 4046 | DBG_PRINT(INFO_DBG, "%s:Out of memory", sp->dev->name); |
4047 | DBG_PRINT(ERR_DBG, " in Rx Intr!!\n"); | 4047 | DBG_PRINT(INFO_DBG, " in Rx Intr!!\n"); |
4048 | } | 4048 | } |
4049 | return 0; | 4049 | return 0; |
4050 | } | 4050 | } |
@@ -5961,12 +5961,12 @@ static void s2io_tasklet(unsigned long dev_addr) | |||
5961 | for (i = 0; i < config->rx_ring_num; i++) { | 5961 | for (i = 0; i < config->rx_ring_num; i++) { |
5962 | ret = fill_rx_buffers(sp, i); | 5962 | ret = fill_rx_buffers(sp, i); |
5963 | if (ret == -ENOMEM) { | 5963 | if (ret == -ENOMEM) { |
5964 | DBG_PRINT(ERR_DBG, "%s: Out of ", | 5964 | DBG_PRINT(INFO_DBG, "%s: Out of ", |
5965 | dev->name); | 5965 | dev->name); |
5966 | DBG_PRINT(ERR_DBG, "memory in tasklet\n"); | 5966 | DBG_PRINT(ERR_DBG, "memory in tasklet\n"); |
5967 | break; | 5967 | break; |
5968 | } else if (ret == -EFILL) { | 5968 | } else if (ret == -EFILL) { |
5969 | DBG_PRINT(ERR_DBG, | 5969 | DBG_PRINT(INFO_DBG, |
5970 | "%s: Rx Ring %d is full\n", | 5970 | "%s: Rx Ring %d is full\n", |
5971 | dev->name, i); | 5971 | dev->name, i); |
5972 | break; | 5972 | break; |
@@ -6077,8 +6077,8 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, | |||
6077 | } else { | 6077 | } else { |
6078 | *skb = dev_alloc_skb(size); | 6078 | *skb = dev_alloc_skb(size); |
6079 | if (!(*skb)) { | 6079 | if (!(*skb)) { |
6080 | DBG_PRINT(ERR_DBG, "%s: Out of ", dev->name); | 6080 | DBG_PRINT(INFO_DBG, "%s: Out of ", dev->name); |
6081 | DBG_PRINT(ERR_DBG, "memory to allocate SKBs\n"); | 6081 | DBG_PRINT(INFO_DBG, "memory to allocate SKBs\n"); |
6082 | return -ENOMEM ; | 6082 | return -ENOMEM ; |
6083 | } | 6083 | } |
6084 | /* storing the mapped addr in a temp variable | 6084 | /* 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 | } else { | 6100 | } else { |
6101 | *skb = dev_alloc_skb(size); | 6101 | *skb = dev_alloc_skb(size); |
6102 | if (!(*skb)) { | 6102 | if (!(*skb)) { |
6103 | DBG_PRINT(ERR_DBG, "%s: dev_alloc_skb failed\n", | 6103 | DBG_PRINT(INFO_DBG, "%s: dev_alloc_skb failed\n", |
6104 | dev->name); | 6104 | dev->name); |
6105 | return -ENOMEM; | 6105 | return -ENOMEM; |
6106 | } | 6106 | } |
@@ -6127,7 +6127,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, | |||
6127 | } else { | 6127 | } else { |
6128 | *skb = dev_alloc_skb(size); | 6128 | *skb = dev_alloc_skb(size); |
6129 | if (!(*skb)) { | 6129 | if (!(*skb)) { |
6130 | DBG_PRINT(ERR_DBG, "%s: dev_alloc_skb failed\n", | 6130 | DBG_PRINT(INFO_DBG, "%s: dev_alloc_skb failed\n", |
6131 | dev->name); | 6131 | dev->name); |
6132 | return -ENOMEM; | 6132 | return -ENOMEM; |
6133 | } | 6133 | } |
@@ -6628,7 +6628,6 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp) | |||
6628 | 6628 | ||
6629 | /* Updating statistics */ | 6629 | /* Updating statistics */ |
6630 | rxdp->Host_Control = 0; | 6630 | rxdp->Host_Control = 0; |
6631 | sp->rx_pkt_count++; | ||
6632 | sp->stats.rx_packets++; | 6631 | sp->stats.rx_packets++; |
6633 | if (sp->rxd_mode == RXD_MODE_1) { | 6632 | if (sp->rxd_mode == RXD_MODE_1) { |
6634 | int len = RXD_GET_BUFFER0_SIZE_1(rxdp->Control_2); | 6633 | 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 | goto register_failed; | 7263 | goto register_failed; |
7265 | } | 7264 | } |
7266 | s2io_vpd_read(sp); | 7265 | s2io_vpd_read(sp); |
7267 | DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2005 Neterion Inc.\n"); | 7266 | DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2007 Neterion Inc.\n"); |
7268 | DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name, | 7267 | DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name, |
7269 | sp->product_name, get_xena_rev_id(sp->pdev)); | 7268 | sp->product_name, get_xena_rev_id(sp->pdev)); |
7270 | DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, | 7269 | DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 803137ca4b6c..a656d18b33df 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /************************************************************************ | 1 | /************************************************************************ |
2 | * s2io.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC | 2 | * s2io.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC |
3 | * Copyright(c) 2002-2005 Neterion Inc. | 3 | * Copyright(c) 2002-2007 Neterion Inc. |
4 | 4 | ||
5 | * This software may be used and distributed according to the terms of | 5 | * This software may be used and distributed according to the terms of |
6 | * the GNU General Public License (GPL), incorporated herein by reference. | 6 | * the GNU General Public License (GPL), incorporated herein by reference. |
@@ -760,7 +760,6 @@ struct s2io_nic { | |||
760 | #define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED | 760 | #define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED |
761 | 761 | ||
762 | struct mac_addr def_mac_addr[MAX_MAC_SUPPORTED]; | 762 | struct mac_addr def_mac_addr[MAX_MAC_SUPPORTED]; |
763 | struct mac_addr pre_mac_addr[MAX_MAC_SUPPORTED]; | ||
764 | 763 | ||
765 | struct net_device_stats stats; | 764 | struct net_device_stats stats; |
766 | int high_dma_flag; | 765 | int high_dma_flag; |
@@ -794,11 +793,6 @@ struct s2io_nic { | |||
794 | u16 all_multi_pos; | 793 | u16 all_multi_pos; |
795 | u16 promisc_flg; | 794 | u16 promisc_flg; |
796 | 795 | ||
797 | u16 tx_pkt_count; | ||
798 | u16 rx_pkt_count; | ||
799 | u16 tx_err_count; | ||
800 | u16 rx_err_count; | ||
801 | |||
802 | /* Id timer, used to blink NIC to physically identify NIC. */ | 796 | /* Id timer, used to blink NIC to physically identify NIC. */ |
803 | struct timer_list id_timer; | 797 | struct timer_list id_timer; |
804 | 798 | ||