You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/04/13 18:47:59 UTC

[incubator-nuttx-apps] 01/02: Revert "rpmsg: pointer of netdev ioctl support cross-core memory access"

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 3a42d849f5cc9d4b14bb43220c3f6370564a7cd0
Author: zhanghongyu <zh...@xiaomi.com>
AuthorDate: Fri Apr 1 16:42:58 2022 +0800

    Revert "rpmsg: pointer of netdev ioctl support cross-core memory access"
    
    This reverts commit bd539651cdf1e5067dc5d21349ef835e98e262eb.
    
    Reason for revert: Change the implementation method
    
    Signed-off-by: zhanghongyu <zh...@xiaomi.com>
---
 netutils/usrsock_rpmsg/usrsock_rpmsg.h        | 15 ---------
 netutils/usrsock_rpmsg/usrsock_rpmsg_client.c | 45 ---------------------------
 netutils/usrsock_rpmsg/usrsock_rpmsg_server.c | 17 ----------
 3 files changed, 77 deletions(-)

diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg.h b/netutils/usrsock_rpmsg/usrsock_rpmsg.h
index 3ca44934a..4c0b1bd05 100644
--- a/netutils/usrsock_rpmsg/usrsock_rpmsg.h
+++ b/netutils/usrsock_rpmsg/usrsock_rpmsg.h
@@ -27,11 +27,6 @@
 
 #include <nuttx/net/usrsock.h>
 
-#ifdef CONFIG_NETDEV_WIRELESS_IOCTL
-#  include <nuttx/wireless/wireless.h>
-#  include <metal/cache.h>
-#endif
-
 /****************************************************************************
  * Pre-processor definitions
  ****************************************************************************/
@@ -40,16 +35,6 @@
 
 #define USRSOCK_RPMSG_DNS_EVENT      127
 
-#ifdef CONFIG_NETDEV_WIRELESS_IOCTL
-#  define WL_IS80211POINTERCMD(cmd)  ((cmd) == SIOCGIWSCAN || \
-                                      (cmd) == SIOCSIWCOUNTRY || \
-                                      (cmd) == SIOCGIWRANGE || \
-                                      (cmd) == SIOCSIWENCODEEXT || \
-                                      (cmd) == SIOCGIWENCODEEXT || \
-                                      (cmd) == SIOCGIWESSID || \
-                                      (cmd) == SIOCSIWESSID)
-#endif
-
 /****************************************************************************
  * Public Types
  ****************************************************************************/
diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg_client.c b/netutils/usrsock_rpmsg/usrsock_rpmsg_client.c
index 2d608e6d0..a33fff876 100644
--- a/netutils/usrsock_rpmsg/usrsock_rpmsg_client.c
+++ b/netutils/usrsock_rpmsg/usrsock_rpmsg_client.c
@@ -49,12 +49,6 @@ struct usrsock_rpmsg_s
   struct file           file;
 };
 
-enum usrsock_cache_action_e
-{
-  USRSOCK_COHERENT_BEFORE,
-  USRSOCK_COHERENT_AFTER,
-};
-
 /****************************************************************************
  * Private Function Prototypes
  ****************************************************************************/
@@ -161,41 +155,6 @@ static int usrsock_rpmsg_ept_cb(struct rpmsg_endpoint *ept, void *data,
   return ret;
 }
 
-#ifdef CONFIG_NETDEV_WIRELESS_IOCTL
-
-static void usersock_coherent_cache(FAR void *buf,
-                                    enum usrsock_cache_action_e action)
-{
-  FAR struct usrsock_request_ioctl_s *req = buf;
-  FAR struct iwreq *wlreq;
-
-  if (req->head.reqid == USRSOCK_REQUEST_IOCTL)
-    {
-      if (WL_IS80211POINTERCMD(req->cmd))
-        {
-          wlreq = (FAR struct iwreq *)(req + 1);
-          if (action == USRSOCK_COHERENT_BEFORE)
-            {
-              metal_cache_flush(wlreq->u.data.pointer,
-                                wlreq->u.data.length);
-            }
-
-          if (action == USRSOCK_COHERENT_AFTER)
-            {
-              metal_cache_invalidate(wlreq->u.data.pointer,
-                                    wlreq->u.data.length);
-            }
-        }
-    }
-}
-
-#else
-static void usersock_coherent_cache(FAR void *buf,
-                                    enum usrsock_cache_action_e action)
-{
-}
-#endif
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -292,8 +251,6 @@ int main(int argc, char *argv[])
               break;
             }
 
-          usersock_coherent_cache(buf, USRSOCK_COHERENT_BEFORE);
-
           /* Send the packet to remote */
 
           ret = rpmsg_send_nocopy(&priv.ept, buf, ret);
@@ -301,8 +258,6 @@ int main(int argc, char *argv[])
             {
               break;
             }
-
-          usersock_coherent_cache(buf, USRSOCK_COHERENT_AFTER);
         }
 
       /* Reclaim the resource */
diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
index 3fe22a527..18393d897 100644
--- a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
+++ b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
@@ -719,26 +719,9 @@ static int usrsock_rpmsg_ioctl_handler(struct rpmsg_endpoint *ept,
   if (req->usockid >= 0 &&
       req->usockid < CONFIG_NETUTILS_USRSOCK_NSOCK_DESCRIPTORS)
     {
-#ifdef CONFIG_NETDEV_WIRELESS_IOCTL
-      FAR struct iwreq *wlreq = (FAR struct iwreq *)(req + 1);
-      if (WL_IS80211POINTERCMD(req->cmd))
-        {
-          metal_cache_invalidate(wlreq->u.data.pointer,
-                                 wlreq->u.data.length);
-        }
-#endif
-
       memcpy(ack + 1, req + 1, req->arglen);
       ret = psock_ioctl(&priv->socks[req->usockid],
               req->cmd, (unsigned long)(ack + 1));
-
-#ifdef CONFIG_NETDEV_WIRELESS_IOCTL
-      if (WL_IS80211POINTERCMD(req->cmd))
-        {
-          metal_cache_flush(wlreq->u.data.pointer,
-                            wlreq->u.data.length);
-        }
-#endif
     }
 
   return usrsock_rpmsg_send_data_ack(ept,