aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-12-20 18:52:02 -0500
committerBen Hutchings <bhutchings@solarflare.com>2012-01-26 19:10:44 -0500
commit788ec41cc843f12e8d0eba5f2b37af18b76654a5 (patch)
tree267d39e7760936fa746d3832a17566d219f8e932
parent3f713bf4dd9f7ef2a2c5e9ec124b3d992a2669db (diff)
sfc: Use new names for MC shared memory layout constants
These are defined alongside the firmware protocol in mcdi_pcol.h. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/mcdi.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index f16145d9281..e5837a6485a 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -22,18 +22,12 @@
22 ************************************************************************** 22 **************************************************************************
23 */ 23 */
24 24
25/* Software-defined structure to the shared-memory */
26#define CMD_NOTIFY_PORT0 0
27#define CMD_NOTIFY_PORT1 4
28#define CMD_PDU_PORT0 0x008
29#define CMD_PDU_PORT1 0x108
30
31#define MCDI_RPC_TIMEOUT 10 /*seconds */ 25#define MCDI_RPC_TIMEOUT 10 /*seconds */
32 26
33#define MCDI_PDU(efx) \ 27#define MCDI_PDU(efx) \
34 (efx_port_num(efx) ? CMD_PDU_PORT1 : CMD_PDU_PORT0) 28 (efx_port_num(efx) ? MC_SMEM_P1_PDU_OFST : MC_SMEM_P0_PDU_OFST)
35#define MCDI_DOORBELL(efx) \ 29#define MCDI_DOORBELL(efx) \
36 (efx_port_num(efx) ? CMD_NOTIFY_PORT1 : CMD_NOTIFY_PORT0) 30 (efx_port_num(efx) ? MC_SMEM_P1_DOORBELL_OFST : MC_SMEM_P0_DOORBELL_OFST)
37#define MCDI_STATUS(efx) \ 31#define MCDI_STATUS(efx) \
38 (efx_port_num(efx) ? MC_SMEM_P1_STATUS_OFST : MC_SMEM_P0_STATUS_OFST) 32 (efx_port_num(efx) ? MC_SMEM_P1_STATUS_OFST : MC_SMEM_P0_STATUS_OFST)
39 33
@@ -83,7 +77,7 @@ static void efx_mcdi_copyin(struct efx_nic *efx, unsigned cmd,
83 u32 xflags, seqno; 77 u32 xflags, seqno;
84 78
85 BUG_ON(atomic_read(&mcdi->state) == MCDI_STATE_QUIESCENT); 79 BUG_ON(atomic_read(&mcdi->state) == MCDI_STATE_QUIESCENT);
86 BUG_ON(inlen & 3 || inlen >= 0x100); 80 BUG_ON(inlen & 3 || inlen >= MC_SMEM_PDU_LEN);
87 81
88 seqno = mcdi->seqno & SEQ_MASK; 82 seqno = mcdi->seqno & SEQ_MASK;
89 xflags = 0; 83 xflags = 0;
@@ -117,7 +111,7 @@ static void efx_mcdi_copyout(struct efx_nic *efx, u8 *outbuf, size_t outlen)
117 int i; 111 int i;
118 112
119 BUG_ON(atomic_read(&mcdi->state) == MCDI_STATE_QUIESCENT); 113 BUG_ON(atomic_read(&mcdi->state) == MCDI_STATE_QUIESCENT);
120 BUG_ON(outlen & 3 || outlen >= 0x100); 114 BUG_ON(outlen & 3 || outlen >= MC_SMEM_PDU_LEN);
121 115
122 for (i = 0; i < outlen; i += 4) 116 for (i = 0; i < outlen; i += 4)
123 *((__le32 *)(outbuf + i)) = _efx_readd(efx, pdu + 4 + i); 117 *((__le32 *)(outbuf + i)) = _efx_readd(efx, pdu + 4 + i);