diff options
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 41 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ctx.c | 9 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ethtool.c | 35 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hdr.h | 10 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 103 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.h | 13 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 5 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 99 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_niu.c | 16 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_phan_reg.h | 4 |
10 files changed, 224 insertions, 111 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 8e736614407d..93a7b9b668d5 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -508,6 +508,8 @@ typedef enum { | |||
508 | NETXEN_BRDTYPE_P3_10000_BASE_T = 0x0027, | 508 | NETXEN_BRDTYPE_P3_10000_BASE_T = 0x0027, |
509 | NETXEN_BRDTYPE_P3_XG_LOM = 0x0028, | 509 | NETXEN_BRDTYPE_P3_XG_LOM = 0x0028, |
510 | NETXEN_BRDTYPE_P3_4_GB_MM = 0x0029, | 510 | NETXEN_BRDTYPE_P3_4_GB_MM = 0x0029, |
511 | NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a, | ||
512 | NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b, | ||
511 | NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, | 513 | NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, |
512 | NETXEN_BRDTYPE_P3_10G_XFP = 0x0032 | 514 | NETXEN_BRDTYPE_P3_10G_XFP = 0x0032 |
513 | 515 | ||
@@ -1170,6 +1172,36 @@ typedef struct { | |||
1170 | nx_nic_intr_coalesce_data_t irq; | 1172 | nx_nic_intr_coalesce_data_t irq; |
1171 | } nx_nic_intr_coalesce_t; | 1173 | } nx_nic_intr_coalesce_t; |
1172 | 1174 | ||
1175 | #define NX_HOST_REQUEST 0x13 | ||
1176 | #define NX_NIC_REQUEST 0x14 | ||
1177 | |||
1178 | #define NX_MAC_EVENT 0x1 | ||
1179 | |||
1180 | enum { | ||
1181 | NX_NIC_H2C_OPCODE_START = 0, | ||
1182 | NX_NIC_H2C_OPCODE_CONFIG_RSS, | ||
1183 | NX_NIC_H2C_OPCODE_CONFIG_RSS_TBL, | ||
1184 | NX_NIC_H2C_OPCODE_CONFIG_INTR_COALESCE, | ||
1185 | NX_NIC_H2C_OPCODE_CONFIG_LED, | ||
1186 | NX_NIC_H2C_OPCODE_CONFIG_PROMISCUOUS, | ||
1187 | NX_NIC_H2C_OPCODE_CONFIG_L2_MAC, | ||
1188 | NX_NIC_H2C_OPCODE_LRO_REQUEST, | ||
1189 | NX_NIC_H2C_OPCODE_GET_SNMP_STATS, | ||
1190 | NX_NIC_H2C_OPCODE_PROXY_START_REQUEST, | ||
1191 | NX_NIC_H2C_OPCODE_PROXY_STOP_REQUEST, | ||
1192 | NX_NIC_H2C_OPCODE_PROXY_SET_MTU, | ||
1193 | NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE, | ||
1194 | NX_H2P_OPCODE_GET_FINGER_PRINT_REQUEST, | ||
1195 | NX_H2P_OPCODE_INSTALL_LICENSE_REQUEST, | ||
1196 | NX_H2P_OPCODE_GET_LICENSE_CAPABILITY_REQUEST, | ||
1197 | NX_NIC_H2C_OPCODE_GET_NET_STATS, | ||
1198 | NX_NIC_H2C_OPCODE_LAST | ||
1199 | }; | ||
1200 | |||
1201 | #define VPORT_MISS_MODE_DROP 0 /* drop all unmatched */ | ||
1202 | #define VPORT_MISS_MODE_ACCEPT_ALL 1 /* accept all packets */ | ||
1203 | #define VPORT_MISS_MODE_ACCEPT_MULTI 2 /* accept unmatched multicast */ | ||
1204 | |||
1173 | typedef struct { | 1205 | typedef struct { |
1174 | u64 qhdr; | 1206 | u64 qhdr; |
1175 | u64 req_hdr; | 1207 | u64 req_hdr; |
@@ -1288,7 +1320,7 @@ struct netxen_adapter { | |||
1288 | int (*disable_phy_interrupts) (struct netxen_adapter *); | 1320 | int (*disable_phy_interrupts) (struct netxen_adapter *); |
1289 | int (*macaddr_set) (struct netxen_adapter *, netxen_ethernet_macaddr_t); | 1321 | int (*macaddr_set) (struct netxen_adapter *, netxen_ethernet_macaddr_t); |
1290 | int (*set_mtu) (struct netxen_adapter *, int); | 1322 | int (*set_mtu) (struct netxen_adapter *, int); |
1291 | int (*set_promisc) (struct netxen_adapter *, netxen_niu_prom_mode_t); | 1323 | int (*set_promisc) (struct netxen_adapter *, u32); |
1292 | int (*phy_read) (struct netxen_adapter *, long reg, u32 *); | 1324 | int (*phy_read) (struct netxen_adapter *, long reg, u32 *); |
1293 | int (*phy_write) (struct netxen_adapter *, long reg, u32 val); | 1325 | int (*phy_write) (struct netxen_adapter *, long reg, u32 val); |
1294 | int (*init_port) (struct netxen_adapter *, int); | 1326 | int (*init_port) (struct netxen_adapter *, int); |
@@ -1465,9 +1497,10 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter); | |||
1465 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); | 1497 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); |
1466 | void netxen_p2_nic_set_multi(struct net_device *netdev); | 1498 | void netxen_p2_nic_set_multi(struct net_device *netdev); |
1467 | void netxen_p3_nic_set_multi(struct net_device *netdev); | 1499 | void netxen_p3_nic_set_multi(struct net_device *netdev); |
1500 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); | ||
1468 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); | 1501 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); |
1469 | 1502 | ||
1470 | u32 nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, u32 mtu); | 1503 | int nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu); |
1471 | int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu); | 1504 | int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu); |
1472 | 1505 | ||
1473 | int netxen_nic_set_mac(struct net_device *netdev, void *p); | 1506 | int netxen_nic_set_mac(struct net_device *netdev, void *p); |
@@ -1502,7 +1535,9 @@ static const struct netxen_brdinfo netxen_boards[] = { | |||
1502 | {NETXEN_BRDTYPE_P3_10G_SFP_PLUS, 2, "Dual XGb SFP+ LP"}, | 1535 | {NETXEN_BRDTYPE_P3_10G_SFP_PLUS, 2, "Dual XGb SFP+ LP"}, |
1503 | {NETXEN_BRDTYPE_P3_10000_BASE_T, 1, "XGB 10G BaseT LP"}, | 1536 | {NETXEN_BRDTYPE_P3_10000_BASE_T, 1, "XGB 10G BaseT LP"}, |
1504 | {NETXEN_BRDTYPE_P3_XG_LOM, 2, "Dual XGb LOM"}, | 1537 | {NETXEN_BRDTYPE_P3_XG_LOM, 2, "Dual XGb LOM"}, |
1505 | {NETXEN_BRDTYPE_P3_4_GB_MM, 4, "Quad GB - March Madness"}, | 1538 | {NETXEN_BRDTYPE_P3_4_GB_MM, 4, "NX3031 Gigabit Ethernet"}, |
1539 | {NETXEN_BRDTYPE_P3_10G_SFP_CT, 2, "NX3031 10 Gigabit Ethernet"}, | ||
1540 | {NETXEN_BRDTYPE_P3_10G_SFP_QT, 2, "Quanta Dual XGb SFP+"}, | ||
1506 | {NETXEN_BRDTYPE_P3_10G_CX4, 2, "Reference Dual CX4 Option"}, | 1541 | {NETXEN_BRDTYPE_P3_10G_CX4, 2, "Reference Dual CX4 Option"}, |
1507 | {NETXEN_BRDTYPE_P3_10G_XFP, 1, "Reference Single XFP Option"} | 1542 | {NETXEN_BRDTYPE_P3_10G_XFP, 1, "Reference Single XFP Option"} |
1508 | }; | 1543 | }; |
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index 64babc59e699..64b51643c626 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c | |||
@@ -145,8 +145,8 @@ netxen_issue_cmd(struct netxen_adapter *adapter, | |||
145 | return rcode; | 145 | return rcode; |
146 | } | 146 | } |
147 | 147 | ||
148 | u32 | 148 | int |
149 | nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, u32 mtu) | 149 | nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu) |
150 | { | 150 | { |
151 | u32 rcode = NX_RCODE_SUCCESS; | 151 | u32 rcode = NX_RCODE_SUCCESS; |
152 | struct netxen_recv_context *recv_ctx = &adapter->recv_ctx[0]; | 152 | struct netxen_recv_context *recv_ctx = &adapter->recv_ctx[0]; |
@@ -160,7 +160,10 @@ nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, u32 mtu) | |||
160 | 0, | 160 | 0, |
161 | NX_CDRP_CMD_SET_MTU); | 161 | NX_CDRP_CMD_SET_MTU); |
162 | 162 | ||
163 | return rcode; | 163 | if (rcode != NX_RCODE_SUCCESS) |
164 | return -EIO; | ||
165 | |||
166 | return 0; | ||
164 | } | 167 | } |
165 | 168 | ||
166 | static int | 169 | static int |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 48ee06b6f4e9..4ad3e0844b99 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -140,18 +140,33 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
140 | if (netif_running(dev)) { | 140 | if (netif_running(dev)) { |
141 | ecmd->speed = adapter->link_speed; | 141 | ecmd->speed = adapter->link_speed; |
142 | ecmd->duplex = adapter->link_duplex; | 142 | ecmd->duplex = adapter->link_duplex; |
143 | } else | 143 | ecmd->autoneg = adapter->link_autoneg; |
144 | return -EIO; /* link absent */ | 144 | } |
145 | |||
145 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | 146 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
146 | ecmd->supported = (SUPPORTED_TP | | 147 | u32 val; |
147 | SUPPORTED_1000baseT_Full | | 148 | |
148 | SUPPORTED_10000baseT_Full); | 149 | adapter->hw_read_wx(adapter, NETXEN_PORT_MODE_ADDR, &val, 4); |
149 | ecmd->advertising = (ADVERTISED_TP | | 150 | if (val == NETXEN_PORT_MODE_802_3_AP) { |
150 | ADVERTISED_1000baseT_Full | | 151 | ecmd->supported = SUPPORTED_1000baseT_Full; |
151 | ADVERTISED_10000baseT_Full); | 152 | ecmd->advertising = ADVERTISED_1000baseT_Full; |
153 | } else { | ||
154 | ecmd->supported = SUPPORTED_10000baseT_Full; | ||
155 | ecmd->advertising = ADVERTISED_10000baseT_Full; | ||
156 | } | ||
157 | |||
152 | ecmd->port = PORT_TP; | 158 | ecmd->port = PORT_TP; |
153 | 159 | ||
154 | ecmd->speed = SPEED_10000; | 160 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { |
161 | u16 pcifn = adapter->ahw.pci_func; | ||
162 | |||
163 | adapter->hw_read_wx(adapter, | ||
164 | P3_LINK_SPEED_REG(pcifn), &val, 4); | ||
165 | ecmd->speed = P3_LINK_SPEED_MHZ * | ||
166 | P3_LINK_SPEED_VAL(pcifn, val); | ||
167 | } else | ||
168 | ecmd->speed = SPEED_10000; | ||
169 | |||
155 | ecmd->duplex = DUPLEX_FULL; | 170 | ecmd->duplex = DUPLEX_FULL; |
156 | ecmd->autoneg = AUTONEG_DISABLE; | 171 | ecmd->autoneg = AUTONEG_DISABLE; |
157 | } else | 172 | } else |
@@ -192,6 +207,8 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
192 | break; | 207 | break; |
193 | case NETXEN_BRDTYPE_P2_SB31_10G: | 208 | case NETXEN_BRDTYPE_P2_SB31_10G: |
194 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: | 209 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: |
210 | case NETXEN_BRDTYPE_P3_10G_SFP_CT: | ||
211 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: | ||
195 | case NETXEN_BRDTYPE_P3_10G_XFP: | 212 | case NETXEN_BRDTYPE_P3_10G_XFP: |
196 | ecmd->supported |= SUPPORTED_FIBRE; | 213 | ecmd->supported |= SUPPORTED_FIBRE; |
197 | ecmd->advertising |= ADVERTISED_FIBRE; | 214 | ecmd->advertising |= ADVERTISED_FIBRE; |
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h index 3ce13e451aac..e8e8d73f6ed7 100644 --- a/drivers/net/netxen/netxen_nic_hdr.h +++ b/drivers/net/netxen/netxen_nic_hdr.h | |||
@@ -724,6 +724,13 @@ enum { | |||
724 | #define XG_LINK_STATE_P3(pcifn,val) \ | 724 | #define XG_LINK_STATE_P3(pcifn,val) \ |
725 | (((val) >> ((pcifn) * 4)) & XG_LINK_STATE_P3_MASK) | 725 | (((val) >> ((pcifn) * 4)) & XG_LINK_STATE_P3_MASK) |
726 | 726 | ||
727 | #define P3_LINK_SPEED_MHZ 100 | ||
728 | #define P3_LINK_SPEED_MASK 0xff | ||
729 | #define P3_LINK_SPEED_REG(pcifn) \ | ||
730 | (CRB_PF_LINK_SPEED_1 + (((pcifn) / 4) * 4)) | ||
731 | #define P3_LINK_SPEED_VAL(pcifn, reg) \ | ||
732 | (((reg) >> (8 * ((pcifn) & 0x3))) & P3_LINK_SPEED_MASK) | ||
733 | |||
727 | #define NETXEN_CAM_RAM_BASE (NETXEN_CRB_CAM + 0x02000) | 734 | #define NETXEN_CAM_RAM_BASE (NETXEN_CRB_CAM + 0x02000) |
728 | #define NETXEN_CAM_RAM(reg) (NETXEN_CAM_RAM_BASE + (reg)) | 735 | #define NETXEN_CAM_RAM(reg) (NETXEN_CAM_RAM_BASE + (reg)) |
729 | #define NETXEN_FW_VERSION_MAJOR (NETXEN_CAM_RAM(0x150)) | 736 | #define NETXEN_FW_VERSION_MAJOR (NETXEN_CAM_RAM(0x150)) |
@@ -836,9 +843,11 @@ enum { | |||
836 | 843 | ||
837 | #define PCIE_SETUP_FUNCTION (0x12040) | 844 | #define PCIE_SETUP_FUNCTION (0x12040) |
838 | #define PCIE_SETUP_FUNCTION2 (0x12048) | 845 | #define PCIE_SETUP_FUNCTION2 (0x12048) |
846 | #define PCIE_MISCCFG_RC (0x1206c) | ||
839 | #define PCIE_TGT_SPLIT_CHICKEN (0x12080) | 847 | #define PCIE_TGT_SPLIT_CHICKEN (0x12080) |
840 | #define PCIE_CHICKEN3 (0x120c8) | 848 | #define PCIE_CHICKEN3 (0x120c8) |
841 | 849 | ||
850 | #define ISR_INT_STATE_REG (NETXEN_PCIX_PS_REG(PCIE_MISCCFG_RC)) | ||
842 | #define PCIE_MAX_MASTER_SPLIT (0x14048) | 851 | #define PCIE_MAX_MASTER_SPLIT (0x14048) |
843 | 852 | ||
844 | #define NETXEN_PORT_MODE_NONE 0 | 853 | #define NETXEN_PORT_MODE_NONE 0 |
@@ -854,6 +863,7 @@ enum { | |||
854 | #define NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL (0x14) | 863 | #define NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL (0x14) |
855 | 864 | ||
856 | #define ISR_MSI_INT_TRIGGER(FUNC) (NETXEN_PCIX_PS_REG(PCIX_MSI_F(FUNC))) | 865 | #define ISR_MSI_INT_TRIGGER(FUNC) (NETXEN_PCIX_PS_REG(PCIX_MSI_F(FUNC))) |
866 | #define ISR_LEGACY_INT_TRIGGERED(VAL) (((VAL) & 0x300) == 0x200) | ||
857 | 867 | ||
858 | /* | 868 | /* |
859 | * PCI Interrupt Vector Values. | 869 | * PCI Interrupt Vector Values. |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 96a3bc6426e2..9aa20f961618 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -285,14 +285,7 @@ static unsigned crb_hub_agt[64] = | |||
285 | #define ADDR_IN_RANGE(addr, low, high) \ | 285 | #define ADDR_IN_RANGE(addr, low, high) \ |
286 | (((addr) <= (high)) && ((addr) >= (low))) | 286 | (((addr) <= (high)) && ((addr) >= (low))) |
287 | 287 | ||
288 | #define NETXEN_MAX_MTU 8000 + NETXEN_ENET_HEADER_SIZE + NETXEN_ETH_FCS_SIZE | ||
289 | #define NETXEN_MIN_MTU 64 | ||
290 | #define NETXEN_ETH_FCS_SIZE 4 | ||
291 | #define NETXEN_ENET_HEADER_SIZE 14 | ||
292 | #define NETXEN_WINDOW_ONE 0x2000000 /*CRB Window: bit 25 of CRB address */ | 288 | #define NETXEN_WINDOW_ONE 0x2000000 /*CRB Window: bit 25 of CRB address */ |
293 | #define NETXEN_FIRMWARE_LEN ((16 * 1024) / 4) | ||
294 | #define NETXEN_NIU_HDRSIZE (0x1 << 6) | ||
295 | #define NETXEN_NIU_TLRSIZE (0x1 << 5) | ||
296 | 289 | ||
297 | #define NETXEN_NIC_ZERO_PAUSE_ADDR 0ULL | 290 | #define NETXEN_NIC_ZERO_PAUSE_ADDR 0ULL |
298 | #define NETXEN_NIC_UNIT_PAUSE_ADDR 0x200ULL | 291 | #define NETXEN_NIC_UNIT_PAUSE_ADDR 0x200ULL |
@@ -541,9 +534,6 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter, | |||
541 | return 0; | 534 | return 0; |
542 | } | 535 | } |
543 | 536 | ||
544 | #define NIC_REQUEST 0x14 | ||
545 | #define NETXEN_MAC_EVENT 0x1 | ||
546 | |||
547 | static int nx_p3_sre_macaddr_change(struct net_device *dev, | 537 | static int nx_p3_sre_macaddr_change(struct net_device *dev, |
548 | u8 *addr, unsigned op) | 538 | u8 *addr, unsigned op) |
549 | { | 539 | { |
@@ -553,8 +543,8 @@ static int nx_p3_sre_macaddr_change(struct net_device *dev, | |||
553 | int rv; | 543 | int rv; |
554 | 544 | ||
555 | memset(&req, 0, sizeof(nx_nic_req_t)); | 545 | memset(&req, 0, sizeof(nx_nic_req_t)); |
556 | req.qhdr |= (NIC_REQUEST << 23); | 546 | req.qhdr |= (NX_NIC_REQUEST << 23); |
557 | req.req_hdr |= NETXEN_MAC_EVENT; | 547 | req.req_hdr |= NX_MAC_EVENT; |
558 | req.req_hdr |= ((u64)adapter->portnum << 16); | 548 | req.req_hdr |= ((u64)adapter->portnum << 16); |
559 | mac_req.op = op; | 549 | mac_req.op = op; |
560 | memcpy(&mac_req.mac_addr, addr, 6); | 550 | memcpy(&mac_req.mac_addr, addr, 6); |
@@ -575,31 +565,35 @@ void netxen_p3_nic_set_multi(struct net_device *netdev) | |||
575 | nx_mac_list_t *cur, *next, *del_list, *add_list = NULL; | 565 | nx_mac_list_t *cur, *next, *del_list, *add_list = NULL; |
576 | struct dev_mc_list *mc_ptr; | 566 | struct dev_mc_list *mc_ptr; |
577 | u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | 567 | u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |
578 | 568 | u32 mode = VPORT_MISS_MODE_DROP; | |
579 | adapter->set_promisc(adapter, NETXEN_NIU_PROMISC_MODE); | ||
580 | |||
581 | /* | ||
582 | * Programming mac addresses will automaticly enabling L2 filtering. | ||
583 | * HW will replace timestamp with L2 conid when L2 filtering is | ||
584 | * enabled. This causes problem for LSA. Do not enabling L2 filtering | ||
585 | * until that problem is fixed. | ||
586 | */ | ||
587 | if ((netdev->flags & IFF_PROMISC) || | ||
588 | (netdev->mc_count > adapter->max_mc_count)) | ||
589 | return; | ||
590 | 569 | ||
591 | del_list = adapter->mac_list; | 570 | del_list = adapter->mac_list; |
592 | adapter->mac_list = NULL; | 571 | adapter->mac_list = NULL; |
593 | 572 | ||
594 | nx_p3_nic_add_mac(adapter, netdev->dev_addr, &add_list, &del_list); | 573 | nx_p3_nic_add_mac(adapter, netdev->dev_addr, &add_list, &del_list); |
574 | nx_p3_nic_add_mac(adapter, bcast_addr, &add_list, &del_list); | ||
575 | |||
576 | if (netdev->flags & IFF_PROMISC) { | ||
577 | mode = VPORT_MISS_MODE_ACCEPT_ALL; | ||
578 | goto send_fw_cmd; | ||
579 | } | ||
580 | |||
581 | if ((netdev->flags & IFF_ALLMULTI) || | ||
582 | (netdev->mc_count > adapter->max_mc_count)) { | ||
583 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; | ||
584 | goto send_fw_cmd; | ||
585 | } | ||
586 | |||
595 | if (netdev->mc_count > 0) { | 587 | if (netdev->mc_count > 0) { |
596 | nx_p3_nic_add_mac(adapter, bcast_addr, &add_list, &del_list); | ||
597 | for (mc_ptr = netdev->mc_list; mc_ptr; | 588 | for (mc_ptr = netdev->mc_list; mc_ptr; |
598 | mc_ptr = mc_ptr->next) { | 589 | mc_ptr = mc_ptr->next) { |
599 | nx_p3_nic_add_mac(adapter, mc_ptr->dmi_addr, | 590 | nx_p3_nic_add_mac(adapter, mc_ptr->dmi_addr, |
600 | &add_list, &del_list); | 591 | &add_list, &del_list); |
601 | } | 592 | } |
602 | } | 593 | } |
594 | |||
595 | send_fw_cmd: | ||
596 | adapter->set_promisc(adapter, mode); | ||
603 | for (cur = del_list; cur;) { | 597 | for (cur = del_list; cur;) { |
604 | nx_p3_sre_macaddr_change(netdev, cur->mac_addr, NETXEN_MAC_DEL); | 598 | nx_p3_sre_macaddr_change(netdev, cur->mac_addr, NETXEN_MAC_DEL); |
605 | next = cur->next; | 599 | next = cur->next; |
@@ -615,6 +609,21 @@ void netxen_p3_nic_set_multi(struct net_device *netdev) | |||
615 | } | 609 | } |
616 | } | 610 | } |
617 | 611 | ||
612 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) | ||
613 | { | ||
614 | nx_nic_req_t req; | ||
615 | |||
616 | memset(&req, 0, sizeof(nx_nic_req_t)); | ||
617 | |||
618 | req.qhdr |= (NX_HOST_REQUEST << 23); | ||
619 | req.req_hdr |= NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE; | ||
620 | req.req_hdr |= ((u64)adapter->portnum << 16); | ||
621 | req.words[0] = cpu_to_le64(mode); | ||
622 | |||
623 | return netxen_send_cmd_descs(adapter, | ||
624 | (struct cmd_desc_type0 *)&req, 1); | ||
625 | } | ||
626 | |||
618 | #define NETXEN_CONFIG_INTR_COALESCE 3 | 627 | #define NETXEN_CONFIG_INTR_COALESCE 3 |
619 | 628 | ||
620 | /* | 629 | /* |
@@ -627,7 +636,7 @@ int netxen_config_intr_coalesce(struct netxen_adapter *adapter) | |||
627 | 636 | ||
628 | memset(&req, 0, sizeof(nx_nic_req_t)); | 637 | memset(&req, 0, sizeof(nx_nic_req_t)); |
629 | 638 | ||
630 | req.qhdr |= (NIC_REQUEST << 23); | 639 | req.qhdr |= (NX_NIC_REQUEST << 23); |
631 | req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE; | 640 | req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE; |
632 | req.req_hdr |= ((u64)adapter->portnum << 16); | 641 | req.req_hdr |= ((u64)adapter->portnum << 16); |
633 | 642 | ||
@@ -653,6 +662,7 @@ int netxen_nic_change_mtu(struct net_device *netdev, int mtu) | |||
653 | { | 662 | { |
654 | struct netxen_adapter *adapter = netdev_priv(netdev); | 663 | struct netxen_adapter *adapter = netdev_priv(netdev); |
655 | int max_mtu; | 664 | int max_mtu; |
665 | int rc = 0; | ||
656 | 666 | ||
657 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | 667 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
658 | max_mtu = P3_MAX_MTU; | 668 | max_mtu = P3_MAX_MTU; |
@@ -666,16 +676,12 @@ int netxen_nic_change_mtu(struct net_device *netdev, int mtu) | |||
666 | } | 676 | } |
667 | 677 | ||
668 | if (adapter->set_mtu) | 678 | if (adapter->set_mtu) |
669 | adapter->set_mtu(adapter, mtu); | 679 | rc = adapter->set_mtu(adapter, mtu); |
670 | netdev->mtu = mtu; | ||
671 | 680 | ||
672 | mtu += MTU_FUDGE_FACTOR; | 681 | if (!rc) |
673 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | 682 | netdev->mtu = mtu; |
674 | nx_fw_cmd_set_mtu(adapter, mtu); | ||
675 | else if (adapter->set_mtu) | ||
676 | adapter->set_mtu(adapter, mtu); | ||
677 | 683 | ||
678 | return 0; | 684 | return rc; |
679 | } | 685 | } |
680 | 686 | ||
681 | int netxen_is_flash_supported(struct netxen_adapter *adapter) | 687 | int netxen_is_flash_supported(struct netxen_adapter *adapter) |
@@ -1411,7 +1417,8 @@ static int netxen_nic_pci_mem_read_direct(struct netxen_adapter *adapter, | |||
1411 | (netxen_nic_pci_is_same_window(adapter, off+size-1) == 0)) { | 1417 | (netxen_nic_pci_is_same_window(adapter, off+size-1) == 0)) { |
1412 | write_unlock_irqrestore(&adapter->adapter_lock, flags); | 1418 | write_unlock_irqrestore(&adapter->adapter_lock, flags); |
1413 | printk(KERN_ERR "%s out of bound pci memory access. " | 1419 | printk(KERN_ERR "%s out of bound pci memory access. " |
1414 | "offset is 0x%llx\n", netxen_nic_driver_name, off); | 1420 | "offset is 0x%llx\n", netxen_nic_driver_name, |
1421 | (unsigned long long)off); | ||
1415 | return -1; | 1422 | return -1; |
1416 | } | 1423 | } |
1417 | 1424 | ||
@@ -1484,7 +1491,8 @@ netxen_nic_pci_mem_write_direct(struct netxen_adapter *adapter, u64 off, | |||
1484 | (netxen_nic_pci_is_same_window(adapter, off+size-1) == 0)) { | 1491 | (netxen_nic_pci_is_same_window(adapter, off+size-1) == 0)) { |
1485 | write_unlock_irqrestore(&adapter->adapter_lock, flags); | 1492 | write_unlock_irqrestore(&adapter->adapter_lock, flags); |
1486 | printk(KERN_ERR "%s out of bound pci memory access. " | 1493 | printk(KERN_ERR "%s out of bound pci memory access. " |
1487 | "offset is 0x%llx\n", netxen_nic_driver_name, off); | 1494 | "offset is 0x%llx\n", netxen_nic_driver_name, |
1495 | (unsigned long long)off); | ||
1488 | return -1; | 1496 | return -1; |
1489 | } | 1497 | } |
1490 | 1498 | ||
@@ -2016,6 +2024,8 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2016 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: | 2024 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: |
2017 | case NETXEN_BRDTYPE_P3_IMEZ: | 2025 | case NETXEN_BRDTYPE_P3_IMEZ: |
2018 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: | 2026 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: |
2027 | case NETXEN_BRDTYPE_P3_10G_SFP_CT: | ||
2028 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: | ||
2019 | case NETXEN_BRDTYPE_P3_10G_XFP: | 2029 | case NETXEN_BRDTYPE_P3_10G_XFP: |
2020 | case NETXEN_BRDTYPE_P3_10000_BASE_T: | 2030 | case NETXEN_BRDTYPE_P3_10000_BASE_T: |
2021 | 2031 | ||
@@ -2034,6 +2044,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2034 | default: | 2044 | default: |
2035 | printk("%s: Unknown(%x)\n", netxen_nic_driver_name, | 2045 | printk("%s: Unknown(%x)\n", netxen_nic_driver_name, |
2036 | boardinfo->board_type); | 2046 | boardinfo->board_type); |
2047 | rv = -ENODEV; | ||
2037 | break; | 2048 | break; |
2038 | } | 2049 | } |
2039 | 2050 | ||
@@ -2044,6 +2055,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2044 | 2055 | ||
2045 | int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) | 2056 | int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) |
2046 | { | 2057 | { |
2058 | new_mtu += MTU_FUDGE_FACTOR; | ||
2047 | netxen_nic_write_w0(adapter, | 2059 | netxen_nic_write_w0(adapter, |
2048 | NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->physical_port), | 2060 | NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->physical_port), |
2049 | new_mtu); | 2061 | new_mtu); |
@@ -2052,7 +2064,7 @@ int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) | |||
2052 | 2064 | ||
2053 | int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) | 2065 | int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) |
2054 | { | 2066 | { |
2055 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; | 2067 | new_mtu += MTU_FUDGE_FACTOR; |
2056 | if (adapter->physical_port == 0) | 2068 | if (adapter->physical_port == 0) |
2057 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, | 2069 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, |
2058 | new_mtu); | 2070 | new_mtu); |
@@ -2074,12 +2086,22 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
2074 | __u32 status; | 2086 | __u32 status; |
2075 | __u32 autoneg; | 2087 | __u32 autoneg; |
2076 | __u32 mode; | 2088 | __u32 mode; |
2089 | __u32 port_mode; | ||
2077 | 2090 | ||
2078 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); | 2091 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); |
2079 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ | 2092 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ |
2093 | |||
2094 | adapter->hw_read_wx(adapter, | ||
2095 | NETXEN_PORT_MODE_ADDR, &port_mode, 4); | ||
2096 | if (port_mode == NETXEN_PORT_MODE_802_3_AP) { | ||
2097 | adapter->link_speed = SPEED_1000; | ||
2098 | adapter->link_duplex = DUPLEX_FULL; | ||
2099 | adapter->link_autoneg = AUTONEG_DISABLE; | ||
2100 | return; | ||
2101 | } | ||
2102 | |||
2080 | if (adapter->phy_read | 2103 | if (adapter->phy_read |
2081 | && adapter-> | 2104 | && adapter->phy_read(adapter, |
2082 | phy_read(adapter, | ||
2083 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, | 2105 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
2084 | &status) == 0) { | 2106 | &status) == 0) { |
2085 | if (netxen_get_phy_link(status)) { | 2107 | if (netxen_get_phy_link(status)) { |
@@ -2109,8 +2131,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
2109 | break; | 2131 | break; |
2110 | } | 2132 | } |
2111 | if (adapter->phy_read | 2133 | if (adapter->phy_read |
2112 | && adapter-> | 2134 | && adapter->phy_read(adapter, |
2113 | phy_read(adapter, | ||
2114 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 2135 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
2115 | &autoneg) != 0) | 2136 | &autoneg) != 0) |
2116 | adapter->link_autoneg = autoneg; | 2137 | adapter->link_autoneg = autoneg; |
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h index b8e0030f03d7..aae737dc77a8 100644 --- a/drivers/net/netxen/netxen_nic_hw.h +++ b/drivers/net/netxen/netxen_nic_hw.h | |||
@@ -419,12 +419,9 @@ typedef enum { | |||
419 | #define netxen_get_niu_enable_ge(config_word) \ | 419 | #define netxen_get_niu_enable_ge(config_word) \ |
420 | _netxen_crb_get_bit(config_word, 1) | 420 | _netxen_crb_get_bit(config_word, 1) |
421 | 421 | ||
422 | /* Promiscous mode options (GbE mode only) */ | 422 | #define NETXEN_NIU_NON_PROMISC_MODE 0 |
423 | typedef enum { | 423 | #define NETXEN_NIU_PROMISC_MODE 1 |
424 | NETXEN_NIU_PROMISC_MODE = 0, | 424 | #define NETXEN_NIU_ALLMULTI_MODE 2 |
425 | NETXEN_NIU_NON_PROMISC_MODE, | ||
426 | NETXEN_NIU_ALLMULTI_MODE | ||
427 | } netxen_niu_prom_mode_t; | ||
428 | 425 | ||
429 | /* | 426 | /* |
430 | * NIU GB Drop CRC Register | 427 | * NIU GB Drop CRC Register |
@@ -471,9 +468,9 @@ typedef enum { | |||
471 | 468 | ||
472 | /* Set promiscuous mode for a GbE interface */ | 469 | /* Set promiscuous mode for a GbE interface */ |
473 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | 470 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, |
474 | netxen_niu_prom_mode_t mode); | 471 | u32 mode); |
475 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | 472 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, |
476 | netxen_niu_prom_mode_t mode); | 473 | u32 mode); |
477 | 474 | ||
478 | /* set the MAC address for a given MAC */ | 475 | /* set the MAC address for a given MAC */ |
479 | int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | 476 | int netxen_niu_macaddr_set(struct netxen_adapter *adapter, |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 01ab31b34a85..519fc860e17e 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -364,6 +364,11 @@ void netxen_initialize_adapter_ops(struct netxen_adapter *adapter) | |||
364 | default: | 364 | default: |
365 | break; | 365 | break; |
366 | } | 366 | } |
367 | |||
368 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { | ||
369 | adapter->set_mtu = nx_fw_cmd_set_mtu; | ||
370 | adapter->set_promisc = netxen_p3_nic_set_promisc; | ||
371 | } | ||
367 | } | 372 | } |
368 | 373 | ||
369 | /* | 374 | /* |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 91d209a8f6cb..7615c715e66e 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -166,7 +166,8 @@ static void netxen_nic_disable_int(struct netxen_adapter *adapter) | |||
166 | if (!NETXEN_IS_MSI_FAMILY(adapter)) { | 166 | if (!NETXEN_IS_MSI_FAMILY(adapter)) { |
167 | do { | 167 | do { |
168 | adapter->pci_write_immediate(adapter, | 168 | adapter->pci_write_immediate(adapter, |
169 | ISR_INT_TARGET_STATUS, 0xffffffff); | 169 | adapter->legacy_intr.tgt_status_reg, |
170 | 0xffffffff); | ||
170 | mask = adapter->pci_read_immediate(adapter, | 171 | mask = adapter->pci_read_immediate(adapter, |
171 | ISR_INT_VECTOR); | 172 | ISR_INT_VECTOR); |
172 | if (!(mask & 0x80)) | 173 | if (!(mask & 0x80)) |
@@ -175,7 +176,7 @@ static void netxen_nic_disable_int(struct netxen_adapter *adapter) | |||
175 | } while (--retries); | 176 | } while (--retries); |
176 | 177 | ||
177 | if (!retries) { | 178 | if (!retries) { |
178 | printk(KERN_NOTICE "%s: Failed to disable interrupt completely\n", | 179 | printk(KERN_NOTICE "%s: Failed to disable interrupt\n", |
179 | netxen_nic_driver_name); | 180 | netxen_nic_driver_name); |
180 | } | 181 | } |
181 | } else { | 182 | } else { |
@@ -190,8 +191,6 @@ static void netxen_nic_enable_int(struct netxen_adapter *adapter) | |||
190 | { | 191 | { |
191 | u32 mask; | 192 | u32 mask; |
192 | 193 | ||
193 | DPRINTK(1, INFO, "Entered ISR Enable \n"); | ||
194 | |||
195 | if (adapter->intr_scheme != -1 && | 194 | if (adapter->intr_scheme != -1 && |
196 | adapter->intr_scheme != INTR_SCHEME_PERPORT) { | 195 | adapter->intr_scheme != INTR_SCHEME_PERPORT) { |
197 | switch (adapter->ahw.board_type) { | 196 | switch (adapter->ahw.board_type) { |
@@ -213,16 +212,13 @@ static void netxen_nic_enable_int(struct netxen_adapter *adapter) | |||
213 | 212 | ||
214 | if (!NETXEN_IS_MSI_FAMILY(adapter)) { | 213 | if (!NETXEN_IS_MSI_FAMILY(adapter)) { |
215 | mask = 0xbff; | 214 | mask = 0xbff; |
216 | if (adapter->intr_scheme != -1 && | 215 | if (adapter->intr_scheme == INTR_SCHEME_PERPORT) |
217 | adapter->intr_scheme != INTR_SCHEME_PERPORT) { | 216 | adapter->pci_write_immediate(adapter, |
217 | adapter->legacy_intr.tgt_mask_reg, mask); | ||
218 | else | ||
218 | adapter->pci_write_normalize(adapter, | 219 | adapter->pci_write_normalize(adapter, |
219 | CRB_INT_VECTOR, 0); | 220 | CRB_INT_VECTOR, 0); |
220 | } | ||
221 | adapter->pci_write_immediate(adapter, | ||
222 | ISR_INT_TARGET_MASK, mask); | ||
223 | } | 221 | } |
224 | |||
225 | DPRINTK(1, INFO, "Done with enable Int\n"); | ||
226 | } | 222 | } |
227 | 223 | ||
228 | static int nx_set_dma_mask(struct netxen_adapter *adapter, uint8_t revision_id) | 224 | static int nx_set_dma_mask(struct netxen_adapter *adapter, uint8_t revision_id) |
@@ -284,6 +280,8 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
284 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: | 280 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: |
285 | case NETXEN_BRDTYPE_P3_IMEZ: | 281 | case NETXEN_BRDTYPE_P3_IMEZ: |
286 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: | 282 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: |
283 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: | ||
284 | case NETXEN_BRDTYPE_P3_10G_SFP_CT: | ||
287 | case NETXEN_BRDTYPE_P3_10G_XFP: | 285 | case NETXEN_BRDTYPE_P3_10G_XFP: |
288 | case NETXEN_BRDTYPE_P3_10000_BASE_T: | 286 | case NETXEN_BRDTYPE_P3_10000_BASE_T: |
289 | adapter->msix_supported = !!use_msi_x; | 287 | adapter->msix_supported = !!use_msi_x; |
@@ -301,6 +299,10 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
301 | case NETXEN_BRDTYPE_P3_REF_QG: | 299 | case NETXEN_BRDTYPE_P3_REF_QG: |
302 | case NETXEN_BRDTYPE_P3_4_GB: | 300 | case NETXEN_BRDTYPE_P3_4_GB: |
303 | case NETXEN_BRDTYPE_P3_4_GB_MM: | 301 | case NETXEN_BRDTYPE_P3_4_GB_MM: |
302 | adapter->msix_supported = 0; | ||
303 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G; | ||
304 | break; | ||
305 | |||
304 | case NETXEN_BRDTYPE_P2_SB35_4G: | 306 | case NETXEN_BRDTYPE_P2_SB35_4G: |
305 | case NETXEN_BRDTYPE_P2_SB31_2G: | 307 | case NETXEN_BRDTYPE_P2_SB31_2G: |
306 | adapter->msix_supported = 0; | 308 | adapter->msix_supported = 0; |
@@ -700,13 +702,10 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
700 | adapter->status &= ~NETXEN_NETDEV_STATUS; | 702 | adapter->status &= ~NETXEN_NETDEV_STATUS; |
701 | adapter->rx_csum = 1; | 703 | adapter->rx_csum = 1; |
702 | adapter->mc_enabled = 0; | 704 | adapter->mc_enabled = 0; |
703 | if (NX_IS_REVISION_P3(revision_id)) { | 705 | if (NX_IS_REVISION_P3(revision_id)) |
704 | adapter->max_mc_count = 38; | 706 | adapter->max_mc_count = 38; |
705 | adapter->max_rds_rings = 2; | 707 | else |
706 | } else { | ||
707 | adapter->max_mc_count = 16; | 708 | adapter->max_mc_count = 16; |
708 | adapter->max_rds_rings = 3; | ||
709 | } | ||
710 | 709 | ||
711 | netdev->open = netxen_nic_open; | 710 | netdev->open = netxen_nic_open; |
712 | netdev->stop = netxen_nic_close; | 711 | netdev->stop = netxen_nic_close; |
@@ -779,10 +778,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
779 | if (adapter->portnum == 0) | 778 | if (adapter->portnum == 0) |
780 | first_driver = 1; | 779 | first_driver = 1; |
781 | } | 780 | } |
782 | adapter->crb_addr_cmd_producer = crb_cmd_producer[adapter->portnum]; | ||
783 | adapter->crb_addr_cmd_consumer = crb_cmd_consumer[adapter->portnum]; | ||
784 | netxen_nic_update_cmd_producer(adapter, 0); | ||
785 | netxen_nic_update_cmd_consumer(adapter, 0); | ||
786 | 781 | ||
787 | if (first_driver) { | 782 | if (first_driver) { |
788 | first_boot = adapter->pci_read_normalize(adapter, | 783 | first_boot = adapter->pci_read_normalize(adapter, |
@@ -1053,6 +1048,11 @@ static int netxen_nic_open(struct net_device *netdev) | |||
1053 | return -EIO; | 1048 | return -EIO; |
1054 | } | 1049 | } |
1055 | 1050 | ||
1051 | if (adapter->fw_major < 4) | ||
1052 | adapter->max_rds_rings = 3; | ||
1053 | else | ||
1054 | adapter->max_rds_rings = 2; | ||
1055 | |||
1056 | err = netxen_alloc_sw_resources(adapter); | 1056 | err = netxen_alloc_sw_resources(adapter); |
1057 | if (err) { | 1057 | if (err) { |
1058 | printk(KERN_ERR "%s: Error in setting sw resources\n", | 1058 | printk(KERN_ERR "%s: Error in setting sw resources\n", |
@@ -1074,10 +1074,10 @@ static int netxen_nic_open(struct net_device *netdev) | |||
1074 | crb_cmd_producer[adapter->portnum]; | 1074 | crb_cmd_producer[adapter->portnum]; |
1075 | adapter->crb_addr_cmd_consumer = | 1075 | adapter->crb_addr_cmd_consumer = |
1076 | crb_cmd_consumer[adapter->portnum]; | 1076 | crb_cmd_consumer[adapter->portnum]; |
1077 | } | ||
1078 | 1077 | ||
1079 | netxen_nic_update_cmd_producer(adapter, 0); | 1078 | netxen_nic_update_cmd_producer(adapter, 0); |
1080 | netxen_nic_update_cmd_consumer(adapter, 0); | 1079 | netxen_nic_update_cmd_consumer(adapter, 0); |
1080 | } | ||
1081 | 1081 | ||
1082 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { | 1082 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { |
1083 | for (ring = 0; ring < adapter->max_rds_rings; ring++) | 1083 | for (ring = 0; ring < adapter->max_rds_rings; ring++) |
@@ -1113,9 +1113,7 @@ static int netxen_nic_open(struct net_device *netdev) | |||
1113 | netxen_nic_set_link_parameters(adapter); | 1113 | netxen_nic_set_link_parameters(adapter); |
1114 | 1114 | ||
1115 | netdev->set_multicast_list(netdev); | 1115 | netdev->set_multicast_list(netdev); |
1116 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | 1116 | if (adapter->set_mtu) |
1117 | nx_fw_cmd_set_mtu(adapter, netdev->mtu); | ||
1118 | else | ||
1119 | adapter->set_mtu(adapter, netdev->mtu); | 1117 | adapter->set_mtu(adapter, netdev->mtu); |
1120 | 1118 | ||
1121 | mod_timer(&adapter->watchdog_timer, jiffies); | 1119 | mod_timer(&adapter->watchdog_timer, jiffies); |
@@ -1410,20 +1408,17 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter) | |||
1410 | 1408 | ||
1411 | port = adapter->physical_port; | 1409 | port = adapter->physical_port; |
1412 | 1410 | ||
1413 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 1411 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { |
1414 | val = adapter->pci_read_normalize(adapter, CRB_XG_STATE); | 1412 | val = adapter->pci_read_normalize(adapter, CRB_XG_STATE_P3); |
1415 | linkup = (val >> port) & 1; | 1413 | val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val); |
1414 | linkup = (val == XG_LINK_UP_P3); | ||
1416 | } else { | 1415 | } else { |
1417 | if (adapter->fw_major < 4) { | 1416 | val = adapter->pci_read_normalize(adapter, CRB_XG_STATE); |
1418 | val = adapter->pci_read_normalize(adapter, | 1417 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) |
1419 | CRB_XG_STATE); | 1418 | linkup = (val >> port) & 1; |
1419 | else { | ||
1420 | val = (val >> port*8) & 0xff; | 1420 | val = (val >> port*8) & 0xff; |
1421 | linkup = (val == XG_LINK_UP); | 1421 | linkup = (val == XG_LINK_UP); |
1422 | } else { | ||
1423 | val = adapter->pci_read_normalize(adapter, | ||
1424 | CRB_XG_STATE_P3); | ||
1425 | val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val); | ||
1426 | linkup = (val == XG_LINK_UP_P3); | ||
1427 | } | 1422 | } |
1428 | } | 1423 | } |
1429 | 1424 | ||
@@ -1535,15 +1530,33 @@ static irqreturn_t netxen_intr(int irq, void *data) | |||
1535 | struct netxen_adapter *adapter = data; | 1530 | struct netxen_adapter *adapter = data; |
1536 | u32 our_int = 0; | 1531 | u32 our_int = 0; |
1537 | 1532 | ||
1538 | our_int = adapter->pci_read_normalize(adapter, CRB_INT_VECTOR); | 1533 | u32 status = 0; |
1539 | /* not our interrupt */ | 1534 | |
1540 | if ((our_int & (0x80 << adapter->portnum)) == 0) | 1535 | status = adapter->pci_read_immediate(adapter, ISR_INT_VECTOR); |
1536 | |||
1537 | if (!(status & adapter->legacy_intr.int_vec_bit)) | ||
1541 | return IRQ_NONE; | 1538 | return IRQ_NONE; |
1542 | 1539 | ||
1543 | if (adapter->intr_scheme == INTR_SCHEME_PERPORT) { | 1540 | if (adapter->ahw.revision_id >= NX_P3_B1) { |
1544 | /* claim interrupt */ | 1541 | /* check interrupt state machine, to be sure */ |
1545 | adapter->pci_write_normalize(adapter, CRB_INT_VECTOR, | 1542 | status = adapter->pci_read_immediate(adapter, |
1543 | ISR_INT_STATE_REG); | ||
1544 | if (!ISR_LEGACY_INT_TRIGGERED(status)) | ||
1545 | return IRQ_NONE; | ||
1546 | |||
1547 | } else if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { | ||
1548 | |||
1549 | our_int = adapter->pci_read_normalize(adapter, CRB_INT_VECTOR); | ||
1550 | /* not our interrupt */ | ||
1551 | if ((our_int & (0x80 << adapter->portnum)) == 0) | ||
1552 | return IRQ_NONE; | ||
1553 | |||
1554 | if (adapter->intr_scheme == INTR_SCHEME_PERPORT) { | ||
1555 | /* claim interrupt */ | ||
1556 | adapter->pci_write_normalize(adapter, | ||
1557 | CRB_INT_VECTOR, | ||
1546 | our_int & ~((u32)(0x80 << adapter->portnum))); | 1558 | our_int & ~((u32)(0x80 << adapter->portnum))); |
1559 | } | ||
1547 | } | 1560 | } |
1548 | 1561 | ||
1549 | netxen_handle_int(adapter); | 1562 | netxen_handle_int(adapter); |
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index 4cb8f4a1cf4b..27f07f6a45b1 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -610,6 +610,9 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | |||
610 | int i; | 610 | int i; |
611 | DECLARE_MAC_BUF(mac); | 611 | DECLARE_MAC_BUF(mac); |
612 | 612 | ||
613 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | ||
614 | return 0; | ||
615 | |||
613 | for (i = 0; i < 10; i++) { | 616 | for (i = 0; i < 10; i++) { |
614 | temp[0] = temp[1] = 0; | 617 | temp[0] = temp[1] = 0; |
615 | memcpy(temp + 2, addr, 2); | 618 | memcpy(temp + 2, addr, 2); |
@@ -727,6 +730,9 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) | |||
727 | __u32 mac_cfg0; | 730 | __u32 mac_cfg0; |
728 | u32 port = adapter->physical_port; | 731 | u32 port = adapter->physical_port; |
729 | 732 | ||
733 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | ||
734 | return 0; | ||
735 | |||
730 | if (port > NETXEN_NIU_MAX_GBE_PORTS) | 736 | if (port > NETXEN_NIU_MAX_GBE_PORTS) |
731 | return -EINVAL; | 737 | return -EINVAL; |
732 | mac_cfg0 = 0; | 738 | mac_cfg0 = 0; |
@@ -743,6 +749,9 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) | |||
743 | __u32 mac_cfg; | 749 | __u32 mac_cfg; |
744 | u32 port = adapter->physical_port; | 750 | u32 port = adapter->physical_port; |
745 | 751 | ||
752 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | ||
753 | return 0; | ||
754 | |||
746 | if (port > NETXEN_NIU_MAX_XG_PORTS) | 755 | if (port > NETXEN_NIU_MAX_XG_PORTS) |
747 | return -EINVAL; | 756 | return -EINVAL; |
748 | 757 | ||
@@ -755,7 +764,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) | |||
755 | 764 | ||
756 | /* Set promiscuous mode for a GbE interface */ | 765 | /* Set promiscuous mode for a GbE interface */ |
757 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | 766 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, |
758 | netxen_niu_prom_mode_t mode) | 767 | u32 mode) |
759 | { | 768 | { |
760 | __u32 reg; | 769 | __u32 reg; |
761 | u32 port = adapter->physical_port; | 770 | u32 port = adapter->physical_port; |
@@ -819,6 +828,9 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | |||
819 | u8 temp[4]; | 828 | u8 temp[4]; |
820 | u32 val; | 829 | u32 val; |
821 | 830 | ||
831 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | ||
832 | return 0; | ||
833 | |||
822 | if ((phy < 0) || (phy > NETXEN_NIU_MAX_XG_PORTS)) | 834 | if ((phy < 0) || (phy > NETXEN_NIU_MAX_XG_PORTS)) |
823 | return -EIO; | 835 | return -EIO; |
824 | 836 | ||
@@ -894,7 +906,7 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, | |||
894 | #endif /* 0 */ | 906 | #endif /* 0 */ |
895 | 907 | ||
896 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | 908 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, |
897 | netxen_niu_prom_mode_t mode) | 909 | u32 mode) |
898 | { | 910 | { |
899 | __u32 reg; | 911 | __u32 reg; |
900 | u32 port = adapter->physical_port; | 912 | u32 port = adapter->physical_port; |
diff --git a/drivers/net/netxen/netxen_nic_phan_reg.h b/drivers/net/netxen/netxen_nic_phan_reg.h index 3bfa51b62a4f..83e5ee57bfef 100644 --- a/drivers/net/netxen/netxen_nic_phan_reg.h +++ b/drivers/net/netxen/netxen_nic_phan_reg.h | |||
@@ -95,8 +95,8 @@ | |||
95 | #define CRB_HOST_STS_PROD NETXEN_NIC_REG(0xdc) | 95 | #define CRB_HOST_STS_PROD NETXEN_NIC_REG(0xdc) |
96 | #define CRB_HOST_STS_CONS NETXEN_NIC_REG(0xe0) | 96 | #define CRB_HOST_STS_CONS NETXEN_NIC_REG(0xe0) |
97 | #define CRB_PEG_CMD_PROD NETXEN_NIC_REG(0xe4) | 97 | #define CRB_PEG_CMD_PROD NETXEN_NIC_REG(0xe4) |
98 | #define CRB_PEG_CMD_CONS NETXEN_NIC_REG(0xe8) | 98 | #define CRB_PF_LINK_SPEED_1 NETXEN_NIC_REG(0xe8) |
99 | #define CRB_HOST_BUFFER_PROD NETXEN_NIC_REG(0xec) | 99 | #define CRB_PF_LINK_SPEED_2 NETXEN_NIC_REG(0xec) |
100 | #define CRB_HOST_BUFFER_CONS NETXEN_NIC_REG(0xf0) | 100 | #define CRB_HOST_BUFFER_CONS NETXEN_NIC_REG(0xf0) |
101 | #define CRB_JUMBO_BUFFER_PROD NETXEN_NIC_REG(0xf4) | 101 | #define CRB_JUMBO_BUFFER_PROD NETXEN_NIC_REG(0xf4) |
102 | #define CRB_JUMBO_BUFFER_CONS NETXEN_NIC_REG(0xf8) | 102 | #define CRB_JUMBO_BUFFER_CONS NETXEN_NIC_REG(0xf8) |