diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-08-23 04:35:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-23 22:00:29 -0400 |
commit | 7d6fd5e7e97a2188d56441e4e96494c21c5994a7 (patch) | |
tree | 23cb119c2d2a094363f2dd5cc53e9443e87f5ae3 /drivers/net/netxen | |
parent | 22b5794b5d58ea81e91d68d00e49357b66d5a559 (diff) |
netxen: remove netxen_nic_phan_reg.h
Consolidate register definitions in netxen_nic_hdr.h
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 31 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ctx.c | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ethtool.c | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hdr.h | 85 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.h | 18 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_phan_reg.h | 178 |
9 files changed, 102 insertions, 215 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index fa43aa059c4..7a93f8275c9 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <asm/io.h> | 53 | #include <asm/io.h> |
54 | #include <asm/byteorder.h> | 54 | #include <asm/byteorder.h> |
55 | 55 | ||
56 | #include "netxen_nic_hdr.h" | ||
56 | #include "netxen_nic_hw.h" | 57 | #include "netxen_nic_hw.h" |
57 | 58 | ||
58 | #define _NETXEN_NIC_LINUX_MAJOR 4 | 59 | #define _NETXEN_NIC_LINUX_MAJOR 4 |
@@ -227,8 +228,6 @@ | |||
227 | #define MPORT_SINGLE_FUNCTION_MODE 0x1111 | 228 | #define MPORT_SINGLE_FUNCTION_MODE 0x1111 |
228 | #define MPORT_MULTI_FUNCTION_MODE 0x2222 | 229 | #define MPORT_MULTI_FUNCTION_MODE 0x2222 |
229 | 230 | ||
230 | #include "netxen_nic_phan_reg.h" | ||
231 | |||
232 | /* | 231 | /* |
233 | * NetXen host-peg signal message structure | 232 | * NetXen host-peg signal message structure |
234 | * | 233 | * |
@@ -503,17 +502,11 @@ struct netxen_skb_frag { | |||
503 | u64 length; | 502 | u64 length; |
504 | }; | 503 | }; |
505 | 504 | ||
506 | #define _netxen_set_bits(config_word, start, bits, val) {\ | 505 | struct netxen_recv_crb { |
507 | unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start));\ | 506 | u32 crb_rcv_producer[NUM_RCV_DESC_RINGS]; |
508 | unsigned long long __tvalue = (val); \ | 507 | u32 crb_sts_consumer[NUM_STS_DESC_RINGS]; |
509 | (config_word) &= ~__tmask; \ | 508 | u32 sw_int_mask[NUM_STS_DESC_RINGS]; |
510 | (config_word) |= (((__tvalue) << (start)) & __tmask); \ | 509 | }; |
511 | } | ||
512 | |||
513 | #define _netxen_clear_bits(config_word, start, bits) {\ | ||
514 | unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start)); \ | ||
515 | (config_word) &= ~__tmask; \ | ||
516 | } | ||
517 | 510 | ||
518 | /* Following defines are for the state of the buffers */ | 511 | /* Following defines are for the state of the buffers */ |
519 | #define NETXEN_BUFFER_FREE 0 | 512 | #define NETXEN_BUFFER_FREE 0 |
@@ -1194,6 +1187,18 @@ struct netxen_adapter { | |||
1194 | const struct firmware *fw; | 1187 | const struct firmware *fw; |
1195 | }; | 1188 | }; |
1196 | 1189 | ||
1190 | /* Set promiscuous mode for a GbE interface */ | ||
1191 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, u32 mode); | ||
1192 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | ||
1193 | u32 mode); | ||
1194 | /* Generic enable for GbE ports. Will detect the speed of the link. */ | ||
1195 | int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port); | ||
1196 | int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port); | ||
1197 | |||
1198 | /* Disable a GbE interface */ | ||
1199 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter); | ||
1200 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter); | ||
1201 | |||
1197 | int netxen_niu_xgbe_enable_phy_interrupts(struct netxen_adapter *adapter); | 1202 | int netxen_niu_xgbe_enable_phy_interrupts(struct netxen_adapter *adapter); |
1198 | int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter); | 1203 | int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter); |
1199 | int netxen_niu_xgbe_disable_phy_interrupts(struct netxen_adapter *adapter); | 1204 | int netxen_niu_xgbe_disable_phy_interrupts(struct netxen_adapter *adapter); |
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index 9e0469643d3..3d676fecb0a 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c | |||
@@ -30,7 +30,6 @@ | |||
30 | 30 | ||
31 | #include "netxen_nic_hw.h" | 31 | #include "netxen_nic_hw.h" |
32 | #include "netxen_nic.h" | 32 | #include "netxen_nic.h" |
33 | #include "netxen_nic_phan_reg.h" | ||
34 | 33 | ||
35 | #define NXHAL_VERSION 1 | 34 | #define NXHAL_VERSION 1 |
36 | 35 | ||
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index db66e7053b9..3886135006e 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -37,7 +37,6 @@ | |||
37 | 37 | ||
38 | #include "netxen_nic.h" | 38 | #include "netxen_nic.h" |
39 | #include "netxen_nic_hw.h" | 39 | #include "netxen_nic_hw.h" |
40 | #include "netxen_nic_phan_reg.h" | ||
41 | 40 | ||
42 | struct netxen_nic_stats { | 41 | struct netxen_nic_stats { |
43 | char stat_string[ETH_GSTRING_LEN]; | 42 | char stat_string[ETH_GSTRING_LEN]; |
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h index a7328584a21..c4a4a8ba14f 100644 --- a/drivers/net/netxen/netxen_nic_hdr.h +++ b/drivers/net/netxen/netxen_nic_hdr.h | |||
@@ -723,9 +723,92 @@ enum { | |||
723 | #define NETXEN_FW_VERSION_MINOR (NETXEN_CAM_RAM(0x154)) | 723 | #define NETXEN_FW_VERSION_MINOR (NETXEN_CAM_RAM(0x154)) |
724 | #define NETXEN_FW_VERSION_SUB (NETXEN_CAM_RAM(0x158)) | 724 | #define NETXEN_FW_VERSION_SUB (NETXEN_CAM_RAM(0x158)) |
725 | #define NETXEN_ROM_LOCK_ID (NETXEN_CAM_RAM(0x100)) | 725 | #define NETXEN_ROM_LOCK_ID (NETXEN_CAM_RAM(0x100)) |
726 | #define NETXEN_PHY_LOCK_ID (NETXEN_CAM_RAM(0x120)) | ||
726 | #define NETXEN_CRB_WIN_LOCK_ID (NETXEN_CAM_RAM(0x124)) | 727 | #define NETXEN_CRB_WIN_LOCK_ID (NETXEN_CAM_RAM(0x124)) |
727 | 728 | ||
728 | #define NETXEN_PHY_LOCK_ID (NETXEN_CAM_RAM(0x120)) | 729 | #define NIC_CRB_BASE (NETXEN_CAM_RAM(0x200)) |
730 | #define NIC_CRB_BASE_2 (NETXEN_CAM_RAM(0x700)) | ||
731 | #define NETXEN_NIC_REG(X) (NIC_CRB_BASE+(X)) | ||
732 | #define NETXEN_NIC_REG_2(X) (NIC_CRB_BASE_2+(X)) | ||
733 | |||
734 | #define NX_CDRP_CRB_OFFSET (NETXEN_NIC_REG(0x18)) | ||
735 | #define NX_ARG1_CRB_OFFSET (NETXEN_NIC_REG(0x1c)) | ||
736 | #define NX_ARG2_CRB_OFFSET (NETXEN_NIC_REG(0x20)) | ||
737 | #define NX_ARG3_CRB_OFFSET (NETXEN_NIC_REG(0x24)) | ||
738 | #define NX_SIGN_CRB_OFFSET (NETXEN_NIC_REG(0x28)) | ||
739 | |||
740 | #define CRB_HOST_DUMMY_BUF_ADDR_HI (NETXEN_NIC_REG(0x3c)) | ||
741 | #define CRB_HOST_DUMMY_BUF_ADDR_LO (NETXEN_NIC_REG(0x40)) | ||
742 | |||
743 | #define CRB_CMDPEG_STATE (NETXEN_NIC_REG(0x50)) | ||
744 | #define CRB_RCVPEG_STATE (NETXEN_NIC_REG(0x13c)) | ||
745 | |||
746 | #define CRB_XG_STATE (NETXEN_NIC_REG(0x94)) | ||
747 | #define CRB_XG_STATE_P3 (NETXEN_NIC_REG(0x98)) | ||
748 | #define CRB_PF_LINK_SPEED_1 (NETXEN_NIC_REG(0xe8)) | ||
749 | #define CRB_PF_LINK_SPEED_2 (NETXEN_NIC_REG(0xec)) | ||
750 | |||
751 | #define CRB_MPORT_MODE (NETXEN_NIC_REG(0xc4)) | ||
752 | #define CRB_DMA_SHIFT (NETXEN_NIC_REG(0xcc)) | ||
753 | #define CRB_INT_VECTOR (NETXEN_NIC_REG(0xd4)) | ||
754 | |||
755 | #define CRB_CMD_PRODUCER_OFFSET (NETXEN_NIC_REG(0x08)) | ||
756 | #define CRB_CMD_CONSUMER_OFFSET (NETXEN_NIC_REG(0x0c)) | ||
757 | #define CRB_CMD_PRODUCER_OFFSET_1 (NETXEN_NIC_REG(0x1ac)) | ||
758 | #define CRB_CMD_CONSUMER_OFFSET_1 (NETXEN_NIC_REG(0x1b0)) | ||
759 | #define CRB_CMD_PRODUCER_OFFSET_2 (NETXEN_NIC_REG(0x1b8)) | ||
760 | #define CRB_CMD_CONSUMER_OFFSET_2 (NETXEN_NIC_REG(0x1bc)) | ||
761 | #define CRB_CMD_PRODUCER_OFFSET_3 (NETXEN_NIC_REG(0x1d0)) | ||
762 | #define CRB_CMD_CONSUMER_OFFSET_3 (NETXEN_NIC_REG(0x1d4)) | ||
763 | #define CRB_TEMP_STATE (NETXEN_NIC_REG(0x1b4)) | ||
764 | |||
765 | #define CRB_V2P_0 (NETXEN_NIC_REG(0x290)) | ||
766 | #define CRB_V2P(port) (CRB_V2P_0+((port)*4)) | ||
767 | #define CRB_DRIVER_VERSION (NETXEN_NIC_REG(0x2a0)) | ||
768 | |||
769 | #define CRB_SW_INT_MASK_0 (NETXEN_NIC_REG(0x1d8)) | ||
770 | #define CRB_SW_INT_MASK_1 (NETXEN_NIC_REG(0x1e0)) | ||
771 | #define CRB_SW_INT_MASK_2 (NETXEN_NIC_REG(0x1e4)) | ||
772 | #define CRB_SW_INT_MASK_3 (NETXEN_NIC_REG(0x1e8)) | ||
773 | |||
774 | #define CRB_FW_CAPABILITIES_1 (NETXEN_CAM_RAM(0x128)) | ||
775 | #define CRB_MAC_BLOCK_START (NETXEN_CAM_RAM(0x1c0)) | ||
776 | |||
777 | /* | ||
778 | * capabilities register, can be used to selectively enable/disable features | ||
779 | * for backward compability | ||
780 | */ | ||
781 | #define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8) | ||
782 | #define CRB_NIC_CAPABILITIES_FW NETXEN_NIC_REG(0x1dc) | ||
783 | #define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270) | ||
784 | #define CRB_NIC_MSI_MODE_FW NETXEN_NIC_REG(0x274) | ||
785 | |||
786 | #define INTR_SCHEME_PERPORT 0x1 | ||
787 | #define MSI_MODE_MULTIFUNC 0x1 | ||
788 | |||
789 | /* used for ethtool tests */ | ||
790 | #define CRB_SCRATCHPAD_TEST NETXEN_NIC_REG(0x280) | ||
791 | |||
792 | /* | ||
793 | * CrbPortPhanCntrHi/Lo is used to pass the address of HostPhantomIndex address | ||
794 | * which can be read by the Phantom host to get producer/consumer indexes from | ||
795 | * Phantom/Casper. If it is not HOST_SHARED_MEMORY, then the following | ||
796 | * registers will be used for the addresses of the ring's shared memory | ||
797 | * on the Phantom. | ||
798 | */ | ||
799 | |||
800 | #define nx_get_temp_val(x) ((x) >> 16) | ||
801 | #define nx_get_temp_state(x) ((x) & 0xffff) | ||
802 | #define nx_encode_temp(val, state) (((val) << 16) | (state)) | ||
803 | |||
804 | /* | ||
805 | * Temperature control. | ||
806 | */ | ||
807 | enum { | ||
808 | NX_TEMP_NORMAL = 0x1, /* Normal operating range */ | ||
809 | NX_TEMP_WARN, /* Sound alert, temperature getting high */ | ||
810 | NX_TEMP_PANIC /* Fatal error, hardware has shut down. */ | ||
811 | }; | ||
729 | 812 | ||
730 | /* Lock IDs for PHY lock */ | 813 | /* Lock IDs for PHY lock */ |
731 | #define PHY_LOCK_DRIVER 0x44524956 | 814 | #define PHY_LOCK_DRIVER 0x44524956 |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 965f783d39f..9138bbcbb80 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -30,7 +30,6 @@ | |||
30 | 30 | ||
31 | #include "netxen_nic.h" | 31 | #include "netxen_nic.h" |
32 | #include "netxen_nic_hw.h" | 32 | #include "netxen_nic_hw.h" |
33 | #include "netxen_nic_phan_reg.h" | ||
34 | 33 | ||
35 | #include <net/ip.h> | 34 | #include <net/ip.h> |
36 | 35 | ||
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h index d4e83333978..fc0638f2d6d 100644 --- a/drivers/net/netxen/netxen_nic_hw.h +++ b/drivers/net/netxen/netxen_nic_hw.h | |||
@@ -31,8 +31,6 @@ | |||
31 | #ifndef __NETXEN_NIC_HW_H_ | 31 | #ifndef __NETXEN_NIC_HW_H_ |
32 | #define __NETXEN_NIC_HW_H_ | 32 | #define __NETXEN_NIC_HW_H_ |
33 | 33 | ||
34 | #include "netxen_nic_hdr.h" | ||
35 | |||
36 | /* Hardware memory size of 128 meg */ | 34 | /* Hardware memory size of 128 meg */ |
37 | #define NETXEN_MEMADDR_MAX (128 * 1024 * 1024) | 35 | #define NETXEN_MEMADDR_MAX (128 * 1024 * 1024) |
38 | 36 | ||
@@ -387,22 +385,6 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter); | |||
387 | #define netxen_xg_soft_reset(config_word) \ | 385 | #define netxen_xg_soft_reset(config_word) \ |
388 | ((config_word) |= 1 << 4) | 386 | ((config_word) |= 1 << 4) |
389 | 387 | ||
390 | /* Set promiscuous mode for a GbE interface */ | ||
391 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | ||
392 | u32 mode); | ||
393 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | ||
394 | u32 mode); | ||
395 | |||
396 | /* Generic enable for GbE ports. Will detect the speed of the link. */ | ||
397 | int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port); | ||
398 | |||
399 | int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port); | ||
400 | |||
401 | /* Disable a GbE interface */ | ||
402 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter); | ||
403 | |||
404 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter); | ||
405 | |||
406 | typedef struct { | 388 | typedef struct { |
407 | unsigned valid; | 389 | unsigned valid; |
408 | unsigned start_128M; | 390 | unsigned start_128M; |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index c3609e42287..474c568adcc 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include "netxen_nic.h" | 33 | #include "netxen_nic.h" |
34 | #include "netxen_nic_hw.h" | 34 | #include "netxen_nic_hw.h" |
35 | #include "netxen_nic_phan_reg.h" | ||
36 | 35 | ||
37 | struct crb_addr_pair { | 36 | struct crb_addr_pair { |
38 | u32 addr; | 37 | u32 addr; |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 794c19b2254..bd4589f1d46 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include "netxen_nic_hw.h" | 33 | #include "netxen_nic_hw.h" |
34 | 34 | ||
35 | #include "netxen_nic.h" | 35 | #include "netxen_nic.h" |
36 | #include "netxen_nic_phan_reg.h" | ||
37 | 36 | ||
38 | #include <linux/dma-mapping.h> | 37 | #include <linux/dma-mapping.h> |
39 | #include <linux/if_vlan.h> | 38 | #include <linux/if_vlan.h> |
diff --git a/drivers/net/netxen/netxen_nic_phan_reg.h b/drivers/net/netxen/netxen_nic_phan_reg.h deleted file mode 100644 index b73a62ca74f..00000000000 --- a/drivers/net/netxen/netxen_nic_phan_reg.h +++ /dev/null | |||
@@ -1,178 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2003 - 2009 NetXen, Inc. | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, | ||
18 | * MA 02111-1307, USA. | ||
19 | * | ||
20 | * The full GNU General Public License is included in this distribution | ||
21 | * in the file called LICENSE. | ||
22 | * | ||
23 | * Contact Information: | ||
24 | * info@netxen.com | ||
25 | * NetXen Inc, | ||
26 | * 18922 Forge Drive | ||
27 | * Cupertino, CA 95014-0701 | ||
28 | * | ||
29 | */ | ||
30 | |||
31 | #ifndef __NIC_PHAN_REG_H_ | ||
32 | #define __NIC_PHAN_REG_H_ | ||
33 | |||
34 | /* | ||
35 | * CRB Registers or queue message done only at initialization time. | ||
36 | */ | ||
37 | #define NIC_CRB_BASE NETXEN_CAM_RAM(0x200) | ||
38 | #define NETXEN_NIC_REG(X) (NIC_CRB_BASE+(X)) | ||
39 | #define NIC_CRB_BASE_2 NETXEN_CAM_RAM(0x700) | ||
40 | #define NETXEN_NIC_REG_2(X) (NIC_CRB_BASE_2+(X)) | ||
41 | |||
42 | #define CRB_PHAN_CNTRL_LO_OFFSET NETXEN_NIC_REG(0x00) | ||
43 | #define CRB_PHAN_CNTRL_HI_OFFSET NETXEN_NIC_REG(0x04) | ||
44 | #define CRB_CMD_PRODUCER_OFFSET NETXEN_NIC_REG(0x08) | ||
45 | #define CRB_CMD_CONSUMER_OFFSET NETXEN_NIC_REG(0x0c) | ||
46 | #define CRB_PAUSE_ADDR_LO NETXEN_NIC_REG(0x10) | ||
47 | #define CRB_PAUSE_ADDR_HI NETXEN_NIC_REG(0x14) | ||
48 | #define NX_CDRP_CRB_OFFSET NETXEN_NIC_REG(0x18) | ||
49 | #define NX_ARG1_CRB_OFFSET NETXEN_NIC_REG(0x1c) | ||
50 | #define NX_ARG2_CRB_OFFSET NETXEN_NIC_REG(0x20) | ||
51 | #define NX_ARG3_CRB_OFFSET NETXEN_NIC_REG(0x24) | ||
52 | #define NX_SIGN_CRB_OFFSET NETXEN_NIC_REG(0x28) | ||
53 | #define CRB_CMD_INTR_LOOP NETXEN_NIC_REG(0x20) | ||
54 | #define CRB_CMD_DMA_LOOP NETXEN_NIC_REG(0x24) | ||
55 | #define CRB_RCV_INTR_LOOP NETXEN_NIC_REG(0x28) | ||
56 | #define CRB_RCV_DMA_LOOP NETXEN_NIC_REG(0x2c) | ||
57 | #define CRB_ENABLE_TX_INTR NETXEN_NIC_REG(0x30) | ||
58 | #define CRB_MMAP_ADDR_3 NETXEN_NIC_REG(0x34) | ||
59 | #define CRB_CMDPEG_CMDRING NETXEN_NIC_REG(0x38) | ||
60 | #define CRB_HOST_DUMMY_BUF_ADDR_HI NETXEN_NIC_REG(0x3c) | ||
61 | #define CRB_HOST_DUMMY_BUF_ADDR_LO NETXEN_NIC_REG(0x40) | ||
62 | #define CRB_MMAP_ADDR_0 NETXEN_NIC_REG(0x44) | ||
63 | #define CRB_MMAP_ADDR_1 NETXEN_NIC_REG(0x48) | ||
64 | #define CRB_MMAP_ADDR_2 NETXEN_NIC_REG(0x4c) | ||
65 | #define CRB_CMDPEG_STATE NETXEN_NIC_REG(0x50) | ||
66 | #define CRB_MMAP_SIZE_0 NETXEN_NIC_REG(0x54) | ||
67 | #define CRB_MMAP_SIZE_1 NETXEN_NIC_REG(0x58) | ||
68 | #define CRB_MMAP_SIZE_2 NETXEN_NIC_REG(0x5c) | ||
69 | #define CRB_MMAP_SIZE_3 NETXEN_NIC_REG(0x60) | ||
70 | #define CRB_GLOBAL_INT_COAL NETXEN_NIC_REG(0x64) | ||
71 | #define CRB_INT_COAL_MODE NETXEN_NIC_REG(0x68) | ||
72 | #define CRB_MAX_RCV_BUFS NETXEN_NIC_REG(0x6c) | ||
73 | #define CRB_TX_INT_THRESHOLD NETXEN_NIC_REG(0x70) | ||
74 | #define CRB_RX_PKT_TIMER NETXEN_NIC_REG(0x74) | ||
75 | #define CRB_TX_PKT_TIMER NETXEN_NIC_REG(0x78) | ||
76 | #define CRB_RX_PKT_CNT NETXEN_NIC_REG(0x7c) | ||
77 | #define CRB_RX_TMR_CNT NETXEN_NIC_REG(0x80) | ||
78 | #define CRB_RX_LRO_TIMER NETXEN_NIC_REG(0x84) | ||
79 | #define CRB_RX_LRO_MID_TIMER NETXEN_NIC_REG(0x88) | ||
80 | #define CRB_DMA_MAX_RCV_BUFS NETXEN_NIC_REG(0x8c) | ||
81 | #define CRB_MAX_DMA_ENTRIES NETXEN_NIC_REG(0x90) | ||
82 | #define CRB_XG_STATE NETXEN_NIC_REG(0x94) /* XG Link status */ | ||
83 | #define CRB_XG_STATE_P3 NETXEN_NIC_REG(0x98) /* XG PF Link status */ | ||
84 | #define CRB_AGENT_TX_SIZE NETXEN_NIC_REG(0x9c) | ||
85 | #define CRB_AGENT_TX_TYPE NETXEN_NIC_REG(0xa0) | ||
86 | #define CRB_AGENT_TX_ADDR NETXEN_NIC_REG(0xa4) | ||
87 | #define CRB_AGENT_TX_MSS NETXEN_NIC_REG(0xa8) | ||
88 | #define CRB_TX_STATE NETXEN_NIC_REG(0xac) | ||
89 | #define CRB_TX_COUNT NETXEN_NIC_REG(0xb0) | ||
90 | #define CRB_RX_STATE NETXEN_NIC_REG(0xb4) | ||
91 | #define CRB_RX_PERF_DEBUG_1 NETXEN_NIC_REG(0xb8) | ||
92 | #define CRB_RX_LRO_CONTROL NETXEN_NIC_REG(0xbc) | ||
93 | #define CRB_RX_LRO_START_NUM NETXEN_NIC_REG(0xc0) | ||
94 | #define CRB_MPORT_MODE NETXEN_NIC_REG(0xc4) | ||
95 | #define CRB_CMD_RING_SIZE NETXEN_NIC_REG(0xc8) | ||
96 | #define CRB_DMA_SHIFT NETXEN_NIC_REG(0xcc) | ||
97 | #define CRB_INT_VECTOR NETXEN_NIC_REG(0xd4) | ||
98 | #define CRB_CTX_RESET NETXEN_NIC_REG(0xd8) | ||
99 | #define CRB_HOST_STS_PROD NETXEN_NIC_REG(0xdc) | ||
100 | #define CRB_HOST_STS_CONS NETXEN_NIC_REG(0xe0) | ||
101 | #define CRB_PEG_CMD_PROD NETXEN_NIC_REG(0xe4) | ||
102 | #define CRB_PF_LINK_SPEED_1 NETXEN_NIC_REG(0xe8) | ||
103 | #define CRB_PF_LINK_SPEED_2 NETXEN_NIC_REG(0xec) | ||
104 | #define CRB_HOST_BUFFER_CONS NETXEN_NIC_REG(0xf0) | ||
105 | #define CRB_JUMBO_BUFFER_PROD NETXEN_NIC_REG(0xf4) | ||
106 | #define CRB_JUMBO_BUFFER_CONS NETXEN_NIC_REG(0xf8) | ||
107 | #define CRB_HOST_DUMMY_BUF NETXEN_NIC_REG(0xfc) | ||
108 | |||
109 | #define CRB_RCVPEG_STATE NETXEN_NIC_REG(0x13c) | ||
110 | #define CRB_CMD_PRODUCER_OFFSET_1 NETXEN_NIC_REG(0x1ac) | ||
111 | #define CRB_CMD_CONSUMER_OFFSET_1 NETXEN_NIC_REG(0x1b0) | ||
112 | #define CRB_CMD_PRODUCER_OFFSET_2 NETXEN_NIC_REG(0x1b8) | ||
113 | #define CRB_CMD_CONSUMER_OFFSET_2 NETXEN_NIC_REG(0x1bc) | ||
114 | #define CRB_CMD_PRODUCER_OFFSET_3 NETXEN_NIC_REG(0x1d0) | ||
115 | #define CRB_CMD_CONSUMER_OFFSET_3 NETXEN_NIC_REG(0x1d4) | ||
116 | #define CRB_TEMP_STATE NETXEN_NIC_REG(0x1b4) | ||
117 | |||
118 | #define CRB_V2P_0 NETXEN_NIC_REG(0x290) | ||
119 | #define CRB_V2P_1 NETXEN_NIC_REG(0x294) | ||
120 | #define CRB_V2P_2 NETXEN_NIC_REG(0x298) | ||
121 | #define CRB_V2P_3 NETXEN_NIC_REG(0x29c) | ||
122 | #define CRB_V2P(port) (CRB_V2P_0+((port)*4)) | ||
123 | #define CRB_DRIVER_VERSION NETXEN_NIC_REG(0x2a0) | ||
124 | #define CRB_SW_INT_MASK_0 NETXEN_NIC_REG(0x1d8) | ||
125 | #define CRB_SW_INT_MASK_1 NETXEN_NIC_REG(0x1e0) | ||
126 | #define CRB_SW_INT_MASK_2 NETXEN_NIC_REG(0x1e4) | ||
127 | #define CRB_SW_INT_MASK_3 NETXEN_NIC_REG(0x1e8) | ||
128 | |||
129 | #define CRB_FW_CAPABILITIES_1 NETXEN_CAM_RAM(0x128) | ||
130 | #define CRB_MAC_BLOCK_START NETXEN_CAM_RAM(0x1c0) | ||
131 | |||
132 | /* | ||
133 | * capabilities register, can be used to selectively enable/disable features | ||
134 | * for backward compability | ||
135 | */ | ||
136 | #define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8) | ||
137 | #define CRB_NIC_CAPABILITIES_FW NETXEN_NIC_REG(0x1dc) | ||
138 | #define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270) | ||
139 | #define CRB_NIC_MSI_MODE_FW NETXEN_NIC_REG(0x274) | ||
140 | |||
141 | #define INTR_SCHEME_PERPORT 0x1 | ||
142 | #define MSI_MODE_MULTIFUNC 0x1 | ||
143 | |||
144 | /* used for ethtool tests */ | ||
145 | #define CRB_SCRATCHPAD_TEST NETXEN_NIC_REG(0x280) | ||
146 | |||
147 | /* | ||
148 | * CrbPortPhanCntrHi/Lo is used to pass the address of HostPhantomIndex address | ||
149 | * which can be read by the Phantom host to get producer/consumer indexes from | ||
150 | * Phantom/Casper. If it is not HOST_SHARED_MEMORY, then the following | ||
151 | * registers will be used for the addresses of the ring's shared memory | ||
152 | * on the Phantom. | ||
153 | */ | ||
154 | |||
155 | #define nx_get_temp_val(x) ((x) >> 16) | ||
156 | #define nx_get_temp_state(x) ((x) & 0xffff) | ||
157 | #define nx_encode_temp(val, state) (((val) << 16) | (state)) | ||
158 | |||
159 | /* | ||
160 | * CRB registers used by the receive peg logic. | ||
161 | */ | ||
162 | |||
163 | struct netxen_recv_crb { | ||
164 | u32 crb_rcv_producer[NUM_RCV_DESC_RINGS]; | ||
165 | u32 crb_sts_consumer[NUM_STS_DESC_RINGS]; | ||
166 | u32 sw_int_mask[NUM_STS_DESC_RINGS]; | ||
167 | }; | ||
168 | |||
169 | /* | ||
170 | * Temperature control. | ||
171 | */ | ||
172 | enum { | ||
173 | NX_TEMP_NORMAL = 0x1, /* Normal operating range */ | ||
174 | NX_TEMP_WARN, /* Sound alert, temperature getting high */ | ||
175 | NX_TEMP_PANIC /* Fatal error, hardware has shut down. */ | ||
176 | }; | ||
177 | |||
178 | #endif /* __NIC_PHAN_REG_H_ */ | ||