Lines Matching refs:msg

140 	unsigned char *msg = data;  in nvec_status_notifier()  local
147 msg, msg[1] + 2, true); in nvec_status_notifier()
191 void nvec_msg_free(struct nvec_chip *nvec, struct nvec_msg *msg) in nvec_msg_free() argument
193 if (msg != &nvec->tx_scratch) in nvec_msg_free()
194 dev_vdbg(nvec->dev, "INFO: Free %ti\n", msg - nvec->msg_pool); in nvec_msg_free()
195 atomic_set(&msg->used, 0); in nvec_msg_free()
203 static bool nvec_msg_is_event(struct nvec_msg *msg) in nvec_msg_is_event() argument
205 return msg->data[0] >> 7; in nvec_msg_is_event()
214 static size_t nvec_msg_size(struct nvec_msg *msg) in nvec_msg_size() argument
216 bool is_event = nvec_msg_is_event(msg); in nvec_msg_size()
217 int event_length = (msg->data[0] & 0x60) >> 5; in nvec_msg_size()
221 return (msg->pos || msg->size) ? (msg->data[1] + 2) : 0; in nvec_msg_size()
258 struct nvec_msg *msg; in nvec_write_async() local
261 msg = nvec_msg_alloc(nvec, NVEC_MSG_TX); in nvec_write_async()
263 if (!msg) in nvec_write_async()
266 msg->data[0] = size; in nvec_write_async()
267 memcpy(msg->data + 1, data, size); in nvec_write_async()
268 msg->size = size + 1; in nvec_write_async()
271 list_add_tail(&msg->node, &nvec->tx_data); in nvec_write_async()
299 struct nvec_msg **msg) in nvec_write_sync() argument
303 *msg = NULL; in nvec_write_sync()
323 *msg = nvec->last_sync_msg; in nvec_write_sync()
379 struct nvec_msg *msg; in nvec_request_master() local
383 msg = list_first_entry(&nvec->tx_data, struct nvec_msg, node); in nvec_request_master()
392 msg->pos = 0; in nvec_request_master()
398 list_del_init(&msg->node); in nvec_request_master()
399 nvec_msg_free(nvec, msg); in nvec_request_master()
413 static int parse_msg(struct nvec_chip *nvec, struct nvec_msg *msg) in parse_msg() argument
415 if ((msg->data[0] & 1 << 7) == 0 && msg->data[3]) { in parse_msg()
416 dev_err(nvec->dev, "ec responded %*ph\n", 4, msg->data); in parse_msg()
420 if ((msg->data[0] >> 7) == 1 && (msg->data[0] & 0x0f) == 5) in parse_msg()
422 DUMP_PREFIX_NONE, 16, 1, msg->data, in parse_msg()
423 msg->data[1] + 2, true); in parse_msg()
425 atomic_notifier_call_chain(&nvec->notifier_list, msg->data[0] & 0x8f, in parse_msg()
426 msg->data); in parse_msg()
442 struct nvec_msg *msg; in nvec_dispatch() local
446 msg = list_first_entry(&nvec->rx_data, struct nvec_msg, node); in nvec_dispatch()
447 list_del_init(&msg->node); in nvec_dispatch()
451 (msg->data[2] << 8) + msg->data[0]) { in nvec_dispatch()
454 nvec->last_sync_msg = msg; in nvec_dispatch()
457 parse_msg(nvec, msg); in nvec_dispatch()
458 nvec_msg_free(nvec, msg); in nvec_dispatch()
770 struct nvec_msg *msg; in tegra_nvec_probe() local
855 err = nvec_write_sync(nvec, get_firmware_version, 2, &msg); in tegra_nvec_probe()
860 msg->data[4], msg->data[5], in tegra_nvec_probe()
861 msg->data[6], msg->data[7]); in tegra_nvec_probe()
863 nvec_msg_free(nvec, msg); in tegra_nvec_probe()
903 struct nvec_msg *msg; in nvec_suspend() local
911 err = nvec_write_sync(nvec, ap_suspend, sizeof(ap_suspend), &msg); in nvec_suspend()
913 nvec_msg_free(nvec, msg); in nvec_suspend()