Rename macros and types to namespace their usage

Macros and types have been renamed accordingly to namespace them by
their usage in the new kernel driver source tree structure.

This is done in a separate commit from the restructuring to avoid Git
from seeing some of the moved files as new ones because they have been
both moved and modified at the same time and thus losing the connection
in the history.

Change-Id: Icd4d8e8c76779479b5b46a55bf1d4f78a629c281
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
diff --git a/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c b/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
index 5d46434..5fa7515 100644
--- a/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
+++ b/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
@@ -41,18 +41,19 @@
  * Functions
  ****************************************************************************/
 
-static int ethosu_cancel_inference_send(
-	struct ethosu_cancel_inference *cancellation,
-	struct ethosu_mailbox *mailbox)
+static int ethosu_rpmsg_cancel_inference_send(
+	struct ethosu_rpmsg_cancel_inference *cancellation,
+	struct ethosu_rpmsg_mailbox *mailbox)
 {
-	return ethosu_mailbox_cancel_inference(mailbox,
-					       &cancellation->msg,
-					       cancellation->inf->msg.id);
+	return ethosu_rpmsg_mailbox_cancel_inference(mailbox,
+						     &cancellation->msg,
+						     cancellation->inf->msg.id);
 }
 
-static void ethosu_cancel_inference_fail(struct ethosu_mailbox_msg *msg)
+static void ethosu_rpmsg_cancel_inference_fail(
+	struct ethosu_rpmsg_mailbox_msg *msg)
 {
-	struct ethosu_cancel_inference *cancellation =
+	struct ethosu_rpmsg_cancel_inference *cancellation =
 		container_of(msg, typeof(*cancellation), msg);
 
 	if (completion_done(&cancellation->done))
@@ -63,12 +64,12 @@
 	complete(&cancellation->done);
 }
 
-int ethosu_cancel_inference_request(struct device *dev,
-				    struct ethosu_mailbox *mailbox,
-				    struct ethosu_inference *inf,
-				    struct ethosu_uapi_cancel_inference_status *uapi)
+int ethosu_rpmsg_cancel_inference_request(struct device *dev,
+					  struct ethosu_rpmsg_mailbox *mailbox,
+					  struct ethosu_rpmsg_inference *inf,
+					  struct ethosu_uapi_cancel_inference_status *uapi)
 {
-	struct ethosu_cancel_inference *cancellation;
+	struct ethosu_rpmsg_cancel_inference *cancellation;
 	int ret;
 	int timeout;
 
@@ -80,13 +81,13 @@
 
 	cancellation =
 		devm_kzalloc(dev,
-			     sizeof(struct ethosu_cancel_inference),
+			     sizeof(struct ethosu_rpmsg_cancel_inference),
 			     GFP_KERNEL);
 	if (!cancellation)
 		return -ENOMEM;
 
 	/* increase ref count on the inference we are refering to */
-	ethosu_inference_get(inf);
+	ethosu_rpmsg_inference_get(inf);
 	/* mark inference ABORTING to avoid resending the inference message */
 	inf->status = ETHOSU_UAPI_STATUS_ABORTING;
 
@@ -94,10 +95,10 @@
 	cancellation->inf = inf;
 	cancellation->uapi = uapi;
 	init_completion(&cancellation->done);
-	cancellation->msg.fail = ethosu_cancel_inference_fail;
+	cancellation->msg.fail = ethosu_rpmsg_cancel_inference_fail;
 
-	ret = ethosu_mailbox_register(mailbox,
-				      &cancellation->msg);
+	ret = ethosu_rpmsg_mailbox_register(mailbox,
+					    &cancellation->msg);
 	if (ret < 0)
 		goto kfree;
 
@@ -105,7 +106,7 @@
 		"Inference cancellation create. cancel=0x%pK, msg.id=%ddev",
 		cancellation, cancellation->msg.id);
 
-	ret = ethosu_cancel_inference_send(cancellation, mailbox);
+	ret = ethosu_rpmsg_cancel_inference_send(cancellation, mailbox);
 	if (0 != ret)
 		goto deregister;
 
@@ -140,30 +141,30 @@
 		inf->status = ETHOSU_UAPI_STATUS_ABORTED;
 
 deregister:
-	ethosu_mailbox_deregister(mailbox,
-				  &cancellation->msg);
+	ethosu_rpmsg_mailbox_deregister(mailbox,
+					&cancellation->msg);
 
 kfree:
 	dev_dbg(dev,
 		"Cancel inference destroy. cancel=0x%pK", cancellation);
 
 	/* decrease the reference on the inference we are refering to */
-	ethosu_inference_put(cancellation->inf);
+	ethosu_rpmsg_inference_put(cancellation->inf);
 	devm_kfree(dev, cancellation);
 
 	return ret;
 }
 
-void ethosu_cancel_inference_rsp(struct ethosu_mailbox *mailbox,
-				 int msg_id,
-				 struct ethosu_core_msg_cancel_inference_rsp *rsp)
+void ethosu_rpmsg_cancel_inference_rsp(struct ethosu_rpmsg_mailbox *mailbox,
+				       int msg_id,
+				       struct ethosu_rpmsg_cancel_inference_rsp *rsp)
 {
 	struct device *dev = mailbox->dev;
-	struct ethosu_mailbox_msg *msg;
-	struct ethosu_cancel_inference *cancellation;
+	struct ethosu_rpmsg_mailbox_msg *msg;
+	struct ethosu_rpmsg_cancel_inference *cancellation;
 
-	msg = ethosu_mailbox_find(mailbox, msg_id,
-				  ETHOSU_CORE_MSG_CANCEL_INFERENCE_REQ);
+	msg = ethosu_rpmsg_mailbox_find(mailbox, msg_id,
+					ETHOSU_RPMSG_CANCEL_INFERENCE_REQ);
 	if (IS_ERR(msg)) {
 		dev_warn(dev,
 			 "Id for cancel inference msg not found. Id=0x%x: %ld",
@@ -179,10 +180,10 @@
 
 	cancellation->errno = 0;
 	switch (rsp->status) {
-	case ETHOSU_CORE_STATUS_OK:
+	case ETHOSU_RPMSG_STATUS_OK:
 		cancellation->uapi->status = ETHOSU_UAPI_STATUS_OK;
 		break;
-	case ETHOSU_CORE_STATUS_ERROR:
+	case ETHOSU_RPMSG_STATUS_ERROR:
 		cancellation->uapi->status = ETHOSU_UAPI_STATUS_ERROR;
 		break;
 	}