Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

gscd.c File Reference

#include <linux/module.h>
#include <linux/malloc.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/kernel.h>
#include <linux/cdrom.h>
#include <linux/ioport.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/init.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/blk.h>
#include "gscd.h"

Include dependency graph for gscd.c:

Go to the source code of this file.

Defines

#define GSCD_VERSION   "0.4a Oliver Raupach <raupach@nwfs1.rz.fh-hannover.de>"
#define NO_GSCD_DEBUG
#define NO_IOCTL_DEBUG
#define NO_MODULE_DEBUG
#define NO_FUTURE_WORK
#define MAJOR_NR   GOLDSTAR_CDROM_MAJOR
#define gscd_port   gscd

Functions

 MODULE_PARM (gscd,"h")
static void gscd_transfer (void)
static void gscd_read_cmd (void)
static void gscd_hsg2msf (long hsg, struct msf *msf)
static void gscd_bin2bcd (unsigned char *p)
static void do_gscd_request (void)
static int gscd_ioctl (struct inode *, struct file *, unsigned int, unsigned long)
static int gscd_open (struct inode *, struct file *)
static int gscd_release (struct inode *, struct file *)
static int check_gscd_med_chg (kdev_t)
static void cc_Reset (void)
static int wait_drv_ready (void)
static int find_drives (void)
static void cmd_out (int, char *, char *, int)
static void cmd_status (void)
static void cc_Ident (char *)
static void cc_SetSpeed (void)
static void init_cd_drive (int)
static int get_status (void)
static void clear_Audio (void)
static void cc_invalidate (void)
static int my_gscd_init (void)
static void cmd_info_in (char *, int)
static void cmd_end (void)
static void cmd_read_b (char *, int, int)
static void cmd_read_w (char *, int, int)
static int cmd_unit_alive (void)
static void cmd_write_cmd (char *)
 __initfunc (void gscd_setup(char *str, int *ints))
 __initfunc (int find_drives(void))
 __initfunc (void init_cd_drive(int num))

Variables

static int gscd_blocksizes [1] = {512}
static int gscdPresent = 0
static unsigned char gscd_buf [2048]
static int gscd_bn = -1
static short gscd_port = GSCD_BASE_ADDR
static int curr_drv_state
static int drv_states [] = {0,0,0,0,0,0,0,0}
static int drv_mode
static int disk_state
static int speed
static int ndrives
static unsigned char drv_num_read
static unsigned char f_dsk_valid
static unsigned char current_drive
static unsigned char f_drv_ok
static char f_AudioPlay
static char f_AudioPause
static int AudioStart_m
static int AudioStart_f
static int AudioEnd_m
static int AudioEnd_f
static struct file_operations gscd_fops


Define Documentation

#define gscd_port   gscd
 

Definition at line 66 of file gscd.c.

Referenced by __initfunc().

#define GSCD_VERSION   "0.4a Oliver Raupach <raupach@nwfs1.rz.fh-hannover.de>"
 

Definition at line 1 of file gscd.c.

#define MAJOR_NR   GOLDSTAR_CDROM_MAJOR
 

Definition at line 64 of file gscd.c.

#define NO_FUTURE_WORK
 

Definition at line 41 of file gscd.c.

#define NO_GSCD_DEBUG
 

Definition at line 38 of file gscd.c.

#define NO_IOCTL_DEBUG
 

Definition at line 39 of file gscd.c.

#define NO_MODULE_DEBUG
 

Definition at line 40 of file gscd.c.


Function Documentation

__initfunc void   init_cd_drive(int num)  ) 
 

Definition at line 905 of file gscd.c.

References cc_Ident(), cc_SetSpeed(), i, and printk.

Here is the call graph for this function:

__initfunc int   find_drives(void)  ) 
 

Definition at line 854 of file gscd.c.

References cmd_status(), curr_drv_state, disk_state, drv_states, i, init_cd_drive(), ndrives, printk, speed, ST_INVALID, ST_x01, ST_x04, and ST_x08.

Here is the call graph for this function:

__initfunc void   gscd_setup(char *str, int *ints)  ) 
 

Definition at line 197 of file gscd.c.

