summaryrefslogtreecommitdiff
path: root/drivers/rpmsg/qcom_glink_native.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rpmsg/qcom_glink_native.c')
-rw-r--r--drivers/rpmsg/qcom_glink_native.c51
1 files changed, 30 insertions, 21 deletions
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index f505f58b797d..e2ce4e638258 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -40,7 +40,7 @@ struct glink_msg {
* struct glink_defer_cmd - deferred incoming control message
* @node: list node
* @msg: message header
- * data: payload of the message
+ * @data: payload of the message
*
* Copy of a received control message, to be added to @rx_queue and processed
* by @rx_work of @qcom_glink.
@@ -56,12 +56,13 @@ struct glink_defer_cmd {
* struct glink_core_rx_intent - RX intent
* RX intent
*
- * data: pointer to the data (may be NULL for zero-copy)
- * id: remote or local intent ID
- * size: size of the original intent (do not modify)
- * reuse: To mark if the intent can be reused after first use
- * in_use: To mark if intent is already in use for the channel
- * offset: next write offset (initially 0)
+ * @data: pointer to the data (may be NULL for zero-copy)
+ * @id: remote or local intent ID
+ * @size: size of the original intent (do not modify)
+ * @reuse: To mark if the intent can be reused after first use
+ * @in_use: To mark if intent is already in use for the channel
+ * @offset: next write offset (initially 0)
+ * @node: list node
*/
struct glink_core_rx_intent {
void *data;
@@ -89,10 +90,14 @@ struct glink_core_rx_intent {
* @idr_lock: synchronizes @lcids and @rcids modifications
* @lcids: idr of all channels with a known local channel id
* @rcids: idr of all channels with a known remote channel id
+ * @features: remote features
+ * @intentless: flag to indicate that there is no intent
*/
struct qcom_glink {
struct device *dev;
+ const char *name;
+
struct mbox_client mbox_client;
struct mbox_chan *mbox_chan;
@@ -512,8 +517,8 @@ static void qcom_glink_rx_done(struct qcom_glink *glink,
* qcom_glink_receive_version() - receive version/features from remote system
*
* @glink: pointer to transport interface
- * @r_version: remote version
- * @r_features: remote features
+ * @version: remote version
+ * @features: remote features
*
* This function is called in response to a remote-initiated version/feature
* negotiation sequence.
@@ -538,8 +543,8 @@ static void qcom_glink_receive_version(struct qcom_glink *glink,
* qcom_glink_receive_version_ack() - receive negotiation ack from remote system
*
* @glink: pointer to transport interface
- * @r_version: remote version response
- * @r_features: remote features response
+ * @version: remote version response
+ * @features: remote features response
*
* This function is called in response to a local-initiated version/feature
* negotiation sequence and is the counter-offer from the remote side based
@@ -567,7 +572,7 @@ static void qcom_glink_receive_version_ack(struct qcom_glink *glink,
/**
* qcom_glink_send_intent_req_ack() - convert an rx intent request ack cmd to
- wire format and transmit
+ * wire format and transmit
* @glink: The transport to transmit on.
* @channel: The glink channel
* @granted: The request response to encode.
@@ -594,7 +599,7 @@ static int qcom_glink_send_intent_req_ack(struct qcom_glink *glink,
* transmit
* @glink: The transport to transmit on.
* @channel: The local channel
- * @size: The intent to pass on to remote.
+ * @intent: The intent to pass on to remote.
*
* Return: 0 on success or standard Linux error code.
*/
@@ -603,11 +608,11 @@ static int qcom_glink_advertise_intent(struct qcom_glink *glink,
struct glink_core_rx_intent *intent)
{
struct command {
- u16 id;
- u16 lcid;
- u32 count;
- u32 size;
- u32 liid;
+ __le16 id;
+ __le16 lcid;
+ __le32 count;
+ __le32 size;
+ __le32 liid;
} __packed;
struct command cmd;
@@ -698,9 +703,9 @@ static void qcom_glink_handle_rx_done(struct qcom_glink *glink,
/**
* qcom_glink_handle_intent_req() - Receive a request for rx_intent
* from remote side
- * if_ptr: Pointer to the transport interface
- * rcid: Remote channel ID
- * size: size of the intent
+ * @glink: Pointer to the transport interface
+ * @cid: Remote channel ID
+ * @size: size of the intent
*
* The function searches for the local channel to which the request for
* rx_intent has arrived and allocates and notifies the remote back
@@ -1572,6 +1577,10 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev,
idr_init(&glink->lcids);
idr_init(&glink->rcids);
+ ret = of_property_read_string(dev->of_node, "label", &glink->name);
+ if (ret < 0)
+ glink->name = dev->of_node->name;
+
glink->mbox_client.dev = dev;
glink->mbox_client.knows_txdone = true;
glink->mbox_chan = mbox_request_channel(&glink->mbox_client, 0);