]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/sysdev/fsl_rmu.c
rapidio: add global inbound port write interfaces
[karo-tx-linux.git] / arch / powerpc / sysdev / fsl_rmu.c
index ffe0ee8327682496e4367d609a8cc86e1c482b72..c1826de4e749dc1ab15987831d310fb91f0fc6c9 100644 (file)
@@ -481,14 +481,14 @@ pw_done:
 static void fsl_pw_dpc(struct work_struct *work)
 {
        struct fsl_rio_pw *pw = container_of(work, struct fsl_rio_pw, pw_work);
-       u32 msg_buffer[RIO_PW_MSG_SIZE/sizeof(u32)];
+       union rio_pw_msg msg_buffer;
+       int i;
 
        /*
         * Process port-write messages
         */
-       while (kfifo_out_spinlocked(&pw->pw_fifo, (unsigned char *)msg_buffer,
+       while (kfifo_out_spinlocked(&pw->pw_fifo, (unsigned char *)&msg_buffer,
                         RIO_PW_MSG_SIZE, &pw->pw_fifo_lock)) {
-               /* Process one message */
 #ifdef DEBUG_PW
                {
                u32 i;
@@ -496,15 +496,19 @@ static void fsl_pw_dpc(struct work_struct *work)
                for (i = 0; i < RIO_PW_MSG_SIZE/sizeof(u32); i++) {
                        if ((i%4) == 0)
                                pr_debug("\n0x%02x: 0x%08x", i*4,
-                                        msg_buffer[i]);
+                                        msg_buffer.raw[i]);
                        else
-                               pr_debug(" 0x%08x", msg_buffer[i]);
+                               pr_debug(" 0x%08x", msg_buffer.raw[i]);
                }
                pr_debug("\n");
                }
 #endif
                /* Pass the port-write message to RIO core for processing */
-               rio_inb_pwrite_handler((union rio_pw_msg *)msg_buffer);
+               for (i = 0; i < MAX_PORT_NUM; i++) {
+                       if (pw->mport[i])
+                               rio_inb_pwrite_handler(pw->mport[i],
+                                                      &msg_buffer);
+               }
        }
 }