Lines Matching refs:txmsg
701 const struct drm_dp_sideband_msg_tx *txmsg) in drm_dp_mst_dump_sideband_msg_tx() argument
708 drm_dp_mst_rad_to_str(txmsg->dst->rad, txmsg->dst->lct, buf, in drm_dp_mst_dump_sideband_msg_tx()
711 txmsg->cur_offset, txmsg->cur_len, txmsg->seqno, in drm_dp_mst_dump_sideband_msg_tx()
712 drm_dp_mst_sideband_tx_state_str(txmsg->state), in drm_dp_mst_dump_sideband_msg_tx()
713 txmsg->path_msg, buf); in drm_dp_mst_dump_sideband_msg_tx()
715 ret = drm_dp_decode_sideband_req(txmsg, &req); in drm_dp_mst_dump_sideband_msg_tx()
1251 struct drm_dp_sideband_msg_tx *txmsg) in check_txmsg_state() argument
1260 state = READ_ONCE(txmsg->state); in check_txmsg_state()
1266 struct drm_dp_sideband_msg_tx *txmsg) in drm_dp_mst_wait_tx_reply() argument
1288 check_txmsg_state(mgr, txmsg), in drm_dp_mst_wait_tx_reply()
1302 if (txmsg->state == DRM_DP_SIDEBAND_TX_TIMEOUT) { in drm_dp_mst_wait_tx_reply()
1308 txmsg, txmsg->state, txmsg->seqno); in drm_dp_mst_wait_tx_reply()
1314 if (txmsg->state == DRM_DP_SIDEBAND_TX_QUEUED || in drm_dp_mst_wait_tx_reply()
1315 txmsg->state == DRM_DP_SIDEBAND_TX_START_SEND || in drm_dp_mst_wait_tx_reply()
1316 txmsg->state == DRM_DP_SIDEBAND_TX_SENT) in drm_dp_mst_wait_tx_reply()
1317 list_del(&txmsg->next); in drm_dp_mst_wait_tx_reply()
1324 drm_dp_mst_dump_sideband_msg_tx(&p, txmsg); in drm_dp_mst_wait_tx_reply()
2762 struct drm_dp_sideband_msg_tx *txmsg) in set_hdr_from_dst_qlock() argument
2764 struct drm_dp_mst_branch *mstb = txmsg->dst; in set_hdr_from_dst_qlock()
2767 req_type = txmsg->msg[0] & 0x7f; in set_hdr_from_dst_qlock()
2774 hdr->path_msg = txmsg->path_msg; in set_hdr_from_dst_qlock()
2791 struct drm_dp_sideband_msg_tx *txmsg, in process_single_tx_qlock() argument
2799 if (txmsg->state == DRM_DP_SIDEBAND_TX_SENT) in process_single_tx_qlock()
2804 if (txmsg->state == DRM_DP_SIDEBAND_TX_QUEUED) in process_single_tx_qlock()
2805 txmsg->state = DRM_DP_SIDEBAND_TX_START_SEND; in process_single_tx_qlock()
2808 ret = set_hdr_from_dst_qlock(&hdr, txmsg); in process_single_tx_qlock()
2813 len = txmsg->cur_len - txmsg->cur_offset; in process_single_tx_qlock()
2819 if (len == txmsg->cur_len) in process_single_tx_qlock()
2827 memcpy(&chunk[idx], &txmsg->msg[txmsg->cur_offset], tosend); in process_single_tx_qlock()
2840 drm_dp_mst_dump_sideband_msg_tx(&p, txmsg); in process_single_tx_qlock()
2845 txmsg->cur_offset += tosend; in process_single_tx_qlock()
2846 if (txmsg->cur_offset == txmsg->cur_len) { in process_single_tx_qlock()
2847 txmsg->state = DRM_DP_SIDEBAND_TX_SENT; in process_single_tx_qlock()
2855 struct drm_dp_sideband_msg_tx *txmsg; in process_single_down_tx_qlock() local
2864 txmsg = list_first_entry(&mgr->tx_msg_downq, in process_single_down_tx_qlock()
2866 ret = process_single_tx_qlock(mgr, txmsg, false); in process_single_down_tx_qlock()
2869 list_del(&txmsg->next); in process_single_down_tx_qlock()
2870 txmsg->state = DRM_DP_SIDEBAND_TX_TIMEOUT; in process_single_down_tx_qlock()
2876 struct drm_dp_sideband_msg_tx *txmsg) in drm_dp_queue_down_tx() argument
2879 list_add_tail(&txmsg->next, &mgr->tx_msg_downq); in drm_dp_queue_down_tx()
2885 drm_dp_mst_dump_sideband_msg_tx(&p, txmsg); in drm_dp_queue_down_tx()
2920 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_send_link_address() local
2926 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_send_link_address()
2927 if (!txmsg) in drm_dp_send_link_address()
2930 txmsg->dst = mstb; in drm_dp_send_link_address()
2931 build_link_address(txmsg); in drm_dp_send_link_address()
2934 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_send_link_address()
2937 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); in drm_dp_send_link_address()
2942 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { in drm_dp_send_link_address()
2948 reply = &txmsg->reply.u.link_addr; in drm_dp_send_link_address()
2992 kfree(txmsg); in drm_dp_send_link_address()
3000 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_send_clear_payload_id_table() local
3003 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_send_clear_payload_id_table()
3004 if (!txmsg) in drm_dp_send_clear_payload_id_table()
3007 txmsg->dst = mstb; in drm_dp_send_clear_payload_id_table()
3008 build_clear_payload_id_table(txmsg); in drm_dp_send_clear_payload_id_table()
3010 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_send_clear_payload_id_table()
3012 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); in drm_dp_send_clear_payload_id_table()
3013 if (ret > 0 && txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) in drm_dp_send_clear_payload_id_table()
3016 kfree(txmsg); in drm_dp_send_clear_payload_id_table()
3025 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_send_enum_path_resources() local
3028 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_send_enum_path_resources()
3029 if (!txmsg) in drm_dp_send_enum_path_resources()
3032 txmsg->dst = mstb; in drm_dp_send_enum_path_resources()
3033 build_enum_path_resources(txmsg, port->port_num); in drm_dp_send_enum_path_resources()
3035 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_send_enum_path_resources()
3037 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); in drm_dp_send_enum_path_resources()
3040 path_res = &txmsg->reply.u.path_resources; in drm_dp_send_enum_path_resources()
3042 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { in drm_dp_send_enum_path_resources()
3066 kfree(txmsg); in drm_dp_send_enum_path_resources()
3124 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_payload_send_msg() local
3141 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_payload_send_msg()
3142 if (!txmsg) { in drm_dp_payload_send_msg()
3150 txmsg->dst = mstb; in drm_dp_payload_send_msg()
3151 build_allocate_payload(txmsg, port_num, in drm_dp_payload_send_msg()
3155 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_payload_send_msg()
3165 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); in drm_dp_payload_send_msg()
3167 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) in drm_dp_payload_send_msg()
3172 kfree(txmsg); in drm_dp_payload_send_msg()
3181 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_send_power_updown_phy() local
3188 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_send_power_updown_phy()
3189 if (!txmsg) { in drm_dp_send_power_updown_phy()
3194 txmsg->dst = port->parent; in drm_dp_send_power_updown_phy()
3195 build_power_updown_phy(txmsg, port->port_num, power_up); in drm_dp_send_power_updown_phy()
3196 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_send_power_updown_phy()
3198 ret = drm_dp_mst_wait_tx_reply(port->parent, txmsg); in drm_dp_send_power_updown_phy()
3200 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) in drm_dp_send_power_updown_phy()
3205 kfree(txmsg); in drm_dp_send_power_updown_phy()
3218 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_send_query_stream_enc_status() local
3222 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_send_query_stream_enc_status()
3223 if (!txmsg) in drm_dp_send_query_stream_enc_status()
3243 txmsg->dst = mgr->mst_primary; in drm_dp_send_query_stream_enc_status()
3245 build_query_stream_enc_status(txmsg, payload->vcpi, nonce); in drm_dp_send_query_stream_enc_status()
3247 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_send_query_stream_enc_status()
3249 ret = drm_dp_mst_wait_tx_reply(mgr->mst_primary, txmsg); in drm_dp_send_query_stream_enc_status()
3252 } else if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { in drm_dp_send_query_stream_enc_status()
3259 memcpy(status, &txmsg->reply.u.enc_status, sizeof(*status)); in drm_dp_send_query_stream_enc_status()
3265 kfree(txmsg); in drm_dp_send_query_stream_enc_status()
3466 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_send_dpcd_read() local
3473 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_send_dpcd_read()
3474 if (!txmsg) { in drm_dp_send_dpcd_read()
3479 build_dpcd_read(txmsg, port->port_num, offset, size); in drm_dp_send_dpcd_read()
3480 txmsg->dst = port->parent; in drm_dp_send_dpcd_read()
3482 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_send_dpcd_read()
3484 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); in drm_dp_send_dpcd_read()
3488 if (txmsg->reply.reply_type == 1) { in drm_dp_send_dpcd_read()
3495 if (txmsg->reply.u.remote_dpcd_read_ack.num_bytes != size) { in drm_dp_send_dpcd_read()
3500 ret = min_t(size_t, txmsg->reply.u.remote_dpcd_read_ack.num_bytes, in drm_dp_send_dpcd_read()
3502 memcpy(bytes, txmsg->reply.u.remote_dpcd_read_ack.bytes, ret); in drm_dp_send_dpcd_read()
3505 kfree(txmsg); in drm_dp_send_dpcd_read()
3517 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_send_dpcd_write() local
3524 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_send_dpcd_write()
3525 if (!txmsg) { in drm_dp_send_dpcd_write()
3530 build_dpcd_write(txmsg, port->port_num, offset, size, bytes); in drm_dp_send_dpcd_write()
3531 txmsg->dst = mstb; in drm_dp_send_dpcd_write()
3533 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_send_dpcd_write()
3535 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); in drm_dp_send_dpcd_write()
3537 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) in drm_dp_send_dpcd_write()
3543 kfree(txmsg); in drm_dp_send_dpcd_write()
3563 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_send_up_ack_reply() local
3565 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_send_up_ack_reply()
3566 if (!txmsg) in drm_dp_send_up_ack_reply()
3569 txmsg->dst = mstb; in drm_dp_send_up_ack_reply()
3570 drm_dp_encode_up_ack_reply(txmsg, req_type); in drm_dp_send_up_ack_reply()
3574 process_single_tx_qlock(mgr, txmsg, true); in drm_dp_send_up_ack_reply()
3577 kfree(txmsg); in drm_dp_send_up_ack_reply()
3947 const struct drm_dp_sideband_msg_tx *txmsg, in verify_rx_request_type() argument
3951 const struct drm_dp_mst_branch *mstb = txmsg->dst; in verify_rx_request_type()
3952 int tx_req_type = get_msg_request_type(txmsg->msg[0]); in verify_rx_request_type()
3971 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_mst_handle_down_rep() local
3985 txmsg = list_first_entry_or_null(&mgr->tx_msg_downq, in drm_dp_mst_handle_down_rep()
3989 if (!txmsg || txmsg->dst != mstb) { in drm_dp_mst_handle_down_rep()
4001 if (!verify_rx_request_type(mgr, txmsg, msg)) { in drm_dp_mst_handle_down_rep()
4007 drm_dp_sideband_parse_reply(mgr, msg, &txmsg->reply); in drm_dp_mst_handle_down_rep()
4009 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { in drm_dp_mst_handle_down_rep()
4012 txmsg->reply.req_type, in drm_dp_mst_handle_down_rep()
4013 drm_dp_mst_req_type_str(txmsg->reply.req_type), in drm_dp_mst_handle_down_rep()
4014 txmsg->reply.u.nak.reason, in drm_dp_mst_handle_down_rep()
4015 drm_dp_mst_nak_reason_str(txmsg->reply.u.nak.reason), in drm_dp_mst_handle_down_rep()
4016 txmsg->reply.u.nak.nak_data); in drm_dp_mst_handle_down_rep()
4019 txmsg->state = DRM_DP_SIDEBAND_TX_RX; in drm_dp_mst_handle_down_rep()
4020 list_del(&txmsg->next); in drm_dp_mst_handle_down_rep()
4274 struct drm_dp_sideband_msg_tx *txmsg; in drm_dp_mst_hpd_irq_send_new_request() local
4278 txmsg = list_first_entry_or_null(&mgr->tx_msg_downq, in drm_dp_mst_hpd_irq_send_new_request()
4281 if (!txmsg || in drm_dp_mst_hpd_irq_send_new_request()
4282 txmsg->state == DRM_DP_SIDEBAND_TX_START_SEND || in drm_dp_mst_hpd_irq_send_new_request()
4283 txmsg->state == DRM_DP_SIDEBAND_TX_SENT) in drm_dp_mst_hpd_irq_send_new_request()
5036 struct drm_dp_sideband_msg_tx *txmsg, *txmsg_tmp; in drm_dp_delayed_destroy_mstb() local
5048 list_for_each_entry_safe(txmsg, txmsg_tmp, &mgr->tx_msg_downq, next) { in drm_dp_delayed_destroy_mstb()
5049 if (txmsg->dst != mstb) in drm_dp_delayed_destroy_mstb()
5052 txmsg->state = DRM_DP_SIDEBAND_TX_TIMEOUT; in drm_dp_delayed_destroy_mstb()
5053 list_del(&txmsg->next); in drm_dp_delayed_destroy_mstb()
5829 struct drm_dp_sideband_msg_tx *txmsg = NULL; in drm_dp_mst_i2c_read() local
5845 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_mst_i2c_read()
5846 if (!txmsg) { in drm_dp_mst_i2c_read()
5851 txmsg->dst = mstb; in drm_dp_mst_i2c_read()
5852 drm_dp_encode_sideband_req(&msg, txmsg); in drm_dp_mst_i2c_read()
5854 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_mst_i2c_read()
5856 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); in drm_dp_mst_i2c_read()
5859 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { in drm_dp_mst_i2c_read()
5863 if (txmsg->reply.u.remote_i2c_read_ack.num_bytes != msgs[num - 1].len) { in drm_dp_mst_i2c_read()
5867 memcpy(msgs[num - 1].buf, txmsg->reply.u.remote_i2c_read_ack.bytes, msgs[num - 1].len); in drm_dp_mst_i2c_read()
5871 kfree(txmsg); in drm_dp_mst_i2c_read()
5882 struct drm_dp_sideband_msg_tx *txmsg = NULL; in drm_dp_mst_i2c_write() local
5885 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); in drm_dp_mst_i2c_write()
5886 if (!txmsg) { in drm_dp_mst_i2c_write()
5898 memset(txmsg, 0, sizeof(*txmsg)); in drm_dp_mst_i2c_write()
5899 txmsg->dst = mstb; in drm_dp_mst_i2c_write()
5901 drm_dp_encode_sideband_req(&msg, txmsg); in drm_dp_mst_i2c_write()
5902 drm_dp_queue_down_tx(mgr, txmsg); in drm_dp_mst_i2c_write()
5904 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg); in drm_dp_mst_i2c_write()
5906 if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) { in drm_dp_mst_i2c_write()
5916 kfree(txmsg); in drm_dp_mst_i2c_write()