Lines Matching defs:raw

336 			   struct drm_dp_sideband_msg_tx *raw)
340 u8 *buf = raw->msg;
452 raw->cur_len = idx;
458 drm_dp_decode_sideband_req(const struct drm_dp_sideband_msg_tx *raw,
461 const u8 *buf = raw->msg;
735 struct drm_dp_sideband_msg_tx *raw)
738 u8 *buf = raw->msg;
742 raw->cur_len = idx;
800 struct drm_dp_sideband_msg_rx *raw,
806 memcpy(repmsg->u.link_addr.guid, &raw->msg[idx], 16);
808 repmsg->u.link_addr.nports = raw->msg[idx] & 0xf;
810 if (idx > raw->curlen)
813 if (raw->msg[idx] & 0x80)
816 repmsg->u.link_addr.ports[i].peer_device_type = (raw->msg[idx] >> 4) & 0x7;
817 repmsg->u.link_addr.ports[i].port_number = (raw->msg[idx] & 0xf);
820 if (idx > raw->curlen)
822 repmsg->u.link_addr.ports[i].mcs = (raw->msg[idx] >> 7) & 0x1;
823 repmsg->u.link_addr.ports[i].ddps = (raw->msg[idx] >> 6) & 0x1;
825 repmsg->u.link_addr.ports[i].legacy_device_plug_status = (raw->msg[idx] >> 5) & 0x1;
827 if (idx > raw->curlen)
830 repmsg->u.link_addr.ports[i].dpcd_revision = (raw->msg[idx]);
832 if (idx > raw->curlen)
834 memcpy(repmsg->u.link_addr.ports[i].peer_guid, &raw->msg[idx], 16);
836 if (idx > raw->curlen)
838 repmsg->u.link_addr.ports[i].num_sdp_streams = (raw->msg[idx] >> 4) & 0xf;
839 repmsg->u.link_addr.ports[i].num_sdp_stream_sinks = (raw->msg[idx] & 0xf);
843 if (idx > raw->curlen)
849 DRM_DEBUG_KMS("link address reply parse length fail %d %d\n", idx, raw->curlen);
853 static bool drm_dp_sideband_parse_remote_dpcd_read(struct drm_dp_sideband_msg_rx *raw,
858 repmsg->u.remote_dpcd_read_ack.port_number = raw->msg[idx] & 0xf;
860 if (idx > raw->curlen)
862 repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx];
864 if (idx > raw->curlen)
867 memcpy(repmsg->u.remote_dpcd_read_ack.bytes, &raw->msg[idx], repmsg->u.remote_dpcd_read_ack.num_bytes);
870 DRM_DEBUG_KMS("link address reply parse length fail %d %d\n", idx, raw->curlen);
874 static bool drm_dp_sideband_parse_remote_dpcd_write(struct drm_dp_sideband_msg_rx *raw,
879 repmsg->u.remote_dpcd_write_ack.port_number = raw->msg[idx] & 0xf;
881 if (idx > raw->curlen)
885 DRM_DEBUG_KMS("parse length fail %d %d\n", idx, raw->curlen);
889 static bool drm_dp_sideband_parse_remote_i2c_read_ack(struct drm_dp_sideband_msg_rx *raw,
894 repmsg->u.remote_i2c_read_ack.port_number = (raw->msg[idx] & 0xf);
896 if (idx > raw->curlen)
898 repmsg->u.remote_i2c_read_ack.num_bytes = raw->msg[idx];
901 memcpy(repmsg->u.remote_i2c_read_ack.bytes, &raw->msg[idx], repmsg->u.remote_i2c_read_ack.num_bytes);
904 DRM_DEBUG_KMS("remote i2c reply parse length fail %d %d\n", idx, raw->curlen);
908 static bool drm_dp_sideband_parse_enum_path_resources_ack(struct drm_dp_sideband_msg_rx *raw,
913 repmsg->u.path_resources.port_number = (raw->msg[idx] >> 4) & 0xf;
914 repmsg->u.path_resources.fec_capable = raw->msg[idx] & 0x1;
916 if (idx > raw->curlen)
918 repmsg->u.path_resources.full_payload_bw_number = (raw->msg[idx] << 8) | (raw->msg[idx+1]);
920 if (idx > raw->curlen)
922 repmsg->u.path_resources.avail_payload_bw_number = (raw->msg[idx] << 8) | (raw->msg[idx+1]);
924 if (idx > raw->curlen)
928 DRM_DEBUG_KMS("enum resource parse length fail %d %d\n", idx, raw->curlen);
932 static bool drm_dp_sideband_parse_allocate_payload_ack(struct drm_dp_sideband_msg_rx *raw,
937 repmsg->u.allocate_payload.port_number = (raw->msg[idx] >> 4) & 0xf;
939 if (idx > raw->curlen)
941 repmsg->u.allocate_payload.vcpi = raw->msg[idx];
943 if (idx > raw->curlen)
945 repmsg->u.allocate_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx+1]);
947 if (idx > raw->curlen)
951 DRM_DEBUG_KMS("allocate payload parse length fail %d %d\n", idx, raw->curlen);
955 static bool drm_dp_sideband_parse_query_payload_ack(struct drm_dp_sideband_msg_rx *raw,
960 repmsg->u.query_payload.port_number = (raw->msg[idx] >> 4) & 0xf;
962 if (idx > raw->curlen)
964 repmsg->u.query_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]);
966 if (idx > raw->curlen)
970 DRM_DEBUG_KMS("query payload parse length fail %d %d\n", idx, raw->curlen);
974 static bool drm_dp_sideband_parse_power_updown_phy_ack(struct drm_dp_sideband_msg_rx *raw,
979 repmsg->u.port_number.port_number = (raw->msg[idx] >> 4) & 0xf;
981 if (idx > raw->curlen) {
983 idx, raw->curlen);
991 struct drm_dp_sideband_msg_rx *raw,
998 reply->stream_id = raw->msg[3];
1000 reply->reply_signed = raw->msg[2] & BIT(0);
1010 reply->hdcp_1x_device_present = raw->msg[2] & BIT(4);
1011 reply->hdcp_2x_device_present = raw->msg[2] & BIT(3);
1013 reply->query_capable_device_present = raw->msg[2] & BIT(5);
1014 reply->legacy_device_present = raw->msg[2] & BIT(6);
1015 reply->unauthorizable_device_present = raw->msg[2] & BIT(7);
1017 reply->auth_completed = !!(raw->msg[1] & BIT(3));
1018 reply->encryption_enabled = !!(raw->msg[1] & BIT(4));
1019 reply->repeater_present = !!(raw->msg[1] & BIT(5));
1020 reply->state = (raw->msg[1] & GENMASK(7, 6)) >> 6;
1026 struct drm_dp_sideband_msg_rx *raw,
1030 msg->reply_type = (raw->msg[0] & 0x80) >> 7;
1031 msg->req_type = (raw->msg[0] & 0x7f);
1034 memcpy(msg->u.nak.guid, &raw->msg[1], 16);
1035 msg->u.nak.reason = raw->msg[17];
1036 msg->u.nak.nak_data = raw->msg[18];
1042 return drm_dp_sideband_parse_link_address(mgr, raw, msg);
1044 return drm_dp_sideband_parse_query_payload_ack(raw, msg);
1046 return drm_dp_sideband_parse_remote_dpcd_read(raw, msg);
1048 return drm_dp_sideband_parse_remote_dpcd_write(raw, msg);
1050 return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg);
1054 return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg);
1056 return drm_dp_sideband_parse_allocate_payload_ack(raw, msg);
1059 return drm_dp_sideband_parse_power_updown_phy_ack(raw, msg);
1063 return drm_dp_sideband_parse_query_stream_enc_status(raw, msg);
1073 struct drm_dp_sideband_msg_rx *raw,
1078 msg->u.conn_stat.port_number = (raw->msg[idx] & 0xf0) >> 4;
1080 if (idx > raw->curlen)
1083 memcpy(msg->u.conn_stat.guid, &raw->msg[idx], 16);
1085 if (idx > raw->curlen)
1088 msg->u.conn_stat.legacy_device_plug_status = (raw->msg[idx] >> 6) & 0x1;
1089 msg->u.conn_stat.displayport_device_plug_status = (raw->msg[idx] >> 5) & 0x1;
1090 msg->u.conn_stat.message_capability_status = (raw->msg[idx] >> 4) & 0x1;
1091 msg->u.conn_stat.input_port = (raw->msg[idx] >> 3) & 0x1;
1092 msg->u.conn_stat.peer_device_type = (raw->msg[idx] & 0x7);
1097 idx, raw->curlen);
1102 struct drm_dp_sideband_msg_rx *raw,
1107 msg->u.resource_stat.port_number = (raw->msg[idx] & 0xf0) >> 4;
1109 if (idx > raw->curlen)
1112 memcpy(msg->u.resource_stat.guid, &raw->msg[idx], 16);
1114 if (idx > raw->curlen)
1117 msg->u.resource_stat.available_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]);
1121 drm_dbg_kms(mgr->dev, "resource status reply parse length fail %d %d\n", idx, raw->curlen);
1126 struct drm_dp_sideband_msg_rx *raw,
1130 msg->req_type = (raw->msg[0] & 0x7f);
1134 return drm_dp_sideband_parse_connection_status_notify(mgr, raw, msg);
1136 return drm_dp_sideband_parse_resource_status_notify(mgr, raw, msg);