Lines Matching full:msg
50 static int __hsmp_send_message(struct hsmp_socket *sock, struct hsmp_message *msg) in __hsmp_send_message() argument
70 while (index < msg->num_args) { in __hsmp_send_message()
72 &msg->args[index], HSMP_WR); in __hsmp_send_message()
81 ret = sock->amd_hsmp_rdwr(sock, mbinfo->msg_id_off, &msg->msg_id, HSMP_WR); in __hsmp_send_message()
83 dev_err(sock->dev, "Error %d writing message ID %u\n", ret, msg->msg_id); in __hsmp_send_message()
114 msg->msg_id, mbox_status); in __hsmp_send_message()
118 msg->msg_id, mbox_status); in __hsmp_send_message()
122 msg->msg_id, mbox_status); in __hsmp_send_message()
126 msg->msg_id, mbox_status); in __hsmp_send_message()
130 msg->msg_id, mbox_status); in __hsmp_send_message()
134 msg->msg_id, mbox_status); in __hsmp_send_message()
146 while (index < msg->response_sz) { in __hsmp_send_message()
148 &msg->args[index], HSMP_RD); in __hsmp_send_message()
151 ret, index, msg->msg_id); in __hsmp_send_message()
160 static int validate_message(struct hsmp_message *msg) in validate_message() argument
163 if (msg->msg_id < HSMP_TEST || msg->msg_id >= HSMP_MSG_ID_MAX) in validate_message()
167 if (hsmp_msg_desc_table[msg->msg_id].type == HSMP_RSVD) in validate_message()
171 if (msg->num_args != hsmp_msg_desc_table[msg->msg_id].num_args || in validate_message()
172 msg->response_sz != hsmp_msg_desc_table[msg->msg_id].response_sz) in validate_message()
178 int hsmp_send_message(struct hsmp_message *msg) in hsmp_send_message() argument
183 if (!msg) in hsmp_send_message()
185 ret = validate_message(msg); in hsmp_send_message()
189 if (!hsmp_pdev.sock || msg->sock_ind >= hsmp_pdev.num_sockets) in hsmp_send_message()
191 sock = &hsmp_pdev.sock[msg->sock_ind]; in hsmp_send_message()
203 ret = __hsmp_send_message(sock, msg); in hsmp_send_message()
213 struct hsmp_message msg = { 0 }; in hsmp_test() local
220 msg.msg_id = HSMP_TEST; in hsmp_test()
221 msg.num_args = 1; in hsmp_test()
222 msg.response_sz = 1; in hsmp_test()
223 msg.args[0] = value; in hsmp_test()
224 msg.sock_ind = sock_ind; in hsmp_test()
226 ret = hsmp_send_message(&msg); in hsmp_test()
231 if (msg.args[0] != (value + 1)) { in hsmp_test()
234 sock_ind, (value + 1), msg.args[0]); in hsmp_test()
245 struct hsmp_message msg = { 0 }; in hsmp_ioctl() local
248 if (copy_struct_from_user(&msg, sizeof(msg), arguser, sizeof(struct hsmp_message))) in hsmp_ioctl()
252 * Check msg_id is within the range of supported msg ids in hsmp_ioctl()
255 if (msg.msg_id < HSMP_TEST || msg.msg_id >= HSMP_MSG_ID_MAX) in hsmp_ioctl()
264 if (hsmp_msg_desc_table[msg.msg_id].type != HSMP_SET) in hsmp_ioctl()
272 if (hsmp_msg_desc_table[msg.msg_id].type != HSMP_GET) in hsmp_ioctl()
285 ret = hsmp_send_message(&msg); in hsmp_ioctl()
289 if (hsmp_msg_desc_table[msg.msg_id].response_sz > 0) { in hsmp_ioctl()
291 if (copy_to_user(arguser, &msg, sizeof(struct hsmp_message))) in hsmp_ioctl()
300 struct hsmp_message msg = { 0 }; in hsmp_metric_tbl_read() local
312 msg.msg_id = HSMP_GET_METRIC_TABLE; in hsmp_metric_tbl_read()
313 msg.sock_ind = sock->sock_ind; in hsmp_metric_tbl_read()
315 ret = hsmp_send_message(&msg); in hsmp_metric_tbl_read()
327 struct hsmp_message msg = { 0 }; in hsmp_get_tbl_dram_base() local
331 msg.sock_ind = sock_ind; in hsmp_get_tbl_dram_base()
332 msg.response_sz = hsmp_msg_desc_table[HSMP_GET_METRIC_TABLE_DRAM_ADDR].response_sz; in hsmp_get_tbl_dram_base()
333 msg.msg_id = HSMP_GET_METRIC_TABLE_DRAM_ADDR; in hsmp_get_tbl_dram_base()
335 ret = hsmp_send_message(&msg); in hsmp_get_tbl_dram_base()
343 dram_addr = msg.args[0] | ((u64)(msg.args[1]) << 32); in hsmp_get_tbl_dram_base()
360 struct hsmp_message msg = { 0 }; in hsmp_cache_proto_ver() local
363 msg.msg_id = HSMP_GET_PROTO_VER; in hsmp_cache_proto_ver()
364 msg.sock_ind = sock_ind; in hsmp_cache_proto_ver()
365 msg.response_sz = hsmp_msg_desc_table[HSMP_GET_PROTO_VER].response_sz; in hsmp_cache_proto_ver()
367 ret = hsmp_send_message(&msg); in hsmp_cache_proto_ver()
369 hsmp_pdev.proto_ver = msg.args[0]; in hsmp_cache_proto_ver()