aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/mcdi.h
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2022-11-14 13:15:54 +0000
committerDavid S. Miller <davem@davemloft.net>2022-11-16 09:07:02 +0000
commite5731274cdd186a362beba1bbf0cc35e1dd5f547 (patch)
tree9d9c00853968ef8efab5b74118795a632708f530 /drivers/net/ethernet/sfc/mcdi.h
parentsfc: add ability for extra channels to receive raw RX buffers (diff)
downloadlinux-e5731274cdd186a362beba1bbf0cc35e1dd5f547.tar.xz
linux-e5731274cdd186a362beba1bbf0cc35e1dd5f547.zip
sfc: add ef100 MAE counter support functions
Start and stop MAE counter streaming, and grant credits. Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/mcdi.h')
-rw-r--r--drivers/net/ethernet/sfc/mcdi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h
index fbeb58104936..7e35fec9da35 100644
--- a/drivers/net/ethernet/sfc/mcdi.h
+++ b/drivers/net/ethernet/sfc/mcdi.h
@@ -221,6 +221,11 @@ void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
#define MCDI_BYTE(_buf, _field) \
((void)BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 1), \
*MCDI_PTR(_buf, _field))
+#define MCDI_SET_WORD(_buf, _field, _value) do { \
+ BUILD_BUG_ON(MC_CMD_ ## _field ## _LEN != 2); \
+ BUILD_BUG_ON(MC_CMD_ ## _field ## _OFST & 1); \
+ *(__force __le16 *)MCDI_PTR(_buf, _field) = cpu_to_le16(_value);\
+ } while (0)
#define MCDI_WORD(_buf, _field) \
((u16)BUILD_BUG_ON_ZERO(MC_CMD_ ## _field ## _LEN != 2) + \
le16_to_cpu(*(__force const __le16 *)MCDI_PTR(_buf, _field)))