Skip to content

Commit

Permalink
netxen: remove netxen_nic_phan_reg.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dhananjay Phadke authored and David S. Miller committed Aug 24, 2009
1 parent 22b5794 commit 7d6fd5e
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 215 deletions.
31 changes: 18 additions & 13 deletions drivers/net/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <asm/io.h>
#include <asm/byteorder.h>

#include "netxen_nic_hdr.h"
#include "netxen_nic_hw.h"

#define _NETXEN_NIC_LINUX_MAJOR 4
Expand Down Expand Up @@ -227,8 +228,6 @@
#define MPORT_SINGLE_FUNCTION_MODE 0x1111
#define MPORT_MULTI_FUNCTION_MODE 0x2222

#include "netxen_nic_phan_reg.h"

/*
* NetXen host-peg signal message structure
*
Expand Down Expand Up @@ -503,17 +502,11 @@ struct netxen_skb_frag {
u64 length;
};

#define _netxen_set_bits(config_word, start, bits, val) {\
unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start));\
unsigned long long __tvalue = (val); \
(config_word) &= ~__tmask; \
(config_word) |= (((__tvalue) << (start)) & __tmask); \
}

#define _netxen_clear_bits(config_word, start, bits) {\
unsigned long long __tmask = (((1ULL << (bits)) - 1) << (start)); \
(config_word) &= ~__tmask; \
}
struct netxen_recv_crb {
u32 crb_rcv_producer[NUM_RCV_DESC_RINGS];
u32 crb_sts_consumer[NUM_STS_DESC_RINGS];
u32 sw_int_mask[NUM_STS_DESC_RINGS];
};

/* Following defines are for the state of the buffers */
#define NETXEN_BUFFER_FREE 0
Expand Down Expand Up @@ -1194,6 +1187,18 @@ struct netxen_adapter {
const struct firmware *fw;
};

/* Set promiscuous mode for a GbE interface */
int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, u32 mode);
int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
u32 mode);
/* Generic enable for GbE ports. Will detect the speed of the link. */
int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port);
int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port);

/* Disable a GbE interface */
int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter);
int netxen_niu_disable_xg_port(struct netxen_adapter *adapter);

int netxen_niu_xgbe_enable_phy_interrupts(struct netxen_adapter *adapter);
int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter);
int netxen_niu_xgbe_disable_phy_interrupts(struct netxen_adapter *adapter);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/netxen/netxen_nic_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "netxen_nic_hw.h"
#include "netxen_nic.h"
#include "netxen_nic_phan_reg.h"

#define NXHAL_VERSION 1

Expand Down
1 change: 0 additions & 1 deletion drivers/net/netxen/netxen_nic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

#include "netxen_nic.h"
#include "netxen_nic_hw.h"
#include "netxen_nic_phan_reg.h"

