aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-04-07 18:50:38 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-08 18:58:24 -0400
commite98e3350c03af4187e1d5fe007c7b460e378990c (patch)
tree5245bf0e0662ab27d1f8b33e629e4b0d118aa189 /drivers/net
parent577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff)
netxen: code cleanup
o remove unused structure defs. o remove unnecessary includes. o replace enums with specific #defines. o reduce footprint of stats structure. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/netxen/netxen_nic.h246
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c11
-rw-r--r--drivers/net/netxen/netxen_nic_hdr.h8
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c17
-rw-r--r--drivers/net/netxen/netxen_nic_hw.h66
-rw-r--r--drivers/net/netxen/netxen_nic_main.c19
-rw-r--r--drivers/net/netxen/netxen_nic_niu.c14
-rw-r--r--drivers/net/netxen/netxen_nic_phan_reg.h21
8 files changed, 146 insertions, 256 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index c40815169f35..184eb6f76d55 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -34,10 +34,6 @@
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/types.h> 36#include <linux/types.h>
37#include <linux/compiler.h>
38#include <linux/slab.h>
39#include <linux/delay.h>
40#include <linux/init.h>
41#include <linux/ioport.h> 37#include <linux/ioport.h>
42#include <linux/pci.h> 38#include <linux/pci.h>
43#include <linux/netdevice.h> 39#include <linux/netdevice.h>
@@ -49,18 +45,12 @@
49 45
50#include <linux/ethtool.h> 46#include <linux/ethtool.h>
51#include <linux/mii.h> 47#include <linux/mii.h>
52#include <linux/interrupt.h>
53#include <linux/timer.h> 48#include <linux/timer.h>
54 49
55#include <linux/mm.h>
56#include <linux/mman.h>
57#include <linux/vmalloc.h> 50#include <linux/vmalloc.h>
58 51
59#include <asm/system.h>
60#include <asm/io.h> 52#include <asm/io.h>
61#include <asm/byteorder.h> 53#include <asm/byteorder.h>
62#include <asm/uaccess.h>
63#include <asm/pgtable.h>
64 54
65#include "netxen_nic_hw.h" 55#include "netxen_nic_hw.h"
66 56
@@ -118,6 +108,7 @@
118#define NX_P3_A2 0x30 108#define NX_P3_A2 0x30
119#define NX_P3_B0 0x40 109#define NX_P3_B0 0x40
120#define NX_P3_B1 0x41 110#define NX_P3_B1 0x41
111#define NX_P3_B2 0x42
121 112
122#define NX_IS_REVISION_P2(REVISION) (REVISION <= NX_P2_C1) 113#define NX_IS_REVISION_P2(REVISION) (REVISION <= NX_P2_C1)
123#define NX_IS_REVISION_P3(REVISION) (REVISION >= NX_P3_A0) 114#define NX_IS_REVISION_P3(REVISION) (REVISION >= NX_P3_A0)
@@ -203,18 +194,8 @@
203#define MAX_RCV_DESCRIPTORS_10G 4096 194#define MAX_RCV_DESCRIPTORS_10G 4096
204#define MAX_JUMBO_RCV_DESCRIPTORS 1024 195#define MAX_JUMBO_RCV_DESCRIPTORS 1024
205#define MAX_LRO_RCV_DESCRIPTORS 8 196#define MAX_LRO_RCV_DESCRIPTORS 8
206#define MAX_RCVSTATUS_DESCRIPTORS MAX_RCV_DESCRIPTORS
207#define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS
208#define MAX_RCV_DESC MAX_RCV_DESCRIPTORS
209#define MAX_RCVSTATUS_DESC MAX_RCV_DESCRIPTORS
210#define MAX_EPG_DESCRIPTORS (MAX_CMD_DESCRIPTORS * 8)
211#define NUM_RCV_DESC (MAX_RCV_DESC + MAX_JUMBO_RCV_DESCRIPTORS + \
212 MAX_LRO_RCV_DESCRIPTORS)
213#define MIN_TX_COUNT 4096
214#define MIN_RX_COUNT 4096
215#define NETXEN_CTX_SIGNATURE 0xdee0 197#define NETXEN_CTX_SIGNATURE 0xdee0
216#define NETXEN_RCV_PRODUCER(ringid) (ringid) 198#define NETXEN_RCV_PRODUCER(ringid) (ringid)
217#define MAX_FRAME_SIZE 0x10000 /* 64K MAX size for LSO */
218 199
219#define PHAN_PEG_RCV_INITIALIZED 0xff01 200#define PHAN_PEG_RCV_INITIALIZED 0xff01
220#define PHAN_PEG_RCV_START_INITIALIZE 0xff00 201#define PHAN_PEG_RCV_START_INITIALIZE 0xff00
@@ -384,11 +365,6 @@ struct rcv_desc {
384 365
385/* Note: sizeof(status_desc) should always be a mutliple of 2 */ 366/* Note: sizeof(status_desc) should always be a mutliple of 2 */
386 367
387#define netxen_get_sts_desc_lro_cnt(status_desc) \
388 ((status_desc)->lro & 0x7F)
389#define netxen_get_sts_desc_lro_last_frag(status_desc) \
390 (((status_desc)->lro & 0x80) >> 7)
391
392#define netxen_get_sts_port(sts_data) \ 368#define netxen_get_sts_port(sts_data) \
393 ((sts_data) & 0x0F) 369 ((sts_data) & 0x0F)
394#define netxen_get_sts_status(sts_data) \ 370#define netxen_get_sts_status(sts_data) \
@@ -434,10 +410,6 @@ struct status_desc {
434 }; 410 };
435} __attribute__ ((aligned(16))); 411} __attribute__ ((aligned(16)));
436 412
437enum {
438 NETXEN_RCV_PEG_0 = 0,
439 NETXEN_RCV_PEG_1
440};
441/* The version of the main data structure */ 413/* The version of the main data structure */
442#define NETXEN_BDINFO_VERSION 1 414#define NETXEN_BDINFO_VERSION 1
443 415
@@ -447,85 +419,35 @@ enum {
447/* Max number of Gig ports on a Phantom board */ 419/* Max number of Gig ports on a Phantom board */
448#define NETXEN_MAX_PORTS 4 420#define NETXEN_MAX_PORTS 4
449 421
450typedef enum { 422#define NETXEN_BRDTYPE_P1_BD 0x0000
451 NETXEN_BRDTYPE_P1_BD = 0x0000, 423#define NETXEN_BRDTYPE_P1_SB 0x0001
452 NETXEN_BRDTYPE_P1_SB = 0x0001, 424#define NETXEN_BRDTYPE_P1_SMAX 0x0002
453 NETXEN_BRDTYPE_P1_SMAX = 0x0002, 425#define NETXEN_BRDTYPE_P1_SOCK 0x0003
454 NETXEN_BRDTYPE_P1_SOCK = 0x0003, 426
455 427#define NETXEN_BRDTYPE_P2_SOCK_31 0x0008
456 NETXEN_BRDTYPE_P2_SOCK_31 = 0x0008, 428#define NETXEN_BRDTYPE_P2_SOCK_35 0x0009
457 NETXEN_BRDTYPE_P2_SOCK_35 = 0x0009, 429#define NETXEN_BRDTYPE_P2_SB35_4G 0x000a
458 NETXEN_BRDTYPE_P2_SB35_4G = 0x000a, 430#define NETXEN_BRDTYPE_P2_SB31_10G 0x000b
459 NETXEN_BRDTYPE_P2_SB31_10G = 0x000b, 431#define NETXEN_BRDTYPE_P2_SB31_2G 0x000c
460 NETXEN_BRDTYPE_P2_SB31_2G = 0x000c, 432
461 433#define NETXEN_BRDTYPE_P2_SB31_10G_IMEZ 0x000d
462 NETXEN_BRDTYPE_P2_SB31_10G_IMEZ = 0x000d, 434#define NETXEN_BRDTYPE_P2_SB31_10G_HMEZ 0x000e
463 NETXEN_BRDTYPE_P2_SB31_10G_HMEZ = 0x000e, 435#define NETXEN_BRDTYPE_P2_SB31_10G_CX4 0x000f
464 NETXEN_BRDTYPE_P2_SB31_10G_CX4 = 0x000f, 436
465 437#define NETXEN_BRDTYPE_P3_REF_QG 0x0021
466 NETXEN_BRDTYPE_P3_REF_QG = 0x0021, 438#define NETXEN_BRDTYPE_P3_HMEZ 0x0022
467 NETXEN_BRDTYPE_P3_HMEZ = 0x0022, 439#define NETXEN_BRDTYPE_P3_10G_CX4_LP 0x0023
468 NETXEN_BRDTYPE_P3_10G_CX4_LP = 0x0023, 440#define NETXEN_BRDTYPE_P3_4_GB 0x0024
469 NETXEN_BRDTYPE_P3_4_GB = 0x0024, 441#define NETXEN_BRDTYPE_P3_IMEZ 0x0025
470 NETXEN_BRDTYPE_P3_IMEZ = 0x0025, 442#define NETXEN_BRDTYPE_P3_10G_SFP_PLUS 0x0026
471 NETXEN_BRDTYPE_P3_10G_SFP_PLUS = 0x0026, 443#define NETXEN_BRDTYPE_P3_10000_BASE_T 0x0027
472 NETXEN_BRDTYPE_P3_10000_BASE_T = 0x0027, 444#define NETXEN_BRDTYPE_P3_XG_LOM 0x0028
473 NETXEN_BRDTYPE_P3_XG_LOM = 0x0028, 445#define NETXEN_BRDTYPE_P3_4_GB_MM 0x0029
474 NETXEN_BRDTYPE_P3_4_GB_MM = 0x0029, 446#define NETXEN_BRDTYPE_P3_10G_SFP_CT 0x002a
475 NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a, 447#define NETXEN_BRDTYPE_P3_10G_SFP_QT 0x002b
476 NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b, 448#define NETXEN_BRDTYPE_P3_10G_CX4 0x0031
477 NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, 449#define NETXEN_BRDTYPE_P3_10G_XFP 0x0032
478 NETXEN_BRDTYPE_P3_10G_XFP = 0x0032, 450#define NETXEN_BRDTYPE_P3_10G_TP 0x0080
479 NETXEN_BRDTYPE_P3_10G_TP = 0x0080
480
481} netxen_brdtype_t;
482
483typedef enum {
484 NETXEN_BRDMFG_INVENTEC = 1
485} netxen_brdmfg;
486
487typedef enum {
488 MEM_ORG_128Mbx4 = 0x0, /* DDR1 only */
489 MEM_ORG_128Mbx8 = 0x1, /* DDR1 only */
490 MEM_ORG_128Mbx16 = 0x2, /* DDR1 only */
491 MEM_ORG_256Mbx4 = 0x3,
492 MEM_ORG_256Mbx8 = 0x4,
493 MEM_ORG_256Mbx16 = 0x5,
494 MEM_ORG_512Mbx4 = 0x6,
495 MEM_ORG_512Mbx8 = 0x7,
496 MEM_ORG_512Mbx16 = 0x8,
497 MEM_ORG_1Gbx4 = 0x9,
498 MEM_ORG_1Gbx8 = 0xa,
499 MEM_ORG_1Gbx16 = 0xb,
500 MEM_ORG_2Gbx4 = 0xc,
501 MEM_ORG_2Gbx8 = 0xd,
502 MEM_ORG_2Gbx16 = 0xe,
503 MEM_ORG_128Mbx32 = 0x10002, /* GDDR only */
504 MEM_ORG_256Mbx32 = 0x10005 /* GDDR only */
505} netxen_mn_mem_org_t;
506
507typedef enum {
508 MEM_ORG_512Kx36 = 0x0,
509 MEM_ORG_1Mx36 = 0x1,
510 MEM_ORG_2Mx36 = 0x2
511} netxen_sn_mem_org_t;
512
513typedef enum {
514 MEM_DEPTH_4MB = 0x1,
515 MEM_DEPTH_8MB = 0x2,
516 MEM_DEPTH_16MB = 0x3,
517 MEM_DEPTH_32MB = 0x4,
518 MEM_DEPTH_64MB = 0x5,
519 MEM_DEPTH_128MB = 0x6,
520 MEM_DEPTH_256MB = 0x7,
521 MEM_DEPTH_512MB = 0x8,
522 MEM_DEPTH_1GB = 0x9,
523 MEM_DEPTH_2GB = 0xa,
524 MEM_DEPTH_4GB = 0xb,
525 MEM_DEPTH_8GB = 0xc,
526 MEM_DEPTH_16GB = 0xd,
527 MEM_DEPTH_32GB = 0xe
528} netxen_mem_depth_t;
529 451
530struct netxen_board_info { 452struct netxen_board_info {
531 u32 header_version; 453 u32 header_version;
@@ -676,17 +598,15 @@ struct netxen_new_user_info {
676#define PRIMARY_IMAGE_BAD 0xffffffff 598#define PRIMARY_IMAGE_BAD 0xffffffff
677 599
678/* Flash memory map */ 600/* Flash memory map */
679typedef enum { 601#define NETXEN_CRBINIT_START 0 /* crbinit section */
680 NETXEN_CRBINIT_START = 0, /* Crbinit section */ 602#define NETXEN_BRDCFG_START 0x4000 /* board config */
681 NETXEN_BRDCFG_START = 0x4000, /* board config */ 603#define NETXEN_INITCODE_START 0x6000 /* pegtune code */
682 NETXEN_INITCODE_START = 0x6000, /* pegtune code */ 604#define NETXEN_BOOTLD_START 0x10000 /* bootld */
683 NETXEN_BOOTLD_START = 0x10000, /* bootld */ 605#define NETXEN_IMAGE_START 0x43000 /* compressed image */
684 NETXEN_IMAGE_START = 0x43000, /* compressed image */ 606#define NETXEN_SECONDARY_START 0x200000 /* backup images */
685 NETXEN_SECONDARY_START = 0x200000, /* backup images */ 607#define NETXEN_PXE_START 0x3E0000 /* PXE boot rom */
686 NETXEN_PXE_START = 0x3E0000, /* user defined region */ 608#define NETXEN_USER_START 0x3E8000 /* Firmare info */
687 NETXEN_USER_START = 0x3E8000, /* User defined region for new boards */ 609#define NETXEN_FIXED_START 0x3F0000 /* backup of crbinit */
688 NETXEN_FIXED_START = 0x3F0000 /* backup of crbinit */
689} netxen_flash_map_t;
690 610
691#define NX_FW_VERSION_OFFSET (NETXEN_USER_START+0x408) 611#define NX_FW_VERSION_OFFSET (NETXEN_USER_START+0x408)
692#define NX_FW_SIZE_OFFSET (NETXEN_USER_START+0x40c) 612#define NX_FW_SIZE_OFFSET (NETXEN_USER_START+0x40c)
@@ -708,21 +628,8 @@ typedef enum {
708#define NETXEN_FLASH_SECONDARY_SIZE (NETXEN_USER_START-NETXEN_SECONDARY_START) 628#define NETXEN_FLASH_SECONDARY_SIZE (NETXEN_USER_START-NETXEN_SECONDARY_START)
709#define NETXEN_NUM_PRIMARY_SECTORS (0x20) 629#define NETXEN_NUM_PRIMARY_SECTORS (0x20)
710#define NETXEN_NUM_CONFIG_SECTORS (1) 630#define NETXEN_NUM_CONFIG_SECTORS (1)
711#define PFX "NetXen: "
712extern char netxen_nic_driver_name[]; 631extern char netxen_nic_driver_name[];
713 632
714/* Note: Make sure to not call this before adapter->port is valid */
715#if !defined(NETXEN_DEBUG)
716#define DPRINTK(klevel, fmt, args...) do { \
717 } while (0)
718#else
719#define DPRINTK(klevel, fmt, args...) do { \
720 printk(KERN_##klevel PFX "%s: %s: " fmt, __func__,\
721 (adapter != NULL && adapter->netdev != NULL) ? \
722 adapter->netdev->name : NULL, \
723 ## args); } while(0)
724#endif
725
726/* Number of status descriptors to handle per interrupt */ 633/* Number of status descriptors to handle per interrupt */
727#define MAX_STATUS_HANDLE (64) 634#define MAX_STATUS_HANDLE (64)
728 635
@@ -807,20 +714,14 @@ struct netxen_hardware_context {
807#define ETHERNET_FCS_SIZE 4 714#define ETHERNET_FCS_SIZE 4
808 715
809struct netxen_adapter_stats { 716struct netxen_adapter_stats {
810 u64 rcvdbadskb;
811 u64 xmitcalled; 717 u64 xmitcalled;
812 u64 xmitedframes;
813 u64 xmitfinished; 718 u64 xmitfinished;
814 u64 badskblen;
815 u64 nocmddescriptor;
816 u64 polled;
817 u64 rxdropped; 719 u64 rxdropped;
818 u64 txdropped; 720 u64 txdropped;
819 u64 csummed; 721 u64 csummed;
820 u64 no_rcv; 722 u64 no_rcv;
821 u64 rxbytes; 723 u64 rxbytes;
822 u64 txbytes; 724 u64 txbytes;
823 u64 ints;
824}; 725};
825 726
826/* 727/*
@@ -1154,26 +1055,53 @@ typedef struct {
1154 1055
1155#define NX_MAC_EVENT 0x1 1056#define NX_MAC_EVENT 0x1
1156 1057
1157enum { 1058/*
1158 NX_NIC_H2C_OPCODE_START = 0, 1059 * Driver --> Firmware
1159 NX_NIC_H2C_OPCODE_CONFIG_RSS, 1060 */
1160 NX_NIC_H2C_OPCODE_CONFIG_RSS_TBL, 1061#define NX_NIC_H2C_OPCODE_START 0
1161 NX_NIC_H2C_OPCODE_CONFIG_INTR_COALESCE, 1062#define NX_NIC_H2C_OPCODE_CONFIG_RSS 1
1162 NX_NIC_H2C_OPCODE_CONFIG_LED, 1063#define NX_NIC_H2C_OPCODE_CONFIG_RSS_TBL 2
1163 NX_NIC_H2C_OPCODE_CONFIG_PROMISCUOUS, 1064#define NX_NIC_H2C_OPCODE_CONFIG_INTR_COALESCE 3
1164 NX_NIC_H2C_OPCODE_CONFIG_L2_MAC, 1065#define NX_NIC_H2C_OPCODE_CONFIG_LED 4
1165 NX_NIC_H2C_OPCODE_LRO_REQUEST, 1066#define NX_NIC_H2C_OPCODE_CONFIG_PROMISCUOUS 5
1166 NX_NIC_H2C_OPCODE_GET_SNMP_STATS, 1067#define NX_NIC_H2C_OPCODE_CONFIG_L2_MAC 6
1167 NX_NIC_H2C_OPCODE_PROXY_START_REQUEST, 1068#define NX_NIC_H2C_OPCODE_LRO_REQUEST 7
1168 NX_NIC_H2C_OPCODE_PROXY_STOP_REQUEST, 1069#define NX_NIC_H2C_OPCODE_GET_SNMP_STATS 8
1169 NX_NIC_H2C_OPCODE_PROXY_SET_MTU, 1070#define NX_NIC_H2C_OPCODE_PROXY_START_REQUEST 9
1170 NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE, 1071#define NX_NIC_H2C_OPCODE_PROXY_STOP_REQUEST 10
1171 NX_H2P_OPCODE_GET_FINGER_PRINT_REQUEST, 1072#define NX_NIC_H2C_OPCODE_PROXY_SET_MTU 11
1172 NX_H2P_OPCODE_INSTALL_LICENSE_REQUEST, 1073#define NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE 12
1173 NX_H2P_OPCODE_GET_LICENSE_CAPABILITY_REQUEST, 1074#define NX_NIC_H2C_OPCODE_GET_FINGER_PRINT_REQUEST 13
1174 NX_NIC_H2C_OPCODE_GET_NET_STATS, 1075#define NX_NIC_H2C_OPCODE_INSTALL_LICENSE_REQUEST 14
1175 NX_NIC_H2C_OPCODE_LAST 1076#define NX_NIC_H2C_OPCODE_GET_LICENSE_CAPABILITY_REQUEST 15
1176}; 1077#define NX_NIC_H2C_OPCODE_GET_NET_STATS 16
1078#define NX_NIC_H2C_OPCODE_PROXY_UPDATE_P2V 17
1079#define NX_NIC_H2C_OPCODE_CONFIG_IPADDR 18
1080#define NX_NIC_H2C_OPCODE_CONFIG_LOOPBACK 19
1081#define NX_NIC_H2C_OPCODE_PROXY_STOP_DONE 20
1082#define NX_NIC_H2C_OPCODE_GET_LINKEVENT 21
1083#define NX_NIC_C2C_OPCODE 22
1084#define NX_NIC_H2C_OPCODE_LAST 23
1085
1086/*
1087 * Firmware --> Driver
1088 */
1089
1090#define NX_NIC_C2H_OPCODE_START 128
1091#define NX_NIC_C2H_OPCODE_CONFIG_RSS_RESPONSE 129
1092#define NX_NIC_C2H_OPCODE_CONFIG_RSS_TBL_RESPONSE 130
1093#define NX_NIC_C2H_OPCODE_CONFIG_MAC_RESPONSE 131
1094#define NX_NIC_C2H_OPCODE_CONFIG_PROMISCUOUS_RESPONSE 132
1095#define NX_NIC_C2H_OPCODE_CONFIG_L2_MAC_RESPONSE 133
1096#define NX_NIC_C2H_OPCODE_LRO_DELETE_RESPONSE 134
1097#define NX_NIC_C2H_OPCODE_LRO_ADD_FAILURE_RESPONSE 135
1098#define NX_NIC_C2H_OPCODE_GET_SNMP_STATS 136
1099#define NX_NIC_C2H_OPCODE_GET_FINGER_PRINT_REPLY 137
1100#define NX_NIC_C2H_OPCODE_INSTALL_LICENSE_REPLY 138
1101#define NX_NIC_C2H_OPCODE_GET_LICENSE_CAPABILITIES_REPLY 139
1102#define NX_NIC_C2H_OPCODE_GET_NET_STATS_RESPONSE 140
1103#define NX_NIC_C2H_OPCODE_GET_LINKEVENT_RESPONSE 141
1104#define NX_NIC_C2H_OPCODE_LAST 142
1177 1105
1178#define VPORT_MISS_MODE_DROP 0 /* drop all unmatched */ 1106#define VPORT_MISS_MODE_DROP 0 /* drop all unmatched */
1179#define VPORT_MISS_MODE_ACCEPT_ALL 1 /* accept all packets */ 1107#define VPORT_MISS_MODE_ACCEPT_ALL 1 /* accept all packets */
@@ -1491,7 +1419,7 @@ void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter,
1491 1419
1492#define NETXEN_MAX_SHORT_NAME 32 1420#define NETXEN_MAX_SHORT_NAME 32
1493struct netxen_brdinfo { 1421struct netxen_brdinfo {
1494 netxen_brdtype_t brdtype; /* type of board */ 1422 int brdtype; /* type of board */
1495 long ports; /* max no of physical ports */ 1423 long ports; /* max no of physical ports */
1496 char short_name[NETXEN_MAX_SHORT_NAME]; 1424 char short_name[NETXEN_MAX_SHORT_NAME];
1497}; 1425};
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index a677ff895184..fe910c1715d6 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -30,7 +30,6 @@
30 30
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <asm/uaccess.h>
34#include <linux/pci.h> 33#include <linux/pci.h>
35#include <asm/io.h> 34#include <asm/io.h>
36#include <linux/netdevice.h> 35#include <linux/netdevice.h>
@@ -53,13 +52,9 @@ struct netxen_nic_stats {
53#define NETXEN_NIC_INVALID_DATA 0xDEADBEEF 52#define NETXEN_NIC_INVALID_DATA 0xDEADBEEF
54 53
55static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = { 54static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = {
56 {"rcvd_bad_skb", NETXEN_NIC_STAT(stats.rcvdbadskb)},
57 {"xmit_called", NETXEN_NIC_STAT(stats.xmitcalled)}, 55 {"xmit_called", NETXEN_NIC_STAT(stats.xmitcalled)},
58 {"xmited_frames", NETXEN_NIC_STAT(stats.xmitedframes)},
59 {"xmit_finished", NETXEN_NIC_STAT(stats.xmitfinished)}, 56 {"xmit_finished", NETXEN_NIC_STAT(stats.xmitfinished)},
60 {"bad_skb_len", NETXEN_NIC_STAT(stats.badskblen)}, 57 {"rx_dropped", NETXEN_NIC_STAT(stats.rxdropped)},
61 {"no_cmd_desc", NETXEN_NIC_STAT(stats.nocmddescriptor)},
62 {"polled", NETXEN_NIC_STAT(stats.polled)},
63 {"tx_dropped", NETXEN_NIC_STAT(stats.txdropped)}, 58 {"tx_dropped", NETXEN_NIC_STAT(stats.txdropped)},
64 {"csummed", NETXEN_NIC_STAT(stats.csummed)}, 59 {"csummed", NETXEN_NIC_STAT(stats.csummed)},
65 {"no_rcv", NETXEN_NIC_STAT(stats.no_rcv)}, 60 {"no_rcv", NETXEN_NIC_STAT(stats.no_rcv)},
@@ -168,7 +163,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
168 ecmd->phy_address = adapter->physical_port; 163 ecmd->phy_address = adapter->physical_port;
169 ecmd->transceiver = XCVR_EXTERNAL; 164 ecmd->transceiver = XCVR_EXTERNAL;
170 165
171 switch ((netxen_brdtype_t)adapter->ahw.board_type) { 166 switch (adapter->ahw.board_type) {
172 case NETXEN_BRDTYPE_P2_SB35_4G: 167 case NETXEN_BRDTYPE_P2_SB35_4G:
173 case NETXEN_BRDTYPE_P2_SB31_2G: 168 case NETXEN_BRDTYPE_P2_SB31_2G:
174 case NETXEN_BRDTYPE_P3_REF_QG: 169 case NETXEN_BRDTYPE_P3_REF_QG:
@@ -227,7 +222,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
227 break; 222 break;
228 default: 223 default:
229 printk(KERN_ERR "netxen-nic: Unsupported board model %d\n", 224 printk(KERN_ERR "netxen-nic: Unsupported board model %d\n",
230 (netxen_brdtype_t)adapter->ahw.board_type); 225 adapter->ahw.board_type);
231 return -EIO; 226 return -EIO;
232 } 227 }
233 228
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h
index 016c62129c76..7f0ddbfa7b28 100644
--- a/drivers/net/netxen/netxen_nic_hdr.h
+++ b/drivers/net/netxen/netxen_nic_hdr.h
@@ -31,16 +31,8 @@
31#ifndef __NETXEN_NIC_HDR_H_ 31#ifndef __NETXEN_NIC_HDR_H_
32#define __NETXEN_NIC_HDR_H_ 32#define __NETXEN_NIC_HDR_H_
33 33
34#include <linux/module.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
36#include <linux/spinlock.h>
37#include <asm/irq.h>
38#include <linux/init.h>
39#include <linux/errno.h>
40#include <linux/pci.h>
41#include <linux/types.h> 35#include <linux/types.h>
42#include <asm/uaccess.h>
43#include <asm/string.h> /* for memset */
44 36
45/* 37/*
46 * The basic unit of access when reading/writing control registers. 38 * The basic unit of access when reading/writing control registers.
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 5026811c04ce..67d63eecc9cb 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -48,6 +48,21 @@
48#define CRB_HI(off) ((crb_hub_agt[CRB_BLK(off)] << 20) | ((off) & 0xf0000)) 48#define CRB_HI(off) ((crb_hub_agt[CRB_BLK(off)] << 20) | ((off) & 0xf0000))
49#define CRB_INDIRECT_2M (0x1e0000UL) 49#define CRB_INDIRECT_2M (0x1e0000UL)
50 50
51#ifndef readq
52static inline u64 readq(void __iomem *addr)
53{
54 return readl(addr) | (((u64) readl(addr + 4)) << 32LL);
55}
56#endif
57
58#ifndef writeq
59static inline void writeq(u64 val, void __iomem *addr)
60{
61 writel(((u32) (val)), (addr));
62 writel(((u32) (val >> 32)), (addr + 4));
63}
64#endif
65
51#define CRB_WIN_LOCK_TIMEOUT 100000000 66#define CRB_WIN_LOCK_TIMEOUT 100000000
52static crb_128M_2M_block_map_t crb_128M_2M_map[64] = { 67static crb_128M_2M_block_map_t crb_128M_2M_map[64] = {
53 {{{0, 0, 0, 0} } }, /* 0: PCI */ 68 {{{0, 0, 0, 0} } }, /* 0: PCI */
@@ -2148,7 +2163,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
2148 board_type = NETXEN_BRDTYPE_P3_10G_TP; 2163 board_type = NETXEN_BRDTYPE_P3_10G_TP;
2149 } 2164 }
2150 2165
2151 switch ((netxen_brdtype_t)board_type) { 2166 switch (board_type) {
2152 case NETXEN_BRDTYPE_P2_SB35_4G: 2167 case NETXEN_BRDTYPE_P2_SB35_4G:
2153 adapter->ahw.port_type = NETXEN_NIC_GBE; 2168 adapter->ahw.port_type = NETXEN_NIC_GBE;
2154 break; 2169 break;
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h
index 04b47a7993cd..f20c96591a87 100644
--- a/drivers/net/netxen/netxen_nic_hw.h
+++ b/drivers/net/netxen/netxen_nic_hw.h
@@ -36,35 +36,15 @@
36/* Hardware memory size of 128 meg */ 36/* Hardware memory size of 128 meg */
37#define NETXEN_MEMADDR_MAX (128 * 1024 * 1024) 37#define NETXEN_MEMADDR_MAX (128 * 1024 * 1024)
38 38
39#ifndef readq
40static inline u64 readq(void __iomem * addr)
41{
42 return readl(addr) | (((u64) readl(addr + 4)) << 32LL);
43}
44#endif
45
46#ifndef writeq
47static inline void writeq(u64 val, void __iomem * addr)
48{
49 writel(((u32) (val)), (addr));
50 writel(((u32) (val >> 32)), (addr + 4));
51}
52#endif
53
54struct netxen_adapter; 39struct netxen_adapter;
55 40
56#define NETXEN_PCI_MAPSIZE_BYTES (NETXEN_PCI_MAPSIZE << 20) 41#define NETXEN_PCI_MAPSIZE_BYTES (NETXEN_PCI_MAPSIZE << 20)
57 42
58struct netxen_port;
59void netxen_nic_set_link_parameters(struct netxen_adapter *adapter); 43void netxen_nic_set_link_parameters(struct netxen_adapter *adapter);
60 44
61typedef u8 netxen_ethernet_macaddr_t[6]; 45typedef u8 netxen_ethernet_macaddr_t[6];
62 46
63/* Nibble or Byte mode for phy interface (GbE mode only) */ 47/* Nibble or Byte mode for phy interface (GbE mode only) */
64typedef enum {
65 NETXEN_NIU_10_100_MB = 0,
66 NETXEN_NIU_1000_MB
67} netxen_niu_gbe_ifmode_t;
68 48
69#define _netxen_crb_get_bit(var, bit) ((var >> bit) & 0x1) 49#define _netxen_crb_get_bit(var, bit) ((var >> bit) & 0x1)
70 50
@@ -222,30 +202,28 @@ typedef enum {
222/* 202/*
223 * PHY-Specific MII control/status registers. 203 * PHY-Specific MII control/status registers.
224 */ 204 */
225typedef enum { 205#define NETXEN_NIU_GB_MII_MGMT_ADDR_CONTROL 0
226 NETXEN_NIU_GB_MII_MGMT_ADDR_CONTROL = 0, 206#define NETXEN_NIU_GB_MII_MGMT_ADDR_STATUS 1
227 NETXEN_NIU_GB_MII_MGMT_ADDR_STATUS = 1, 207#define NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_ID_0 2
228 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_ID_0 = 2, 208#define NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_ID_1 3
229 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_ID_1 = 3, 209#define NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG 4
230 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG = 4, 210#define NETXEN_NIU_GB_MII_MGMT_ADDR_LNKPART 5
231 NETXEN_NIU_GB_MII_MGMT_ADDR_LNKPART = 5, 211#define NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG_MORE 6
232 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG_MORE = 6, 212#define NETXEN_NIU_GB_MII_MGMT_ADDR_NEXTPAGE_XMIT 7
233 NETXEN_NIU_GB_MII_MGMT_ADDR_NEXTPAGE_XMIT = 7, 213#define NETXEN_NIU_GB_MII_MGMT_ADDR_LNKPART_NEXTPAGE 8
234 NETXEN_NIU_GB_MII_MGMT_ADDR_LNKPART_NEXTPAGE = 8, 214#define NETXEN_NIU_GB_MII_MGMT_ADDR_1000BT_CONTROL 9
235 NETXEN_NIU_GB_MII_MGMT_ADDR_1000BT_CONTROL = 9, 215#define NETXEN_NIU_GB_MII_MGMT_ADDR_1000BT_STATUS 10
236 NETXEN_NIU_GB_MII_MGMT_ADDR_1000BT_STATUS = 10, 216#define NETXEN_NIU_GB_MII_MGMT_ADDR_EXTENDED_STATUS 15
237 NETXEN_NIU_GB_MII_MGMT_ADDR_EXTENDED_STATUS = 15, 217#define NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_CONTROL 16
238 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_CONTROL = 16, 218#define NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS 17
239 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS = 17, 219#define NETXEN_NIU_GB_MII_MGMT_ADDR_INT_ENABLE 18
240 NETXEN_NIU_GB_MII_MGMT_ADDR_INT_ENABLE = 18, 220#define NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS 19
241 NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS = 19, 221#define NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_CONTROL_MORE 20
242 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_CONTROL_MORE = 20, 222#define NETXEN_NIU_GB_MII_MGMT_ADDR_RECV_ERROR_COUNT 21
243 NETXEN_NIU_GB_MII_MGMT_ADDR_RECV_ERROR_COUNT = 21, 223#define NETXEN_NIU_GB_MII_MGMT_ADDR_LED_CONTROL 24
244 NETXEN_NIU_GB_MII_MGMT_ADDR_LED_CONTROL = 24, 224#define NETXEN_NIU_GB_MII_MGMT_ADDR_LED_OVERRIDE 25
245 NETXEN_NIU_GB_MII_MGMT_ADDR_LED_OVERRIDE = 25, 225#define NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_CONTROL_MORE_YET 26
246 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_CONTROL_MORE_YET = 26, 226#define NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS_MORE 27
247 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS_MORE = 27
248} netxen_niu_phy_register_t;
249 227
250/* 228/*
251 * PHY-Specific Status Register (reg 17). 229 * PHY-Specific Status Register (reg 17).
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index aef77289bd34..85693c0f5637 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -29,7 +29,7 @@
29 */ 29 */
30 30
31#include <linux/vmalloc.h> 31#include <linux/vmalloc.h>
32#include <linux/highmem.h> 32#include <linux/interrupt.h>
33#include "netxen_nic_hw.h" 33#include "netxen_nic_hw.h"
34 34
35#include "netxen_nic.h" 35#include "netxen_nic.h"
@@ -1598,10 +1598,6 @@ static void netxen_tx_timeout_task(struct work_struct *work)
1598 netif_wake_queue(adapter->netdev); 1598 netif_wake_queue(adapter->netdev);
1599} 1599}
1600 1600
1601/*
1602 * netxen_nic_get_stats - Get System Network Statistics
1603 * @netdev: network interface device structure
1604 */
1605struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev) 1601struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
1606{ 1602{
1607 struct netxen_adapter *adapter = netdev_priv(netdev); 1603 struct netxen_adapter *adapter = netdev_priv(netdev);
@@ -1609,22 +1605,11 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev)
1609 1605
1610 memset(stats, 0, sizeof(*stats)); 1606 memset(stats, 0, sizeof(*stats));
1611 1607
1612 /* total packets received */
1613 stats->rx_packets = adapter->stats.no_rcv; 1608 stats->rx_packets = adapter->stats.no_rcv;
1614 /* total packets transmitted */ 1609 stats->tx_packets = adapter->stats.xmitfinished;
1615 stats->tx_packets = adapter->stats.xmitedframes +
1616 adapter->stats.xmitfinished;
1617 /* total bytes received */
1618 stats->rx_bytes = adapter->stats.rxbytes; 1610 stats->rx_bytes = adapter->stats.rxbytes;
1619 /* total bytes transmitted */
1620 stats->tx_bytes = adapter->stats.txbytes; 1611 stats->tx_bytes = adapter->stats.txbytes;
1621 /* bad packets received */
1622 stats->rx_errors = adapter->stats.rcvdbadskb;
1623 /* packet transmit problems */
1624 stats->tx_errors = adapter->stats.nocmddescriptor;
1625 /* no space in linux buffers */
1626 stats->rx_dropped = adapter->stats.rxdropped; 1612 stats->rx_dropped = adapter->stats.rxdropped;
1627 /* no space available in linux */
1628 stats->tx_dropped = adapter->stats.txdropped; 1613 stats->tx_dropped = adapter->stats.txdropped;
1629 1614
1630 return stats; 1615 return stats;
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c
index d85203203d4d..3310471ba1a0 100644
--- a/drivers/net/netxen/netxen_nic_niu.c
+++ b/drivers/net/netxen/netxen_nic_niu.c
@@ -342,9 +342,9 @@ static void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter,
342 } 342 }
343 343
344 if (netxen_niu_gbe_enable_phy_interrupts(adapter)) 344 if (netxen_niu_gbe_enable_phy_interrupts(adapter))
345 printk(KERN_ERR PFX "ERROR enabling PHY interrupts\n"); 345 printk(KERN_ERR "ERROR enabling PHY interrupts\n");
346 if (netxen_niu_gbe_clear_phy_interrupts(adapter)) 346 if (netxen_niu_gbe_clear_phy_interrupts(adapter))
347 printk(KERN_ERR PFX "ERROR clearing PHY interrupts\n"); 347 printk(KERN_ERR "ERROR clearing PHY interrupts\n");
348} 348}
349 349
350/* 350/*
@@ -380,9 +380,9 @@ static void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter,
380 } 380 }
381 381
382 if (netxen_niu_gbe_enable_phy_interrupts(adapter)) 382 if (netxen_niu_gbe_enable_phy_interrupts(adapter))
383 printk(KERN_ERR PFX "ERROR enabling PHY interrupts\n"); 383 printk(KERN_ERR "ERROR enabling PHY interrupts\n");
384 if (netxen_niu_gbe_clear_phy_interrupts(adapter)) 384 if (netxen_niu_gbe_clear_phy_interrupts(adapter))
385 printk(KERN_ERR PFX "ERROR clearing PHY interrupts\n"); 385 printk(KERN_ERR "ERROR clearing PHY interrupts\n");
386} 386}
387 387
388int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) 388int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
@@ -428,13 +428,13 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
428 | 428 |
429 NETXEN_GB_MAC_PAUSED_FRMS); 429 NETXEN_GB_MAC_PAUSED_FRMS);
430 if (netxen_niu_gbe_clear_phy_interrupts(adapter)) 430 if (netxen_niu_gbe_clear_phy_interrupts(adapter))
431 printk(KERN_ERR PFX 431 printk(KERN_ERR
432 "ERROR clearing PHY interrupts\n"); 432 "ERROR clearing PHY interrupts\n");
433 if (netxen_niu_gbe_enable_phy_interrupts(adapter)) 433 if (netxen_niu_gbe_enable_phy_interrupts(adapter))
434 printk(KERN_ERR PFX 434 printk(KERN_ERR
435 "ERROR enabling PHY interrupts\n"); 435 "ERROR enabling PHY interrupts\n");
436 if (netxen_niu_gbe_clear_phy_interrupts(adapter)) 436 if (netxen_niu_gbe_clear_phy_interrupts(adapter))
437 printk(KERN_ERR PFX 437 printk(KERN_ERR
438 "ERROR clearing PHY interrupts\n"); 438 "ERROR clearing PHY interrupts\n");
439 result = -1; 439 result = -1;
440 } 440 }
diff --git a/drivers/net/netxen/netxen_nic_phan_reg.h b/drivers/net/netxen/netxen_nic_phan_reg.h
index 50183335e43a..18ea35d51160 100644
--- a/drivers/net/netxen/netxen_nic_phan_reg.h
+++ b/drivers/net/netxen/netxen_nic_phan_reg.h
@@ -41,18 +41,18 @@
41#define CRB_PHAN_CNTRL_HI_OFFSET NETXEN_NIC_REG(0x04) 41#define CRB_PHAN_CNTRL_HI_OFFSET NETXEN_NIC_REG(0x04)
42#define CRB_CMD_PRODUCER_OFFSET NETXEN_NIC_REG(0x08) 42#define CRB_CMD_PRODUCER_OFFSET NETXEN_NIC_REG(0x08)
43#define CRB_CMD_CONSUMER_OFFSET NETXEN_NIC_REG(0x0c) 43#define CRB_CMD_CONSUMER_OFFSET NETXEN_NIC_REG(0x0c)
44#define CRB_PAUSE_ADDR_LO NETXEN_NIC_REG(0x10) /* C0 EPG BUG */ 44#define CRB_PAUSE_ADDR_LO NETXEN_NIC_REG(0x10)
45#define CRB_PAUSE_ADDR_HI NETXEN_NIC_REG(0x14) 45#define CRB_PAUSE_ADDR_HI NETXEN_NIC_REG(0x14)
46#define NX_CDRP_CRB_OFFSET NETXEN_NIC_REG(0x18) 46#define NX_CDRP_CRB_OFFSET NETXEN_NIC_REG(0x18)
47#define NX_ARG1_CRB_OFFSET NETXEN_NIC_REG(0x1c) 47#define NX_ARG1_CRB_OFFSET NETXEN_NIC_REG(0x1c)
48#define NX_ARG2_CRB_OFFSET NETXEN_NIC_REG(0x20) 48#define NX_ARG2_CRB_OFFSET NETXEN_NIC_REG(0x20)
49#define NX_ARG3_CRB_OFFSET NETXEN_NIC_REG(0x24) 49#define NX_ARG3_CRB_OFFSET NETXEN_NIC_REG(0x24)
50#define NX_SIGN_CRB_OFFSET NETXEN_NIC_REG(0x28) 50#define NX_SIGN_CRB_OFFSET NETXEN_NIC_REG(0x28)
51#define CRB_CMD_INTR_LOOP NETXEN_NIC_REG(0x20) /* 4 regs for perf */ 51#define CRB_CMD_INTR_LOOP NETXEN_NIC_REG(0x20)
52#define CRB_CMD_DMA_LOOP NETXEN_NIC_REG(0x24) 52#define CRB_CMD_DMA_LOOP NETXEN_NIC_REG(0x24)
53#define CRB_RCV_INTR_LOOP NETXEN_NIC_REG(0x28) 53#define CRB_RCV_INTR_LOOP NETXEN_NIC_REG(0x28)
54#define CRB_RCV_DMA_LOOP NETXEN_NIC_REG(0x2c) 54#define CRB_RCV_DMA_LOOP NETXEN_NIC_REG(0x2c)
55#define CRB_ENABLE_TX_INTR NETXEN_NIC_REG(0x30) /* phantom init status */ 55#define CRB_ENABLE_TX_INTR NETXEN_NIC_REG(0x30)
56#define CRB_MMAP_ADDR_3 NETXEN_NIC_REG(0x34) 56#define CRB_MMAP_ADDR_3 NETXEN_NIC_REG(0x34)
57#define CRB_CMDPEG_CMDRING NETXEN_NIC_REG(0x38) 57#define CRB_CMDPEG_CMDRING NETXEN_NIC_REG(0x38)
58#define CRB_HOST_DUMMY_BUF_ADDR_HI NETXEN_NIC_REG(0x3c) 58#define CRB_HOST_DUMMY_BUF_ADDR_HI NETXEN_NIC_REG(0x3c)
@@ -65,7 +65,7 @@
65#define CRB_MMAP_SIZE_1 NETXEN_NIC_REG(0x58) 65#define CRB_MMAP_SIZE_1 NETXEN_NIC_REG(0x58)
66#define CRB_MMAP_SIZE_2 NETXEN_NIC_REG(0x5c) 66#define CRB_MMAP_SIZE_2 NETXEN_NIC_REG(0x5c)
67#define CRB_MMAP_SIZE_3 NETXEN_NIC_REG(0x60) 67#define CRB_MMAP_SIZE_3 NETXEN_NIC_REG(0x60)
68#define CRB_GLOBAL_INT_COAL NETXEN_NIC_REG(0x64) /* interrupt coalescing */ 68#define CRB_GLOBAL_INT_COAL NETXEN_NIC_REG(0x64)
69#define CRB_INT_COAL_MODE NETXEN_NIC_REG(0x68) 69#define CRB_INT_COAL_MODE NETXEN_NIC_REG(0x68)
70#define CRB_MAX_RCV_BUFS NETXEN_NIC_REG(0x6c) 70#define CRB_MAX_RCV_BUFS NETXEN_NIC_REG(0x6c)
71#define CRB_TX_INT_THRESHOLD NETXEN_NIC_REG(0x70) 71#define CRB_TX_INT_THRESHOLD NETXEN_NIC_REG(0x70)
@@ -83,13 +83,13 @@
83#define CRB_AGENT_TX_TYPE NETXEN_NIC_REG(0xa0) 83#define CRB_AGENT_TX_TYPE NETXEN_NIC_REG(0xa0)
84#define CRB_AGENT_TX_ADDR NETXEN_NIC_REG(0xa4) 84#define CRB_AGENT_TX_ADDR NETXEN_NIC_REG(0xa4)
85#define CRB_AGENT_TX_MSS NETXEN_NIC_REG(0xa8) 85#define CRB_AGENT_TX_MSS NETXEN_NIC_REG(0xa8)
86#define CRB_TX_STATE NETXEN_NIC_REG(0xac) /* Debug -performance */ 86#define CRB_TX_STATE NETXEN_NIC_REG(0xac)
87#define CRB_TX_COUNT NETXEN_NIC_REG(0xb0) 87#define CRB_TX_COUNT NETXEN_NIC_REG(0xb0)
88#define CRB_RX_STATE NETXEN_NIC_REG(0xb4) 88#define CRB_RX_STATE NETXEN_NIC_REG(0xb4)
89#define CRB_RX_PERF_DEBUG_1 NETXEN_NIC_REG(0xb8) 89#define CRB_RX_PERF_DEBUG_1 NETXEN_NIC_REG(0xb8)
90#define CRB_RX_LRO_CONTROL NETXEN_NIC_REG(0xbc) /* LRO On/OFF */ 90#define CRB_RX_LRO_CONTROL NETXEN_NIC_REG(0xbc)
91#define CRB_RX_LRO_START_NUM NETXEN_NIC_REG(0xc0) 91#define CRB_RX_LRO_START_NUM NETXEN_NIC_REG(0xc0)
92#define CRB_MPORT_MODE NETXEN_NIC_REG(0xc4) /* Multiport Mode */ 92#define CRB_MPORT_MODE NETXEN_NIC_REG(0xc4)
93#define CRB_CMD_RING_SIZE NETXEN_NIC_REG(0xc8) 93#define CRB_CMD_RING_SIZE NETXEN_NIC_REG(0xc8)
94#define CRB_DMA_SHIFT NETXEN_NIC_REG(0xcc) 94#define CRB_DMA_SHIFT NETXEN_NIC_REG(0xcc)
95#define CRB_INT_VECTOR NETXEN_NIC_REG(0xd4) 95#define CRB_INT_VECTOR NETXEN_NIC_REG(0xd4)
@@ -109,8 +109,6 @@
109#define CRB_CMD_CONSUMER_OFFSET_1 NETXEN_NIC_REG(0x1b0) 109#define CRB_CMD_CONSUMER_OFFSET_1 NETXEN_NIC_REG(0x1b0)
110#define CRB_CMD_PRODUCER_OFFSET_2 NETXEN_NIC_REG(0x1b8) 110#define CRB_CMD_PRODUCER_OFFSET_2 NETXEN_NIC_REG(0x1b8)
111#define CRB_CMD_CONSUMER_OFFSET_2 NETXEN_NIC_REG(0x1bc) 111#define CRB_CMD_CONSUMER_OFFSET_2 NETXEN_NIC_REG(0x1bc)
112
113// 1c0 to 1cc used for signature reg
114#define CRB_CMD_PRODUCER_OFFSET_3 NETXEN_NIC_REG(0x1d0) 112#define CRB_CMD_PRODUCER_OFFSET_3 NETXEN_NIC_REG(0x1d0)
115#define CRB_CMD_CONSUMER_OFFSET_3 NETXEN_NIC_REG(0x1d4) 113#define CRB_CMD_CONSUMER_OFFSET_3 NETXEN_NIC_REG(0x1d4)
116#define CRB_TEMP_STATE NETXEN_NIC_REG(0x1b4) 114#define CRB_TEMP_STATE NETXEN_NIC_REG(0x1b4)
@@ -120,8 +118,7 @@
120#define CRB_V2P_2 NETXEN_NIC_REG(0x298) 118#define CRB_V2P_2 NETXEN_NIC_REG(0x298)
121#define CRB_V2P_3 NETXEN_NIC_REG(0x29c) 119#define CRB_V2P_3 NETXEN_NIC_REG(0x29c)
122#define CRB_V2P(port) (CRB_V2P_0+((port)*4)) 120#define CRB_V2P(port) (CRB_V2P_0+((port)*4))
123#define CRB_DRIVER_VERSION NETXEN_NIC_REG(0x2a0) 121#define CRB_DRIVER_VERSION NETXEN_NIC_REG(0x2a0)
124/* sw int status/mask registers */
125#define CRB_SW_INT_MASK_0 NETXEN_NIC_REG(0x1d8) 122#define CRB_SW_INT_MASK_0 NETXEN_NIC_REG(0x1d8)
126#define CRB_SW_INT_MASK_1 NETXEN_NIC_REG(0x1e0) 123#define CRB_SW_INT_MASK_1 NETXEN_NIC_REG(0x1e0)
127#define CRB_SW_INT_MASK_2 NETXEN_NIC_REG(0x1e4) 124#define CRB_SW_INT_MASK_2 NETXEN_NIC_REG(0x1e4)
@@ -136,7 +133,7 @@
136#define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8) 133#define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8)
137#define CRB_NIC_CAPABILITIES_FW NETXEN_NIC_REG(0x1dc) 134#define CRB_NIC_CAPABILITIES_FW NETXEN_NIC_REG(0x1dc)
138#define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270) 135#define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270)
139#define CRB_NIC_MSI_MODE_FW NETXEN_NIC_REG(0x274) 136#define CRB_NIC_MSI_MODE_FW NETXEN_NIC_REG(0x274)
140 137
141#define INTR_SCHEME_PERPORT 0x1 138#define INTR_SCHEME_PERPORT 0x1
142#define MSI_MODE_MULTIFUNC 0x1 139#define MSI_MODE_MULTIFUNC 0x1