aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r--drivers/net/netxen/netxen_nic.h38
1 files changed, 8 insertions, 30 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 1bee560d7d0a..d925053fe597 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -343,7 +343,6 @@ typedef enum {
343 NETXEN_BRDTYPE_P2_SB31_10G_HMEZ = 0x000e, 343 NETXEN_BRDTYPE_P2_SB31_10G_HMEZ = 0x000e,
344 NETXEN_BRDTYPE_P2_SB31_10G_CX4 = 0x000f 344 NETXEN_BRDTYPE_P2_SB31_10G_CX4 = 0x000f
345} netxen_brdtype_t; 345} netxen_brdtype_t;
346#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t))
347 346
348typedef enum { 347typedef enum {
349 NETXEN_BRDMFG_INVENTEC = 1 348 NETXEN_BRDMFG_INVENTEC = 1
@@ -937,9 +936,7 @@ static inline void netxen_nic_disable_int(struct netxen_adapter *adapter)
937 /* 936 /*
938 * ISR_INT_MASK: Can be read from window 0 or 1. 937 * ISR_INT_MASK: Can be read from window 0 or 1.
939 */ 938 */
940 writel(0x7ff, 939 writel(0x7ff, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
941 (void __iomem
942 *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
943 940
944} 941}
945 942
@@ -959,14 +956,12 @@ static inline void netxen_nic_enable_int(struct netxen_adapter *adapter)
959 break; 956 break;
960 } 957 }
961 958
962 writel(mask, 959 writel(mask, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
963 (void __iomem
964 *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
965 960
966 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { 961 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
967 mask = 0xbff; 962 mask = 0xbff;
968 writel(mask, (void __iomem *) 963 writel(mask, PCI_OFFSET_SECOND_RANGE(adapter,
969 (PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_MASK))); 964 ISR_INT_TARGET_MASK));
970 } 965 }
971} 966}
972 967
@@ -975,13 +970,13 @@ static inline void netxen_nic_enable_int(struct netxen_adapter *adapter)
975 */ 970 */
976 971
977#define NETXEN_MAX_SHORT_NAME 16 972#define NETXEN_MAX_SHORT_NAME 16
978typedef struct { 973struct netxen_brdinfo {
979 netxen_brdtype_t brdtype; /* type of board */ 974 netxen_brdtype_t brdtype; /* type of board */
980 long ports; /* max no of physical ports */ 975 long ports; /* max no of physical ports */
981 char short_name[NETXEN_MAX_SHORT_NAME]; 976 char short_name[NETXEN_MAX_SHORT_NAME];
982} netxen_brdinfo_t; 977};
983 978
984static const netxen_brdinfo_t netxen_boards[] = { 979static const struct netxen_brdinfo netxen_boards[] = {
985 {NETXEN_BRDTYPE_P2_SB31_10G_CX4, 1, "XGb CX4"}, 980 {NETXEN_BRDTYPE_P2_SB31_10G_CX4, 1, "XGb CX4"},
986 {NETXEN_BRDTYPE_P2_SB31_10G_HMEZ, 1, "XGb HMEZ"}, 981 {NETXEN_BRDTYPE_P2_SB31_10G_HMEZ, 1, "XGb HMEZ"},
987 {NETXEN_BRDTYPE_P2_SB31_10G_IMEZ, 2, "XGb IMEZ"}, 982 {NETXEN_BRDTYPE_P2_SB31_10G_IMEZ, 2, "XGb IMEZ"},
@@ -990,24 +985,7 @@ static const netxen_brdinfo_t netxen_boards[] = {
990 {NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"}, 985 {NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"},
991}; 986};
992 987
993#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t)) 988#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(struct netxen_brdinfo))
994
995static inline void get_brd_ports_name_by_type(u32 type, int *ports, char *name)
996{
997 int i, found = 0;
998 for (i = 0; i < NUM_SUPPORTED_BOARDS; ++i) {
999 if (netxen_boards[i].brdtype == type) {
1000 *ports = netxen_boards[i].ports;
1001 strcpy(name, netxen_boards[i].short_name);
1002 found = 1;
1003 break;
1004 }
1005 }
1006 if (!found) {
1007 *ports = 0;
1008 name = "Unknown";
1009 }
1010}
1011 989
1012static inline void get_brd_port_by_type(u32 type, int *ports) 990static inline void get_brd_port_by_type(u32 type, int *ports)
1013{ 991{