struct netxen_nic_stats {
char stat_string[ETH_GSTRING_LEN];
Expand Down
85 changes: 84 additions & 1 deletion drivers/net/netxen/netxen_nic_hdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,92 @@ enum {
#define NETXEN_FW_VERSION_MINOR (NETXEN_CAM_RAM(0x154))
#define NETXEN_FW_VERSION_SUB (NETXEN_CAM_RAM(0x158))
#define NETXEN_ROM_LOCK_ID (NETXEN_CAM_RAM(0x100))
#define NETXEN_PHY_LOCK_ID (NETXEN_CAM_RAM(0x120))
#define NETXEN_CRB_WIN_LOCK_ID (NETXEN_CAM_RAM(0x124))

#define NETXEN_PHY_LOCK_ID (NETXEN_CAM_RAM(0x120))
#define NIC_CRB_BASE (NETXEN_CAM_RAM(0x200))
#define NIC_CRB_BASE_2 (NETXEN_CAM_RAM(0x700))
#define NETXEN_NIC_REG(X) (NIC_CRB_BASE+(X))
#define NETXEN_NIC_REG_2(X) (NIC_CRB_BASE_2+(X))

#define NX_CDRP_CRB_OFFSET (NETXEN_NIC_REG(0x18))
#define NX_ARG1_CRB_OFFSET (NETXEN_NIC_REG(0x1c))
#define NX_ARG2_CRB_OFFSET (NETXEN_NIC_REG(0x20))
#define NX_ARG3_CRB_OFFSET (NETXEN_NIC_REG(0x24))
#define NX_SIGN_CRB_OFFSET (NETXEN_NIC_REG(0x28))

#define CRB_HOST_DUMMY_BUF_ADDR_HI (NETXEN_NIC_REG(0x3c))
#define CRB_HOST_DUMMY_BUF_ADDR_LO (NETXEN_NIC_REG(0x40))

#define CRB_CMDPEG_STATE (NETXEN_NIC_REG(0x50))
#define CRB_RCVPEG_STATE (NETXEN_NIC_REG(0x13c))

#define CRB_XG_STATE (NETXEN_NIC_REG(0x94))
#define CRB_XG_STATE_P3 (NETXEN_NIC_REG(0x98))
#define CRB_PF_LINK_SPEED_1 (NETXEN_NIC_REG(0xe8))
#define CRB_PF_LINK_SPEED_2 (NETXEN_NIC_REG(0xec))

#define CRB_MPORT_MODE (NETXEN_NIC_REG(0xc4))
#define CRB_DMA_SHIFT (NETXEN_NIC_REG(0xcc))
#define CRB_INT_VECTOR (NETXEN_NIC_REG(0xd4))

#define CRB_CMD_PRODUCER_OFFSET (NETXEN_NIC_REG(0x08))
#define CRB_CMD_CONSUMER_OFFSET (NETXEN_NIC_REG(0x0c))
#define CRB_CMD_PRODUCER_OFFSET_1 (NETXEN_NIC_REG(0x1ac))
#define CRB_CMD_CONSUMER_OFFSET_1 (NETXEN_NIC_REG(0x1b0))
#define CRB_CMD_PRODUCER_OFFSET_2 (NETXEN_NIC_REG(0x1b8))
#define CRB_CMD_CONSUMER_OFFSET_2 (NETXEN_NIC_REG(0x1bc))
#define CRB_CMD_PRODUCER_OFFSET_3 (NETXEN_NIC_REG(0x1d0))
#define CRB_CMD_CONSUMER_OFFSET_3 (NETXEN_NIC_REG(0x1d4))
#define CRB_TEMP_STATE (NETXEN_NIC_REG(0x1b4))

#define CRB_V2P_0 (NETXEN_NIC_REG(0x290))
#define CRB_V2P(port) (CRB_V2P_0+((port)*4))
#define CRB_DRIVER_VERSION (NETXEN_NIC_REG(0x2a0))

#define CRB_SW_INT_MASK_0 (NETXEN_NIC_REG(0x1d8))
#define CRB_SW_INT_MASK_1 (NETXEN_NIC_REG(0x1e0))
#define CRB_SW_INT_MASK_2 (NETXEN_NIC_REG(0x1e4))
#define CRB_SW_INT_MASK_3 (NETXEN_NIC_REG(0x1e8))

#define CRB_FW_CAPABILITIES_1 (NETXEN_CAM_RAM(0x128))
#define CRB_MAC_BLOCK_START (NETXEN_CAM_RAM(0x1c0))

/*
* capabilities register, can be used to selectively enable/disable features
* for backward compability
*/
#define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8)
#define CRB_NIC_CAPABILITIES_FW NETXEN_NIC_REG(0x1dc)
#define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270)
#define CRB_NIC_MSI_MODE_FW NETXEN_NIC_REG(0x274)

#define INTR_SCHEME_PERPORT 0x1
#define MSI_MODE_MULTIFUNC 0x1

/* used for ethtool tests */
#define CRB_SCRATCHPAD_TEST NETXEN_NIC_REG(0x280)

/*
* CrbPortPhanCntrHi/Lo is used to pass the address of HostPhantomIndex address
* which can be read by the Phantom host to get producer/consumer indexes from
* Phantom/Casper. If it is not HOST_SHARED_MEMORY, then the following
* registers will be used for the addresses of the ring's shared memory
* on the Phantom.
*/

#define nx_get_temp_val(x) ((x) >> 16)
#define nx_get_temp_state(x) ((x) & 0xffff)
#define nx_encode_temp(val, state) (((val) << 16) | (state))

/*
* Temperature control.
*/
enum {
NX_TEMP_NORMAL = 0x1, /* Normal operating range */
NX_TEMP_WARN, /* Sound alert, temperature getting high */
NX_TEMP_PANIC /* Fatal error, hardware has shut down. */
};

/* Lock IDs for PHY lock */
#define PHY_LOCK_DRIVER 0x44524956
Expand Down
1 change: 0 additions & 1 deletion drivers/net/netxen/netxen_nic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "netxen_nic.h"
#include "netxen_nic_hw.h"
#include "netxen_nic_phan_reg.h"

#include <net/ip.h>

Expand Down
18 changes: 0 additions & 18 deletions drivers/net/netxen/netxen_nic_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#ifndef __NETXEN_NIC_HW_H_
#define __NETXEN_NIC_HW_H_

#include "netxen_nic_hdr.h"

/* Hardware memory size of 128 meg */
#define NETXEN_MEMADDR_MAX (128 * 1024 * 1024)

Expand Down Expand Up @@ -387,22 +385,6 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter);
#define netxen_xg_soft_reset(config_word) \
((config_word) |= 1 << 4)

/* Set promiscuous mode for a GbE interface */
int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
u32 mode);
int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
u32 mode);

/* Generic enable for GbE ports. Will detect the speed of the link. */
int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port);

int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port);

/* Disable a GbE interface */
int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter);

int netxen_niu_disable_xg_port(struct netxen_adapter *adapter);

typedef struct {
unsigned valid;
unsigned start_128M;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/netxen/netxen_nic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/delay.h>
#include "netxen_nic.h"
#include "netxen_nic_hw.h"
#include "netxen_nic_phan_reg.h"

struct crb_addr_pair {
u32 addr;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "netxen_nic_hw.h"

#include "netxen_nic.h"
#include "netxen_nic_phan_reg.h"

#include <linux/dma-mapping.h>
#include <linux/if_vlan.h>
Expand Down
Loading

0 comments on commit 7d6fd5e

Please sign in to comment.