@@ -1450,10 +1450,44 @@ static void scmi_common_fastchannel_db_ring(struct scmi_fc_db_info *db)
1450
1450
#endif
1451
1451
}
1452
1452
1453
+ /**
1454
+ * scmi_protocol_msg_check - Check protocol message attributes
1455
+ *
1456
+ * @ph: A reference to the protocol handle.
1457
+ * @message_id: The ID of the message to check.
1458
+ * @attributes: A parameter to optionally return the retrieved message
1459
+ * attributes, in case of Success.
1460
+ *
1461
+ * An helper to check protocol message attributes for a specific protocol
1462
+ * and message pair.
1463
+ *
1464
+ * Return: 0 on SUCCESS
1465
+ */
1466
+ static int scmi_protocol_msg_check (const struct scmi_protocol_handle * ph ,
1467
+ u32 message_id , u32 * attributes )
1468
+ {
1469
+ int ret ;
1470
+ struct scmi_xfer * t ;
1471
+
1472
+ ret = xfer_get_init (ph , PROTOCOL_MESSAGE_ATTRIBUTES ,
1473
+ sizeof (__le32 ), 0 , & t );
1474
+ if (ret )
1475
+ return ret ;
1476
+
1477
+ put_unaligned_le32 (message_id , t -> tx .buf );
1478
+ ret = do_xfer (ph , t );
1479
+ if (!ret && attributes )
1480
+ * attributes = get_unaligned_le32 (t -> rx .buf );
1481
+ xfer_put (ph , t );
1482
+
1483
+ return ret ;
1484
+ }
1485
+
1453
1486
static const struct scmi_proto_helpers_ops helpers_ops = {
1454
1487
.extended_name_get = scmi_common_extended_name_get ,
1455
1488
.iter_response_init = scmi_iterator_init ,
1456
1489
.iter_response_run = scmi_iterator_run ,
1490
+ .protocol_msg_check = scmi_protocol_msg_check ,
1457
1491
.fastchannel_init = scmi_common_fastchannel_init ,
1458
1492
.fastchannel_db_ring = scmi_common_fastchannel_db_ring ,
1459
1493
};
0 commit comments