Commit 4e816d03 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Bjorn Andersson

rpmsg: glink: Fix GLINK command prefix

The upstream GLINK driver was first introduced to communicate with the
RPM on MSM8996, presumably as an artifact from that era the command
defines was prefixed RPM_CMD, while they actually are GLINK_CMDs.

Let's rename these, to keep things tidy. No functional change.
Signed-off-by: default avatarBjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: default avatarChris Lew <quic_clew@quicinc.com>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230214225933.2025595-1-quic_bjorande@quicinc.com
parent a8f500c6
...@@ -183,20 +183,20 @@ struct glink_channel { ...@@ -183,20 +183,20 @@ struct glink_channel {
static const struct rpmsg_endpoint_ops glink_endpoint_ops; static const struct rpmsg_endpoint_ops glink_endpoint_ops;
#define RPM_CMD_VERSION 0 #define GLINK_CMD_VERSION 0
#define RPM_CMD_VERSION_ACK 1 #define GLINK_CMD_VERSION_ACK 1
#define RPM_CMD_OPEN 2 #define GLINK_CMD_OPEN 2
#define RPM_CMD_CLOSE 3 #define GLINK_CMD_CLOSE 3
#define RPM_CMD_OPEN_ACK 4 #define GLINK_CMD_OPEN_ACK 4
#define RPM_CMD_INTENT 5 #define GLINK_CMD_INTENT 5
#define RPM_CMD_RX_DONE 6 #define GLINK_CMD_RX_DONE 6
#define RPM_CMD_RX_INTENT_REQ 7 #define GLINK_CMD_RX_INTENT_REQ 7
#define RPM_CMD_RX_INTENT_REQ_ACK 8 #define GLINK_CMD_RX_INTENT_REQ_ACK 8
#define RPM_CMD_TX_DATA 9 #define GLINK_CMD_TX_DATA 9
#define RPM_CMD_CLOSE_ACK 11 #define GLINK_CMD_CLOSE_ACK 11
#define RPM_CMD_TX_DATA_CONT 12 #define GLINK_CMD_TX_DATA_CONT 12
#define RPM_CMD_READ_NOTIF 13 #define GLINK_CMD_READ_NOTIF 13
#define RPM_CMD_RX_DONE_W_REUSE 14 #define GLINK_CMD_RX_DONE_W_REUSE 14
#define GLINK_FEATURE_INTENTLESS BIT(1) #define GLINK_FEATURE_INTENTLESS BIT(1)
...@@ -306,7 +306,7 @@ static void qcom_glink_send_read_notify(struct qcom_glink *glink) ...@@ -306,7 +306,7 @@ static void qcom_glink_send_read_notify(struct qcom_glink *glink)
{ {
struct glink_msg msg; struct glink_msg msg;
msg.cmd = cpu_to_le16(RPM_CMD_READ_NOTIF); msg.cmd = cpu_to_le16(GLINK_CMD_READ_NOTIF);
msg.param1 = 0; msg.param1 = 0;
msg.param2 = 0; msg.param2 = 0;
...@@ -375,7 +375,7 @@ static int qcom_glink_send_version(struct qcom_glink *glink) ...@@ -375,7 +375,7 @@ static int qcom_glink_send_version(struct qcom_glink *glink)
{ {
struct glink_msg msg; struct glink_msg msg;
msg.cmd = cpu_to_le16(RPM_CMD_VERSION); msg.cmd = cpu_to_le16(GLINK_CMD_VERSION);
msg.param1 = cpu_to_le16(GLINK_VERSION_1); msg.param1 = cpu_to_le16(GLINK_VERSION_1);
msg.param2 = cpu_to_le32(glink->features); msg.param2 = cpu_to_le32(glink->features);
...@@ -386,7 +386,7 @@ static void qcom_glink_send_version_ack(struct qcom_glink *glink) ...@@ -386,7 +386,7 @@ static void qcom_glink_send_version_ack(struct qcom_glink *glink)
{ {
struct glink_msg msg; struct glink_msg msg;
msg.cmd = cpu_to_le16(RPM_CMD_VERSION_ACK); msg.cmd = cpu_to_le16(GLINK_CMD_VERSION_ACK);
msg.param1 = cpu_to_le16(GLINK_VERSION_1); msg.param1 = cpu_to_le16(GLINK_VERSION_1);
msg.param2 = cpu_to_le32(glink->features); msg.param2 = cpu_to_le32(glink->features);
...@@ -398,7 +398,7 @@ static void qcom_glink_send_open_ack(struct qcom_glink *glink, ...@@ -398,7 +398,7 @@ static void qcom_glink_send_open_ack(struct qcom_glink *glink,
{ {
struct glink_msg msg; struct glink_msg msg;
msg.cmd = cpu_to_le16(RPM_CMD_OPEN_ACK); msg.cmd = cpu_to_le16(GLINK_CMD_OPEN_ACK);
msg.param1 = cpu_to_le16(channel->rcid); msg.param1 = cpu_to_le16(channel->rcid);
msg.param2 = cpu_to_le32(0); msg.param2 = cpu_to_le32(0);
...@@ -430,11 +430,11 @@ static void qcom_glink_intent_req_abort(struct glink_channel *channel) ...@@ -430,11 +430,11 @@ static void qcom_glink_intent_req_abort(struct glink_channel *channel)
} }
/** /**
* qcom_glink_send_open_req() - send a RPM_CMD_OPEN request to the remote * qcom_glink_send_open_req() - send a GLINK_CMD_OPEN request to the remote
* @glink: Ptr to the glink edge * @glink: Ptr to the glink edge
* @channel: Ptr to the channel that the open req is sent * @channel: Ptr to the channel that the open req is sent
* *
* Allocates a local channel id and sends a RPM_CMD_OPEN message to the remote. * Allocates a local channel id and sends a GLINK_CMD_OPEN message to the remote.
* Will return with refcount held, regardless of outcome. * Will return with refcount held, regardless of outcome.
* *
* Return: 0 on success, negative errno otherwise. * Return: 0 on success, negative errno otherwise.
...@@ -463,7 +463,7 @@ static int qcom_glink_send_open_req(struct qcom_glink *glink, ...@@ -463,7 +463,7 @@ static int qcom_glink_send_open_req(struct qcom_glink *glink,
channel->lcid = ret; channel->lcid = ret;
req.msg.cmd = cpu_to_le16(RPM_CMD_OPEN); req.msg.cmd = cpu_to_le16(GLINK_CMD_OPEN);
req.msg.param1 = cpu_to_le16(channel->lcid); req.msg.param1 = cpu_to_le16(channel->lcid);
req.msg.param2 = cpu_to_le32(name_len); req.msg.param2 = cpu_to_le32(name_len);
strcpy(req.name, channel->name); strcpy(req.name, channel->name);
...@@ -488,7 +488,7 @@ static void qcom_glink_send_close_req(struct qcom_glink *glink, ...@@ -488,7 +488,7 @@ static void qcom_glink_send_close_req(struct qcom_glink *glink,
{ {
struct glink_msg req; struct glink_msg req;
req.cmd = cpu_to_le16(RPM_CMD_CLOSE); req.cmd = cpu_to_le16(GLINK_CMD_CLOSE);
req.param1 = cpu_to_le16(channel->lcid); req.param1 = cpu_to_le16(channel->lcid);
req.param2 = 0; req.param2 = 0;
...@@ -500,7 +500,7 @@ static void qcom_glink_send_close_ack(struct qcom_glink *glink, ...@@ -500,7 +500,7 @@ static void qcom_glink_send_close_ack(struct qcom_glink *glink,
{ {
struct glink_msg req; struct glink_msg req;
req.cmd = cpu_to_le16(RPM_CMD_CLOSE_ACK); req.cmd = cpu_to_le16(GLINK_CMD_CLOSE_ACK);
req.param1 = cpu_to_le16(rcid); req.param1 = cpu_to_le16(rcid);
req.param2 = 0; req.param2 = 0;
...@@ -531,7 +531,7 @@ static void qcom_glink_rx_done_work(struct work_struct *work) ...@@ -531,7 +531,7 @@ static void qcom_glink_rx_done_work(struct work_struct *work)
iid = intent->id; iid = intent->id;
reuse = intent->reuse; reuse = intent->reuse;
cmd.id = reuse ? RPM_CMD_RX_DONE_W_REUSE : RPM_CMD_RX_DONE; cmd.id = reuse ? GLINK_CMD_RX_DONE_W_REUSE : GLINK_CMD_RX_DONE;
cmd.lcid = cid; cmd.lcid = cid;
cmd.liid = iid; cmd.liid = iid;
...@@ -643,7 +643,7 @@ static int qcom_glink_send_intent_req_ack(struct qcom_glink *glink, ...@@ -643,7 +643,7 @@ static int qcom_glink_send_intent_req_ack(struct qcom_glink *glink,
{ {
struct glink_msg msg; struct glink_msg msg;
msg.cmd = cpu_to_le16(RPM_CMD_RX_INTENT_REQ_ACK); msg.cmd = cpu_to_le16(GLINK_CMD_RX_INTENT_REQ_ACK);
msg.param1 = cpu_to_le16(channel->lcid); msg.param1 = cpu_to_le16(channel->lcid);
msg.param2 = cpu_to_le32(granted); msg.param2 = cpu_to_le32(granted);
...@@ -674,7 +674,7 @@ static int qcom_glink_advertise_intent(struct qcom_glink *glink, ...@@ -674,7 +674,7 @@ static int qcom_glink_advertise_intent(struct qcom_glink *glink,
} __packed; } __packed;
struct command cmd; struct command cmd;
cmd.id = cpu_to_le16(RPM_CMD_INTENT); cmd.id = cpu_to_le16(GLINK_CMD_INTENT);
cmd.lcid = cpu_to_le16(channel->lcid); cmd.lcid = cpu_to_le16(channel->lcid);
cmd.count = cpu_to_le32(1); cmd.count = cpu_to_le32(1);
cmd.size = cpu_to_le32(intent->size); cmd.size = cpu_to_le32(intent->size);
...@@ -1037,40 +1037,40 @@ void qcom_glink_native_rx(struct qcom_glink *glink) ...@@ -1037,40 +1037,40 @@ void qcom_glink_native_rx(struct qcom_glink *glink)
param2 = le32_to_cpu(msg.param2); param2 = le32_to_cpu(msg.param2);
switch (cmd) { switch (cmd) {
case RPM_CMD_VERSION: case GLINK_CMD_VERSION:
case RPM_CMD_VERSION_ACK: case GLINK_CMD_VERSION_ACK:
case RPM_CMD_CLOSE: case GLINK_CMD_CLOSE:
case RPM_CMD_CLOSE_ACK: case GLINK_CMD_CLOSE_ACK:
case RPM_CMD_RX_INTENT_REQ: case GLINK_CMD_RX_INTENT_REQ:
ret = qcom_glink_rx_defer(glink, 0); ret = qcom_glink_rx_defer(glink, 0);
break; break;
case RPM_CMD_OPEN_ACK: case GLINK_CMD_OPEN_ACK:
ret = qcom_glink_rx_open_ack(glink, param1); ret = qcom_glink_rx_open_ack(glink, param1);
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
break; break;
case RPM_CMD_OPEN: case GLINK_CMD_OPEN:
ret = qcom_glink_rx_defer(glink, param2); ret = qcom_glink_rx_defer(glink, param2);
break; break;
case RPM_CMD_TX_DATA: case GLINK_CMD_TX_DATA:
case RPM_CMD_TX_DATA_CONT: case GLINK_CMD_TX_DATA_CONT:
ret = qcom_glink_rx_data(glink, avail); ret = qcom_glink_rx_data(glink, avail);
break; break;
case RPM_CMD_READ_NOTIF: case GLINK_CMD_READ_NOTIF:
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
qcom_glink_tx_kick(glink); qcom_glink_tx_kick(glink);
break; break;
case RPM_CMD_INTENT: case GLINK_CMD_INTENT:
qcom_glink_handle_intent(glink, param1, param2, avail); qcom_glink_handle_intent(glink, param1, param2, avail);
break; break;
case RPM_CMD_RX_DONE: case GLINK_CMD_RX_DONE:
qcom_glink_handle_rx_done(glink, param1, param2, false); qcom_glink_handle_rx_done(glink, param1, param2, false);
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
break; break;
case RPM_CMD_RX_DONE_W_REUSE: case GLINK_CMD_RX_DONE_W_REUSE:
qcom_glink_handle_rx_done(glink, param1, param2, true); qcom_glink_handle_rx_done(glink, param1, param2, true);
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
break; break;
case RPM_CMD_RX_INTENT_REQ_ACK: case GLINK_CMD_RX_INTENT_REQ_ACK:
qcom_glink_handle_intent_req_ack(glink, param1, param2); qcom_glink_handle_intent_req_ack(glink, param1, param2);
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
break; break;
...@@ -1272,7 +1272,7 @@ static int qcom_glink_request_intent(struct qcom_glink *glink, ...@@ -1272,7 +1272,7 @@ static int qcom_glink_request_intent(struct qcom_glink *glink,
reinit_completion(&channel->intent_req_comp); reinit_completion(&channel->intent_req_comp);
cmd.id = RPM_CMD_RX_INTENT_REQ; cmd.id = GLINK_CMD_RX_INTENT_REQ;
cmd.cid = channel->lcid; cmd.cid = channel->lcid;
cmd.size = size; cmd.size = size;
...@@ -1346,7 +1346,7 @@ static int __qcom_glink_send(struct glink_channel *channel, ...@@ -1346,7 +1346,7 @@ static int __qcom_glink_send(struct glink_channel *channel,
chunk_size = SZ_8K; chunk_size = SZ_8K;
left_size = len - chunk_size; left_size = len - chunk_size;
} }
req.msg.cmd = cpu_to_le16(RPM_CMD_TX_DATA); req.msg.cmd = cpu_to_le16(GLINK_CMD_TX_DATA);
req.msg.param1 = cpu_to_le16(channel->lcid); req.msg.param1 = cpu_to_le16(channel->lcid);
req.msg.param2 = cpu_to_le32(iid); req.msg.param2 = cpu_to_le32(iid);
req.chunk_size = cpu_to_le32(chunk_size); req.chunk_size = cpu_to_le32(chunk_size);
...@@ -1367,7 +1367,7 @@ static int __qcom_glink_send(struct glink_channel *channel, ...@@ -1367,7 +1367,7 @@ static int __qcom_glink_send(struct glink_channel *channel,
chunk_size = SZ_8K; chunk_size = SZ_8K;
left_size -= chunk_size; left_size -= chunk_size;
req.msg.cmd = cpu_to_le16(RPM_CMD_TX_DATA_CONT); req.msg.cmd = cpu_to_le16(GLINK_CMD_TX_DATA_CONT);
req.msg.param1 = cpu_to_le16(channel->lcid); req.msg.param1 = cpu_to_le16(channel->lcid);
req.msg.param2 = cpu_to_le32(iid); req.msg.param2 = cpu_to_le32(iid);
req.chunk_size = cpu_to_le32(chunk_size); req.chunk_size = cpu_to_le32(chunk_size);
...@@ -1631,22 +1631,22 @@ static void qcom_glink_work(struct work_struct *work) ...@@ -1631,22 +1631,22 @@ static void qcom_glink_work(struct work_struct *work)
param2 = le32_to_cpu(msg->param2); param2 = le32_to_cpu(msg->param2);
switch (cmd) { switch (cmd) {
case RPM_CMD_VERSION: case GLINK_CMD_VERSION:
qcom_glink_receive_version(glink, param1, param2); qcom_glink_receive_version(glink, param1, param2);
break; break;
case RPM_CMD_VERSION_ACK: case GLINK_CMD_VERSION_ACK:
qcom_glink_receive_version_ack(glink, param1, param2); qcom_glink_receive_version_ack(glink, param1, param2);
break; break;
case RPM_CMD_OPEN: case GLINK_CMD_OPEN:
qcom_glink_rx_open(glink, param1, msg->data); qcom_glink_rx_open(glink, param1, msg->data);
break; break;
case RPM_CMD_CLOSE: case GLINK_CMD_CLOSE:
qcom_glink_rx_close(glink, param1); qcom_glink_rx_close(glink, param1);
break; break;
case RPM_CMD_CLOSE_ACK: case GLINK_CMD_CLOSE_ACK:
qcom_glink_rx_close_ack(glink, param1); qcom_glink_rx_close_ack(glink, param1);
break; break;
case RPM_CMD_RX_INTENT_REQ: case GLINK_CMD_RX_INTENT_REQ:
qcom_glink_handle_intent_req(glink, param1, param2); qcom_glink_handle_intent_req(glink, param1, param2);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment