}
/* Wait for PA_OK = drive answers with AFL_PA_OK after receiving parameters*/
+#if 0
# define PA_OK pa_ok()
static void pa_ok(void)
{
}
} while (aztIndatum != AFL_PA_OK);
}
+#endif
/* Wait for STEN=Low = handshake signal 'AFL_.._OK available or command executed*/
# define STEN_LOW sten_low()
/* Read the table of contents header, i.e. no. of tracks and start of first
* track
*/
-static int aztGetDiskInfo()
+static int aztGetDiskInfo(void)
{
int limit;
unsigned char test;
struct azt_Toc *tocPtr;
struct cdrom_subchnl subchnl;
struct cdrom_volctrl volctrl;
+ void __user *argp = (void __user *)arg;
#ifdef AZT_DEBUG
printk("aztcd: starting aztcd_ioctl - Command:%x Time: %li\n",
#ifdef AZT_DEBUG
printk("aztcd ioctl MULTISESSION\n");
#endif
- if (copy_from_user
- (&ms, (void *) arg,
+ if (copy_from_user(&ms, argp,
sizeof(struct cdrom_multisession)))
return -EFAULT;
if (ms.addr_format == CDROM_MSF) {
else
return -EINVAL;
ms.xa_flag = DiskInfo.xa;
- if (copy_to_user
- ((void *) arg, &ms,
+ if (copy_to_user(argp, &ms,
sizeof(struct cdrom_multisession)))
return -EFAULT;
#ifdef AZT_DEBUG
return 0;
}
case CDROMPLAYTRKIND: /* Play a track. This currently ignores index. */
- if (copy_from_user(&ti, (void *) arg, sizeof ti))
+ if (copy_from_user(&ti, argp, sizeof ti))
return -EFAULT;
if (ti.cdti_trk0 < DiskInfo.first
|| ti.cdti_trk0 > DiskInfo.last
aztAudioStatus = CDROM_AUDIO_NO_STATUS;
}
*/
- if (copy_from_user(&msf, (void *) arg, sizeof msf))
+ if (copy_from_user(&msf, argp, sizeof msf))
return -EFAULT;
/* convert to bcd */
azt_bin2bcd(&msf.cdmsf_min0);
case CDROMREADTOCHDR: /* Read the table of contents header */
tocHdr.cdth_trk0 = DiskInfo.first;
tocHdr.cdth_trk1 = DiskInfo.last;
- if (copy_to_user((void *) arg, &tocHdr, sizeof tocHdr))
+ if (copy_to_user(argp, &tocHdr, sizeof tocHdr))
return -EFAULT;
break;
case CDROMREADTOCENTRY: /* Read an entry in the table of contents */
- if (copy_from_user(&entry, (void *) arg, sizeof entry))
+ if (copy_from_user(&entry, argp, sizeof entry))
return -EFAULT;
if ((!aztTocUpToDate) || aztDiskChanged)
aztUpdateToc();
} else {
return -EINVAL;
}
- if (copy_to_user((void *) arg, &entry, sizeof entry))
+ if (copy_to_user(argp, &entry, sizeof entry))
return -EFAULT;
break;
case CDROMSUBCHNL: /* Get subchannel info */
if (copy_from_user
- (&subchnl, (void *) arg, sizeof(struct cdrom_subchnl)))
+ (&subchnl, argp, sizeof(struct cdrom_subchnl)))
return -EFAULT;
if (aztGetQChannelInfo(&qInfo) < 0) {
#ifdef AZT_DEBUG
subchnl.cdsc_reladdr.msf.frame =
azt_bcd2bin(qInfo.trackTime.frame);
}
- if (copy_to_user
- ((void *) arg, &subchnl, sizeof(struct cdrom_subchnl)))
+ if (copy_to_user(argp, &subchnl, sizeof(struct cdrom_subchnl)))
return -EFAULT;
break;
case CDROMVOLCTRL: /* Volume control
* With my Aztech CD268-01A volume control does not work, I can only
turn the channels on (any value !=0) or off (value==0). Maybe it
works better with your drive */
- if (copy_from_user
- (&volctrl, (char *) arg, sizeof(volctrl)))
+ if (copy_from_user(&volctrl, argp, sizeof(volctrl)))
return -EFAULT;
azt_Play.start.min = 0x21;
azt_Play.start.sec = 0x84;
case CDROMREADCOOKED: /*read data in mode 1 (2048 Bytes) */
case CDROMREADRAW: /*read data in mode 2 (2336 Bytes) */
{
- if (copy_from_user(&msf, (void *) arg, sizeof msf))
+ if (copy_from_user(&msf, argp, sizeof msf))
return -EFAULT;
/* convert to bcd */
azt_bin2bcd(&msf.cdmsf_min0);
if (DiskInfo.xa) {
return -1; /*XA Disks can't be read raw */
} else {
- if (sendAztCmd
- (ACMD_PLAY_READ_RAW,
- &azt_Play))
+ if (sendAztCmd(ACMD_PLAY_READ_RAW, &azt_Play))
return -1;
DTEN_LOW;
- insb(DATA_PORT, buf,
- CD_FRAMESIZE_RAW);
- if (copy_to_user
- ((void *) arg, &buf,
- CD_FRAMESIZE_RAW))
+ insb(DATA_PORT, buf, CD_FRAMESIZE_RAW);
+ if (copy_to_user(argp, &buf, CD_FRAMESIZE_RAW))
return -EFAULT;
}
} else
return -1;
DTEN_LOW;
insb(DATA_PORT, buf, CD_FRAMESIZE);
- if (copy_to_user
- ((void *) arg, &buf, CD_FRAMESIZE))
+ if (copy_to_user(argp, &buf, CD_FRAMESIZE))
return -EFAULT;
}
}
break;
case CDROMSEEK: /*seek msf address */
- if (copy_from_user(&msf, (void *) arg, sizeof msf))
+ if (copy_from_user(&msf, argp, sizeof msf))
return -EFAULT;
/* convert to bcd */
azt_bin2bcd(&msf.cdmsf_min0);