Commit 4790654c authored by Jeff Garzik's avatar Jeff Garzik Committed by David S. Miller

[netdrvr] netxen: checkpatch fixes (98% trim trailing whitespace)

Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent ba734f34
...@@ -113,8 +113,8 @@ ...@@ -113,8 +113,8 @@
#define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq) #define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq)
extern struct workqueue_struct *netxen_workq; extern struct workqueue_struct *netxen_workq;
/* /*
* normalize a 64MB crb address to 32MB PCI window * normalize a 64MB crb address to 32MB PCI window
* To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1 * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1
*/ */
#define NETXEN_CRB_NORMAL(reg) \ #define NETXEN_CRB_NORMAL(reg) \
...@@ -736,11 +736,11 @@ struct netxen_skb_frag { ...@@ -736,11 +736,11 @@ struct netxen_skb_frag {
(config_word) &= ~__tmask; \ (config_word) &= ~__tmask; \
(config_word) |= (((__tvalue) << (start)) & __tmask); \ (config_word) |= (((__tvalue) << (start)) & __tmask); \
} }
#define _netxen_clear_bits(config_word, start, bits) {\ #define _netxen_clear_bits(config_word, start, bits) {\
unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start)); \ unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start)); \
(config_word) &= ~__tmask; \ (config_word) &= ~__tmask; \
} }
/* Following defines are for the state of the buffers */ /* Following defines are for the state of the buffers */
#define NETXEN_BUFFER_FREE 0 #define NETXEN_BUFFER_FREE 0
...@@ -879,7 +879,7 @@ struct netxen_dummy_dma { ...@@ -879,7 +879,7 @@ struct netxen_dummy_dma {
struct netxen_adapter { struct netxen_adapter {
struct netxen_hardware_context ahw; struct netxen_hardware_context ahw;
struct netxen_adapter *master; struct netxen_adapter *master;
struct net_device *netdev; struct net_device *netdev;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -916,7 +916,7 @@ struct netxen_adapter { ...@@ -916,7 +916,7 @@ struct netxen_adapter {
u32 temp; u32 temp;
struct netxen_adapter_stats stats; struct netxen_adapter_stats stats;
u16 portno; u16 portno;
u16 link_speed; u16 link_speed;
u16 link_duplex; u16 link_duplex;
...@@ -1050,9 +1050,9 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val); ...@@ -1050,9 +1050,9 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val);
int netxen_load_firmware(struct netxen_adapter *adapter); int netxen_load_firmware(struct netxen_adapter *adapter);
int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose);
int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp); int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp);
int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
u8 *bytes, size_t size); u8 *bytes, size_t size);
int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr,
u8 *bytes, size_t size); u8 *bytes, size_t size);
int netxen_flash_unlock(struct netxen_adapter *adapter); int netxen_flash_unlock(struct netxen_adapter *adapter);
int netxen_backup_crbinit(struct netxen_adapter *adapter); int netxen_backup_crbinit(struct netxen_adapter *adapter);
......
...@@ -423,11 +423,11 @@ netxen_nic_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, ...@@ -423,11 +423,11 @@ netxen_nic_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
if (eeprom->len == 0) if (eeprom->len == 0)
return -EINVAL; return -EINVAL;
eeprom->magic = (adapter->pdev)->vendor | eeprom->magic = (adapter->pdev)->vendor |
((adapter->pdev)->device << 16); ((adapter->pdev)->device << 16);
offset = eeprom->offset; offset = eeprom->offset;
ret = netxen_rom_fast_read_words(adapter, offset, bytes, ret = netxen_rom_fast_read_words(adapter, offset, bytes,
eeprom->len); eeprom->len);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -453,16 +453,16 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, ...@@ -453,16 +453,16 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
netxen_nic_driver_name); netxen_nic_driver_name);
return ret; return ret;
} }
printk(KERN_INFO "%s: flash unlocked. \n", printk(KERN_INFO "%s: flash unlocked. \n",
netxen_nic_driver_name); netxen_nic_driver_name);
last_schedule_time = jiffies; last_schedule_time = jiffies;
ret = netxen_flash_erase_secondary(adapter); ret = netxen_flash_erase_secondary(adapter);
if (ret != FLASH_SUCCESS) { if (ret != FLASH_SUCCESS) {
printk(KERN_ERR "%s: Flash erase failed.\n", printk(KERN_ERR "%s: Flash erase failed.\n",
netxen_nic_driver_name); netxen_nic_driver_name);
return ret; return ret;
} }
printk(KERN_INFO "%s: secondary flash erased successfully.\n", printk(KERN_INFO "%s: secondary flash erased successfully.\n",
netxen_nic_driver_name); netxen_nic_driver_name);
flash_start = 1; flash_start = 1;
return 0; return 0;
...@@ -471,7 +471,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, ...@@ -471,7 +471,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
if (offset == NETXEN_BOOTLD_START) { if (offset == NETXEN_BOOTLD_START) {
ret = netxen_flash_erase_primary(adapter); ret = netxen_flash_erase_primary(adapter);
if (ret != FLASH_SUCCESS) { if (ret != FLASH_SUCCESS) {
printk(KERN_ERR "%s: Flash erase failed.\n", printk(KERN_ERR "%s: Flash erase failed.\n",
netxen_nic_driver_name); netxen_nic_driver_name);
return ret; return ret;
} }
...@@ -483,16 +483,16 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, ...@@ -483,16 +483,16 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
if (ret != FLASH_SUCCESS) if (ret != FLASH_SUCCESS)
return ret; return ret;
printk(KERN_INFO "%s: primary flash erased successfully\n", printk(KERN_INFO "%s: primary flash erased successfully\n",
netxen_nic_driver_name); netxen_nic_driver_name);
ret = netxen_backup_crbinit(adapter); ret = netxen_backup_crbinit(adapter);
if (ret != FLASH_SUCCESS) { if (ret != FLASH_SUCCESS) {
printk(KERN_ERR "%s: CRBinit backup failed.\n", printk(KERN_ERR "%s: CRBinit backup failed.\n",
netxen_nic_driver_name); netxen_nic_driver_name);
return ret; return ret;
} }
printk(KERN_INFO "%s: CRBinit backup done.\n", printk(KERN_INFO "%s: CRBinit backup done.\n",
netxen_nic_driver_name); netxen_nic_driver_name);
ready_to_flash = 1; ready_to_flash = 1;
} }
...@@ -570,7 +570,7 @@ netxen_nic_get_pauseparam(struct net_device *dev, ...@@ -570,7 +570,7 @@ netxen_nic_get_pauseparam(struct net_device *dev,
else else
pause->tx_pause = !(netxen_xg_get_xg1_mask(val)); pause->tx_pause = !(netxen_xg_get_xg1_mask(val));
} else { } else {
printk(KERN_ERR"%s: Unknown board type: %x\n", printk(KERN_ERR"%s: Unknown board type: %x\n",
netxen_nic_driver_name, adapter->ahw.board_type); netxen_nic_driver_name, adapter->ahw.board_type);
} }
} }
...@@ -589,7 +589,7 @@ netxen_nic_set_pauseparam(struct net_device *dev, ...@@ -589,7 +589,7 @@ netxen_nic_set_pauseparam(struct net_device *dev,
/* set flow control */ /* set flow control */
netxen_nic_read_w0(adapter, netxen_nic_read_w0(adapter,
NETXEN_NIU_GB_MAC_CONFIG_0(port), &val); NETXEN_NIU_GB_MAC_CONFIG_0(port), &val);
if (pause->rx_pause) if (pause->rx_pause)
netxen_gb_rx_flowctl(val); netxen_gb_rx_flowctl(val);
else else
...@@ -642,10 +642,10 @@ netxen_nic_set_pauseparam(struct net_device *dev, ...@@ -642,10 +642,10 @@ netxen_nic_set_pauseparam(struct net_device *dev,
else else
netxen_xg_set_xg1_mask(val); netxen_xg_set_xg1_mask(val);
} }
netxen_nic_write_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, val); netxen_nic_write_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, val);
} else { } else {
printk(KERN_ERR "%s: Unknown board type: %x\n", printk(KERN_ERR "%s: Unknown board type: %x\n",
netxen_nic_driver_name, netxen_nic_driver_name,
adapter->ahw.board_type); adapter->ahw.board_type);
} }
return 0; return 0;
......
...@@ -160,7 +160,7 @@ struct netxen_recv_crb recv_crb_registers[] = { ...@@ -160,7 +160,7 @@ struct netxen_recv_crb recv_crb_registers[] = {
}, },
/* Jumbo frames */ /* Jumbo frames */
{ {
/* crb_rcv_producer_offset: */ /* crb_rcv_producer_offset: */
NETXEN_NIC_REG(0x1f8), NETXEN_NIC_REG(0x1f8),
/* crb_rcv_consumer_offset: */ /* crb_rcv_consumer_offset: */
NETXEN_NIC_REG(0x1fc), NETXEN_NIC_REG(0x1fc),
...@@ -209,7 +209,7 @@ struct netxen_recv_crb recv_crb_registers[] = { ...@@ -209,7 +209,7 @@ struct netxen_recv_crb recv_crb_registers[] = {
}, },
/* Jumbo frames */ /* Jumbo frames */
{ {
/* crb_rcv_producer_offset: */ /* crb_rcv_producer_offset: */
NETXEN_NIC_REG(0x23c), NETXEN_NIC_REG(0x23c),
/* crb_rcv_consumer_offset: */ /* crb_rcv_consumer_offset: */
NETXEN_NIC_REG(0x240), NETXEN_NIC_REG(0x240),
...@@ -888,7 +888,7 @@ void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 * value) ...@@ -888,7 +888,7 @@ void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 * value)
netxen_nic_pci_change_crbwindow(adapter, 1); netxen_nic_pci_change_crbwindow(adapter, 1);
} }
static int netxen_pci_set_window_warning_count = 0; static int netxen_pci_set_window_warning_count;
static unsigned long netxen_nic_pci_set_window(struct netxen_adapter *adapter, static unsigned long netxen_nic_pci_set_window(struct netxen_adapter *adapter,
unsigned long long addr) unsigned long long addr)
...@@ -958,7 +958,7 @@ int ...@@ -958,7 +958,7 @@ int
netxen_nic_erase_pxe(struct netxen_adapter *adapter) netxen_nic_erase_pxe(struct netxen_adapter *adapter)
{ {
if (netxen_rom_fast_write(adapter, NETXEN_PXE_START, 0) == -1) { if (netxen_rom_fast_write(adapter, NETXEN_PXE_START, 0) == -1) {
printk(KERN_ERR "%s: erase pxe failed\n", printk(KERN_ERR "%s: erase pxe failed\n",
netxen_nic_driver_name); netxen_nic_driver_name);
return -1; return -1;
} }
...@@ -1039,9 +1039,9 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) ...@@ -1039,9 +1039,9 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu)
{ {
new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE;
if (physical_port[adapter->portnum] == 0) if (physical_port[adapter->portnum] == 0)
netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE,
new_mtu); new_mtu);
else else
netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE,
new_mtu); new_mtu);
return 0; return 0;
......
...@@ -235,7 +235,7 @@ typedef enum { ...@@ -235,7 +235,7 @@ typedef enum {
((config_word) |= 1 << 0) ((config_word) |= 1 << 0)
#define netxen_xg_set_xg1_mask(config_word) \ #define netxen_xg_set_xg1_mask(config_word) \
((config_word) |= 1 << 3) ((config_word) |= 1 << 3)
#define netxen_xg_get_xg0_mask(config_word) \ #define netxen_xg_get_xg0_mask(config_word) \
_netxen_crb_get_bit((config_word), 0) _netxen_crb_get_bit((config_word), 0)
#define netxen_xg_get_xg1_mask(config_word) \ #define netxen_xg_get_xg1_mask(config_word) \
...@@ -273,7 +273,7 @@ typedef enum { ...@@ -273,7 +273,7 @@ typedef enum {
_netxen_crb_get_bit((config_word), 4) _netxen_crb_get_bit((config_word), 4)
#define netxen_gb_get_gb3_mask(config_word) \ #define netxen_gb_get_gb3_mask(config_word) \
_netxen_crb_get_bit((config_word), 6) _netxen_crb_get_bit((config_word), 6)
#define netxen_gb_unset_gb0_mask(config_word) \ #define netxen_gb_unset_gb0_mask(config_word) \
((config_word) &= ~(1 << 0)) ((config_word) &= ~(1 << 0))
#define netxen_gb_unset_gb1_mask(config_word) \ #define netxen_gb_unset_gb1_mask(config_word) \
...@@ -437,7 +437,7 @@ typedef enum { ...@@ -437,7 +437,7 @@ typedef enum {
/* /*
* NIU GB Drop CRC Register * NIU GB Drop CRC Register
* *
* Bit 0 : drop_gb0 => 1:drop pkts with bad CRCs, 0:pass them on * Bit 0 : drop_gb0 => 1:drop pkts with bad CRCs, 0:pass them on
* Bit 1 : drop_gb1 => 1:drop pkts with bad CRCs, 0:pass them on * Bit 1 : drop_gb1 => 1:drop pkts with bad CRCs, 0:pass them on
* Bit 2 : drop_gb2 => 1:drop pkts with bad CRCs, 0:pass them on * Bit 2 : drop_gb2 => 1:drop pkts with bad CRCs, 0:pass them on
...@@ -480,7 +480,7 @@ typedef enum { ...@@ -480,7 +480,7 @@ typedef enum {
/* /*
* MAC Control Register * MAC Control Register
* *
* Bit 0-1 : id_pool0 * Bit 0-1 : id_pool0
* Bit 2 : enable_xtnd0 * Bit 2 : enable_xtnd0
* Bit 4-5 : id_pool1 * Bit 4-5 : id_pool1
...@@ -515,7 +515,7 @@ typedef enum { ...@@ -515,7 +515,7 @@ typedef enum {
((config) |= (((val) & 0x0f) << 28)) ((config) |= (((val) & 0x0f) << 28))
/* Set promiscuous mode for a GbE interface */ /* Set promiscuous mode for a GbE interface */
int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
netxen_niu_prom_mode_t mode); netxen_niu_prom_mode_t mode);
int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
netxen_niu_prom_mode_t mode); netxen_niu_prom_mode_t mode);
......
...@@ -449,7 +449,7 @@ static int do_rom_fast_read_words(struct netxen_adapter *adapter, int addr, ...@@ -449,7 +449,7 @@ static int do_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
} }
int int
netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
u8 *bytes, size_t size) u8 *bytes, size_t size)
{ {
int ret; int ret;
...@@ -490,7 +490,7 @@ int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data) ...@@ -490,7 +490,7 @@ int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data)
} }
#endif /* 0 */ #endif /* 0 */
static int do_rom_fast_write_words(struct netxen_adapter *adapter, static int do_rom_fast_write_words(struct netxen_adapter *adapter,
int addr, u8 *bytes, size_t size) int addr, u8 *bytes, size_t size)
{ {
int addridx = addr; int addridx = addr;
...@@ -505,7 +505,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter, ...@@ -505,7 +505,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter,
ret = do_rom_fast_write(adapter, addridx, data); ret = do_rom_fast_write(adapter, addridx, data);
if (ret < 0) if (ret < 0)
return ret; return ret;
while(1) { while(1) {
int data1; int data1;
...@@ -518,7 +518,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter, ...@@ -518,7 +518,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter,
if (timeout++ >= rom_write_timeout) { if (timeout++ >= rom_write_timeout) {
if (last_attempt++ < 4) { if (last_attempt++ < 4) {
ret = do_rom_fast_write(adapter, ret = do_rom_fast_write(adapter,
addridx, data); addridx, data);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -538,7 +538,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter, ...@@ -538,7 +538,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter,
return ret; return ret;
} }
int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr,
u8 *bytes, size_t size) u8 *bytes, size_t size)
{ {
int ret = 0; int ret = 0;
...@@ -562,7 +562,7 @@ static int netxen_rom_wrsr(struct netxen_adapter *adapter, int data) ...@@ -562,7 +562,7 @@ static int netxen_rom_wrsr(struct netxen_adapter *adapter, int data)
return ret; return ret;
netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_ROM_WDATA, data); netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_ROM_WDATA, data);
netxen_crb_writelit_adapter(adapter, netxen_crb_writelit_adapter(adapter,
NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0x1); NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0x1);
ret = netxen_wait_rom_done(adapter); ret = netxen_wait_rom_done(adapter);
...@@ -592,7 +592,7 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter) ...@@ -592,7 +592,7 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter)
char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL); char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL);
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
/* unlock sector 63 */ /* unlock sector 63 */
val = netxen_rom_rdsr(adapter); val = netxen_rom_rdsr(adapter);
val = val & 0xe3; val = val & 0xe3;
...@@ -605,12 +605,12 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter) ...@@ -605,12 +605,12 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter)
goto out_kfree; goto out_kfree;
/* copy sector 0 to sector 63 */ /* copy sector 0 to sector 63 */
ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START, ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START,
buffer, NETXEN_FLASH_SECTOR_SIZE); buffer, NETXEN_FLASH_SECTOR_SIZE);
if (ret != FLASH_SUCCESS) if (ret != FLASH_SUCCESS)
goto out_kfree; goto out_kfree;
ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START, ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START,
buffer, NETXEN_FLASH_SECTOR_SIZE); buffer, NETXEN_FLASH_SECTOR_SIZE);
if (ret != FLASH_SUCCESS) if (ret != FLASH_SUCCESS)
goto out_kfree; goto out_kfree;
...@@ -658,9 +658,9 @@ static void check_erased_flash(struct netxen_adapter *adapter, int addr) ...@@ -658,9 +658,9 @@ static void check_erased_flash(struct netxen_adapter *adapter, int addr)
int count = 0, erased_errors = 0; int count = 0, erased_errors = 0;
int range; int range;
range = (addr == NETXEN_USER_START) ? range = (addr == NETXEN_USER_START) ?
NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE; NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE;
for (i = addr; i < range; i += 4) { for (i = addr; i < range; i += 4) {
netxen_rom_fast_read(adapter, i, &val); netxen_rom_fast_read(adapter, i, &val);
if (val != 0xffffffff) if (val != 0xffffffff)
...@@ -1495,7 +1495,7 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, ...@@ -1495,7 +1495,7 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter,
count++; /* now there should be no failure */ count++; /* now there should be no failure */
pdesc = &rcv_desc->desc_head[producer]; pdesc = &rcv_desc->desc_head[producer];
skb_reserve(skb, 2); skb_reserve(skb, 2);
/* /*
* This will be setup when we receive the * This will be setup when we receive the
* buffer after it has been filled * buffer after it has been filled
* skb->dev = netdev; * skb->dev = netdev;
......
...@@ -48,7 +48,7 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev) ...@@ -48,7 +48,7 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
/* total packets received */ /* total packets received */
stats->rx_packets = adapter->stats.no_rcv; stats->rx_packets = adapter->stats.no_rcv;
/* total packets transmitted */ /* total packets transmitted */
stats->tx_packets = adapter->stats.xmitedframes + stats->tx_packets = adapter->stats.xmitedframes +
adapter->stats.xmitfinished; adapter->stats.xmitfinished;
/* total bytes received */ /* total bytes received */
stats->rx_bytes = adapter->stats.rxbytes; stats->rx_bytes = adapter->stats.rxbytes;
...@@ -84,7 +84,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) ...@@ -84,7 +84,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable)
/* This should clear the interrupt source */ /* This should clear the interrupt source */
if (adapter->phy_read) if (adapter->phy_read)
adapter->phy_read(adapter, adapter->phy_read(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS, NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS,
&int_src); &int_src);
if (int_src == 0) { if (int_src == 0) {
...@@ -113,7 +113,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) ...@@ -113,7 +113,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable)
DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n");
if (adapter->phy_read if (adapter->phy_read
&& adapter->phy_read(adapter, && adapter->phy_read(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) == 0) { &status) == 0) {
if (netxen_get_phy_int_link_status_changed(int_src)) { if (netxen_get_phy_int_link_status_changed(int_src)) {
...@@ -127,7 +127,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable) ...@@ -127,7 +127,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable)
netxen_nic_driver_name, netxen_nic_driver_name,
adapter->netdev->name); adapter->netdev->name);
} }
netxen_indicate_link_status(adapter, netxen_indicate_link_status(adapter,
netxen_get_phy_link netxen_get_phy_link
(status)); (status));
} }
......
...@@ -350,7 +350,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -350,7 +350,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
first_page_group_start = 0; first_page_group_start = 0;
first_page_group_end = 0; first_page_group_end = 0;
} else { } else {
err = -EIO; err = -EIO;
goto err_out_free_netdev; goto err_out_free_netdev;
} }
...@@ -410,7 +410,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -410,7 +410,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->open = netxen_nic_open; netdev->open = netxen_nic_open;
netdev->stop = netxen_nic_close; netdev->stop = netxen_nic_close;
netdev->hard_start_xmit = netxen_nic_xmit_frame; netdev->hard_start_xmit = netxen_nic_xmit_frame;
netdev->get_stats = netxen_nic_get_stats; netdev->get_stats = netxen_nic_get_stats;
netdev->set_multicast_list = netxen_nic_set_multi; netdev->set_multicast_list = netxen_nic_set_multi;
netdev->set_mac_address = netxen_nic_set_mac; netdev->set_mac_address = netxen_nic_set_mac;
netdev->change_mtu = netxen_nic_change_mtu; netdev->change_mtu = netxen_nic_change_mtu;
...@@ -457,8 +457,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -457,8 +457,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
adapter->max_tx_desc_count = MAX_CMD_DESCRIPTORS_HOST; adapter->max_tx_desc_count = MAX_CMD_DESCRIPTORS_HOST;
if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB35_4G) || if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB35_4G) ||
(adapter->ahw.boardcfg.board_type == (adapter->ahw.boardcfg.board_type ==
NETXEN_BRDTYPE_P2_SB31_2G)) NETXEN_BRDTYPE_P2_SB31_2G))
adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
else else
adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS; adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS;
...@@ -583,9 +583,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -583,9 +583,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (adapter->portnum == 0) { if (adapter->portnum == 0) {
err = netxen_initialize_adapter_offload(adapter); err = netxen_initialize_adapter_offload(adapter);
if (err) if (err)
goto err_out_free_rx_buffer; goto err_out_free_rx_buffer;
val = readl(NETXEN_CRB_NORMALIZE(adapter, val = readl(NETXEN_CRB_NORMALIZE(adapter,
NETXEN_CAM_RAM(0x1fc))); NETXEN_CAM_RAM(0x1fc)));
if (val == 0x55555555) { if (val == 0x55555555) {
/* This is the first boot after power up */ /* This is the first boot after power up */
...@@ -619,7 +619,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -619,7 +619,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* /*
* Tell the hardware our version number. * Tell the hardware our version number.
*/ */
i = (_NETXEN_NIC_LINUX_MAJOR << 16) i = (_NETXEN_NIC_LINUX_MAJOR << 16)
| ((_NETXEN_NIC_LINUX_MINOR << 8)) | ((_NETXEN_NIC_LINUX_MINOR << 8))
| (_NETXEN_NIC_LINUX_SUBVERSION); | (_NETXEN_NIC_LINUX_SUBVERSION);
writel(i, NETXEN_CRB_NORMALIZE(adapter, CRB_DRIVER_VERSION)); writel(i, NETXEN_CRB_NORMALIZE(adapter, CRB_DRIVER_VERSION));
...@@ -659,7 +659,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -659,7 +659,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
break; break;
case NETXEN_NIC_XGBE: case NETXEN_NIC_XGBE:
printk(KERN_INFO "%s: XGbE board initialized\n", printk(KERN_INFO "%s: XGbE board initialized\n",
netxen_nic_driver_name); netxen_nic_driver_name);
break; break;
} }
...@@ -930,7 +930,7 @@ static int netxen_nic_close(struct net_device *netdev) ...@@ -930,7 +930,7 @@ static int netxen_nic_close(struct net_device *netdev)
buffrag++; buffrag++;
if (buffrag->dma) { if (buffrag->dma) {
pci_unmap_page(adapter->pdev, buffrag->dma, pci_unmap_page(adapter->pdev, buffrag->dma,
buffrag->length, buffrag->length,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
buffrag->dma = 0ULL; buffrag->dma = 0ULL;
} }
...@@ -1194,7 +1194,7 @@ static void netxen_tx_timeout(struct net_device *netdev) ...@@ -1194,7 +1194,7 @@ static void netxen_tx_timeout(struct net_device *netdev)
static void netxen_tx_timeout_task(struct work_struct *work) static void netxen_tx_timeout_task(struct work_struct *work)
{ {
struct netxen_adapter *adapter = struct netxen_adapter *adapter =
container_of(work, struct netxen_adapter, tx_timeout_task); container_of(work, struct netxen_adapter, tx_timeout_task);
printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", printk(KERN_ERR "%s %s: transmit timeout, resetting.\n",
......
...@@ -75,7 +75,7 @@ static int phy_unlock(struct netxen_adapter *adapter) ...@@ -75,7 +75,7 @@ static int phy_unlock(struct netxen_adapter *adapter)
return 0; return 0;
} }
/* /*
* netxen_niu_gbe_phy_read - read a register from the GbE PHY via * netxen_niu_gbe_phy_read - read a register from the GbE PHY via
* mii management interface. * mii management interface.
* *
...@@ -88,7 +88,7 @@ static int phy_unlock(struct netxen_adapter *adapter) ...@@ -88,7 +88,7 @@ static int phy_unlock(struct netxen_adapter *adapter)
* -1 on error * -1 on error
* *
*/ */
int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
__u32 * readval) __u32 * readval)
{ {
long timeout = 0; long timeout = 0;
...@@ -171,7 +171,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, ...@@ -171,7 +171,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
return result; return result;
} }
/* /*
* netxen_niu_gbe_phy_write - write a register to the GbE PHY via * netxen_niu_gbe_phy_write - write a register to the GbE PHY via
* mii management interface. * mii management interface.
* *
...@@ -184,7 +184,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, ...@@ -184,7 +184,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
* -1 on error * -1 on error
* *
*/ */
int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg,
__u32 val) __u32 val)
{ {
long timeout = 0; long timeout = 0;
...@@ -275,7 +275,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter) ...@@ -275,7 +275,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter)
netxen_set_phy_int_speed_changed(enable); netxen_set_phy_int_speed_changed(enable);
if (0 != if (0 !=
netxen_niu_gbe_phy_write(adapter, netxen_niu_gbe_phy_write(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_INT_ENABLE, NETXEN_NIU_GB_MII_MGMT_ADDR_INT_ENABLE,
enable)) enable))
result = -EIO; result = -EIO;
...@@ -312,7 +312,7 @@ static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter) ...@@ -312,7 +312,7 @@ static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter)
{ {
int result = 0; int result = 0;
if (0 != if (0 !=
netxen_niu_gbe_phy_write(adapter, netxen_niu_gbe_phy_write(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS, NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS,
-EIO)) -EIO))
result = -EIO; result = -EIO;
...@@ -320,7 +320,7 @@ static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter) ...@@ -320,7 +320,7 @@ static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter)
return result; return result;
} }
/* /*
* netxen_niu_gbe_set_mii_mode- Set 10/100 Mbit Mode for GbE MAC * netxen_niu_gbe_set_mii_mode- Set 10/100 Mbit Mode for GbE MAC
* *
*/ */
...@@ -344,9 +344,9 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, ...@@ -344,9 +344,9 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter,
NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7); NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7);
if (enable) { if (enable) {
/* /*
* Do NOT enable flow control until a suitable solution for * Do NOT enable flow control until a suitable solution for
* shutting down pause frames is found. * shutting down pause frames is found.
*/ */
netxen_crb_writelit_adapter(adapter, netxen_crb_writelit_adapter(adapter,
NETXEN_NIU_GB_MAC_CONFIG_0(port), NETXEN_NIU_GB_MAC_CONFIG_0(port),
...@@ -359,7 +359,7 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, ...@@ -359,7 +359,7 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter,
printk(KERN_ERR PFX "ERROR clearing PHY interrupts\n"); printk(KERN_ERR PFX "ERROR clearing PHY interrupts\n");
} }
/* /*
* netxen_niu_gbe_set_gmii_mode- Set GbE Mode for GbE MAC * netxen_niu_gbe_set_gmii_mode- Set GbE Mode for GbE MAC
*/ */
static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter,
...@@ -382,9 +382,9 @@ static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, ...@@ -382,9 +382,9 @@ static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter,
NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7); NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7);
if (enable) { if (enable) {
/* /*
* Do NOT enable flow control until a suitable solution for * Do NOT enable flow control until a suitable solution for
* shutting down pause frames is found. * shutting down pause frames is found.
*/ */
netxen_crb_writelit_adapter(adapter, netxen_crb_writelit_adapter(adapter,
NETXEN_NIU_GB_MAC_CONFIG_0(port), NETXEN_NIU_GB_MAC_CONFIG_0(port),
...@@ -467,7 +467,7 @@ int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) ...@@ -467,7 +467,7 @@ int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port)
} }
#if 0 #if 0
/* /*
* netxen_niu_gbe_handle_phy_interrupt - Handles GbE PHY interrupts * netxen_niu_gbe_handle_phy_interrupt - Handles GbE PHY interrupts
* @param enable 0 means don't enable the port * @param enable 0 means don't enable the port
* 1 means enable (or re-enable) the port * 1 means enable (or re-enable) the port
...@@ -623,7 +623,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, ...@@ -623,7 +623,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
(adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4)) (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4))
return -2; return -2;
netxen_niu_macaddr_get(adapter, netxen_niu_macaddr_get(adapter,
(netxen_ethernet_macaddr_t *) mac_addr); (netxen_ethernet_macaddr_t *) mac_addr);
if (memcmp(mac_addr, addr, 6) == 0) if (memcmp(mac_addr, addr, 6) == 0)
break; break;
...@@ -753,7 +753,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) ...@@ -753,7 +753,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
} }
/* Set promiscuous mode for a GbE interface */ /* Set promiscuous mode for a GbE interface */
int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
netxen_niu_prom_mode_t mode) netxen_niu_prom_mode_t mode)
{ {
__u32 reg; __u32 reg;
......
/* /*
* Copyright (C) 2003 - 2006 NetXen, Inc. * Copyright (C) 2003 - 2006 NetXen, Inc.
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA. * MA 02111-1307, USA.
* *
* The full GNU General Public License is included in this distribution * The full GNU General Public License is included in this distribution
* in the file called LICENSE. * in the file called LICENSE.
* *
* Contact Information: * Contact Information:
* info@netxen.com * info@netxen.com
* NetXen, * NetXen,
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#ifndef __NIC_PHAN_REG_H_ #ifndef __NIC_PHAN_REG_H_
#define __NIC_PHAN_REG_H_ #define __NIC_PHAN_REG_H_
/* /*
* CRB Registers or queue message done only at initialization time. * CRB Registers or queue message done only at initialization time.
*/ */
#define NIC_CRB_BASE NETXEN_CAM_RAM(0x200) #define NIC_CRB_BASE NETXEN_CAM_RAM(0x200)
......
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