aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/base/efx_mcdi.h
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-02-26 09:17:37 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-02-26 09:21:27 +0100
commit597cb1874068054d4c0be41f161a72ef37888930 (patch)
tree8899c19634bd8e393a8eac05f33925e4d75bd77d /drivers/net/sfc/base/efx_mcdi.h
parent6e7cbd63706f3435b9d9a2057a37db1da01db9a7 (diff)
New upstream version 17.11.5upstream-17.11-stable
Change-Id: I8d2aa1aee2a9a78614dff5a01008f91e88e810c7 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'drivers/net/sfc/base/efx_mcdi.h')
-rw-r--r--drivers/net/sfc/base/efx_mcdi.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/sfc/base/efx_mcdi.h b/drivers/net/sfc/base/efx_mcdi.h
index 21727713..1f355c02 100644
--- a/drivers/net/sfc/base/efx_mcdi.h
+++ b/drivers/net/sfc/base/efx_mcdi.h
@@ -400,6 +400,17 @@ efx_mcdi_phy_module_get_info(
(((mask) & (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) == \
(MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv))
+/*
+ * The buffer size must be a multiple of dword to ensure that MCDI works
+ * properly with Siena based boards (which use on-chip buffer). Also, it
+ * should be at minimum the size of two dwords to allow space for extended
+ * error responses if the request/response buffer sizes are smaller.
+ */
+#define EFX_MCDI_DECLARE_BUF(_name, _in_len, _out_len) \
+ uint8_t _name[P2ROUNDUP(MAX(MAX(_in_len, _out_len), \
+ (2 * sizeof (efx_dword_t))), \
+ sizeof (efx_dword_t))] = {0}
+
typedef enum efx_mcdi_feature_id_e {
EFX_MCDI_FEATURE_FW_UPDATE = 0,
EFX_MCDI_FEATURE_LINK_CONTROL,