5 #include <linux/export.h>
8 #include <linux/slab.h>
20 unsigned int cmd,
unsigned long arg,
26 for (; (ds = s->
setting); s++) {
57 static int ide_get_identity_ioctl(
ide_drive_t *drive,
unsigned int cmd,
77 ata_id_to_hd_driveid(
id);
87 static int ide_get_nice_ioctl(
ide_drive_t *drive,
unsigned long arg)
95 static int ide_set_nice_ioctl(
ide_drive_t *drive,
unsigned long arg)
117 static int ide_cmd_ioctl(
ide_drive_t *drive,
unsigned long arg)
121 u8 args[4], xfer_rate = 0;
125 if (
NULL == (
void *) arg) {
129 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
139 memset(&cmd, 0,
sizeof(cmd));
168 if (xfer_rate != tf->
nsect) {
185 if (
copy_to_user((
void __user *)(arg + 4), buf, bufsize))
192 static int ide_task_ioctl(
ide_drive_t *drive,
unsigned long arg)
202 memset(&cmd, 0,
sizeof(cmd));
203 memcpy(&cmd.tf.feature, &args[1], 6);
204 cmd.tf.command = args[0];
210 args[0] = cmd.tf.command;
211 memcpy(&args[1], &cmd.tf.feature, 6);
225 rq->cmd_type = REQ_TYPE_SPECIAL;
235 unsigned int cmd,
unsigned long arg)
248 return ide_get_identity_ioctl(drive, cmd, arg);
250 return ide_get_nice_ioctl(drive, arg);
254 return ide_set_nice_ioctl(drive, arg);
255 #ifdef CONFIG_IDE_TASK_IOCTL
266 return ide_cmd_ioctl(drive, arg);
270 return ide_task_ioctl(drive, arg);
274 return generic_drive_reset(drive);