@@ -2982,6 +2982,8 @@ static const char *drive_name(int type, int drive)
2982
2982
return "(null)" ;
2983
2983
}
2984
2984
2985
+ #ifdef CONFIG_BLK_DEV_FD_RAWCMD
2986
+
2985
2987
/* raw commands */
2986
2988
static void raw_cmd_done (int flag )
2987
2989
{
@@ -3181,6 +3183,35 @@ static int raw_cmd_ioctl(int cmd, void __user *param)
3181
3183
return ret ;
3182
3184
}
3183
3185
3186
+ static int floppy_raw_cmd_ioctl (int type , int drive , int cmd ,
3187
+ void __user * param )
3188
+ {
3189
+ int ret ;
3190
+
3191
+ pr_warn_once ("Note: FDRAWCMD is deprecated and will be removed from the kernel in the near future.\n" );
3192
+
3193
+ if (type )
3194
+ return - EINVAL ;
3195
+ if (lock_fdc (drive ))
3196
+ return - EINTR ;
3197
+ set_floppy (drive );
3198
+ ret = raw_cmd_ioctl (cmd , param );
3199
+ if (ret == - EINTR )
3200
+ return - EINTR ;
3201
+ process_fd_request ();
3202
+ return ret ;
3203
+ }
3204
+
3205
+ #else /* CONFIG_BLK_DEV_FD_RAWCMD */
3206
+
3207
+ static int floppy_raw_cmd_ioctl (int type , int drive , int cmd ,
3208
+ void __user * param )
3209
+ {
3210
+ return - EOPNOTSUPP ;
3211
+ }
3212
+
3213
+ #endif
3214
+
3184
3215
static int invalidate_drive (struct block_device * bdev )
3185
3216
{
3186
3217
/* invalidate the buffer track to force a reread */
@@ -3369,7 +3400,6 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
3369
3400
{
3370
3401
int drive = (long )bdev -> bd_disk -> private_data ;
3371
3402
int type = ITYPE (drive_state [drive ].fd_device );
3372
- int i ;
3373
3403
int ret ;
3374
3404
int size ;
3375
3405
union inparam {
@@ -3520,16 +3550,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
3520
3550
outparam = & write_errors [drive ];
3521
3551
break ;
3522
3552
case FDRAWCMD :
3523
- if (type )
3524
- return - EINVAL ;
3525
- if (lock_fdc (drive ))
3526
- return - EINTR ;
3527
- set_floppy (drive );
3528
- i = raw_cmd_ioctl (cmd , (void __user * )param );
3529
- if (i == - EINTR )
3530
- return - EINTR ;
3531
- process_fd_request ();
3532
- return i ;
3553
+ return floppy_raw_cmd_ioctl (type , drive , cmd , (void __user * )param );
3533
3554
case FDTWADDLE :
3534
3555
if (lock_fdc (drive ))
3535
3556
return - EINTR ;
0 commit comments