summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/mcdi.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-10-08 21:43:00 +0100
committerBen Hutchings <bhutchings@solarflare.com>2013-08-21 20:20:36 +0100
commit5bc283e51327e249459caab1aff505000ae2beeb (patch)
tree8fd6c302fe5eab6e3c9946d9ef4b667eccb1b3c6 /drivers/net/ethernet/sfc/mcdi.h
parent86094f7f38ff711f3db8497fcb4d2e109100f497 (diff)
downloadlinux-5bc283e51327e249459caab1aff505000ae2beeb.tar.bz2
sfc: Translate MCDI error numbers received in events
Currently we only translate error codes in efx_mcdi_poll(), but we also need to do so in efx_mcdi_ev_cpl(). The reason we didn't notice before is that the MC firmware error codes are mostly taken from Unix/Linux and no translation is necessary on most architectures. Make sure we notice any future failure by changing the sign of resprc (matching the kernel convention) and BUG if it's ever positive at command completion. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/mcdi.h')
-rw-r--r--drivers/net/ethernet/sfc/mcdi.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h
index 0bfed2a64399..9b536d08a162 100644
--- a/drivers/net/ethernet/sfc/mcdi.h
+++ b/drivers/net/ethernet/sfc/mcdi.h
@@ -42,7 +42,7 @@ enum efx_mcdi_mode {
* Serialised by @lock
* @credits: Number of spurious MCDI completion events allowed before we
* trigger a fatal error. Protected by @lock
- * @resprc: Returned MCDI completion
+ * @resprc: Response error/success code (Linux numbering)
* @resplen: Returned payload length
*/
struct efx_mcdi_iface {
@@ -52,7 +52,7 @@ struct efx_mcdi_iface {
enum efx_mcdi_mode mode;
unsigned int credits;
unsigned int seqno;
- unsigned int resprc;
+ int resprc;
size_t resplen;
};