References gscd_port.

void cc_Ident char *   )  [static]
 

Definition at line 481 of file gscd.c.

References CMD_IDENT, cmd_out(), and TYPE_INFO.

Referenced by __initfunc().

Here is the call graph for this function:

void cc_invalidate void   )  [static]
 

Definition at line 435 of file gscd.c.

References clear_Audio(), current_drive, drv_num_read, f_drv_ok, and f_dsk_valid.

Referenced by get_status().

Here is the call graph for this function:

void cc_Reset void   )  [static]
 

Definition at line 502 of file gscd.c.

References cmd_out(), CMD_RESET, dummy, and TYPE_INFO.

Here is the call graph for this function:

void cc_SetSpeed void   )  [static]
 

Definition at line 489 of file gscd.c.

References cmd_out(), CMD_SETSPEED, dummy, speed, and TYPE_INFO.

Referenced by __initfunc(), sbpcd_dev_ioctl(), sbpcd_select_speed(), and SetSpeed().

Here is the call graph for this function:

static int check_gscd_med_chg kdev_t   )  [static]
 

Definition at line 176 of file gscd.c.

References MINOR, printk, and target.

void clear_Audio void   )  [static]
 

Definition at line 446 of file gscd.c.

References AudioEnd_f, AudioEnd_m, AudioStart_f, AudioStart_m, f_AudioPause, and f_AudioPlay.

Referenced by cc_invalidate().

static void cmd_end void   )  [static]
 

Definition at line 782 of file gscd.c.

References disk_state, drv_mode, GSCDPORT, inb, printk, result, and wait_drv_ready().

Referenced by cmd_info_in(), cmd_read_b(), and cmd_read_w().

Here is the call graph for this function:

static void cmd_info_in char *  ,
int 
[static]
 

Definition at line 706 of file gscd.c.

References cmd_end(), GSCDPORT, inb, printk, read, result, and wait_drv_ready().

Referenced by cmd_out().

Here is the call graph for this function:

void cmd_out int  ,
char *  ,
char *  ,
int 
[static]
 

Definition at line 525 of file gscd.c.

References CD_FRAMESIZE, cmd_info_in(), cmd_read_b(), cmd_read_w(), cmd_unit_alive(), cmd_write_cmd(), curr_drv_state, disk_state, drv_mode, dummy, GSCDPORT, i, inb, outb, printk, result, ST_INVALID, ST_x04, ST_x08, TYPE_DATA, wait_drv_ready(), x04, x06, x08, and x09.

Referenced by __initfunc(), cc_CheckMultiSession(), cc_CloseTray(), cc_DriveReset(), cc_GetVolume(), cc_Ident(), cc_LockDoor(), cc_ModeSelect(), cc_ModeSense(), cc_Pause_Resume(), cc_PlayAudio(), cc_ReadCapacity(), cc_ReadError(), cc_ReadPacket(), cc_ReadSubQ(), cc_ReadTocDescr(), cc_ReadTocEntry(), cc_ReadUPC(), cc_Reset(), cc_Seek(), cc_SetSpeed(), cc_SetVolume(), cc_SpinDown(), cc_SpinUp(), cmd_status(), GetStatus(), gscd_ioctl(), gscd_read_cmd(), sbp_read_cmd(), sbpcd_dev_ioctl(), and sbpcd_get_mcn().

Here is the call graph for this function:

static void cmd_read_b char *  ,
int  ,
int 
[static]
 

Definition at line 740 of file gscd.c.

References cmd_end(), GSCDPORT, i, inb, printk, result, and wait_drv_ready().

Referenced by cmd_out().

Here is the call graph for this function:

static void cmd_read_w char *  ,
int  ,
int 
[static]
 

Definition at line 817 of file gscd.c.

References cmd_end(), GSCDPORT, i, inw, printk, result, and wait_drv_ready().

Referenced by cmd_out().

Here is the call graph for this function:

void cmd_status void   )  [static]
 

Definition at line 512 of file gscd.c.

References cmd_out(), CMD_STATUS, disk_state, dummy, printk, and TYPE_INFO.

