#ifdef HAVE_LIBC
if(tpm->fd >= 0) {
files[tpm->fd].read = false;
- files[tpm->fd].tpm_tis.respgot = 0;
files[tpm->fd].offset = 0;
}
#endif
tpm->fd = alloc_fd(FTYPE_TPM_TIS);
printk("tpm_tis_open() -> %d\n", tpm->fd);
files[tpm->fd].tpm_tis.dev = tpm;
- files[tpm->fd].tpm_tis.respgot = 0;
return tpm->fd;
}
#ifdef HAVE_LIBC
if(dev->fd >= 0) {
files[dev->fd].read = false;
- files[dev->fd].tpmfront.respgot = 0;
files[dev->fd].offset = 0;
+ dev->respgot = false;
}
#endif
wmb();
#endif
#ifdef HAVE_LIBC
if(dev->fd >= 0) {
- files[dev->fd].tpmfront.respgot = 1;
+ dev->respgot = true;
}
#endif
quit:
dev->fd = alloc_fd(FTYPE_TPMFRONT);
printk("tpmfront_open(%s) -> %d\n", dev->nodename, dev->fd);
files[dev->fd].tpmfront.dev = dev;
- files[dev->fd].tpmfront.respgot = 0;
+ dev->respgot = false;
return dev->fd;
}
}
/* get the response if we haven't already */
- if(files[dev->fd].tpmfront.respgot == 0) {
+ if (!dev->respgot) {
if ((rc = tpmfront_recv(dev, &dummybuf, &dummysz)) != 0) {
errno = EIO;
return -1;
/* If we have a response waiting, then read it now from the backend
* so we can get its length*/
- if(dev->waiting || (files[dev->fd].read && !files[dev->fd].tpmfront.respgot)) {
+ if(dev->waiting || (files[dev->fd].read && !dev->respgot)) {
if ((rc = tpmfront_recv(dev, &dummybuf, &dummysz)) != 0) {
errno = EIO;
return -1;