Skip to content

Commit

Permalink
netxen: cleanup unused variables/functions
Browse files Browse the repository at this point in the history
o Reduce access to global arrays in data path.
o Remove duplicate/unused variables, unecessary alignment constraints.
o Use correct pci_dev instead of fallback device for consistent
  allocations.
o Disable ethtool set_eeprom functionality for now, it was only used
  for flashing firmware.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Dhananjay Phadke authored and Jeff Garzik committed Jul 22, 2008
1 parent f0084a3 commit 7830b22
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 360 deletions.
19 changes: 4 additions & 15 deletions drivers/net/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@
#define RX_JUMBO_DMA_MAP_LEN \
(MAX_RX_JUMBO_BUFFER_LENGTH - 2)
#define RX_LRO_DMA_MAP_LEN (MAX_RX_LRO_BUFFER_LENGTH - 2)
#define NETXEN_ROM_ROUNDUP 0x80000000ULL

/*
* Maximum number of ring contexts
Expand Down Expand Up @@ -219,8 +218,6 @@ enum {
#define MPORT_MULTI_FUNCTION_MODE 0x2222

#include "netxen_nic_phan_reg.h"
extern unsigned long long netxen_dma_mask;
extern unsigned long last_schedule_time;

/*
* NetXen host-peg signal message structure
Expand Down Expand Up @@ -765,7 +762,6 @@ struct netxen_rx_buffer {
* contains interrupt info as well shared hardware info.
*/
struct netxen_hardware_context {
struct pci_dev *pdev;
void __iomem *pci_base0;
void __iomem *pci_base1;
void __iomem *pci_base2;
Expand All @@ -781,7 +777,6 @@ struct netxen_hardware_context {
u32 qg_linksup;
/* Address of cmd ring in Phantom */
struct cmd_desc_type0 *cmd_desc_head;
struct pci_dev *cmd_desc_pdev;
dma_addr_t cmd_desc_phys_addr;
struct netxen_adapter *adapter;
int pci_func;
Expand Down Expand Up @@ -816,9 +811,8 @@ struct netxen_adapter_stats {
struct netxen_rcv_desc_ctx {
u32 flags;
u32 producer;
u32 rcv_pending; /* Num of bufs posted in phantom */
dma_addr_t phys_addr;
struct pci_dev *phys_pdev;
u32 crb_rcv_producer; /* reg offset */
struct rcv_desc *desc_head; /* address of rx ring in Phantom */
u32 max_rx_desc_count;
u32 dma_size;
Expand All @@ -835,10 +829,9 @@ struct netxen_rcv_desc_ctx {
*/
struct netxen_recv_context {
struct netxen_rcv_desc_ctx rcv_desc[NUM_RCV_DESC_RINGS];
u32 status_rx_producer;
u32 status_rx_consumer;
u32 crb_sts_consumer; /* reg offset */
dma_addr_t rcv_status_desc_phys_addr;
struct pci_dev *rcv_status_desc_pdev;
struct status_desc *rcv_status_desc_head;
};

Expand All @@ -854,7 +847,6 @@ struct netxen_dummy_dma {
struct netxen_adapter {
struct netxen_hardware_context ahw;

struct netxen_adapter *master;
struct net_device *netdev;
struct pci_dev *pdev;
struct napi_struct napi;
Expand All @@ -873,6 +865,8 @@ struct netxen_adapter {
u32 cmd_producer;
__le32 *cmd_consumer;
u32 last_cmd_consumer;
u32 crb_addr_cmd_producer;
u32 crb_addr_cmd_consumer;

u32 max_tx_desc_count;
u32 max_rx_desc_count;
Expand All @@ -886,14 +880,12 @@ struct netxen_adapter {

struct netxen_adapter_stats stats;

u16 portno;
u16 link_speed;
u16 link_duplex;
u16 state;
u16 link_autoneg;
int rx_csum;
int status;
spinlock_t stats_lock;

struct netxen_cmd_buffer *cmd_buf_arr; /* Command buffers for xmit */

Expand All @@ -908,7 +900,6 @@ struct netxen_adapter {

/* Context interface shared between card and host */
struct netxen_ring_ctx *ctx_desc;
struct pci_dev *ctx_desc_pdev;
dma_addr_t ctx_desc_phys_addr;
int intr_scheme;
int msi_mode;
Expand Down Expand Up @@ -1034,8 +1025,6 @@ int netxen_rom_se(struct netxen_adapter *adapter, int addr);

/* Functions from netxen_nic_isr.c */
void netxen_initialize_adapter_sw(struct netxen_adapter *adapter);
void *netxen_alloc(struct pci_dev *pdev, size_t sz, dma_addr_t * ptr,
struct pci_dev **used_dev);
void netxen_initialize_adapter_ops(struct netxen_adapter *adapter);
int netxen_init_firmware(struct netxen_adapter *adapter);
void netxen_free_hw_resources(struct netxen_adapter *adapter);
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/netxen/netxen_nic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ netxen_nic_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
return 0;
}

#if 0
static int
netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
u8 * bytes)
Expand All @@ -447,7 +448,6 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
}
printk(KERN_INFO "%s: flash unlocked. \n",
netxen_nic_driver_name);
last_schedule_time = jiffies;
ret = netxen_flash_erase_secondary(adapter);
if (ret != FLASH_SUCCESS) {
printk(KERN_ERR "%s: Flash erase failed.\n",
Expand Down Expand Up @@ -497,6 +497,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,

return netxen_rom_fast_write_words(adapter, offset, bytes, eeprom->len);
}
#endif /* 0 */

static void
netxen_nic_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
Expand Down Expand Up @@ -745,7 +746,9 @@ struct ethtool_ops netxen_nic_ethtool_ops = {
.get_link = ethtool_op_get_link,
.get_eeprom_len = netxen_nic_get_eeprom_len,
.get_eeprom = netxen_nic_get_eeprom,
#if 0
.set_eeprom = netxen_nic_set_eeprom,
#endif
.get_ringparam = netxen_nic_get_ringparam,
.get_pauseparam = netxen_nic_get_pauseparam,
.set_pauseparam = netxen_nic_set_pauseparam,
Expand Down
Loading

0 comments on commit 7830b22

Please sign in to comment.