Skip to content

Commit 4e816d0

Browse files
quic-bjorandeandersson
authored andcommitted
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: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Chris Lew <quic_clew@quicinc.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230214225933.2025595-1-quic_bjorande@quicinc.com
1 parent a8f500c commit 4e816d0

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

drivers/rpmsg/qcom_glink_native.c

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,20 @@ struct glink_channel {
183183

184184
static const struct rpmsg_endpoint_ops glink_endpoint_ops;
185185

186-
#define RPM_CMD_VERSION 0
187-
#define RPM_CMD_VERSION_ACK 1
188-
#define RPM_CMD_OPEN 2
189-
#define RPM_CMD_CLOSE 3
190-
#define RPM_CMD_OPEN_ACK 4
191-
#define RPM_CMD_INTENT 5
192-
#define RPM_CMD_RX_DONE 6
193-
#define RPM_CMD_RX_INTENT_REQ 7
194-
#define RPM_CMD_RX_INTENT_REQ_ACK 8
195-
#define RPM_CMD_TX_DATA 9
196-
#define RPM_CMD_CLOSE_ACK 11
197-
#define RPM_CMD_TX_DATA_CONT 12
198-
#define RPM_CMD_READ_NOTIF 13
199-
#define RPM_CMD_RX_DONE_W_REUSE 14
186+
#define GLINK_CMD_VERSION 0
187+
#define GLINK_CMD_VERSION_ACK 1
188+
#define GLINK_CMD_OPEN 2
189+
#define GLINK_CMD_CLOSE 3
190+
#define GLINK_CMD_OPEN_ACK 4
191+
#define GLINK_CMD_INTENT 5
192+
#define GLINK_CMD_RX_DONE 6
193+
#define GLINK_CMD_RX_INTENT_REQ 7
194+
#define GLINK_CMD_RX_INTENT_REQ_ACK 8
195+
#define GLINK_CMD_TX_DATA 9
196+
#define GLINK_CMD_CLOSE_ACK 11
197+
#define GLINK_CMD_TX_DATA_CONT 12
198+
#define GLINK_CMD_READ_NOTIF 13
199+
#define GLINK_CMD_RX_DONE_W_REUSE 14
200200

201201
#define GLINK_FEATURE_INTENTLESS BIT(1)
202202

@@ -306,7 +306,7 @@ static void qcom_glink_send_read_notify(struct qcom_glink *glink)
306306
{
307307
struct glink_msg msg;
308308

309-
msg.cmd = cpu_to_le16(RPM_CMD_READ_NOTIF);
309+
msg.cmd = cpu_to_le16(GLINK_CMD_READ_NOTIF);
310310
msg.param1 = 0;
311311
msg.param2 = 0;
312312

@@ -375,7 +375,7 @@ static int qcom_glink_send_version(struct qcom_glink *glink)
375375
{
376376
struct glink_msg msg;
377377

378-
msg.cmd = cpu_to_le16(RPM_CMD_VERSION);
378+
msg.cmd = cpu_to_le16(GLINK_CMD_VERSION);
379379
msg.param1 = cpu_to_le16(GLINK_VERSION_1);
380380
msg.param2 = cpu_to_le32(glink->features);
381381

@@ -386,7 +386,7 @@ static void qcom_glink_send_version_ack(struct qcom_glink *glink)
386386
{
387387
struct glink_msg msg;
388388

389-
msg.cmd = cpu_to_le16(RPM_CMD_VERSION_ACK);
389+
msg.cmd = cpu_to_le16(GLINK_CMD_VERSION_ACK);
390390
msg.param1 = cpu_to_le16(GLINK_VERSION_1);
391391
msg.param2 = cpu_to_le32(glink->features);
392392

@@ -398,7 +398,7 @@ static void qcom_glink_send_open_ack(struct qcom_glink *glink,
398398
{
399399
struct glink_msg msg;
400400

401-
msg.cmd = cpu_to_le16(RPM_CMD_OPEN_ACK);
401+
msg.cmd = cpu_to_le16(GLINK_CMD_OPEN_ACK);
402402
msg.param1 = cpu_to_le16(channel->rcid);
403403
msg.param2 = cpu_to_le32(0);
404404

@@ -430,11 +430,11 @@ static void qcom_glink_intent_req_abort(struct glink_channel *channel)
430430
}
431431

432432
/**
433-
* qcom_glink_send_open_req() - send a RPM_CMD_OPEN request to the remote
433+
* qcom_glink_send_open_req() - send a GLINK_CMD_OPEN request to the remote
434434
* @glink: Ptr to the glink edge
435435
* @channel: Ptr to the channel that the open req is sent
436436
*
437-
* Allocates a local channel id and sends a RPM_CMD_OPEN message to the remote.
437+
* Allocates a local channel id and sends a GLINK_CMD_OPEN message to the remote.
438438
* Will return with refcount held, regardless of outcome.
439439
*
440440
* Return: 0 on success, negative errno otherwise.
@@ -463,7 +463,7 @@ static int qcom_glink_send_open_req(struct qcom_glink *glink,
463463

464464
channel->lcid = ret;
465465

466-
req.msg.cmd = cpu_to_le16(RPM_CMD_OPEN);
466+
req.msg.cmd = cpu_to_le16(GLINK_CMD_OPEN);
467467
req.msg.param1 = cpu_to_le16(channel->lcid);
468468
req.msg.param2 = cpu_to_le32(name_len);
469469
strcpy(req.name, channel->name);
@@ -488,7 +488,7 @@ static void qcom_glink_send_close_req(struct qcom_glink *glink,
488488
{
489489
struct glink_msg req;
490490

491-
req.cmd = cpu_to_le16(RPM_CMD_CLOSE);
491+
req.cmd = cpu_to_le16(GLINK_CMD_CLOSE);
492492
req.param1 = cpu_to_le16(channel->lcid);
493493
req.param2 = 0;
494494

@@ -500,7 +500,7 @@ static void qcom_glink_send_close_ack(struct qcom_glink *glink,
500500
{
501501
struct glink_msg req;
502502

503-
req.cmd = cpu_to_le16(RPM_CMD_CLOSE_ACK);
503+
req.cmd = cpu_to_le16(GLINK_CMD_CLOSE_ACK);
504504
req.param1 = cpu_to_le16(rcid);
505505
req.param2 = 0;
506506

@@ -531,7 +531,7 @@ static void qcom_glink_rx_done_work(struct work_struct *work)
531531
iid = intent->id;
532532
reuse = intent->reuse;
533533

534-
cmd.id = reuse ? RPM_CMD_RX_DONE_W_REUSE : RPM_CMD_RX_DONE;
534+
cmd.id = reuse ? GLINK_CMD_RX_DONE_W_REUSE : GLINK_CMD_RX_DONE;
535535
cmd.lcid = cid;
536536
cmd.liid = iid;
537537

@@ -643,7 +643,7 @@ static int qcom_glink_send_intent_req_ack(struct qcom_glink *glink,
643643
{
644644
struct glink_msg msg;
645645

646-
msg.cmd = cpu_to_le16(RPM_CMD_RX_INTENT_REQ_ACK);
646+
msg.cmd = cpu_to_le16(GLINK_CMD_RX_INTENT_REQ_ACK);
647647
msg.param1 = cpu_to_le16(channel->lcid);
648648
msg.param2 = cpu_to_le32(granted);
649649

@@ -674,7 +674,7 @@ static int qcom_glink_advertise_intent(struct qcom_glink *glink,
674674
} __packed;
675675
struct command cmd;
676676

677-
cmd.id = cpu_to_le16(RPM_CMD_INTENT);
677+
cmd.id = cpu_to_le16(GLINK_CMD_INTENT);
678678
cmd.lcid = cpu_to_le16(channel->lcid);
679679
cmd.count = cpu_to_le32(1);
680680
cmd.size = cpu_to_le32(intent->size);
@@ -1037,40 +1037,40 @@ void qcom_glink_native_rx(struct qcom_glink *glink)
10371037
param2 = le32_to_cpu(msg.param2);
10381038

10391039
switch (cmd) {
1040-
case RPM_CMD_VERSION:
1041-
case RPM_CMD_VERSION_ACK:
1042-
case RPM_CMD_CLOSE:
1043-
case RPM_CMD_CLOSE_ACK:
1044-
case RPM_CMD_RX_INTENT_REQ:
1040+
case GLINK_CMD_VERSION:
1041+
case GLINK_CMD_VERSION_ACK:
1042+
case GLINK_CMD_CLOSE:
1043+
case GLINK_CMD_CLOSE_ACK:
1044+
case GLINK_CMD_RX_INTENT_REQ:
10451045
ret = qcom_glink_rx_defer(glink, 0);
10461046
break;
1047-
case RPM_CMD_OPEN_ACK:
1047+
case GLINK_CMD_OPEN_ACK:
10481048
ret = qcom_glink_rx_open_ack(glink, param1);
10491049
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
10501050
break;
1051-
case RPM_CMD_OPEN:
1051+
case GLINK_CMD_OPEN:
10521052
ret = qcom_glink_rx_defer(glink, param2);
10531053
break;
1054-
case RPM_CMD_TX_DATA:
1055-
case RPM_CMD_TX_DATA_CONT:
1054+
case GLINK_CMD_TX_DATA:
1055+
case GLINK_CMD_TX_DATA_CONT:
10561056
ret = qcom_glink_rx_data(glink, avail);
10571057
break;
1058-
case RPM_CMD_READ_NOTIF:
1058+
case GLINK_CMD_READ_NOTIF:
10591059
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
10601060
qcom_glink_tx_kick(glink);
10611061
break;
1062-
case RPM_CMD_INTENT:
1062+
case GLINK_CMD_INTENT:
10631063
qcom_glink_handle_intent(glink, param1, param2, avail);
10641064
break;
1065-
case RPM_CMD_RX_DONE:
1065+
case GLINK_CMD_RX_DONE:
10661066
qcom_glink_handle_rx_done(glink, param1, param2, false);
10671067
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
10681068
break;
1069-
case RPM_CMD_RX_DONE_W_REUSE:
1069+
case GLINK_CMD_RX_DONE_W_REUSE:
10701070
qcom_glink_handle_rx_done(glink, param1, param2, true);
10711071
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
10721072
break;
1073-
case RPM_CMD_RX_INTENT_REQ_ACK:
1073+
case GLINK_CMD_RX_INTENT_REQ_ACK:
10741074
qcom_glink_handle_intent_req_ack(glink, param1, param2);
10751075
qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8));
10761076
break;
@@ -1272,7 +1272,7 @@ static int qcom_glink_request_intent(struct qcom_glink *glink,
12721272

12731273
reinit_completion(&channel->intent_req_comp);
12741274

1275-
cmd.id = RPM_CMD_RX_INTENT_REQ;
1275+
cmd.id = GLINK_CMD_RX_INTENT_REQ;
12761276
cmd.cid = channel->lcid;
12771277
cmd.size = size;
12781278

@@ -1346,7 +1346,7 @@ static int __qcom_glink_send(struct glink_channel *channel,
13461346
chunk_size = SZ_8K;
13471347
left_size = len - chunk_size;
13481348
}
1349-
req.msg.cmd = cpu_to_le16(RPM_CMD_TX_DATA);
1349+
req.msg.cmd = cpu_to_le16(GLINK_CMD_TX_DATA);
13501350
req.msg.param1 = cpu_to_le16(channel->lcid);
13511351
req.msg.param2 = cpu_to_le32(iid);
13521352
req.chunk_size = cpu_to_le32(chunk_size);
@@ -1367,7 +1367,7 @@ static int __qcom_glink_send(struct glink_channel *channel,
13671367
chunk_size = SZ_8K;
13681368
left_size -= chunk_size;
13691369

1370-
req.msg.cmd = cpu_to_le16(RPM_CMD_TX_DATA_CONT);
1370+
req.msg.cmd = cpu_to_le16(GLINK_CMD_TX_DATA_CONT);
13711371
req.msg.param1 = cpu_to_le16(channel->lcid);
13721372
req.msg.param2 = cpu_to_le32(iid);
13731373
req.chunk_size = cpu_to_le32(chunk_size);
@@ -1631,22 +1631,22 @@ static void qcom_glink_work(struct work_struct *work)
16311631
param2 = le32_to_cpu(msg->param2);
16321632

16331633
switch (cmd) {
1634-
case RPM_CMD_VERSION:
1634+
case GLINK_CMD_VERSION:
16351635
qcom_glink_receive_version(glink, param1, param2);
16361636
break;
1637-
case RPM_CMD_VERSION_ACK:
1637+
case GLINK_CMD_VERSION_ACK:
16381638
qcom_glink_receive_version_ack(glink, param1, param2);
16391639
break;
1640-
case RPM_CMD_OPEN:
1640+
case GLINK_CMD_OPEN:
16411641
qcom_glink_rx_open(glink, param1, msg->data);
16421642
break;
1643-
case RPM_CMD_CLOSE:
1643+
case GLINK_CMD_CLOSE:
16441644
qcom_glink_rx_close(glink, param1);
16451645
break;
1646-
case RPM_CMD_CLOSE_ACK:
1646+
case GLINK_CMD_CLOSE_ACK:
16471647
qcom_glink_rx_close_ack(glink, param1);
16481648
break;
1649-
case RPM_CMD_RX_INTENT_REQ:
1649+
case GLINK_CMD_RX_INTENT_REQ:
16501650
qcom_glink_handle_intent_req(glink, param1, param2);
16511651
break;
16521652
default:

0 commit comments

Comments
 (0)