]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
Removed workaround in tiipc to treat MessageQ rpmsg port as a special case, now that...
authorVW <vwan@ti.com>
Fri, 15 Mar 2013 23:01:30 +0000 (16:01 -0700)
committerVW <vwan@ti.com>
Fri, 15 Mar 2013 23:01:30 +0000 (16:01 -0700)
qnx/src/api/MessageQ.c
qnx/src/ipc3x_dev/ti/syslink/ti-ipc/ti-ipc.c

index 95dd0bbde91e0a1dfb23262b93bee5d0de2e992a..145f74bb875f8aeab069e3f33a8586656a0a68cf 100644 (file)
@@ -722,6 +722,7 @@ Int MessageQ_attach (UInt16 remoteProcId, Ptr sharedAddr)
 {
     Int     status = MessageQ_S_SUCCESS;
     int     ipcFd;
+    int     err;
 
     PRINTVERBOSE1("MessageQ_attach: remoteProcId: %d\n", remoteProcId)
 
@@ -746,10 +747,16 @@ Int MessageQ_attach (UInt16 remoteProcId, Ptr sharedAddr)
                 ipcFd)
             MessageQ_module->ipcFd[remoteProcId] = ipcFd;
             /*
-             * Connect to the remote endpoint and bind a reserved address as
+             * Connect to the remote endpoint and bind any reserved address as
              * local endpoint
              */
             Connect(ipcFd, remoteProcId, MESSAGEQ_RPMSG_PORT);
+            err = BindAddr(ipcFd, TIIPC_ADDRANY);
+            if (err < 0) {
+                status = MessageQ_E_FAIL;
+                printf ("MessageQ_attach: bind failed: %d, %s\n",
+                    errno, strerror(errno));
+            }
         }
     }
     else {
index 2a4da2d5073e2da24573661073ddf5e943f303d1..ab9fa3166bdba8a672db794c1f06e5a525da3eda 100644 (file)
@@ -83,8 +83,6 @@
 
 #define TIIPC_DEVICE_NAME "/dev/tiipc"
 
-#define MESSAGEQ_RPMSG_PORT       61
-#define RPMSG_RESERVED_ADDRESSES  1024
 
 /* structure to hold rpmsg-rpc device information */
 typedef struct named_device {
@@ -1239,15 +1237,9 @@ ti_ipc_write(resmgr_context_t *ctp, io_write_t *msg, RESMGR_OCB_T *io_ocb)
         return (errno);
     }
 
-    /* TODO: Need to make generic instead of hardcoding the address */
-    if (obj->remoteAddr == MESSAGEQ_RPMSG_PORT){
-        status = MessageQCopy_send(obj->procId, MultiProc_self(), obj->remoteAddr,
-                                   RPMSG_RESERVED_ADDRESSES, buf, bytes, TRUE);
-    }
-    else {
-        status = MessageQCopy_send(obj->procId, MultiProc_self(), obj->remoteAddr,
+    status = MessageQCopy_send(obj->procId, MultiProc_self(), obj->remoteAddr,
                                    obj->addr, buf, bytes, TRUE);
-    }
+
     if (status < 0) {
         return (EIO);
     }