aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdrom/cm206.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cdrom/cm206.c')
-rw-r--r--drivers/cdrom/cm206.c52
1 files changed, 20 insertions, 32 deletions
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c
index ce127f7ec0f6..f43a988dd413 100644
--- a/drivers/cdrom/cm206.c
+++ b/drivers/cdrom/cm206.c
@@ -218,12 +218,12 @@ static int cm206_base = CM206_BASE;
218static int cm206_irq = CM206_IRQ; 218static int cm206_irq = CM206_IRQ;
219#ifdef MODULE 219#ifdef MODULE
220static int cm206[2] = { 0, 0 }; /* for compatible `insmod' parameter passing */ 220static int cm206[2] = { 0, 0 }; /* for compatible `insmod' parameter passing */
221module_param_array(cm206, int, NULL, 0); /* base,irq or irq,base */
221#endif 222#endif
222 223
223MODULE_PARM(cm206_base, "i"); /* base */ 224module_param(cm206_base, int, 0); /* base */
224MODULE_PARM(cm206_irq, "i"); /* irq */ 225module_param(cm206_irq, int, 0); /* irq */
225MODULE_PARM(cm206, "1-2i"); /* base,irq or irq,base */ 226module_param(auto_probe, bool, 0); /* auto probe base and irq */
226MODULE_PARM(auto_probe, "i"); /* auto probe base and irq */
227MODULE_LICENSE("GPL"); 227MODULE_LICENSE("GPL");
228 228
229#define POLLOOP 100 /* milliseconds */ 229#define POLLOOP 100 /* milliseconds */
@@ -1157,32 +1157,6 @@ static int cm206_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
1157 } 1157 }
1158} 1158}
1159 1159
1160/* Ioctl. These ioctls are specific to the cm206 driver. I have made
1161 some driver statistics accessible through ioctl calls.
1162 */
1163
1164static int cm206_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
1165 unsigned long arg)
1166{
1167 switch (cmd) {
1168#ifdef STATISTICS
1169 case CM206CTL_GET_STAT:
1170 if (arg >= NR_STATS)
1171 return -EINVAL;
1172 else
1173 return cd->stats[arg];
1174 case CM206CTL_GET_LAST_STAT:
1175 if (arg >= NR_STATS)
1176 return -EINVAL;
1177 else
1178 return cd->last_stat[arg];
1179#endif
1180 default:
1181 debug(("Unknown ioctl call 0x%x\n", cmd));
1182 return -EINVAL;
1183 }
1184}
1185
1186static int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr) 1160static int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr)
1187{ 1161{
1188 if (cd != NULL) { 1162 if (cd != NULL) {
@@ -1321,11 +1295,10 @@ static struct cdrom_device_ops cm206_dops = {
1321 .get_mcn = cm206_get_upc, 1295 .get_mcn = cm206_get_upc,
1322 .reset = cm206_reset, 1296 .reset = cm206_reset,
1323 .audio_ioctl = cm206_audio_ioctl, 1297 .audio_ioctl = cm206_audio_ioctl,
1324 .dev_ioctl = cm206_ioctl,
1325 .capability = CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK | 1298 .capability = CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK |
1326 CDC_MULTI_SESSION | CDC_MEDIA_CHANGED | 1299 CDC_MULTI_SESSION | CDC_MEDIA_CHANGED |
1327 CDC_MCN | CDC_PLAY_AUDIO | CDC_SELECT_SPEED | 1300 CDC_MCN | CDC_PLAY_AUDIO | CDC_SELECT_SPEED |
1328 CDC_IOCTLS | CDC_DRIVE_STATUS, 1301 CDC_DRIVE_STATUS,
1329 .n_minors = 1, 1302 .n_minors = 1,
1330}; 1303};
1331 1304
@@ -1350,6 +1323,21 @@ static int cm206_block_release(struct inode *inode, struct file *file)
1350static int cm206_block_ioctl(struct inode *inode, struct file *file, 1323static int cm206_block_ioctl(struct inode *inode, struct file *file,
1351 unsigned cmd, unsigned long arg) 1324 unsigned cmd, unsigned long arg)
1352{ 1325{
1326 switch (cmd) {
1327#ifdef STATISTICS
1328 case CM206CTL_GET_STAT:
1329 if (arg >= NR_STATS)
1330 return -EINVAL;
1331 return cd->stats[arg];
1332 case CM206CTL_GET_LAST_STAT:
1333 if (arg >= NR_STATS)
1334 return -EINVAL;
1335 return cd->last_stat[arg];
1336#endif
1337 default:
1338 break;
1339 }
1340
1353 return cdrom_ioctl(file, &cm206_info, inode, cmd, arg); 1341 return cdrom_ioctl(file, &cm206_info, inode, cmd, arg);
1354} 1342}
1355 1343