Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
cdrom.c File Reference
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/major.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/cdrom.h>
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/blkpg.h>
#include <linux/init.h>
#include <linux/fcntl.h>
#include <linux/blkdev.h>
#include <linux/times.h>
#include <asm/uaccess.h>

Go to the source code of this file.


#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
#define REVISION   "Revision: 3.20"
#define VERSION   "Id: cdrom.c 3.20 2003/12/17"
#define CD_NOTHING   0x0
#define CD_WARNING   0x1
#define CD_REG_UNREG   0x2
#define CD_DO_IOCTL   0x4
#define CD_OPEN   0x8
#define CD_CLOSE   0x10
#define CD_COUNT_TRACKS   0x20
#define CD_CHANGER   0x40
#define CD_DVD   0x80
#define cdinfo(type, fmt, args...)
#define IOCTL_IN(arg, type, in)
#define IOCTL_OUT(arg, type, out)
#define CDROM_CAN(type)   (cdi->ops->capability & ~cdi->mask & (type))
#define CHECKAUDIO   if ((ret=check_for_audio_disc(cdi, cdo))) return ret
#define CDROM_DEF_TIMEOUT   (7 * HZ)
#define ENSURE(call, bits)   if (cdo->call == NULL) *change_capability &= ~(bits)
#define copy_key(dest, src)   memcpy((dest), (src), sizeof(dvd_key))
#define copy_chal(dest, src)   memcpy((dest), (src), sizeof(dvd_challenge))


 module_param (debug, bool, 0)
 module_param (autoclose, bool, 0)
 module_param (autoeject, bool, 0)
 module_param (lockdoor, bool, 0)
 module_param (check_media_type, bool, 0)
 module_param (mrw_format_restart, bool, 0)
int cdrom_get_last_written (struct cdrom_device_info *, long *)
int register_cdrom (struct cdrom_device_info *cdi)
void unregister_cdrom (struct cdrom_device_info *cdi)
int cdrom_get_media_event (struct cdrom_device_info *cdi, struct media_event_desc *med)
int cdrom_open (struct cdrom_device_info *cdi, struct block_device *bdev, fmode_t mode)
void cdrom_release (struct cdrom_device_info *cdi, fmode_t mode)
int cdrom_number_of_slots (struct cdrom_device_info *cdi)
unsigned int cdrom_check_events (struct cdrom_device_info *cdi, unsigned int clearing)
 EXPORT_SYMBOL (cdrom_check_events)
int cdrom_media_changed (struct cdrom_device_info *cdi)
void init_cdrom_command (struct packet_command *cgc, void *buf, int len, int type)
int cdrom_mode_sense (struct cdrom_device_info *cdi, struct packet_command *cgc, int page_code, int page_control)
int cdrom_mode_select (struct cdrom_device_info *cdi, struct packet_command *cgc)
int cdrom_ioctl (struct cdrom_device_info *cdi, struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
 EXPORT_SYMBOL (cdrom_get_last_written)
 EXPORT_SYMBOL (register_cdrom)
 EXPORT_SYMBOL (unregister_cdrom)
 EXPORT_SYMBOL (cdrom_open)
 EXPORT_SYMBOL (cdrom_release)
 EXPORT_SYMBOL (cdrom_ioctl)
 EXPORT_SYMBOL (cdrom_media_changed)
 EXPORT_SYMBOL (cdrom_number_of_slots)
 EXPORT_SYMBOL (cdrom_mode_select)
 EXPORT_SYMBOL (cdrom_mode_sense)
 EXPORT_SYMBOL (init_cdrom_command)
 EXPORT_SYMBOL (cdrom_get_media_event)
 module_init (cdrom_init)
 module_exit (cdrom_exit)

Macro Definition Documentation

#define CD_CHANGER   0x40

Definition at line 259 of file cdrom.c.

#define CD_CLOSE   0x10

Definition at line 257 of file cdrom.c.

#define CD_COUNT_TRACKS   0x20

Definition at line 258 of file cdrom.c.

#define CD_DO_IOCTL   0x4

Definition at line 255 of file cdrom.c.

#define CD_DVD   0x80

Definition at line 260 of file cdrom.c.

#define CD_NOTHING   0x0

Definition at line 252 of file cdrom.c.

#define CD_OPEN   0x8

Definition at line 256 of file cdrom.c.

#define CD_REG_UNREG   0x2

Definition at line 254 of file cdrom.c.

#define CD_WARNING   0x1

Definition at line 253 of file cdrom.c.

#define cdinfo (   type,
do { \
if ((ERRLOGMASK & type) || debug == 1) \
pr_info(fmt, ##args); \
} while (0)

Definition at line 316 of file cdrom.c.

#define CDROM_CAN (   type)    (cdi->ops->capability & ~cdi->mask & (type))

Definition at line 340 of file cdrom.c.

#define CDROM_DEF_TIMEOUT   (7 * HZ)

Definition at line 349 of file cdrom.c.

#define CHECKAUDIO   if ((ret=check_for_audio_disc(cdi, cdo))) return ret

Definition at line 343 of file cdrom.c.

#define copy_chal (   dest,
)    memcpy((dest), (src), sizeof(dvd_challenge))

Definition at line 1575 of file cdrom.c.

#define copy_key (   dest,
)    memcpy((dest), (src), sizeof(dvd_key))

