diff options
| author | Damien George | 2016-02-09 14:28:50 +0000 |
|---|---|---|
| committer | Damien George | 2016-02-10 08:59:31 +0000 |
| commit | c33ad60a676d46cb18883beedd6c383d6fae9dd8 (patch) | |
| tree | 2ac56735b689abc47fb435268ce1e9fdaa7d459c /extmod/fsusermount.h | |
| parent | 3846fd56c150646099d530196fd6ab9a54536a24 (diff) | |
extmod/fsusermount: Change block protocol to support ioctl method.
The new block protocol is:
- readblocks(self, n, buf)
- writeblocks(self, n, buf)
- ioctl(self, cmd, arg)
The new ioctl method handles the old sync and count methods, as well as
a new "get sector size" method.
The old protocol is still supported, and used if the device doesn't have
the ioctl method.
Diffstat (limited to 'extmod/fsusermount.h')
| -rw-r--r-- | extmod/fsusermount.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/extmod/fsusermount.h b/extmod/fsusermount.h index c141ecb99..53442a368 100644 --- a/extmod/fsusermount.h +++ b/extmod/fsusermount.h @@ -29,8 +29,15 @@ typedef struct _fs_user_mount_t { mp_uint_t len; mp_obj_t readblocks[4]; mp_obj_t writeblocks[4]; - mp_obj_t sync[2]; - mp_obj_t count[2]; + // new protocol uses just ioctl, old uses sync (optional) and count + // if ioctl[3]=count[1]=MP_OBJ_SENTINEL then we have the new protocol, else old + union { + mp_obj_t ioctl[4]; + struct { + mp_obj_t sync[2]; + mp_obj_t count[2]; + } old; + } u; FATFS fatfs; } fs_user_mount_t; |
