Lines Matching refs:msg

203 	u8 *buf = raw->msg;  in drm_dp_encode_sideband_req()
299 static void drm_dp_crc_sideband_chunk_req(u8 *msg, u8 len) in drm_dp_crc_sideband_chunk_req() argument
302 crc4 = drm_dp_msg_data_crc4(msg, len); in drm_dp_crc_sideband_chunk_req()
303 msg[len] = crc4; in drm_dp_crc_sideband_chunk_req()
310 u8 *buf = raw->msg; in drm_dp_encode_sideband_reply()
318 static bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg, in drm_dp_sideband_msg_build() argument
334 msg->curchunk_len = recv_hdr.msg_len; in drm_dp_sideband_msg_build()
335 msg->curchunk_hdrlen = hdrlen; in drm_dp_sideband_msg_build()
338 if (recv_hdr.somt && msg->have_somt) in drm_dp_sideband_msg_build()
342 memcpy(&msg->initial_hdr, &recv_hdr, sizeof(struct drm_dp_sideband_msg_hdr)); in drm_dp_sideband_msg_build()
343 msg->have_somt = true; in drm_dp_sideband_msg_build()
346 msg->have_eomt = true; in drm_dp_sideband_msg_build()
349 msg->curchunk_idx = min(msg->curchunk_len, (u8)(replybuflen - hdrlen)); in drm_dp_sideband_msg_build()
350 memcpy(&msg->chunk[0], replybuf + hdrlen, msg->curchunk_idx); in drm_dp_sideband_msg_build()
352 memcpy(&msg->chunk[msg->curchunk_idx], replybuf, replybuflen); in drm_dp_sideband_msg_build()
353 msg->curchunk_idx += replybuflen; in drm_dp_sideband_msg_build()
356 if (msg->curchunk_idx >= msg->curchunk_len) { in drm_dp_sideband_msg_build()
358 crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len - 1); in drm_dp_sideband_msg_build()
360 memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len - 1); in drm_dp_sideband_msg_build()
361 msg->curlen += msg->curchunk_len - 1; in drm_dp_sideband_msg_build()
371 memcpy(repmsg->u.link_addr.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_link_address()
373 repmsg->u.link_addr.nports = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_link_address()
378 if (raw->msg[idx] & 0x80) in drm_dp_sideband_parse_link_address()
381 repmsg->u.link_addr.ports[i].peer_device_type = (raw->msg[idx] >> 4) & 0x7; in drm_dp_sideband_parse_link_address()
382 repmsg->u.link_addr.ports[i].port_number = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_link_address()
387 repmsg->u.link_addr.ports[i].mcs = (raw->msg[idx] >> 7) & 0x1; in drm_dp_sideband_parse_link_address()
388 repmsg->u.link_addr.ports[i].ddps = (raw->msg[idx] >> 6) & 0x1; in drm_dp_sideband_parse_link_address()
390 repmsg->u.link_addr.ports[i].legacy_device_plug_status = (raw->msg[idx] >> 5) & 0x1; in drm_dp_sideband_parse_link_address()
395 repmsg->u.link_addr.ports[i].dpcd_revision = (raw->msg[idx]); in drm_dp_sideband_parse_link_address()
399 memcpy(repmsg->u.link_addr.ports[i].peer_guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_link_address()
403 repmsg->u.link_addr.ports[i].num_sdp_streams = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_link_address()
404 repmsg->u.link_addr.ports[i].num_sdp_stream_sinks = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_link_address()
422 repmsg->u.remote_dpcd_read_ack.port_number = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_remote_dpcd_read()
426 repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx]; in drm_dp_sideband_parse_remote_dpcd_read()
430 …memcpy(repmsg->u.remote_dpcd_read_ack.bytes, &raw->msg[idx], repmsg->u.remote_dpcd_read_ack.num_by… in drm_dp_sideband_parse_remote_dpcd_read()
441 repmsg->u.remote_dpcd_write_ack.port_number = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_remote_dpcd_write()
456 repmsg->u.remote_i2c_read_ack.port_number = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_remote_i2c_read_ack()
460 repmsg->u.remote_i2c_read_ack.num_bytes = raw->msg[idx]; in drm_dp_sideband_parse_remote_i2c_read_ack()
463 …memcpy(repmsg->u.remote_i2c_read_ack.bytes, &raw->msg[idx], repmsg->u.remote_i2c_read_ack.num_byte… in drm_dp_sideband_parse_remote_i2c_read_ack()
474 repmsg->u.path_resources.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_enum_path_resources_ack()
478 repmsg->u.path_resources.full_payload_bw_number = (raw->msg[idx] << 8) | (raw->msg[idx+1]); in drm_dp_sideband_parse_enum_path_resources_ack()
482 repmsg->u.path_resources.avail_payload_bw_number = (raw->msg[idx] << 8) | (raw->msg[idx+1]); in drm_dp_sideband_parse_enum_path_resources_ack()
496 repmsg->u.allocate_payload.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_allocate_payload_ack()
500 repmsg->u.allocate_payload.vcpi = raw->msg[idx]; in drm_dp_sideband_parse_allocate_payload_ack()
504 repmsg->u.allocate_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx+1]); in drm_dp_sideband_parse_allocate_payload_ack()
518 repmsg->u.query_payload.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_query_payload_ack()
522 repmsg->u.query_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]); in drm_dp_sideband_parse_query_payload_ack()
533 struct drm_dp_sideband_msg_reply_body *msg) in drm_dp_sideband_parse_reply() argument
535 memset(msg, 0, sizeof(*msg)); in drm_dp_sideband_parse_reply()
536 msg->reply_type = (raw->msg[0] & 0x80) >> 7; in drm_dp_sideband_parse_reply()
537 msg->req_type = (raw->msg[0] & 0x7f); in drm_dp_sideband_parse_reply()
539 if (msg->reply_type) { in drm_dp_sideband_parse_reply()
540 memcpy(msg->u.nak.guid, &raw->msg[1], 16); in drm_dp_sideband_parse_reply()
541 msg->u.nak.reason = raw->msg[17]; in drm_dp_sideband_parse_reply()
542 msg->u.nak.nak_data = raw->msg[18]; in drm_dp_sideband_parse_reply()
546 switch (msg->req_type) { in drm_dp_sideband_parse_reply()
548 return drm_dp_sideband_parse_link_address(raw, msg); in drm_dp_sideband_parse_reply()
550 return drm_dp_sideband_parse_query_payload_ack(raw, msg); in drm_dp_sideband_parse_reply()
552 return drm_dp_sideband_parse_remote_dpcd_read(raw, msg); in drm_dp_sideband_parse_reply()
554 return drm_dp_sideband_parse_remote_dpcd_write(raw, msg); in drm_dp_sideband_parse_reply()
556 return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg); in drm_dp_sideband_parse_reply()
558 return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg); in drm_dp_sideband_parse_reply()
560 return drm_dp_sideband_parse_allocate_payload_ack(raw, msg); in drm_dp_sideband_parse_reply()
562 DRM_ERROR("Got unknown reply 0x%02x\n", msg->req_type); in drm_dp_sideband_parse_reply()
568 struct drm_dp_sideband_msg_req_body *msg) in drm_dp_sideband_parse_connection_status_notify() argument
572 msg->u.conn_stat.port_number = (raw->msg[idx] & 0xf0) >> 4; in drm_dp_sideband_parse_connection_status_notify()
577 memcpy(msg->u.conn_stat.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_connection_status_notify()
582 msg->u.conn_stat.legacy_device_plug_status = (raw->msg[idx] >> 6) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
583 msg->u.conn_stat.displayport_device_plug_status = (raw->msg[idx] >> 5) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
584 msg->u.conn_stat.message_capability_status = (raw->msg[idx] >> 4) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
585 msg->u.conn_stat.input_port = (raw->msg[idx] >> 3) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
586 msg->u.conn_stat.peer_device_type = (raw->msg[idx] & 0x7); in drm_dp_sideband_parse_connection_status_notify()
595 struct drm_dp_sideband_msg_req_body *msg) in drm_dp_sideband_parse_resource_status_notify() argument
599 msg->u.resource_stat.port_number = (raw->msg[idx] & 0xf0) >> 4; in drm_dp_sideband_parse_resource_status_notify()
604 memcpy(msg->u.resource_stat.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_resource_status_notify()
609 msg->u.resource_stat.available_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]); in drm_dp_sideband_parse_resource_status_notify()
618 struct drm_dp_sideband_msg_req_body *msg) in drm_dp_sideband_parse_req() argument
620 memset(msg, 0, sizeof(*msg)); in drm_dp_sideband_parse_req()
621 msg->req_type = (raw->msg[0] & 0x7f); in drm_dp_sideband_parse_req()
623 switch (msg->req_type) { in drm_dp_sideband_parse_req()
625 return drm_dp_sideband_parse_connection_status_notify(raw, msg); in drm_dp_sideband_parse_req()
627 return drm_dp_sideband_parse_resource_status_notify(raw, msg); in drm_dp_sideband_parse_req()
629 DRM_ERROR("Got unknown request 0x%02x\n", msg->req_type); in drm_dp_sideband_parse_req()
634 static int build_dpcd_write(struct drm_dp_sideband_msg_tx *msg, u8 port_num, u32 offset, u8 num_byt… in build_dpcd_write() argument
643 drm_dp_encode_sideband_req(&req, msg); in build_dpcd_write()
648 static int build_link_address(struct drm_dp_sideband_msg_tx *msg) in build_link_address() argument
653 drm_dp_encode_sideband_req(&req, msg); in build_link_address()
657 static int build_enum_path_resources(struct drm_dp_sideband_msg_tx *msg, int port_num) in build_enum_path_resources() argument
663 drm_dp_encode_sideband_req(&req, msg); in build_enum_path_resources()
664 msg->path_msg = true; in build_enum_path_resources()
668 static int build_allocate_payload(struct drm_dp_sideband_msg_tx *msg, int port_num, in build_allocate_payload() argument
677 drm_dp_encode_sideband_req(&req, msg); in build_allocate_payload()
678 msg->path_msg = true; in build_allocate_payload()
1342 static int build_dpcd_read(struct drm_dp_sideband_msg_tx *msg, u8 port_num, u32 offset, u8 num_byte…
1350 drm_dp_encode_sideband_req(&req, msg);
1357 bool up, u8 *msg, int len) in drm_dp_send_sideband_msg() argument
1371 &msg[offset], in drm_dp_send_sideband_msg()
1410 req_type = txmsg->msg[0] & 0x7f; in set_hdr_from_dst_qlock()
1464 memcpy(&chunk[idx], &txmsg->msg[txmsg->cur_offset], tosend); in process_single_tx_qlock()
1944 static int drm_dp_encode_up_ack_reply(struct drm_dp_sideband_msg_tx *msg, u8 req_type) in drm_dp_encode_up_ack_reply() argument
1950 drm_dp_encode_sideband_reply(&reply, msg); in drm_dp_encode_up_ack_reply()
2169 struct drm_dp_sideband_msg_rx *msg; in drm_dp_get_one_sb_msg() local
2171 msg = up ? &mgr->up_req_recv : &mgr->down_rep_recv; in drm_dp_get_one_sb_msg()
2180 ret = drm_dp_sideband_msg_build(msg, replyblock, len, true); in drm_dp_get_one_sb_msg()
2185 replylen = msg->curchunk_len + msg->curchunk_hdrlen; in drm_dp_get_one_sb_msg()
2197 ret = drm_dp_sideband_msg_build(msg, replyblock, len, false); in drm_dp_get_one_sb_msg()
2238 mgr->down_rep_recv.msg[0]); in drm_dp_mst_handle_down_rep()
2268 struct drm_dp_sideband_msg_req_body msg; in drm_dp_mst_handle_up_req() local
2284 drm_dp_sideband_parse_req(&mgr->up_req_recv, &msg); in drm_dp_mst_handle_up_req()
2286 if (msg.req_type == DP_CONNECTION_STATUS_NOTIFY) { in drm_dp_mst_handle_up_req()
2287 drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); in drm_dp_mst_handle_up_req()
2290 mstb = drm_dp_get_mst_branch_device_by_guid(mgr, msg.u.conn_stat.guid); in drm_dp_mst_handle_up_req()
2298 drm_dp_update_port(mstb, &msg.u.conn_stat); in drm_dp_mst_handle_up_req()
2300msg.u.conn_stat.port_number, msg.u.conn_stat.legacy_device_plug_status, msg.u.conn_stat.displaypor… in drm_dp_mst_handle_up_req()
2303 } else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) { in drm_dp_mst_handle_up_req()
2304 drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); in drm_dp_mst_handle_up_req()
2306 mstb = drm_dp_get_mst_branch_device_by_guid(mgr, msg.u.resource_stat.guid); in drm_dp_mst_handle_up_req()
2314 …DRM_DEBUG_KMS("Got RSN: pn: %d avail_pbn %d\n", msg.u.resource_stat.port_number, msg.u.resource_st… in drm_dp_mst_handle_up_req()
2963 struct drm_dp_sideband_msg_req_body msg; in drm_dp_mst_i2c_xfer() local
2982 memset(&msg, 0, sizeof(msg)); in drm_dp_mst_i2c_xfer()
2983 msg.req_type = DP_REMOTE_I2C_READ; in drm_dp_mst_i2c_xfer()
2984 msg.u.i2c_read.num_transactions = num - 1; in drm_dp_mst_i2c_xfer()
2985 msg.u.i2c_read.port_number = port->port_num; in drm_dp_mst_i2c_xfer()
2987 msg.u.i2c_read.transactions[i].i2c_dev_id = msgs[i].addr; in drm_dp_mst_i2c_xfer()
2988 msg.u.i2c_read.transactions[i].num_bytes = msgs[i].len; in drm_dp_mst_i2c_xfer()
2989 msg.u.i2c_read.transactions[i].bytes = msgs[i].buf; in drm_dp_mst_i2c_xfer()
2991 msg.u.i2c_read.read_i2c_device_id = msgs[num - 1].addr; in drm_dp_mst_i2c_xfer()
2992 msg.u.i2c_read.num_bytes_read = msgs[num - 1].len; in drm_dp_mst_i2c_xfer()
3001 drm_dp_encode_sideband_req(&msg, txmsg); in drm_dp_mst_i2c_xfer()