Referenced by __initfunc(), get_status(), gscd_ioctl(), and gscd_read_cmd().

Here is the call graph for this function:

static int cmd_unit_alive void   )  [static]
 

Definition at line 682 of file gscd.c.

References curr_drv_state, GSCDPORT, outb, printk, result, wait_drv_ready(), and x08.

Referenced by cmd_out().

Here is the call graph for this function:

static void cmd_write_cmd char *   )  [static]
 

Definition at line 661 of file gscd.c.

References GSCDPORT, i, j, outb, and printk.

Referenced by cmd_out().

static void do_gscd_request void   )  [static]
 

Definition at line 263 of file gscd.c.

References CURRENT, dev, gscd_read_cmd(), gscd_transfer(), MINOR, NULL, printk, READ, and RQ_INACTIVE.

Referenced by gscd_read_cmd().

Here is the call graph for this function:

static int find_drives void   )  [static]
 

int get_status void   )  [static]
 

Definition at line 416 of file gscd.c.

References cc_invalidate(), cmd_status(), disk_state, ST_INVALID, ST_x01, ST_x04, ST_x08, and status.

Referenced by __initfunc(), ftape_get_status(), get_process_array(), gscd_open(), inquiry(), read_hw_addr(), receive_pcb(), receivepkt(), sendpkt(), start_dma(), stop(), testpkt(), and tp_sense().

Here is the call graph for this function:

static void gscd_bin2bcd unsigned char *  p  )  [static]
 

Definition at line 1090 of file gscd.c.

References t, and u.

Referenced by gscd_hsg2msf().

static void gscd_hsg2msf long  hsg,
struct msf msf
[static]
 

Definition at line 1076 of file gscd.c.

References CD_FRAMES, CD_MSF_OFFSET, CD_SECS, gscd_bin2bcd(), and min.

Referenced by gscd_read_cmd().

Here is the call graph for this function:

static int gscd_ioctl struct inode *  ,
struct file ,
unsigned  int,
unsigned  long
[static]
 

Definition at line 206 of file gscd.c.

References CDROMEJECT, CDROMRESUME, CDROMSTART, cmd_out(), cmd_status(), CMD_TRAY_CTL, dummy, EINVAL, and TYPE_INFO.

Here is the call graph for this function:

static int gscd_open struct inode *  ,
struct file
[static]
 

Definition at line 366 of file gscd.c.

References disk_state, ENXIO, get_status(), gscdPresent, MOD_DEC_USE_COUNT, MOD_INC_USE_COUNT, printk, st, ST_DOOR_OPEN, and ST_NO_DISK.

Here is the call graph for this function:

static void gscd_read_cmd void   )  [static]
 

Definition at line 317 of file gscd.c.

References cmd_out(), CMD_READ, cmd_status(), CURRENT, disk_state, do_gscd_request(), msf::frame, gscd_bn, gscd_buf, gscd_hsg2msf(), gscd_transfer(), msf::min, printk, msf::sec, SET_TIMER, ST_DOOR_OPEN, ST_INVALID, ST_NO_DISK, gscd_Play_msf::start, and TYPE_DATA.

Referenced by do_gscd_request().

Here is the call graph for this function:

static int gscd_release struct inode *  ,
struct file
[static]
 

Definition at line 400 of file gscd.c.

References gscd_bn, MOD_DEC_USE_COUNT, printk, and sync_dev().

Here is the call graph for this function:

static void gscd_transfer void   )  [static]
 

Definition at line 244 of file gscd.c.

References CURRENT, gscd_bn, gscd_buf, and memcpy.

Referenced by do_gscd_request(), and gscd_read_cmd().

static void init_cd_drive int   )  [static]
 

Referenced by __initfunc().

MODULE_PARM gscd  ,
"h" 
 

static int my_gscd_init void   )  [static]
 

int wait_drv_ready void   )  [static]
 

Definition at line 462 of file gscd.c.

References found, GSCDPORT, inb, printk, and read.

Referenced by cmd_end(), cmd_info_in(), cmd_out(), cmd_read_b(), cmd_read_w(), and cmd_unit_alive().


Variable Documentation

