hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/uapi/linux/fd.h
....@@ -172,7 +172,10 @@
172172 * used in succession to try to read the disk. If the FDC cannot lock onto
173173 * the disk, the next format is tried. This uses the variable 'probing'.
174174 */
175
- short autodetect[8]; /* autodetected formats */
175
+
176
+#define FD_AUTODETECT_SIZE 8
177
+
178
+ short autodetect[FD_AUTODETECT_SIZE]; /* autodetected formats */
176179
177180 int checkfreq; /* how often should the drive be checked for disk
178181 * changes */
....@@ -357,10 +360,25 @@
357360 int buffer_length; /* length of allocated buffer */
358361
359362 unsigned char rate;
363
+
364
+#define FD_RAW_CMD_SIZE 16
365
+#define FD_RAW_REPLY_SIZE 16
366
+#define FD_RAW_CMD_FULLSIZE (FD_RAW_CMD_SIZE + 1 + FD_RAW_REPLY_SIZE)
367
+
368
+ /* The command may take up the space initially intended for the reply
369
+ * and the reply count. Needed for long 82078 commands such as RESTORE,
370
+ * which takes 17 command bytes.
371
+ */
372
+
360373 unsigned char cmd_count;
361
- unsigned char cmd[16];
362
- unsigned char reply_count;
363
- unsigned char reply[16];
374
+ union {
375
+ struct {
376
+ unsigned char cmd[FD_RAW_CMD_SIZE];
377
+ unsigned char reply_count;
378
+ unsigned char reply[FD_RAW_REPLY_SIZE];
379
+ };
380
+ unsigned char fullcmd[FD_RAW_CMD_FULLSIZE];
381
+ };
364382 int track;
365383 int resultcode;
366384