Lines Matching defs:txmsg

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