diff options
Diffstat (limited to 'kernel/rpmsg/ethosu_rpmsg_network_info.c')
-rw-r--r-- | kernel/rpmsg/ethosu_rpmsg_network_info.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/kernel/rpmsg/ethosu_rpmsg_network_info.c b/kernel/rpmsg/ethosu_rpmsg_network_info.c index 0e54d87..36b6290 100644 --- a/kernel/rpmsg/ethosu_rpmsg_network_info.c +++ b/kernel/rpmsg/ethosu_rpmsg_network_info.c @@ -31,18 +31,19 @@ #define NETWORK_INFO_RESP_TIMEOUT_MS 3000 -static inline int ethosu_network_info_send(struct ethosu_network_info *info, - struct ethosu_mailbox *mailbox) +static inline int ethosu_rpmsg_network_info_send( + struct ethosu_rpmsg_network_info *info, + struct ethosu_rpmsg_mailbox *mailbox) { /* Send network info request to firmware */ - return ethosu_mailbox_network_info_request(mailbox, - &info->msg, - info->net); + return ethosu_rpmsg_mailbox_network_info_request(mailbox, + &info->msg, + info->net); } -static void ethosu_network_info_fail(struct ethosu_mailbox_msg *msg) +static void ethosu_rpmsg_network_info_fail(struct ethosu_rpmsg_mailbox_msg *msg) { - struct ethosu_network_info *info = + struct ethosu_rpmsg_network_info *info = container_of(msg, typeof(*info), msg); if (completion_done(&info->done)) @@ -52,12 +53,12 @@ static void ethosu_network_info_fail(struct ethosu_mailbox_msg *msg) complete(&info->done); } -int ethosu_network_info_request(struct device *dev, - struct ethosu_mailbox *mailbox, - struct ethosu_network *net, - struct ethosu_uapi_network_info *uapi) +int ethosu_rpmsg_network_info_request(struct device *dev, + struct ethosu_rpmsg_mailbox *mailbox, + struct ethosu_rpmsg_network *net, + struct ethosu_uapi_network_info *uapi) { - struct ethosu_network_info *info; + struct ethosu_rpmsg_network_info *info; int ret; int timeout; @@ -69,16 +70,16 @@ int ethosu_network_info_request(struct device *dev, info->net = net; info->uapi = uapi; init_completion(&info->done); - info->msg.fail = ethosu_network_info_fail; + info->msg.fail = ethosu_rpmsg_network_info_fail; - ret = ethosu_mailbox_register(mailbox, &info->msg); + ret = ethosu_rpmsg_mailbox_register(mailbox, &info->msg); if (ret < 0) goto kfree; /* Get reference to network */ - ethosu_network_get(info->net); + ethosu_rpmsg_network_get(info->net); - ret = ethosu_network_info_send(info, mailbox); + ret = ethosu_rpmsg_network_info_send(info, mailbox); if (ret) goto deregister; @@ -104,8 +105,8 @@ int ethosu_network_info_request(struct device *dev, ret = info->errno; deregister: - ethosu_mailbox_deregister(mailbox, &info->msg); - ethosu_network_put(info->net); + ethosu_rpmsg_mailbox_deregister(mailbox, &info->msg); + ethosu_rpmsg_network_put(info->net); kfree: dev_dbg(dev, @@ -116,21 +117,21 @@ kfree: return ret; } -void ethosu_network_info_rsp(struct ethosu_mailbox *mailbox, - int msg_id, - struct ethosu_core_msg_network_info_rsp *rsp) +void ethosu_rpmsg_network_info_rsp(struct ethosu_rpmsg_mailbox *mailbox, + int msg_id, + struct ethosu_rpmsg_network_info_rsp *rsp) { int ret; struct device *dev = mailbox->dev; - struct ethosu_mailbox_msg *msg; - struct ethosu_network_info *info; + struct ethosu_rpmsg_mailbox_msg *msg; + struct ethosu_rpmsg_network_info *info; uint32_t i; const size_t rsp_desc_size = sizeof(rsp->desc); BUILD_BUG_ON(rsp_desc_size != sizeof(info->uapi->desc)); - msg = ethosu_mailbox_find(mailbox, msg_id, - ETHOSU_CORE_MSG_NETWORK_INFO_REQ); + msg = ethosu_rpmsg_mailbox_find(mailbox, msg_id, + ETHOSU_RPMSG_NETWORK_INFO_REQ); if (IS_ERR(msg)) { dev_warn(dev, "Id for network info msg not found. Id=0x%x: %ld\n", @@ -146,7 +147,7 @@ void ethosu_network_info_rsp(struct ethosu_mailbox *mailbox, info->errno = 0; - if (rsp->status != ETHOSU_CORE_STATUS_OK) { + if (rsp->status != ETHOSU_RPMSG_STATUS_OK) { dev_err(dev, "Failed to get information about the network\n"); info->errno = -EBADF; goto signal_complete; |