I2C: change BUSC_I2C_xxx to use own protocol

Previously it would use bits of the character driver protocol, which
will change heavily.  In the new situation, the BUSC_I2C_xxx requests
use a protocol more in line with the PCI protocol, with the reply code
in m_type.

Change-Id: I51597b3f191078c8178ce17372de123031f7a4c4
This commit is contained in:
David van Moolenbroek
2013-09-02 13:45:02 +02:00
committed by Lionel Sambuc
parent 4211c5d267
commit 660d34cd85
3 changed files with 21 additions and 18 deletions

View File

@@ -161,14 +161,14 @@ i2cdriver_reserve_device(endpoint_t bus_endpoint, i2c_addr_t address)
message m;
m.m_type = BUSC_I2C_RESERVE;
m.DEVICE = address;
m.BUSC_I2C_ADDR = address;
r = sendrec(bus_endpoint, &m);
if (r != OK) {
return EIO;
}
return m.REP_STATUS; /* return reply code OK, EBUSY, EINVAL, etc. */
return m.m_type; /* return reply code OK, EBUSY, EINVAL, etc. */
}
int
@@ -184,7 +184,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.IO_GRANT = (char *) grant_nr;
m.BUSC_I2C_GRANT = grant_nr;
r = sendrec(bus_endpoint, &m);
cpf_revoke(grant_nr);
@@ -192,7 +192,7 @@ i2cdriver_exec(endpoint_t bus_endpoint, minix_i2c_ioctl_exec_t * ioctl_exec)
return EIO;
}
return m.REP_STATUS;
return m.m_type;
}
static int