aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-11-23 21:23:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:02 -0500
commit4790654c71b250018ecc234f6b9f1ed96a55572d (patch)
tree0902dbbcc763aa51c6209b560bff97505c0849eb /drivers/net/netxen
parentba734f349d5ba02a736e2d574584c56cd21bad14 (diff)
[netdrvr] netxen: checkpatch fixes (98% trim trailing whitespace)
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r--drivers/net/netxen/netxen_nic.h16
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c26
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c12
-rw-r--r--drivers/net/netxen/netxen_nic_hw.h10
-rw-r--r--drivers/net/netxen/netxen_nic_init.c24
-rw-r--r--drivers/net/netxen/netxen_nic_isr.c8
-rw-r--r--drivers/net/netxen/netxen_nic_main.c20
-rw-r--r--drivers/net/netxen/netxen_nic_niu.c34
-rw-r--r--drivers/net/netxen/netxen_nic_phan_reg.h8
9 files changed, 79 insertions, 79 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index b9d2191e03c9..724f75560ddb 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -113,8 +113,8 @@
113#define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq) 113#define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq)
114extern struct workqueue_struct *netxen_workq; 114extern struct workqueue_struct *netxen_workq;
115 115
116/* 116/*
117 * normalize a 64MB crb address to 32MB PCI window 117 * normalize a 64MB crb address to 32MB PCI window
118 * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1 118 * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1
119 */ 119 */
120#define NETXEN_CRB_NORMAL(reg) \ 120#define NETXEN_CRB_NORMAL(reg) \
@@ -736,11 +736,11 @@ struct netxen_skb_frag {
736 (config_word) &= ~__tmask; \ 736 (config_word) &= ~__tmask; \
737 (config_word) |= (((__tvalue) << (start)) & __tmask); \ 737 (config_word) |= (((__tvalue) << (start)) & __tmask); \
738} 738}
739 739
740#define _netxen_clear_bits(config_word, start, bits) {\ 740#define _netxen_clear_bits(config_word, start, bits) {\
741 unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start)); \ 741 unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start)); \
742 (config_word) &= ~__tmask; \ 742 (config_word) &= ~__tmask; \
743} 743}
744 744
745/* Following defines are for the state of the buffers */ 745/* Following defines are for the state of the buffers */
746#define NETXEN_BUFFER_FREE 0 746#define NETXEN_BUFFER_FREE 0
@@ -879,7 +879,7 @@ struct netxen_dummy_dma {
879 879
880struct netxen_adapter { 880struct netxen_adapter {
881 struct netxen_hardware_context ahw; 881 struct netxen_hardware_context ahw;
882 882
883 struct netxen_adapter *master; 883 struct netxen_adapter *master;
884 struct net_device *netdev; 884 struct net_device *netdev;
885 struct pci_dev *pdev; 885 struct pci_dev *pdev;
@@ -916,7 +916,7 @@ struct netxen_adapter {
916 u32 temp; 916 u32 temp;
917 917
918 struct netxen_adapter_stats stats; 918 struct netxen_adapter_stats stats;
919 919
920 u16 portno; 920 u16 portno;
921 u16 link_speed; 921 u16 link_speed;
922 u16 link_duplex; 922 u16 link_duplex;
@@ -1050,9 +1050,9 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val);
1050int netxen_load_firmware(struct netxen_adapter *adapter); 1050int netxen_load_firmware(struct netxen_adapter *adapter);
1051int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); 1051int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose);
1052int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp); 1052int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp);
1053int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, 1053int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
1054 u8 *bytes, size_t size); 1054 u8 *bytes, size_t size);
1055int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, 1055int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr,
1056 u8 *bytes, size_t size); 1056 u8 *bytes, size_t size);
1057int netxen_flash_unlock(struct netxen_adapter *adapter); 1057int netxen_flash_unlock(struct netxen_adapter *adapter);
1058int netxen_backup_crbinit(struct netxen_adapter *adapter); 1058int netxen_backup_crbinit(struct netxen_adapter *adapter);
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index cdec4f87e1ed..7a876f4b8db2 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -423,11 +423,11 @@ netxen_nic_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
423 if (eeprom->len == 0) 423 if (eeprom->len == 0)
424 return -EINVAL; 424 return -EINVAL;
425 425
426 eeprom->magic = (adapter->pdev)->vendor | 426 eeprom->magic = (adapter->pdev)->vendor |
427 ((adapter->pdev)->device << 16); 427 ((adapter->pdev)->device << 16);
428 offset = eeprom->offset; 428 offset = eeprom->offset;
429 429
430 ret = netxen_rom_fast_read_words(adapter, offset, bytes, 430 ret = netxen_rom_fast_read_words(adapter, offset, bytes,
431 eeprom->len); 431 eeprom->len);
432 if (ret < 0) 432 if (ret < 0)
433 return ret; 433 return ret;
@@ -453,16 +453,16 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
453 netxen_nic_driver_name); 453 netxen_nic_driver_name);
454 return ret; 454 return ret;
455 } 455 }
456 printk(KERN_INFO "%s: flash unlocked. \n", 456 printk(KERN_INFO "%s: flash unlocked. \n",
457 netxen_nic_driver_name); 457 netxen_nic_driver_name);
458 last_schedule_time = jiffies; 458 last_schedule_time = jiffies;
459 ret = netxen_flash_erase_secondary(adapter); 459 ret = netxen_flash_erase_secondary(adapter);
460 if (ret != FLASH_SUCCESS) { 460 if (ret != FLASH_SUCCESS) {
461 printk(KERN_ERR "%s: Flash erase failed.\n", 461 printk(KERN_ERR "%s: Flash erase failed.\n",
462 netxen_nic_driver_name); 462 netxen_nic_driver_name);
463 return ret; 463 return ret;
464 } 464 }
465 printk(KERN_INFO "%s: secondary flash erased successfully.\n", 465 printk(KERN_INFO "%s: secondary flash erased successfully.\n",
466 netxen_nic_driver_name); 466 netxen_nic_driver_name);
467 flash_start = 1; 467 flash_start = 1;
468 return 0; 468 return 0;
@@ -471,7 +471,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
471 if (offset == NETXEN_BOOTLD_START) { 471 if (offset == NETXEN_BOOTLD_START) {
472 ret = netxen_flash_erase_primary(adapter); 472 ret = netxen_flash_erase_primary(adapter);
473 if (ret != FLASH_SUCCESS) { 473 if (ret != FLASH_SUCCESS) {
474 printk(KERN_ERR "%s: Flash erase failed.\n", 474 printk(KERN_ERR "%s: Flash erase failed.\n",
475 netxen_nic_driver_name); 475 netxen_nic_driver_name);
476 return ret; 476 return ret;
477 } 477 }
@@ -483,16 +483,16 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
483 if (ret != FLASH_SUCCESS) 483 if (ret != FLASH_SUCCESS)
484 return ret; 484 return ret;
485 485
486 printk(KERN_INFO "%s: primary flash erased successfully\n", 486 printk(KERN_INFO "%s: primary flash erased successfully\n",
487 netxen_nic_driver_name); 487 netxen_nic_driver_name);
488 488
489 ret = netxen_backup_crbinit(adapter); 489 ret = netxen_backup_crbinit(adapter);
490 if (ret != FLASH_SUCCESS) { 490 if (ret != FLASH_SUCCESS) {
491 printk(KERN_ERR "%s: CRBinit backup failed.\n", 491 printk(KERN_ERR "%s: CRBinit backup failed.\n",
492 netxen_nic_driver_name); 492 netxen_nic_driver_name);
493 return ret; 493 return ret;
494 } 494 }
495 printk(KERN_INFO "%s: CRBinit backup done.\n", 495 printk(KERN_INFO "%s: CRBinit backup done.\n",
496 netxen_nic_driver_name); 496 netxen_nic_driver_name);
497 ready_to_flash = 1; 497 ready_to_flash = 1;
498 } 498 }
@@ -570,7 +570,7 @@ netxen_nic_get_pauseparam(struct net_device *dev,
570 else 570 else
571 pause->tx_pause = !(netxen_xg_get_xg1_mask(val)); 571 pause->tx_pause = !(netxen_xg_get_xg1_mask(val));
572 } else { 572 } else {
573 printk(KERN_ERR"%s: Unknown board type: %x\n", 573 printk(KERN_ERR"%s: Unknown board type: %x\n",
574 netxen_nic_driver_name, adapter->ahw.board_type); 574 netxen_nic_driver_name, adapter->ahw.board_type);
575 } 575 }
576} 576}
@@ -589,7 +589,7 @@ netxen_nic_set_pauseparam(struct net_device *dev,
589 /* set flow control */ 589 /* set flow control */
590 netxen_nic_read_w0(adapter, 590 netxen_nic_read_w0(adapter,
591 NETXEN_NIU_GB_MAC_CONFIG_0(port), &val); 591 NETXEN_NIU_GB_MAC_CONFIG_0(port), &val);
592 592
593 if (pause->rx_pause) 593 if (pause->rx_pause)
594 netxen_gb_rx_flowctl(val); 594 netxen_gb_rx_flowctl(val);
595 else 595 else
@@ -642,10 +642,10 @@ netxen_nic_set_pauseparam(struct net_device *dev,
642 else 642 else
643 netxen_xg_set_xg1_mask(val); 643 netxen_xg_set_xg1_mask(val);
644 } 644 }
645 netxen_nic_write_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, val); 645 netxen_nic_write_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, val);
646 } else { 646 } else {
647 printk(KERN_ERR "%s: Unknown board type: %x\n", 647 printk(KERN_ERR "%s: Unknown board type: %x\n",
648 netxen_nic_driver_name, 648 netxen_nic_driver_name,
649 adapter->ahw.board_type); 649 adapter->ahw.board_type);
650 } 650 }
651 return 0; 651 return 0;
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index a87309c9689c..a88c51f0879b 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -160,7 +160,7 @@ struct netxen_recv_crb recv_crb_registers[] = {
160 }, 160 },
161 /* Jumbo frames */ 161 /* Jumbo frames */
162 { 162 {
163 /* crb_rcv_producer_offset: */ 163 /* crb_rcv_producer_offset: */
164 NETXEN_NIC_REG(0x1f8), 164 NETXEN_NIC_REG(0x1f8),
165 /* crb_rcv_consumer_offset: */ 165 /* crb_rcv_consumer_offset: */
166 NETXEN_NIC_REG(0x1fc), 166 NETXEN_NIC_REG(0x1fc),
@@ -209,7 +209,7 @@ struct netxen_recv_crb recv_crb_registers[] = {
209 }, 209 },
210 /* Jumbo frames */ 210 /* Jumbo frames */
211 { 211 {
212 /* crb_rcv_producer_offset: */ 212 /* crb_rcv_producer_offset: */
213 NETXEN_NIC_REG(0x23c), 213 NETXEN_NIC_REG(0x23c),
214 /* crb_rcv_consumer_offset: */ 214 /* crb_rcv_consumer_offset: */
215 NETXEN_NIC_REG(0x240), 215 NETXEN_NIC_REG(0x240),
@@ -888,7 +888,7 @@ void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 * value)
888 netxen_nic_pci_change_crbwindow(adapter, 1); 888 netxen_nic_pci_change_crbwindow(adapter, 1);
889} 889}
890 890
891static int netxen_pci_set_window_warning_count = 0; 891static int netxen_pci_set_window_warning_count;
892 892
893static unsigned long netxen_nic_pci_set_window(struct netxen_adapter *adapter, 893static unsigned long netxen_nic_pci_set_window(struct netxen_adapter *adapter,
894 unsigned long long addr) 894 unsigned long long addr)
@@ -958,7 +958,7 @@ int
958netxen_nic_erase_pxe(struct netxen_adapter *adapter) 958netxen_nic_erase_pxe(struct netxen_adapter *adapter)
959{ 959{
960 if (netxen_rom_fast_write(adapter, NETXEN_PXE_START, 0) == -1) { 960 if (netxen_rom_fast_write(adapter, NETXEN_PXE_START, 0) == -1) {
961 printk(KERN_ERR "%s: erase pxe failed\n", 961 printk(KERN_ERR "%s: erase pxe failed\n",
962 netxen_nic_driver_name); 962 netxen_nic_driver_name);
963 return -1; 963 return -1;
964 } 964 }
@@ -1039,9 +1039,9 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu)
1039{ 1039{
1040 new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; 1040 new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE;
1041 if (physical_port[adapter->portnum] == 0) 1041 if (physical_port[adapter->portnum] == 0)
1042 netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, 1042 netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE,
1043 new_mtu); 1043 new_mtu);
1044 else 1044 else
1045 netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, 1045 netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE,
1046 new_mtu); 1046 new_mtu);
1047 return 0; 1047 return 0;
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h
index 197e1fc7333d..a3ea1dd98c41 100644
--- a/drivers/net/netxen/netxen_nic_hw.h
+++ b/drivers/net/netxen/netxen_nic_hw.h
@@ -235,7 +235,7 @@ typedef enum {
235 ((config_word) |= 1 << 0) 235 ((config_word) |= 1 << 0)
236#define netxen_xg_set_xg1_mask(config_word) \ 236#define netxen_xg_set_xg1_mask(config_word) \
237 ((config_word) |= 1 << 3) 237 ((config_word) |= 1 << 3)
238 238
239#define netxen_xg_get_xg0_mask(config_word) \ 239#define netxen_xg_get_xg0_mask(config_word) \
240 _netxen_crb_get_bit((config_word), 0) 240 _netxen_crb_get_bit((config_word), 0)
241#define netxen_xg_get_xg1_mask(config_word) \ 241#define netxen_xg_get_xg1_mask(config_word) \
@@ -273,7 +273,7 @@ typedef enum {
273 _netxen_crb_get_bit((config_word), 4) 273 _netxen_crb_get_bit((config_word), 4)
274#define netxen_gb_get_gb3_mask(config_word) \ 274#define netxen_gb_get_gb3_mask(config_word) \
275 _netxen_crb_get_bit((config_word), 6) 275 _netxen_crb_get_bit((config_word), 6)
276 276
277#define netxen_gb_unset_gb0_mask(config_word) \ 277#define netxen_gb_unset_gb0_mask(config_word) \
278 ((config_word) &= ~(1 << 0)) 278 ((config_word) &= ~(1 << 0))
279#define netxen_gb_unset_gb1_mask(config_word) \ 279#define netxen_gb_unset_gb1_mask(config_word) \
@@ -437,7 +437,7 @@ typedef enum {
437 437
438/* 438/*
439 * NIU GB Drop CRC Register 439 * NIU GB Drop CRC Register
440 * 440 *
441 * Bit 0 : drop_gb0 => 1:drop pkts with bad CRCs, 0:pass them on 441 * Bit 0 : drop_gb0 => 1:drop pkts with bad CRCs, 0:pass them on
442 * Bit 1 : drop_gb1 => 1:drop pkts with bad CRCs, 0:pass them on 442 * Bit 1 : drop_gb1 => 1:drop pkts with bad CRCs, 0:pass them on
443 * Bit 2 : drop_gb2 => 1:drop pkts with bad CRCs, 0:pass them on 443 * Bit 2 : drop_gb2 => 1:drop pkts with bad CRCs, 0:pass them on
@@ -480,7 +480,7 @@ typedef enum {
480 480
481/* 481/*
482 * MAC Control Register 482 * MAC Control Register
483 * 483 *
484 * Bit 0-1 : id_pool0 484 * Bit 0-1 : id_pool0
485 * Bit 2 : enable_xtnd0 485 * Bit 2 : enable_xtnd0
486 * Bit 4-5 : id_pool1 486 * Bit 4-5 : id_pool1
@@ -515,7 +515,7 @@ typedef enum {
515 ((config) |= (((val) & 0x0f) << 28)) 515 ((config) |= (((val) & 0x0f) << 28))
516 516
517/* Set promiscuous mode for a GbE interface */ 517/* Set promiscuous mode for a GbE interface */
518int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, 518int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
519 netxen_niu_prom_mode_t mode); 519 netxen_niu_prom_mode_t mode);
520int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, 520int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
521 netxen_niu_prom_mode_t mode); 521 netxen_niu_prom_mode_t mode);
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 1647903a6cf0..74685a1a0b71 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -449,7 +449,7 @@ static int do_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
449} 449}
450 450
451int 451int
452netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, 452netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
453 u8 *bytes, size_t size) 453 u8 *bytes, size_t size)
454{ 454{
455 int ret; 455 int ret;
@@ -490,7 +490,7 @@ int netxen_rom_fast_write(struct netxen_adapter *adapter, int addr, int data)
490} 490}
491#endif /* 0 */ 491#endif /* 0 */
492 492
493static int do_rom_fast_write_words(struct netxen_adapter *adapter, 493static int do_rom_fast_write_words(struct netxen_adapter *adapter,
494 int addr, u8 *bytes, size_t size) 494 int addr, u8 *bytes, size_t size)
495{ 495{
496 int addridx = addr; 496 int addridx = addr;
@@ -505,7 +505,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter,
505 ret = do_rom_fast_write(adapter, addridx, data); 505 ret = do_rom_fast_write(adapter, addridx, data);
506 if (ret < 0) 506 if (ret < 0)
507 return ret; 507 return ret;
508 508
509 while(1) { 509 while(1) {
510 int data1; 510 int data1;
511 511
@@ -518,7 +518,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter,
518 518
519 if (timeout++ >= rom_write_timeout) { 519 if (timeout++ >= rom_write_timeout) {
520 if (last_attempt++ < 4) { 520 if (last_attempt++ < 4) {
521 ret = do_rom_fast_write(adapter, 521 ret = do_rom_fast_write(adapter,
522 addridx, data); 522 addridx, data);
523 if (ret < 0) 523 if (ret < 0)
524 return ret; 524 return ret;
@@ -538,7 +538,7 @@ static int do_rom_fast_write_words(struct netxen_adapter *adapter,
538 return ret; 538 return ret;
539} 539}
540 540
541int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr, 541int netxen_rom_fast_write_words(struct netxen_adapter *adapter, int addr,
542 u8 *bytes, size_t size) 542 u8 *bytes, size_t size)
543{ 543{
544 int ret = 0; 544 int ret = 0;
@@ -562,7 +562,7 @@ static int netxen_rom_wrsr(struct netxen_adapter *adapter, int data)
562 return ret; 562 return ret;
563 563
564 netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_ROM_WDATA, data); 564 netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_ROM_WDATA, data);
565 netxen_crb_writelit_adapter(adapter, 565 netxen_crb_writelit_adapter(adapter,
566 NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0x1); 566 NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0x1);
567 567
568 ret = netxen_wait_rom_done(adapter); 568 ret = netxen_wait_rom_done(adapter);
@@ -592,7 +592,7 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter)
592 char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL); 592 char *buffer = kmalloc(NETXEN_FLASH_SECTOR_SIZE, GFP_KERNEL);
593 593
594 if (!buffer) 594 if (!buffer)
595 return -ENOMEM; 595 return -ENOMEM;
596 /* unlock sector 63 */ 596 /* unlock sector 63 */
597 val = netxen_rom_rdsr(adapter); 597 val = netxen_rom_rdsr(adapter);
598 val = val & 0xe3; 598 val = val & 0xe3;
@@ -605,12 +605,12 @@ int netxen_backup_crbinit(struct netxen_adapter *adapter)
605 goto out_kfree; 605 goto out_kfree;
606 606
607 /* copy sector 0 to sector 63 */ 607 /* copy sector 0 to sector 63 */
608 ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START, 608 ret = netxen_rom_fast_read_words(adapter, NETXEN_CRBINIT_START,
609 buffer, NETXEN_FLASH_SECTOR_SIZE); 609 buffer, NETXEN_FLASH_SECTOR_SIZE);
610 if (ret != FLASH_SUCCESS) 610 if (ret != FLASH_SUCCESS)
611 goto out_kfree; 611 goto out_kfree;
612 612
613 ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START, 613 ret = netxen_rom_fast_write_words(adapter, NETXEN_FIXED_START,
614 buffer, NETXEN_FLASH_SECTOR_SIZE); 614 buffer, NETXEN_FLASH_SECTOR_SIZE);
615 if (ret != FLASH_SUCCESS) 615 if (ret != FLASH_SUCCESS)
616 goto out_kfree; 616 goto out_kfree;
@@ -658,9 +658,9 @@ static void check_erased_flash(struct netxen_adapter *adapter, int addr)
658 int count = 0, erased_errors = 0; 658 int count = 0, erased_errors = 0;
659 int range; 659 int range;
660 660
661 range = (addr == NETXEN_USER_START) ? 661 range = (addr == NETXEN_USER_START) ?
662 NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE; 662 NETXEN_FIXED_START : addr + NETXEN_FLASH_SECTOR_SIZE;
663 663
664 for (i = addr; i < range; i += 4) { 664 for (i = addr; i < range; i += 4) {
665 netxen_rom_fast_read(adapter, i, &val); 665 netxen_rom_fast_read(adapter, i, &val);
666 if (val != 0xffffffff) 666 if (val != 0xffffffff)
@@ -1495,7 +1495,7 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter,
1495 count++; /* now there should be no failure */ 1495 count++; /* now there should be no failure */
1496 pdesc = &rcv_desc->desc_head[producer]; 1496 pdesc = &rcv_desc->desc_head[producer];
1497 skb_reserve(skb, 2); 1497 skb_reserve(skb, 2);
1498 /* 1498 /*
1499 * This will be setup when we receive the 1499 * This will be setup when we receive the
1500 * buffer after it has been filled 1500 * buffer after it has been filled
1501 * skb->dev = netdev; 1501 * skb->dev = netdev;
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c
index 0a261de0a953..48a404aa66ce 100644
--- a/drivers/net/netxen/netxen_nic_isr.c
+++ b/drivers/net/netxen/netxen_nic_isr.c
@@ -48,7 +48,7 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
48 /* total packets received */ 48 /* total packets received */
49 stats->rx_packets = adapter->stats.no_rcv; 49 stats->rx_packets = adapter->stats.no_rcv;
50 /* total packets transmitted */ 50 /* total packets transmitted */
51 stats->tx_packets = adapter->stats.xmitedframes + 51 stats->tx_packets = adapter->stats.xmitedframes +
52 adapter->stats.xmitfinished; 52 adapter->stats.xmitfinished;
53 /* total bytes received */ 53 /* total bytes received */
54 stats->rx_bytes = adapter->stats.rxbytes; 54 stats->rx_bytes = adapter->stats.rxbytes;
@@ -84,7 +84,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable)
84 84
85 /* This should clear the interrupt source */ 85 /* This should clear the interrupt source */
86 if (adapter->phy_read) 86 if (adapter->phy_read)
87 adapter->phy_read(adapter, 87 adapter->phy_read(adapter,
88 NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS, 88 NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS,
89 &int_src); 89 &int_src);
90 if (int_src == 0) { 90 if (int_src == 0) {
@@ -113,7 +113,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable)
113 DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); 113 DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n");
114 114
115 if (adapter->phy_read 115 if (adapter->phy_read
116 && adapter->phy_read(adapter, 116 && adapter->phy_read(adapter,
117 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, 117 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
118 &status) == 0) { 118 &status) == 0) {
119 if (netxen_get_phy_int_link_status_changed(int_src)) { 119 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 netxen_nic_driver_name, 127 netxen_nic_driver_name,
128 adapter->netdev->name); 128 adapter->netdev->name);
129 } 129 }
130 netxen_indicate_link_status(adapter, 130 netxen_indicate_link_status(adapter,
131 netxen_get_phy_link 131 netxen_get_phy_link
132 (status)); 132 (status));
133 } 133 }
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 97006e16f6de..97ba14b759b4 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -350,7 +350,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
350 first_page_group_start = 0; 350 first_page_group_start = 0;
351 first_page_group_end = 0; 351 first_page_group_end = 0;
352 } else { 352 } else {
353 err = -EIO; 353 err = -EIO;
354 goto err_out_free_netdev; 354 goto err_out_free_netdev;
355 } 355 }
356 356
@@ -410,7 +410,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
410 netdev->open = netxen_nic_open; 410 netdev->open = netxen_nic_open;
411 netdev->stop = netxen_nic_close; 411 netdev->stop = netxen_nic_close;
412 netdev->hard_start_xmit = netxen_nic_xmit_frame; 412 netdev->hard_start_xmit = netxen_nic_xmit_frame;
413 netdev->get_stats = netxen_nic_get_stats; 413 netdev->get_stats = netxen_nic_get_stats;
414 netdev->set_multicast_list = netxen_nic_set_multi; 414 netdev->set_multicast_list = netxen_nic_set_multi;
415 netdev->set_mac_address = netxen_nic_set_mac; 415 netdev->set_mac_address = netxen_nic_set_mac;
416 netdev->change_mtu = netxen_nic_change_mtu; 416 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 457
458 adapter->max_tx_desc_count = MAX_CMD_DESCRIPTORS_HOST; 458 adapter->max_tx_desc_count = MAX_CMD_DESCRIPTORS_HOST;
459 if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB35_4G) || 459 if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB35_4G) ||
460 (adapter->ahw.boardcfg.board_type == 460 (adapter->ahw.boardcfg.board_type ==
461 NETXEN_BRDTYPE_P2_SB31_2G)) 461 NETXEN_BRDTYPE_P2_SB31_2G))
462 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; 462 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
463 else 463 else
464 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS; 464 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 583
584 if (adapter->portnum == 0) { 584 if (adapter->portnum == 0) {
585 err = netxen_initialize_adapter_offload(adapter); 585 err = netxen_initialize_adapter_offload(adapter);
586 if (err) 586 if (err)
587 goto err_out_free_rx_buffer; 587 goto err_out_free_rx_buffer;
588 val = readl(NETXEN_CRB_NORMALIZE(adapter, 588 val = readl(NETXEN_CRB_NORMALIZE(adapter,
589 NETXEN_CAM_RAM(0x1fc))); 589 NETXEN_CAM_RAM(0x1fc)));
590 if (val == 0x55555555) { 590 if (val == 0x55555555) {
591 /* This is the first boot after power up */ 591 /* 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 /* 619 /*
620 * Tell the hardware our version number. 620 * Tell the hardware our version number.
621 */ 621 */
622 i = (_NETXEN_NIC_LINUX_MAJOR << 16) 622 i = (_NETXEN_NIC_LINUX_MAJOR << 16)
623 | ((_NETXEN_NIC_LINUX_MINOR << 8)) 623 | ((_NETXEN_NIC_LINUX_MINOR << 8))
624 | (_NETXEN_NIC_LINUX_SUBVERSION); 624 | (_NETXEN_NIC_LINUX_SUBVERSION);
625 writel(i, NETXEN_CRB_NORMALIZE(adapter, CRB_DRIVER_VERSION)); 625 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 break; 659 break;
660 660
661 case NETXEN_NIC_XGBE: 661 case NETXEN_NIC_XGBE:
662 printk(KERN_INFO "%s: XGbE board initialized\n", 662 printk(KERN_INFO "%s: XGbE board initialized\n",
663 netxen_nic_driver_name); 663 netxen_nic_driver_name);
664 break; 664 break;
665 } 665 }
@@ -930,7 +930,7 @@ static int netxen_nic_close(struct net_device *netdev)
930 buffrag++; 930 buffrag++;
931 if (buffrag->dma) { 931 if (buffrag->dma) {
932 pci_unmap_page(adapter->pdev, buffrag->dma, 932 pci_unmap_page(adapter->pdev, buffrag->dma,
933 buffrag->length, 933 buffrag->length,
934 PCI_DMA_TODEVICE); 934 PCI_DMA_TODEVICE);
935 buffrag->dma = 0ULL; 935 buffrag->dma = 0ULL;
936 } 936 }
@@ -1194,7 +1194,7 @@ static void netxen_tx_timeout(struct net_device *netdev)
1194 1194
1195static void netxen_tx_timeout_task(struct work_struct *work) 1195static void netxen_tx_timeout_task(struct work_struct *work)
1196{ 1196{
1197 struct netxen_adapter *adapter = 1197 struct netxen_adapter *adapter =
1198 container_of(work, struct netxen_adapter, tx_timeout_task); 1198 container_of(work, struct netxen_adapter, tx_timeout_task);
1199 1199
1200 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", 1200 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n",
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c
index 2815689bc9af..1c852a76c80d 100644
--- a/drivers/net/netxen/netxen_nic_niu.c
+++ b/drivers/net/netxen/netxen_nic_niu.c
@@ -75,7 +75,7 @@ static int phy_unlock(struct netxen_adapter *adapter)
75 return 0; 75 return 0;
76} 76}
77 77
78/* 78/*
79 * netxen_niu_gbe_phy_read - read a register from the GbE PHY via 79 * netxen_niu_gbe_phy_read - read a register from the GbE PHY via
80 * mii management interface. 80 * mii management interface.
81 * 81 *
@@ -88,7 +88,7 @@ static int phy_unlock(struct netxen_adapter *adapter)
88 * -1 on error 88 * -1 on error
89 * 89 *
90 */ 90 */
91int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, 91int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
92 __u32 * readval) 92 __u32 * readval)
93{ 93{
94 long timeout = 0; 94 long timeout = 0;
@@ -171,7 +171,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
171 return result; 171 return result;
172} 172}
173 173
174/* 174/*
175 * netxen_niu_gbe_phy_write - write a register to the GbE PHY via 175 * netxen_niu_gbe_phy_write - write a register to the GbE PHY via
176 * mii management interface. 176 * mii management interface.
177 * 177 *
@@ -184,7 +184,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
184 * -1 on error 184 * -1 on error
185 * 185 *
186 */ 186 */
187int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, 187int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg,
188 __u32 val) 188 __u32 val)
189{ 189{
190 long timeout = 0; 190 long timeout = 0;
@@ -275,7 +275,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter)
275 netxen_set_phy_int_speed_changed(enable); 275 netxen_set_phy_int_speed_changed(enable);
276 276
277 if (0 != 277 if (0 !=
278 netxen_niu_gbe_phy_write(adapter, 278 netxen_niu_gbe_phy_write(adapter,
279 NETXEN_NIU_GB_MII_MGMT_ADDR_INT_ENABLE, 279 NETXEN_NIU_GB_MII_MGMT_ADDR_INT_ENABLE,
280 enable)) 280 enable))
281 result = -EIO; 281 result = -EIO;
@@ -312,7 +312,7 @@ static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter)
312{ 312{
313 int result = 0; 313 int result = 0;
314 if (0 != 314 if (0 !=
315 netxen_niu_gbe_phy_write(adapter, 315 netxen_niu_gbe_phy_write(adapter,
316 NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS, 316 NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS,
317 -EIO)) 317 -EIO))
318 result = -EIO; 318 result = -EIO;
@@ -320,7 +320,7 @@ static int netxen_niu_gbe_clear_phy_interrupts(struct netxen_adapter *adapter)
320 return result; 320 return result;
321} 321}
322 322
323/* 323/*
324 * netxen_niu_gbe_set_mii_mode- Set 10/100 Mbit Mode for GbE MAC 324 * netxen_niu_gbe_set_mii_mode- Set 10/100 Mbit Mode for GbE MAC
325 * 325 *
326 */ 326 */
@@ -344,9 +344,9 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter,
344 NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7); 344 NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7);
345 345
346 if (enable) { 346 if (enable) {
347 /* 347 /*
348 * Do NOT enable flow control until a suitable solution for 348 * Do NOT enable flow control until a suitable solution for
349 * shutting down pause frames is found. 349 * shutting down pause frames is found.
350 */ 350 */
351 netxen_crb_writelit_adapter(adapter, 351 netxen_crb_writelit_adapter(adapter,
352 NETXEN_NIU_GB_MAC_CONFIG_0(port), 352 NETXEN_NIU_GB_MAC_CONFIG_0(port),
@@ -359,7 +359,7 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter,
359 printk(KERN_ERR PFX "ERROR clearing PHY interrupts\n"); 359 printk(KERN_ERR PFX "ERROR clearing PHY interrupts\n");
360} 360}
361 361
362/* 362/*
363 * netxen_niu_gbe_set_gmii_mode- Set GbE Mode for GbE MAC 363 * netxen_niu_gbe_set_gmii_mode- Set GbE Mode for GbE MAC
364 */ 364 */
365static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, 365static 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 NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7); 382 NETXEN_NIU_GB_MII_MGMT_CONFIG(port), 0x7);
383 383
384 if (enable) { 384 if (enable) {
385 /* 385 /*
386 * Do NOT enable flow control until a suitable solution for 386 * Do NOT enable flow control until a suitable solution for
387 * shutting down pause frames is found. 387 * shutting down pause frames is found.
388 */ 388 */
389 netxen_crb_writelit_adapter(adapter, 389 netxen_crb_writelit_adapter(adapter,
390 NETXEN_NIU_GB_MAC_CONFIG_0(port), 390 NETXEN_NIU_GB_MAC_CONFIG_0(port),
@@ -467,7 +467,7 @@ int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port)
467} 467}
468 468
469#if 0 469#if 0
470/* 470/*
471 * netxen_niu_gbe_handle_phy_interrupt - Handles GbE PHY interrupts 471 * netxen_niu_gbe_handle_phy_interrupt - Handles GbE PHY interrupts
472 * @param enable 0 means don't enable the port 472 * @param enable 0 means don't enable the port
473 * 1 means enable (or re-enable) the port 473 * 1 means enable (or re-enable) the port
@@ -623,7 +623,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
623 (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4)) 623 (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4))
624 return -2; 624 return -2;
625 625
626 netxen_niu_macaddr_get(adapter, 626 netxen_niu_macaddr_get(adapter,
627 (netxen_ethernet_macaddr_t *) mac_addr); 627 (netxen_ethernet_macaddr_t *) mac_addr);
628 if (memcmp(mac_addr, addr, 6) == 0) 628 if (memcmp(mac_addr, addr, 6) == 0)
629 break; 629 break;
@@ -753,7 +753,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
753} 753}
754 754
755/* Set promiscuous mode for a GbE interface */ 755/* Set promiscuous mode for a GbE interface */
756int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, 756int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
757 netxen_niu_prom_mode_t mode) 757 netxen_niu_prom_mode_t mode)
758{ 758{
759 __u32 reg; 759 __u32 reg;
diff --git a/drivers/net/netxen/netxen_nic_phan_reg.h b/drivers/net/netxen/netxen_nic_phan_reg.h
index a6c28de1dbc5..ffa3b7215ce8 100644
--- a/drivers/net/netxen/netxen_nic_phan_reg.h
+++ b/drivers/net/netxen/netxen_nic_phan_reg.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (C) 2003 - 2006 NetXen, Inc. 2 * Copyright (C) 2003 - 2006 NetXen, Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License 6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2 7 * as published by the Free Software Foundation; either version 2
@@ -16,10 +16,10 @@
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 * MA 02111-1307, USA. 18 * MA 02111-1307, USA.
19 * 19 *
20 * The full GNU General Public License is included in this distribution 20 * The full GNU General Public License is included in this distribution
21 * in the file called LICENSE. 21 * in the file called LICENSE.
22 * 22 *
23 * Contact Information: 23 * Contact Information:
24 * info@netxen.com 24 * info@netxen.com
25 * NetXen, 25 * NetXen,
@@ -30,7 +30,7 @@
30#ifndef __NIC_PHAN_REG_H_ 30#ifndef __NIC_PHAN_REG_H_
31#define __NIC_PHAN_REG_H_ 31#define __NIC_PHAN_REG_H_
32 32
33/* 33/*
34 * CRB Registers or queue message done only at initialization time. 34 * CRB Registers or queue message done only at initialization time.
35 */ 35 */
36#define NIC_CRB_BASE NETXEN_CAM_RAM(0x200) 36#define NIC_CRB_BASE NETXEN_CAM_RAM(0x200)