Lines Matching refs:msg

61 	struct drm_dp_sideband_msg_req_body msg;  member
337 u8 *buf = raw->msg; in drm_dp_encode_sideband_req()
433 const struct drm_dp_query_stream_enc_status *msg; in drm_dp_encode_sideband_req() local
435 msg = &req->u.enc_status; in drm_dp_encode_sideband_req()
436 buf[idx] = msg->stream_id; in drm_dp_encode_sideband_req()
438 memcpy(&buf[idx], msg->client_id, sizeof(msg->client_id)); in drm_dp_encode_sideband_req()
439 idx += sizeof(msg->client_id); in drm_dp_encode_sideband_req()
441 buf[idx] |= FIELD_PREP(GENMASK(1, 0), msg->stream_event); in drm_dp_encode_sideband_req()
442 buf[idx] |= msg->valid_stream_event ? BIT(2) : 0; in drm_dp_encode_sideband_req()
443 buf[idx] |= FIELD_PREP(GENMASK(4, 3), msg->stream_behavior); in drm_dp_encode_sideband_req()
444 buf[idx] |= msg->valid_stream_behavior ? BIT(5) : 0; in drm_dp_encode_sideband_req()
458 const u8 *buf = raw->msg; in drm_dp_decode_sideband_req()
723 static void drm_dp_crc_sideband_chunk_req(u8 *msg, u8 len) in drm_dp_crc_sideband_chunk_req() argument
727 crc4 = drm_dp_msg_data_crc4(msg, len); in drm_dp_crc_sideband_chunk_req()
728 msg[len] = crc4; in drm_dp_crc_sideband_chunk_req()
735 u8 *buf = raw->msg; in drm_dp_encode_sideband_reply()
742 static int drm_dp_sideband_msg_set_header(struct drm_dp_sideband_msg_rx *msg, in drm_dp_sideband_msg_set_header() argument
750 if (!hdr->somt && !msg->have_somt) in drm_dp_sideband_msg_set_header()
754 msg->curchunk_idx = 0; in drm_dp_sideband_msg_set_header()
755 msg->curchunk_len = hdr->msg_len; in drm_dp_sideband_msg_set_header()
756 msg->curchunk_hdrlen = hdrlen; in drm_dp_sideband_msg_set_header()
759 if (hdr->somt && msg->have_somt) in drm_dp_sideband_msg_set_header()
763 memcpy(&msg->initial_hdr, hdr, in drm_dp_sideband_msg_set_header()
765 msg->have_somt = true; in drm_dp_sideband_msg_set_header()
768 msg->have_eomt = true; in drm_dp_sideband_msg_set_header()
774 static bool drm_dp_sideband_append_payload(struct drm_dp_sideband_msg_rx *msg, in drm_dp_sideband_append_payload() argument
779 memcpy(&msg->chunk[msg->curchunk_idx], replybuf, replybuflen); in drm_dp_sideband_append_payload()
780 msg->curchunk_idx += replybuflen; in drm_dp_sideband_append_payload()
782 if (msg->curchunk_idx >= msg->curchunk_len) { in drm_dp_sideband_append_payload()
784 crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len - 1); in drm_dp_sideband_append_payload()
785 if (crc4 != msg->chunk[msg->curchunk_len - 1]) in drm_dp_sideband_append_payload()
788 msg->chunk, msg->curchunk_len, false); in drm_dp_sideband_append_payload()
790 memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len - 1); in drm_dp_sideband_append_payload()
791 msg->curlen += msg->curchunk_len - 1; in drm_dp_sideband_append_payload()
803 memcpy(repmsg->u.link_addr.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_link_address()
805 repmsg->u.link_addr.nports = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_link_address()
810 if (raw->msg[idx] & 0x80) in drm_dp_sideband_parse_link_address()
813 repmsg->u.link_addr.ports[i].peer_device_type = (raw->msg[idx] >> 4) & 0x7; in drm_dp_sideband_parse_link_address()
814 repmsg->u.link_addr.ports[i].port_number = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_link_address()
819 repmsg->u.link_addr.ports[i].mcs = (raw->msg[idx] >> 7) & 0x1; in drm_dp_sideband_parse_link_address()
820 repmsg->u.link_addr.ports[i].ddps = (raw->msg[idx] >> 6) & 0x1; in drm_dp_sideband_parse_link_address()
822 repmsg->u.link_addr.ports[i].legacy_device_plug_status = (raw->msg[idx] >> 5) & 0x1; in drm_dp_sideband_parse_link_address()
827 repmsg->u.link_addr.ports[i].dpcd_revision = (raw->msg[idx]); in drm_dp_sideband_parse_link_address()
831 memcpy(repmsg->u.link_addr.ports[i].peer_guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_link_address()
835 repmsg->u.link_addr.ports[i].num_sdp_streams = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_link_address()
836 repmsg->u.link_addr.ports[i].num_sdp_stream_sinks = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_link_address()
855 repmsg->u.remote_dpcd_read_ack.port_number = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_remote_dpcd_read()
859 repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx]; in drm_dp_sideband_parse_remote_dpcd_read()
864 …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()
876 repmsg->u.remote_dpcd_write_ack.port_number = raw->msg[idx] & 0xf; in drm_dp_sideband_parse_remote_dpcd_write()
891 repmsg->u.remote_i2c_read_ack.port_number = (raw->msg[idx] & 0xf); in drm_dp_sideband_parse_remote_i2c_read_ack()
895 repmsg->u.remote_i2c_read_ack.num_bytes = raw->msg[idx]; in drm_dp_sideband_parse_remote_i2c_read_ack()
898 …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()
910 repmsg->u.path_resources.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_enum_path_resources_ack()
911 repmsg->u.path_resources.fec_capable = raw->msg[idx] & 0x1; in drm_dp_sideband_parse_enum_path_resources_ack()
915 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()
919 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()
934 repmsg->u.allocate_payload.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_allocate_payload_ack()
938 repmsg->u.allocate_payload.vcpi = raw->msg[idx]; in drm_dp_sideband_parse_allocate_payload_ack()
942 repmsg->u.allocate_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx+1]); in drm_dp_sideband_parse_allocate_payload_ack()
957 repmsg->u.query_payload.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_query_payload_ack()
961 repmsg->u.query_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]); in drm_dp_sideband_parse_query_payload_ack()
976 repmsg->u.port_number.port_number = (raw->msg[idx] >> 4) & 0xf; in drm_dp_sideband_parse_power_updown_phy_ack()
995 reply->stream_id = raw->msg[3]; in drm_dp_sideband_parse_query_stream_enc_status()
997 reply->reply_signed = raw->msg[2] & BIT(0); in drm_dp_sideband_parse_query_stream_enc_status()
1007 reply->hdcp_1x_device_present = raw->msg[2] & BIT(4); in drm_dp_sideband_parse_query_stream_enc_status()
1008 reply->hdcp_2x_device_present = raw->msg[2] & BIT(3); in drm_dp_sideband_parse_query_stream_enc_status()
1010 reply->query_capable_device_present = raw->msg[2] & BIT(5); in drm_dp_sideband_parse_query_stream_enc_status()
1011 reply->legacy_device_present = raw->msg[2] & BIT(6); in drm_dp_sideband_parse_query_stream_enc_status()
1012 reply->unauthorizable_device_present = raw->msg[2] & BIT(7); in drm_dp_sideband_parse_query_stream_enc_status()
1014 reply->auth_completed = !!(raw->msg[1] & BIT(3)); in drm_dp_sideband_parse_query_stream_enc_status()
1015 reply->encryption_enabled = !!(raw->msg[1] & BIT(4)); in drm_dp_sideband_parse_query_stream_enc_status()
1016 reply->repeater_present = !!(raw->msg[1] & BIT(5)); in drm_dp_sideband_parse_query_stream_enc_status()
1017 reply->state = (raw->msg[1] & GENMASK(7, 6)) >> 6; in drm_dp_sideband_parse_query_stream_enc_status()
1024 struct drm_dp_sideband_msg_reply_body *msg) in drm_dp_sideband_parse_reply() argument
1026 memset(msg, 0, sizeof(*msg)); in drm_dp_sideband_parse_reply()
1027 msg->reply_type = (raw->msg[0] & 0x80) >> 7; in drm_dp_sideband_parse_reply()
1028 msg->req_type = (raw->msg[0] & 0x7f); in drm_dp_sideband_parse_reply()
1030 if (msg->reply_type == DP_SIDEBAND_REPLY_NAK) { in drm_dp_sideband_parse_reply()
1031 memcpy(msg->u.nak.guid, &raw->msg[1], 16); in drm_dp_sideband_parse_reply()
1032 msg->u.nak.reason = raw->msg[17]; in drm_dp_sideband_parse_reply()
1033 msg->u.nak.nak_data = raw->msg[18]; in drm_dp_sideband_parse_reply()
1037 switch (msg->req_type) { in drm_dp_sideband_parse_reply()
1039 return drm_dp_sideband_parse_link_address(mgr, raw, msg); in drm_dp_sideband_parse_reply()
1041 return drm_dp_sideband_parse_query_payload_ack(raw, msg); in drm_dp_sideband_parse_reply()
1043 return drm_dp_sideband_parse_remote_dpcd_read(raw, msg); in drm_dp_sideband_parse_reply()
1045 return drm_dp_sideband_parse_remote_dpcd_write(raw, msg); in drm_dp_sideband_parse_reply()
1047 return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg); in drm_dp_sideband_parse_reply()
1051 return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg); in drm_dp_sideband_parse_reply()
1053 return drm_dp_sideband_parse_allocate_payload_ack(raw, msg); in drm_dp_sideband_parse_reply()
1056 return drm_dp_sideband_parse_power_updown_phy_ack(raw, msg); in drm_dp_sideband_parse_reply()
1060 return drm_dp_sideband_parse_query_stream_enc_status(raw, msg); in drm_dp_sideband_parse_reply()
1063 msg->req_type, drm_dp_mst_req_type_str(msg->req_type)); in drm_dp_sideband_parse_reply()
1071 struct drm_dp_sideband_msg_req_body *msg) in drm_dp_sideband_parse_connection_status_notify() argument
1075 msg->u.conn_stat.port_number = (raw->msg[idx] & 0xf0) >> 4; in drm_dp_sideband_parse_connection_status_notify()
1080 memcpy(msg->u.conn_stat.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_connection_status_notify()
1085 msg->u.conn_stat.legacy_device_plug_status = (raw->msg[idx] >> 6) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
1086 msg->u.conn_stat.displayport_device_plug_status = (raw->msg[idx] >> 5) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
1087 msg->u.conn_stat.message_capability_status = (raw->msg[idx] >> 4) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
1088 msg->u.conn_stat.input_port = (raw->msg[idx] >> 3) & 0x1; in drm_dp_sideband_parse_connection_status_notify()
1089 msg->u.conn_stat.peer_device_type = (raw->msg[idx] & 0x7); in drm_dp_sideband_parse_connection_status_notify()
1100 struct drm_dp_sideband_msg_req_body *msg) in drm_dp_sideband_parse_resource_status_notify() argument
1104 msg->u.resource_stat.port_number = (raw->msg[idx] & 0xf0) >> 4; in drm_dp_sideband_parse_resource_status_notify()
1109 memcpy(msg->u.resource_stat.guid, &raw->msg[idx], 16); in drm_dp_sideband_parse_resource_status_notify()
1114 msg->u.resource_stat.available_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]); in drm_dp_sideband_parse_resource_status_notify()
1124 struct drm_dp_sideband_msg_req_body *msg) in drm_dp_sideband_parse_req() argument
1126 memset(msg, 0, sizeof(*msg)); in drm_dp_sideband_parse_req()
1127 msg->req_type = (raw->msg[0] & 0x7f); in drm_dp_sideband_parse_req()
1129 switch (msg->req_type) { in drm_dp_sideband_parse_req()
1131 return drm_dp_sideband_parse_connection_status_notify(mgr, raw, msg); in drm_dp_sideband_parse_req()
1133 return drm_dp_sideband_parse_resource_status_notify(mgr, raw, msg); in drm_dp_sideband_parse_req()
1136 msg->req_type, drm_dp_mst_req_type_str(msg->req_type)); in drm_dp_sideband_parse_req()
1141 static void build_dpcd_write(struct drm_dp_sideband_msg_tx *msg, in build_dpcd_write() argument
1151 drm_dp_encode_sideband_req(&req, msg); in build_dpcd_write()
1154 static void build_link_address(struct drm_dp_sideband_msg_tx *msg) in build_link_address() argument
1159 drm_dp_encode_sideband_req(&req, msg); in build_link_address()
1162 static void build_clear_payload_id_table(struct drm_dp_sideband_msg_tx *msg) in build_clear_payload_id_table() argument
1167 drm_dp_encode_sideband_req(&req, msg); in build_clear_payload_id_table()
1168 msg->path_msg = true; in build_clear_payload_id_table()
1171 static int build_enum_path_resources(struct drm_dp_sideband_msg_tx *msg, in build_enum_path_resources() argument
1178 drm_dp_encode_sideband_req(&req, msg); in build_enum_path_resources()
1179 msg->path_msg = true; in build_enum_path_resources()
1183 static void build_allocate_payload(struct drm_dp_sideband_msg_tx *msg, in build_allocate_payload() argument
1199 drm_dp_encode_sideband_req(&req, msg); in build_allocate_payload()
1200 msg->path_msg = true; in build_allocate_payload()
1203 static void build_power_updown_phy(struct drm_dp_sideband_msg_tx *msg, in build_power_updown_phy() argument
1214 drm_dp_encode_sideband_req(&req, msg); in build_power_updown_phy()
1215 msg->path_msg = true; in build_power_updown_phy()
1219 build_query_stream_enc_status(struct drm_dp_sideband_msg_tx *msg, u8 stream_id, in build_query_stream_enc_status() argument
1233 drm_dp_encode_sideband_req(&req, msg); in build_query_stream_enc_status()
2708 static void build_dpcd_read(struct drm_dp_sideband_msg_tx *msg, in build_dpcd_read() argument
2717 drm_dp_encode_sideband_req(&req, msg); in build_dpcd_read()
2721 bool up, u8 *msg, int len) in drm_dp_send_sideband_msg() argument
2735 &msg[offset], in drm_dp_send_sideband_msg()
2758 req_type = txmsg->msg[0] & 0x7f; in set_hdr_from_dst_qlock()
2818 memcpy(&chunk[idx], &txmsg->msg[txmsg->cur_offset], tosend); in process_single_tx_qlock()
3514 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
3520 drm_dp_encode_sideband_reply(&reply, msg); in drm_dp_encode_up_ack_reply()
3794 struct drm_dp_sideband_msg_rx *msg = in drm_dp_get_one_sb_msg() local
3826 if (!drm_dp_sideband_msg_set_header(msg, &hdr, hdrlen)) { in drm_dp_get_one_sb_msg()
3831 replylen = min(msg->curchunk_len, (u8)(len - hdrlen)); in drm_dp_get_one_sb_msg()
3832 ret = drm_dp_sideband_append_payload(msg, replyblock + hdrlen, replylen); in drm_dp_get_one_sb_msg()
3838 replylen = msg->curchunk_len + msg->curchunk_hdrlen - len; in drm_dp_get_one_sb_msg()
3850 ret = drm_dp_sideband_append_payload(msg, replyblock, len); in drm_dp_get_one_sb_msg()
3866 struct drm_dp_sideband_msg_rx *msg = &mgr->down_rep_recv; in drm_dp_mst_handle_down_rep() local
3872 if (!msg->have_eomt) in drm_dp_mst_handle_down_rep()
3885 hdr = &msg->initial_hdr; in drm_dp_mst_handle_down_rep()
3887 mstb, hdr->seqno, hdr->lct, hdr->rad[0], msg->msg[0]); in drm_dp_mst_handle_down_rep()
3891 drm_dp_sideband_parse_reply(mgr, msg, &txmsg->reply); in drm_dp_mst_handle_down_rep()
3903 memset(msg, 0, sizeof(struct drm_dp_sideband_msg_rx)); in drm_dp_mst_handle_down_rep()
3916 memset(msg, 0, sizeof(struct drm_dp_sideband_msg_rx)); in drm_dp_mst_handle_down_rep()
3929 struct drm_dp_sideband_msg_req_body *msg = &up_req->msg; in drm_dp_mst_process_up_req() local
3936 if (msg->req_type == DP_CONNECTION_STATUS_NOTIFY) in drm_dp_mst_process_up_req()
3937 guid = msg->u.conn_stat.guid; in drm_dp_mst_process_up_req()
3938 else if (msg->req_type == DP_RESOURCE_STATUS_NOTIFY) in drm_dp_mst_process_up_req()
3939 guid = msg->u.resource_stat.guid; in drm_dp_mst_process_up_req()
3953 if (msg->req_type == DP_CONNECTION_STATUS_NOTIFY) { in drm_dp_mst_process_up_req()
3954 dowork = drm_dp_mst_handle_conn_stat(mstb, &msg->u.conn_stat); in drm_dp_mst_process_up_req()
4011 drm_dp_sideband_parse_req(mgr, &mgr->up_req_recv, &up_req->msg); in drm_dp_mst_handle_up_req()
4013 if (up_req->msg.req_type != DP_CONNECTION_STATUS_NOTIFY && in drm_dp_mst_handle_up_req()
4014 up_req->msg.req_type != DP_RESOURCE_STATUS_NOTIFY) { in drm_dp_mst_handle_up_req()
4016 up_req->msg.req_type); in drm_dp_mst_handle_up_req()
4021 drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, up_req->msg.req_type, in drm_dp_mst_handle_up_req()
4024 if (up_req->msg.req_type == DP_CONNECTION_STATUS_NOTIFY) { in drm_dp_mst_handle_up_req()
4026 &up_req->msg.u.conn_stat; in drm_dp_mst_handle_up_req()
4046 } else if (up_req->msg.req_type == DP_RESOURCE_STATUS_NOTIFY) { in drm_dp_mst_handle_up_req()
4048 &up_req->msg.u.resource_stat; in drm_dp_mst_handle_up_req()
5623 struct drm_dp_sideband_msg_req_body msg; in drm_dp_mst_i2c_read() local
5627 memset(&msg, 0, sizeof(msg)); in drm_dp_mst_i2c_read()
5628 msg.req_type = DP_REMOTE_I2C_READ; in drm_dp_mst_i2c_read()
5629 msg.u.i2c_read.num_transactions = num - 1; in drm_dp_mst_i2c_read()
5630 msg.u.i2c_read.port_number = port->port_num; in drm_dp_mst_i2c_read()
5632 msg.u.i2c_read.transactions[i].i2c_dev_id = msgs[i].addr; in drm_dp_mst_i2c_read()
5633 msg.u.i2c_read.transactions[i].num_bytes = msgs[i].len; in drm_dp_mst_i2c_read()
5634 msg.u.i2c_read.transactions[i].bytes = msgs[i].buf; in drm_dp_mst_i2c_read()
5635 msg.u.i2c_read.transactions[i].no_stop_bit = !(msgs[i].flags & I2C_M_STOP); in drm_dp_mst_i2c_read()
5637 msg.u.i2c_read.read_i2c_device_id = msgs[num - 1].addr; in drm_dp_mst_i2c_read()
5638 msg.u.i2c_read.num_bytes_read = msgs[num - 1].len; in drm_dp_mst_i2c_read()
5647 drm_dp_encode_sideband_req(&msg, txmsg); in drm_dp_mst_i2c_read()
5676 struct drm_dp_sideband_msg_req_body msg; in drm_dp_mst_i2c_write() local
5686 memset(&msg, 0, sizeof(msg)); in drm_dp_mst_i2c_write()
5687 msg.req_type = DP_REMOTE_I2C_WRITE; in drm_dp_mst_i2c_write()
5688 msg.u.i2c_write.port_number = port->port_num; in drm_dp_mst_i2c_write()
5689 msg.u.i2c_write.write_i2c_device_id = msgs[i].addr; in drm_dp_mst_i2c_write()
5690 msg.u.i2c_write.num_bytes = msgs[i].len; in drm_dp_mst_i2c_write()
5691 msg.u.i2c_write.bytes = msgs[i].buf; in drm_dp_mst_i2c_write()
5696 drm_dp_encode_sideband_req(&msg, txmsg); in drm_dp_mst_i2c_write()