diff options
author | Stuart Hodgson <smhodgson@solarflare.com> | 2012-07-16 12:40:47 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-09-07 16:13:40 -0400 |
commit | c3cba721f1b761ca96f6fe437dec738db1069909 (patch) | |
tree | 161493217418d36ff6396218b6c610953641d816 /drivers/net/ethernet/sfc | |
parent | c31e5f9f97fba32103c8bdd286eee8e3aefbee31 (diff) |
sfc: Allow efx_mcdi_rpc to be called in two parts
For NIC/System time synchonisation efx_mcdi_rpc needs to be split in
efx_mcdi_rpc_start and efx_mcdi_rpc_finish operations.
Signed-off-by: Stuart Hodgson <smhodgson@solarflare.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi.c | 21 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi.h | 6 |
2 files changed, 24 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index fc5e7bbcbc9e..2707e86def9e 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c | |||
@@ -320,14 +320,20 @@ static void efx_mcdi_ev_cpl(struct efx_nic *efx, unsigned int seqno, | |||
320 | efx_mcdi_complete(mcdi); | 320 | efx_mcdi_complete(mcdi); |
321 | } | 321 | } |
322 | 322 | ||
323 | /* Issue the given command by writing the data into the shared memory PDU, | ||
324 | * ring the doorbell and wait for completion. Copyout the result. */ | ||
325 | int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, | 323 | int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, |
326 | const u8 *inbuf, size_t inlen, u8 *outbuf, size_t outlen, | 324 | const u8 *inbuf, size_t inlen, u8 *outbuf, size_t outlen, |
327 | size_t *outlen_actual) | 325 | size_t *outlen_actual) |
328 | { | 326 | { |
327 | efx_mcdi_rpc_start(efx, cmd, inbuf, inlen); | ||
328 | return efx_mcdi_rpc_finish(efx, cmd, inlen, | ||
329 | outbuf, outlen, outlen_actual); | ||
330 | } | ||
331 | |||
332 | void efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd, const u8 *inbuf, | ||
333 | size_t inlen) | ||
334 | { | ||
329 | struct efx_mcdi_iface *mcdi = efx_mcdi(efx); | 335 | struct efx_mcdi_iface *mcdi = efx_mcdi(efx); |
330 | int rc; | 336 | |
331 | BUG_ON(efx_nic_rev(efx) < EFX_REV_SIENA_A0); | 337 | BUG_ON(efx_nic_rev(efx) < EFX_REV_SIENA_A0); |
332 | 338 | ||
333 | efx_mcdi_acquire(mcdi); | 339 | efx_mcdi_acquire(mcdi); |
@@ -338,6 +344,15 @@ int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, | |||
338 | spin_unlock_bh(&mcdi->iface_lock); | 344 | spin_unlock_bh(&mcdi->iface_lock); |
339 | 345 | ||
340 | efx_mcdi_copyin(efx, cmd, inbuf, inlen); | 346 | efx_mcdi_copyin(efx, cmd, inbuf, inlen); |
347 | } | ||
348 | |||
349 | int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, | ||
350 | u8 *outbuf, size_t outlen, size_t *outlen_actual) | ||
351 | { | ||
352 | struct efx_mcdi_iface *mcdi = efx_mcdi(efx); | ||
353 | int rc; | ||
354 | |||
355 | BUG_ON(efx_nic_rev(efx) < EFX_REV_SIENA_A0); | ||
341 | 356 | ||
342 | if (mcdi->mode == MCDI_MODE_POLL) | 357 | if (mcdi->mode == MCDI_MODE_POLL) |
343 | rc = efx_mcdi_poll(efx); | 358 | rc = efx_mcdi_poll(efx); |
diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h index 0bdf3e331832..dc25caaa3983 100644 --- a/drivers/net/ethernet/sfc/mcdi.h +++ b/drivers/net/ethernet/sfc/mcdi.h | |||
@@ -71,6 +71,12 @@ extern int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const u8 *inbuf, | |||
71 | size_t inlen, u8 *outbuf, size_t outlen, | 71 | size_t inlen, u8 *outbuf, size_t outlen, |
72 | size_t *outlen_actual); | 72 | size_t *outlen_actual); |
73 | 73 | ||
74 | extern void efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd, | ||
75 | const u8 *inbuf, size_t inlen); | ||
76 | extern int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, | ||
77 | u8 *outbuf, size_t outlen, | ||
78 | size_t *outlen_actual); | ||
79 | |||
74 | extern int efx_mcdi_poll_reboot(struct efx_nic *efx); | 80 | extern int efx_mcdi_poll_reboot(struct efx_nic *efx); |
75 | extern void efx_mcdi_mode_poll(struct efx_nic *efx); | 81 | extern void efx_mcdi_mode_poll(struct efx_nic *efx); |
76 | extern void efx_mcdi_mode_event(struct efx_nic *efx); | 82 | extern void efx_mcdi_mode_event(struct efx_nic *efx); |