int AudioEnd_f [static]
 

Definition at line 152 of file gscd.c.

Referenced by clear_Audio().

int AudioEnd_m [static]
 

Definition at line 151 of file gscd.c.

Referenced by clear_Audio().

int AudioStart_f [static]
 

Definition at line 150 of file gscd.c.

Referenced by clear_Audio().

int AudioStart_m [static]
 

Definition at line 149 of file gscd.c.

Referenced by clear_Audio().

int curr_drv_state [static]
 

Definition at line 134 of file gscd.c.

Referenced by __initfunc(), cmd_out(), and cmd_unit_alive().

unsigned char current_drive [static]
 

Definition at line 143 of file gscd.c.

int disk_state [static]
 

Definition at line 137 of file gscd.c.

Referenced by __initfunc(), cmd_end(), cmd_out(), cmd_status(), get_status(), gscd_open(), and gscd_read_cmd().

int drv_mode [static]
 

Definition at line 136 of file gscd.c.

Referenced by cmd_end(), and cmd_out().

unsigned char drv_num_read [static]
 

Definition at line 141 of file gscd.c.

Referenced by cc_invalidate().

int drv_states[] = {0,0,0,0,0,0,0,0} [static]
 

Definition at line 135 of file gscd.c.

Referenced by __initfunc().

char f_AudioPause [static]
 

Definition at line 148 of file gscd.c.

Referenced by clear_Audio().

char f_AudioPlay [static]
 

Definition at line 147 of file gscd.c.

Referenced by clear_Audio().

unsigned char f_drv_ok [static]
 

Definition at line 144 of file gscd.c.

Referenced by cc_invalidate().

unsigned char f_dsk_valid [static]
 

Definition at line 142 of file gscd.c.

Referenced by cc_invalidate().

int gscd_blocksizes[1] = {512} [static]
 

Definition at line 69 of file gscd.c.

int gscd_bn = -1 [static]
 

Definition at line 74 of file gscd.c.

Referenced by gscd_read_cmd(), gscd_release(), and gscd_transfer().

unsigned char gscd_buf[2048] [static]
 

Definition at line 73 of file gscd.c.

Referenced by gscd_read_cmd(), and gscd_transfer().

struct file_operations gscd_fops [static]
 

Initial value:

 {
        NULL,                   
        block_read,             
        block_write,            
        NULL,                   
        NULL,                   
        gscd_ioctl,             
        NULL,                   
        gscd_open,              
        NULL,                   
        gscd_release,           
        NULL,                   
        NULL,                   
        check_gscd_med_chg,     
        NULL                    
}

Definition at line 155 of file gscd.c.

short gscd_port = GSCD_BASE_ADDR [static]
 

Definition at line 75 of file gscd.c.

int gscdPresent = 0 [static]
 

Definition at line 71 of file gscd.c.

Referenced by gscd_open().

int ndrives [static]
 

Definition at line 139 of file gscd.c.

Referenced by __initfunc().

int speed [static]
 

Definition at line 138 of file gscd.c.

Referenced by __initfunc(), __irport_change_speed(), ace_ioctl(), actisys_change_speed(), ad1848_set_speed(), arch_set_dma_speed(), cc_SetSpeed(), DC390_init(), esi_change_speed(), ess_calc_div(), ess_speed(), ftape_calc_timeouts(), gemini_init_l2(), girbil_change_speed(), h8_get_cpu_speed(), happy_meal_poll_start(), idetape_setup(), ircc_hard_xmit(), irda_setup(), irlap_wait_min_turn_around(), irport_hard_xmit(), irtty_change_speed(), irtty_hard_xmit(), js_sw_probe(), litelink_change_speed(), nsc_ircc_hard_xmit_fir(), nsc_ircc_hard_xmit_sir(), play_next_pcm_block(), sc_ioctl(), SetSpeed(), sis900_check_mode(), sis900_timer(), tekram_change_speed(), toshoboe_hard_xmit(), vac_uart_mode_fixup(), w83977af_hard_xmit(), waveartist_get_speed(), waveartist_prepare_for_input(), waveartist_prepare_for_output(), and xpdsl_init().