]> Zhao Yanbai Git Server - minix.git/commitdiff
Message type for BUSC_I2C_EXEC
authorLionel Sambuc <lionel@minix3.org>
Thu, 15 May 2014 14:39:51 +0000 (16:39 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:44 +0000 (17:05 +0200)
Change-Id: I4b6e33df2dd70d40af4a2f2c899324a40107c56a

drivers/i2c/i2c.c
include/minix/com.h
include/minix/ipc.h
lib/libi2cdriver/i2cdriver.c

index b53bcf6842686c0cfe44c14534e583b711d8f0e7..be1888547896a1513ffbd4d0096e2ea11aaf349b 100644 (file)
@@ -327,7 +327,7 @@ i2c_other(message * m, int ipc_status)
                break;
        case BUSC_I2C_EXEC:
                /* handle request from another driver */
-               r = do_i2c_ioctl_exec(m->m_source, m->BUSC_I2C_GRANT);
+               r = do_i2c_ioctl_exec(m->m_source, m->m_li2cdriver_i2c_busc_i2c_exec.grant);
                break;
        default:
                log_warn(&log, "Invalid message type (0x%x)\n", m->m_type);
index 748ccc3aa3142757d6d79aabec3097c61d7d4033..bd26da18ff4336c3acf5836e9465416ad6ac50b3 100644 (file)
 
 #define BUSC_I2C_RESERVE       (BUSC_RQ_BASE + 64)     /* reserve i2c device */
 #define BUSC_I2C_EXEC          (BUSC_RQ_BASE + 65)     /* perform i2c action */
-#define   BUSC_I2C_GRANT       m2_i1                   /* grant for request */
 
 /*===========================================================================*
  *                        Messages for networking layer                     *
index e65be80207b2db6b0a0efdac7adabafdcb06cc09..e0fbfa8f0f6a4587f4f1fb6af340aadc8e467ea9 100644 (file)
@@ -587,6 +587,18 @@ typedef struct {
 } mess_pm_lexec_exec_new;
 _ASSERT_MSG_SIZE(mess_pm_lexec_exec_new);
 
+typedef struct {
+       cp_grant_id_t grant;
+
+       uint8_t padding[52];
+} mess_li2cdriver_i2c_busc_i2c_exec;
+_ASSERT_MSG_SIZE(mess_li2cdriver_i2c_busc_i2c_exec);
+
+typedef struct {
+       uint8_t padding[56];
+} mess_i2c_li2cdriver_busc_i2c_exec;
+_ASSERT_MSG_SIZE(mess_i2c_li2cdriver_busc_i2c_exec);
+
 typedef struct {
        uint16_t addr; /* FIXME: strictly speaking this is an i2c_addr_t, but
                          to get it I would need to include
@@ -1218,6 +1230,7 @@ typedef struct {
                mess_fs_vfs_readsuper   m_fs_vfs_readsuper;
                mess_fs_vfs_readwrite   m_fs_vfs_readwrite;
 
+               mess_i2c_li2cdriver_busc_i2c_exec m_i2c_li2cdriver_busc_i2c_exec;
                mess_i2c_li2cdriver_busc_i2c_reserve m_i2c_li2cdriver_busc_i2c_reserve;
 
                mess_lc_pm_exec         m_lc_pm_exec;
@@ -1264,6 +1277,7 @@ typedef struct {
 
                mess_lexec_pm_exec_new  m_lexec_pm_exec_new;
 
+               mess_li2cdriver_i2c_busc_i2c_exec m_li2cdriver_i2c_busc_i2c_exec;
                mess_li2cdriver_i2c_busc_i2c_reserve m_li2cdriver_i2c_busc_i2c_reserve;
 
                mess_lsys_krn_schedctl  m_lsys_krn_schedctl;
index f4b6c3b58c7b6f31789f09478917811d7e407164..3112ebd5f90693f983a63b36bcd2174f6264184b 100644 (file)
@@ -182,7 +182,7 @@ i2cdriver_exec(endpoint_t bus_endpoint, minix_i2c_ioctl_exec_t * ioctl_exec)
        memset(&m, '\0', sizeof(message));
 
        m.m_type = BUSC_I2C_EXEC;
-       m.BUSC_I2C_GRANT = grant_nr;
+       m.m_li2cdriver_i2c_busc_i2c_exec.grant = grant_nr;
 
        r = ipc_sendrec(bus_endpoint, &m);
        cpf_revoke(grant_nr);