aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic_ctx.c')
-rw-r--r--drivers/net/netxen/netxen_nic_ctx.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index 7a13ee8144ee..32f48398398b 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -41,8 +41,7 @@ netxen_api_lock(struct netxen_adapter *adapter)
41 41
42 for (;;) { 42 for (;;) {
43 /* Acquire PCIE HW semaphore5 */ 43 /* Acquire PCIE HW semaphore5 */
44 done = netxen_nic_read_w0(adapter, 44 done = NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM5_LOCK));
45 NETXEN_PCIE_REG(PCIE_SEM5_LOCK));
46 45
47 if (done == 1) 46 if (done == 1)
48 break; 47 break;
@@ -56,7 +55,7 @@ netxen_api_lock(struct netxen_adapter *adapter)
56 } 55 }
57 56
58#if 0 57#if 0
59 netxen_nic_write_w1(adapter, 58 NXWR32(adapter,
60 NETXEN_API_LOCK_ID, NX_OS_API_LOCK_DRIVER); 59 NETXEN_API_LOCK_ID, NX_OS_API_LOCK_DRIVER);
61#endif 60#endif
62 return 0; 61 return 0;
@@ -66,8 +65,7 @@ static int
66netxen_api_unlock(struct netxen_adapter *adapter) 65netxen_api_unlock(struct netxen_adapter *adapter)
67{ 66{
68 /* Release PCIE HW semaphore5 */ 67 /* Release PCIE HW semaphore5 */
69 netxen_nic_read_w0(adapter, 68 NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM5_UNLOCK));
70 NETXEN_PCIE_REG(PCIE_SEM5_UNLOCK));
71 return 0; 69 return 0;
72} 70}
73 71
@@ -84,7 +82,7 @@ netxen_poll_rsp(struct netxen_adapter *adapter)
84 if (++timeout > NX_OS_CRB_RETRY_COUNT) 82 if (++timeout > NX_OS_CRB_RETRY_COUNT)
85 return NX_CDRP_RSP_TIMEOUT; 83 return NX_CDRP_RSP_TIMEOUT;
86 84
87 rsp = netxen_nic_read_w1(adapter, NX_CDRP_CRB_OFFSET); 85 rsp = NXRD32(adapter, NX_CDRP_CRB_OFFSET);
88 } while (!NX_CDRP_IS_RSP(rsp)); 86 } while (!NX_CDRP_IS_RSP(rsp));
89 87
90 return rsp; 88 return rsp;
@@ -104,16 +102,15 @@ netxen_issue_cmd(struct netxen_adapter *adapter,
104 if (netxen_api_lock(adapter)) 102 if (netxen_api_lock(adapter))
105 return NX_RCODE_TIMEOUT; 103 return NX_RCODE_TIMEOUT;
106 104
107 netxen_nic_write_w1(adapter, NX_SIGN_CRB_OFFSET, signature); 105 NXWR32(adapter, NX_SIGN_CRB_OFFSET, signature);
108 106
109 netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET, arg1); 107 NXWR32(adapter, NX_ARG1_CRB_OFFSET, arg1);
110 108
111 netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET, arg2); 109 NXWR32(adapter, NX_ARG2_CRB_OFFSET, arg2);
112 110
113 netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET, arg3); 111 NXWR32(adapter, NX_ARG3_CRB_OFFSET, arg3);
114 112
115 netxen_nic_write_w1(adapter, NX_CDRP_CRB_OFFSET, 113 NXWR32(adapter, NX_CDRP_CRB_OFFSET, NX_CDRP_FORM_CMD(cmd));
116 NX_CDRP_FORM_CMD(cmd));
117 114
118 rsp = netxen_poll_rsp(adapter); 115 rsp = netxen_poll_rsp(adapter);
119 116
@@ -123,7 +120,7 @@ netxen_issue_cmd(struct netxen_adapter *adapter,
123 120
124 rcode = NX_RCODE_TIMEOUT; 121 rcode = NX_RCODE_TIMEOUT;
125 } else if (rsp == NX_CDRP_RSP_FAIL) { 122 } else if (rsp == NX_CDRP_RSP_FAIL) {
126 rcode = netxen_nic_read_w1(adapter, NX_ARG1_CRB_OFFSET); 123 rcode = NXRD32(adapter, NX_ARG1_CRB_OFFSET);
127 124
128 printk(KERN_ERR "%s: failed card response code:0x%x\n", 125 printk(KERN_ERR "%s: failed card response code:0x%x\n",
129 netxen_nic_driver_name, rcode); 126 netxen_nic_driver_name, rcode);
@@ -515,11 +512,11 @@ netxen_init_old_ctx(struct netxen_adapter *adapter)
515 adapter->ctx_desc->sts_ring_addr = cpu_to_le64(sds_ring->phys_addr); 512 adapter->ctx_desc->sts_ring_addr = cpu_to_le64(sds_ring->phys_addr);
516 adapter->ctx_desc->sts_ring_size = cpu_to_le32(sds_ring->num_desc); 513 adapter->ctx_desc->sts_ring_size = cpu_to_le32(sds_ring->num_desc);
517 514
518 adapter->hw_write_wx(adapter, CRB_CTX_ADDR_REG_LO(func_id), 515 NXWR32(adapter, CRB_CTX_ADDR_REG_LO(func_id),
519 lower32(adapter->ctx_desc_phys_addr)); 516 lower32(adapter->ctx_desc_phys_addr));
520 adapter->hw_write_wx(adapter, CRB_CTX_ADDR_REG_HI(func_id), 517 NXWR32(adapter, CRB_CTX_ADDR_REG_HI(func_id),
521 upper32(adapter->ctx_desc_phys_addr)); 518 upper32(adapter->ctx_desc_phys_addr));
522 adapter->hw_write_wx(adapter, CRB_CTX_SIGNATURE_REG(func_id), 519 NXWR32(adapter, CRB_CTX_SIGNATURE_REG(func_id),
523 NETXEN_CTX_SIGNATURE | func_id); 520 NETXEN_CTX_SIGNATURE | func_id);
524 return 0; 521 return 0;
525} 522}