Definition at line 1574 of file cdrom.c.

#define ENSURE (   call,
)    if (cdo->call == NULL) *change_capability &= ~(bits)

Definition at line 390 of file cdrom.c.


Definition at line 264 of file cdrom.c.

#define IOCTL_IN (   arg,
if (copy_from_user(&(in), (type __user *) (arg), sizeof (in))) \
return -EFAULT;

Definition at line 330 of file cdrom.c.

#define IOCTL_OUT (   arg,
if (copy_to_user((type __user *) (arg), &(out), sizeof (out))) \
return -EFAULT;

Definition at line 334 of file cdrom.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 245 of file cdrom.c.

#define REVISION   "Revision: 3.20"

Definition at line 247 of file cdrom.c.

#define VERSION   "Id: cdrom.c 3.20 2003/12/17"

Definition at line 248 of file cdrom.c.

Function Documentation

unsigned int cdrom_check_events ( struct cdrom_device_info cdi,
unsigned int  clearing 

Definition at line 1420 of file cdrom.c.

int cdrom_get_last_written ( struct cdrom_device_info cdi,
long last_written 

Definition at line 3282 of file cdrom.c.

int cdrom_get_media_event ( struct cdrom_device_info cdi,
struct media_event_desc med 

Definition at line 465 of file cdrom.c.

int cdrom_ioctl ( struct cdrom_device_info cdi,
struct block_device bdev,
fmode_t  mode,
unsigned int  cmd,
unsigned long  arg 

Definition at line 2736 of file cdrom.c.

int cdrom_media_changed ( struct cdrom_device_info cdi)

Definition at line 1467 of file cdrom.c.

int cdrom_mode_select ( struct cdrom_device_info cdi,
struct packet_command cgc 

Definition at line 1990 of file cdrom.c.

int cdrom_mode_sense ( struct cdrom_device_info cdi,
struct packet_command cgc,
int  page_code,
int  page_control 

Definition at line 1974 of file cdrom.c.

int cdrom_number_of_slots ( struct cdrom_device_info cdi)

Definition at line 1289 of file cdrom.c.

int cdrom_open ( struct cdrom_device_info cdi,
struct block_device bdev,
fmode_t  mode 

Definition at line 980 of file cdrom.c.

void cdrom_release ( struct cdrom_device_info cdi,
fmode_t  mode 

Definition at line 1191 of file cdrom.c.

EXPORT_SYMBOL ( cdrom_check_events  )
EXPORT_SYMBOL ( cdrom_get_last_written  )
EXPORT_SYMBOL ( register_cdrom  )
EXPORT_SYMBOL ( unregister_cdrom  )
EXPORT_SYMBOL ( cdrom_open  )
EXPORT_SYMBOL ( cdrom_release  )
EXPORT_SYMBOL ( cdrom_ioctl  )
EXPORT_SYMBOL ( cdrom_media_changed  )
EXPORT_SYMBOL ( cdrom_number_of_slots  )
EXPORT_SYMBOL ( cdrom_mode_select  )
EXPORT_SYMBOL ( cdrom_mode_sense  )
EXPORT_SYMBOL ( init_cdrom_command  )
EXPORT_SYMBOL ( cdrom_get_media_event  )
void init_cdrom_command ( struct packet_command cgc,
void buf,
int  len,
int  type 

Definition at line 1560 of file cdrom.c.

module_exit ( cdrom_exit  )
module_init ( cdrom_init  )
module_param ( debug  ,
bool  ,
module_param ( autoclose  ,
bool  ,
module_param ( autoeject  ,
bool  ,
module_param ( lockdoor  ,
bool  ,
module_param ( check_media_type  ,
bool  ,
module_param ( mrw_format_restart  ,
bool  ,
int register_cdrom ( struct cdrom_device_info cdi)

Definition at line 392 of file cdrom.c.

void unregister_cdrom ( struct cdrom_device_info cdi)

Definition at line 450 of file cdrom.c.