diff options
author | Denis Efremov <efremov@linux.com> | 2020-05-01 16:44:15 +0300 |
---|---|---|
committer | Denis Efremov <efremov@linux.com> | 2020-05-12 19:34:56 +0300 |
commit | bd10a5f3e21b1cb8e2133c1f08b3e8207cee12dd (patch) | |
tree | c19cc34c921125cf73d6e84b299e062decedb48a /include/uapi/linux/fd.h | |
parent | 9c4c5a24c85585fb8904bd2872501cd8181b3854 (diff) | |
download | linux-bd10a5f3e21b1cb8e2133c1f08b3e8207cee12dd.tar.xz |
floppy: add defines for sizes of cmd & reply buffers of floppy_raw_cmd
Use FD_RAW_CMD_SIZE, FD_RAW_REPLY_SIZE defines instead of magic numbers
for cmd & reply buffers of struct floppy_raw_cmd. Remove local to
floppy.c MAX_REPLIES define, as it is now FD_RAW_REPLY_SIZE.
FD_RAW_CMD_FULLSIZE added as we allow command to also fill reply_count
and reply fields.
Link: https://lore.kernel.org/r/20200501134416.72248-4-efremov@linux.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Denis Efremov <efremov@linux.com>
Diffstat (limited to 'include/uapi/linux/fd.h')
-rw-r--r-- | include/uapi/linux/fd.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/uapi/linux/fd.h b/include/uapi/linux/fd.h index 3f6b7be4c096..2e9c2c1c18e6 100644 --- a/include/uapi/linux/fd.h +++ b/include/uapi/linux/fd.h @@ -360,10 +360,20 @@ struct floppy_raw_cmd { int buffer_length; /* length of allocated buffer */ unsigned char rate; + +#define FD_RAW_CMD_SIZE 16 +#define FD_RAW_REPLY_SIZE 16 +#define FD_RAW_CMD_FULLSIZE (FD_RAW_CMD_SIZE + 1 + FD_RAW_REPLY_SIZE) + + /* The command may take up the space initially intended for the reply + * and the reply count. Needed for long 82078 commands such as RESTORE, + * which takes 17 command bytes. + */ + unsigned char cmd_count; - unsigned char cmd[16]; + unsigned char cmd[FD_RAW_CMD_SIZE]; unsigned char reply_count; - unsigned char reply[16]; + unsigned char reply[FD_RAW_REPLY_SIZE]; int track; int resultcode; |