[08/18] common/idpf: swap opcode and retval location in msg struct
Checks
Commit Message
To make the code more readable and make it clearer that the opcode goes
in cookie_high and retval goes in cookie_low.
Add macro definitions for filling opcode and retval.
Signed-off-by: Charles Stoll <charles.stoll@intel.com>
Signed-off-by: Wenjing Qiao <wenjing.qiao@intel.com>
---
drivers/common/idpf/base/idpf_controlq.c | 2 ++
drivers/common/idpf/base/idpf_controlq_api.h | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
@@ -288,6 +288,8 @@ int idpf_ctlq_deinit(struct idpf_hw *hw)
* send routine via the q_msg struct / control queue specific data struct.
* The control queue will hold a reference to each send message until
* the completion for that message has been cleaned.
+ * Since all q_msgs being sent are store in native endianness, these values
+ * must be converted to LE before being written to the hw descriptor.
*/
int idpf_ctlq_send(struct idpf_hw *hw, struct idpf_ctlq_info *cq,
u16 num_q_msg, struct idpf_ctlq_msg q_msg[])
@@ -63,9 +63,13 @@ struct idpf_ctlq_msg {
u16 status; /* when receiving a message */
};
union {
+#ifndef __KERNEL__
+#define FILL_OPCODE_V1(msg, opcode) ((msg).cookie.cfg.mbx.chnl_opcode = opcode)
+#define FILL_RETVAL_V1(msg, retval) ((msg).cookie.cfg.mbx.chnl_retval = retval)
+#endif /* __KERNEL__ */
struct {
- u32 chnl_retval;
u32 chnl_opcode;
+ u32 chnl_retval;
} mbx;
} cookie;
union {