Lines Matching refs:msg

13 s32 fm10k_tlv_msg_init(u32 *msg, u16 msg_id)  in fm10k_tlv_msg_init()  argument
16 if (!msg) in fm10k_tlv_msg_init()
19 *msg = (FM10K_TLV_FLAGS_MSG << FM10K_TLV_FLAGS_SHIFT) | msg_id; in fm10k_tlv_msg_init()
34 static s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id, in fm10k_tlv_attr_put_null_string() argument
41 if (!string || !msg) in fm10k_tlv_attr_put_null_string()
44 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; in fm10k_tlv_attr_put_null_string()
70 *msg += FM10K_TLV_LEN_ALIGN(len); in fm10k_tlv_attr_put_null_string()
112 s32 fm10k_tlv_attr_put_mac_vlan(u32 *msg, u16 attr_id, in fm10k_tlv_attr_put_mac_vlan() argument
119 if (!msg || !mac_addr) in fm10k_tlv_attr_put_mac_vlan()
122 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; in fm10k_tlv_attr_put_mac_vlan()
134 *msg += FM10K_TLV_LEN_ALIGN(len); in fm10k_tlv_attr_put_mac_vlan()
172 s32 fm10k_tlv_attr_put_bool(u32 *msg, u16 attr_id) in fm10k_tlv_attr_put_bool() argument
175 if (!msg) in fm10k_tlv_attr_put_bool()
179 msg[FM10K_TLV_DWORD_LEN(*msg)] = attr_id; in fm10k_tlv_attr_put_bool()
182 *msg += FM10K_TLV_HDR_LEN << FM10K_TLV_LEN_SHIFT; in fm10k_tlv_attr_put_bool()
198 s32 fm10k_tlv_attr_put_value(u32 *msg, u16 attr_id, s64 value, u32 len) in fm10k_tlv_attr_put_value() argument
203 if (!msg || !len || len > 8 || (len & (len - 1))) in fm10k_tlv_attr_put_value()
206 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; in fm10k_tlv_attr_put_value()
222 *msg += FM10K_TLV_LEN_ALIGN(len); in fm10k_tlv_attr_put_value()
270 s32 fm10k_tlv_attr_put_le_struct(u32 *msg, u16 attr_id, in fm10k_tlv_attr_put_le_struct() argument
278 if (!msg || !len || (len % 4)) in fm10k_tlv_attr_put_le_struct()
281 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; in fm10k_tlv_attr_put_le_struct()
293 *msg += FM10K_TLV_LEN_ALIGN(len); in fm10k_tlv_attr_put_le_struct()
340 static u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id) in fm10k_tlv_attr_nest_start() argument
345 if (!msg) in fm10k_tlv_attr_nest_start()
348 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; in fm10k_tlv_attr_nest_start()
365 static s32 fm10k_tlv_attr_nest_stop(u32 *msg) in fm10k_tlv_attr_nest_stop() argument
371 if (!msg) in fm10k_tlv_attr_nest_stop()
375 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; in fm10k_tlv_attr_nest_stop()
381 *msg += len; in fm10k_tlv_attr_nest_stop()
544 s32 fm10k_tlv_msg_parse(struct fm10k_hw *hw, u32 *msg, in fm10k_tlv_msg_parse() argument
553 if (!msg || !data) in fm10k_tlv_msg_parse()
557 if (!(*msg & (FM10K_TLV_FLAGS_MSG << FM10K_TLV_FLAGS_SHIFT))) in fm10k_tlv_msg_parse()
561 msg_id = *msg & FM10K_TLV_ID_MASK; in fm10k_tlv_msg_parse()
573 err = fm10k_tlv_attr_parse(msg, results, data->attr); in fm10k_tlv_msg_parse()
640 static void fm10k_tlv_msg_test_generate_data(u32 *msg, u32 attr_flags) in fm10k_tlv_msg_test_generate_data() argument
643 fm10k_tlv_attr_put_null_string(msg, FM10K_TEST_MSG_STRING, in fm10k_tlv_msg_test_generate_data()
646 fm10k_tlv_attr_put_mac_vlan(msg, FM10K_TEST_MSG_MAC_ADDR, in fm10k_tlv_msg_test_generate_data()
649 fm10k_tlv_attr_put_u8(msg, FM10K_TEST_MSG_U8, test_u8); in fm10k_tlv_msg_test_generate_data()
651 fm10k_tlv_attr_put_u16(msg, FM10K_TEST_MSG_U16, test_u16); in fm10k_tlv_msg_test_generate_data()
653 fm10k_tlv_attr_put_u32(msg, FM10K_TEST_MSG_U32, test_u32); in fm10k_tlv_msg_test_generate_data()
655 fm10k_tlv_attr_put_u64(msg, FM10K_TEST_MSG_U64, test_u64); in fm10k_tlv_msg_test_generate_data()
657 fm10k_tlv_attr_put_s8(msg, FM10K_TEST_MSG_S8, test_s8); in fm10k_tlv_msg_test_generate_data()
659 fm10k_tlv_attr_put_s16(msg, FM10K_TEST_MSG_S16, test_s16); in fm10k_tlv_msg_test_generate_data()
661 fm10k_tlv_attr_put_s32(msg, FM10K_TEST_MSG_S32, test_s32); in fm10k_tlv_msg_test_generate_data()
663 fm10k_tlv_attr_put_s64(msg, FM10K_TEST_MSG_S64, test_s64); in fm10k_tlv_msg_test_generate_data()
665 fm10k_tlv_attr_put_le_struct(msg, FM10K_TEST_MSG_LE_STRUCT, in fm10k_tlv_msg_test_generate_data()
677 void fm10k_tlv_msg_test_create(u32 *msg, u32 attr_flags) in fm10k_tlv_msg_test_create() argument
681 fm10k_tlv_msg_init(msg, FM10K_TLV_MSG_ID_TEST); in fm10k_tlv_msg_test_create()
683 fm10k_tlv_msg_test_generate_data(msg, attr_flags); in fm10k_tlv_msg_test_create()
689 nest = fm10k_tlv_attr_nest_start(msg, FM10K_TEST_MSG_NESTED); in fm10k_tlv_msg_test_create()
693 fm10k_tlv_attr_nest_stop(msg); in fm10k_tlv_msg_test_create()