⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sbpcd.h

📁 嵌入式ARM的一些源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/*
 * sbpcd.h   Specify interface address and interface type here.
 */

/*
 * Attention! This file contains user-serviceable parts!
 * I recommend to make use of it...
 * If you feel helpless, look into linux/Documentation/cdrom/sbpcd
 * (good idea anyway, at least before mailing me).
 *
 * The definitions for the first controller can get overridden by
 * the kernel command line ("lilo boot option").
 * Examples:
 *                                 sbpcd=0x300,LaserMate
 *                             or
 *                                 sbpcd=0x230,SoundBlaster
 *                             or
 *                                 sbpcd=0x338,SoundScape
 *                             or
 *                                 sbpcd=0x2C0,Teac16bit
 *
 * If sbpcd gets used as a module, you can load it with
 *     insmod sbpcd.o sbpcd=0x300,0
 * or
 *     insmod sbpcd.o sbpcd=0x230,1
 * or
 *     insmod sbpcd.o sbpcd=0x338,2
 * or
 *     insmod sbpcd.o sbpcd=0x2C0,3
 * respective to override the configured address and type.
 */

/*
 * define your CDROM port base address as CDROM_PORT
 * and specify the type of your interface card as SBPRO.
 *
 * address:
 * ========
 * SBPRO type addresses typically are 0x0230 (=0x220+0x10), 0x0250, ...
 * LASERMATE type (CI-101P, WDH-7001C) addresses typically are 0x0300, ...
 * SOUNDSCAPE addresses are from the LASERMATE type and range. You have to
 * specify the REAL address here, not the configuration port address. Look
 * at the CDROM driver's invoking line within your DOS CONFIG.SYS, or let
 * sbpcd auto-probe, if you are not firm with the address.
 * There are some soundcards on the market with 0x0630, 0x0650, ...; their
 * type is not obvious (both types are possible).
 *
 * example: if your SBPRO audio address is 0x220, specify 0x230 and SBPRO 1.
 *          if your soundcard has its CDROM port above 0x300, specify
 *          that address and try SBPRO 0 first.
 *          if your SoundScape configuration port is at 0x330, specify
 *          0x338 and SBPRO 2.
 *
 * interface type:
 * ===============
 * set SBPRO to 1 for "true" SoundBlaster card
 * set SBPRO to 0 for "compatible" soundcards and
 *                for "poor" (no sound) interface cards.
 * set SBPRO to 2 for Ensonic SoundScape or SPEA Media FX cards
 * set SBPRO to 3 for Teac 16bit interface cards
 *
 * Almost all "compatible" sound boards need to set SBPRO to 0.
 * If SBPRO is set wrong, the drives will get found - but any
 * data access will give errors (audio access will work).
 * The "OmniCD" no-sound interface card from CreativeLabs and most Teac
 * interface cards need SBPRO 1.
 *
 * sound base:
 * ===========
 * The SOUND_BASE definition tells if we should try to turn the CD sound
 * channels on. It will only be of use regarding soundcards with a SbPro
 * compatible mixer.
 *
 * Example: #define SOUND_BASE 0x220 enables the sound card's CD channels
 *          #define SOUND_BASE 0     leaves the soundcard untouched
 */
#if !(SBPCD_ISSUE-1)     /* first (or if you have only one) interface board: */
#define CDROM_PORT 0x340 /* <-----------<< port address                      */
#define SBPRO      0     /* <-----------<< interface type                    */
#define MAX_DRIVES 4     /* set to 1 if the card does not use "drive select" */
#define SOUND_BASE 0x220 /* <-----------<< sound address of this card or 0   */
#endif
#if !(SBPCD_ISSUE-2)     /* ==================== second interface board: === */
#define CDROM_PORT 0x344 /* <-----------<< port address                      */
#define SBPRO      0     /* <-----------<< interface type                    */
#define MAX_DRIVES 4     /* set to 1 if the card does not use "drive select" */
#define SOUND_BASE 0x000 /* <-----------<< sound address of this card or 0   */
#endif
#if !(SBPCD_ISSUE-3)     /* ===================== third interface board: === */
#define CDROM_PORT 0x630 /* <-----------<< port address                      */
#define SBPRO      1     /* <-----------<< interface type                    */
#define MAX_DRIVES 4     /* set to 1 if the card does not use "drive select" */
#define SOUND_BASE 0x240 /* <-----------<< sound address of this card or 0   */
#endif
#if !(SBPCD_ISSUE-4)     /* ==================== fourth interface board: === */
#define CDROM_PORT 0x634 /* <-----------<< port address                      */
#define SBPRO      0     /* <-----------<< interface type                    */
#define MAX_DRIVES 4     /* set to 1 if the card does not use "drive select" */
#define SOUND_BASE 0x000 /* <-----------<< sound address of this card or 0   */
#endif

/*
 * some more or less user dependent definitions - service them!
 */

/* Set this to 0 once you have configured your interface definitions right. */
#define DISTRIBUTION 1

/*
 * Time to wait after giving a message.
 * This gets important if you enable non-standard DBG_xxx flags.
 * You will see what happens if you omit the pause or make it
 * too short. Be warned!
 */
#define KLOGD_PAUSE 1

/* tray control: eject tray if no disk is in */
#if DISTRIBUTION
#define JUKEBOX 0
#else
#define JUKEBOX 1
#endif DISTRIBUTION

/* tray control: eject tray after last use */
#if DISTRIBUTION
#define EJECT 0
#else
#define EJECT 1
#endif DISTRIBUTION

/* max. number of audio frames to read with one     */
/* request (allocates n* 2352 bytes kernel memory!) */
/* may be freely adjusted, f.e. 75 (= 1 sec.), at   */
/* runtime by use of the CDROMAUDIOBUFSIZ ioctl.    */
#define READ_AUDIO 0

/* Optimizations for the Teac CD-55A drive read performance.
 * SBP_TEAC_SPEED can be changed here, or one can set the 
 * variable "teac" when loading as a module.
 * Valid settings are:
 *   0 - very slow - the recommended "DISTRIBUTION 1" setup.
 *   1 - 2x performance with little overhead. No busy waiting.
 *   2 - 4x performance with 5ms overhead per read. Busy wait.
 *
 * Setting SBP_TEAC_SPEED or the variable 'teac' to anything
 * other than 0 may cause problems. If you run into them, first
 * change SBP_TEAC_SPEED back to 0 and see if your drive responds
 * normally. If yes, you are "allowed" to report your case - to help
 * me with the driver, not to solve your hassle. Don磘 mail if you
 * simply are stuck into your own "tuning" experiments, you know?
 */
#define SBP_TEAC_SPEED 1

/*==========================================================================*/
/*==========================================================================*/
/*
 * nothing to change below here if you are not fully aware what you're doing
 */
#ifndef _LINUX_SBPCD_H

#define _LINUX_SBPCD_H
/*==========================================================================*/
/*==========================================================================*/
/*
 * driver's own read_ahead, data mode
 */
#define SBP_BUFFER_FRAMES 8 

#define LONG_TIMING 0 /* test against timeouts with "gold" CDs on CR-521 */
#undef  FUTURE
#undef SAFE_MIXED

#define TEST_UPC 0
#define SPEA_TEST 0
#define TEST_STI 0
#define OLD_BUSY 0
#undef PATH_CHECK
#ifndef SOUND_BASE
#define SOUND_BASE 0
#endif
#if DISTRIBUTION
#undef SBP_TEAC_SPEED
#define SBP_TEAC_SPEED 0
#endif
/*==========================================================================*/
/*
 * DDI interface definitions
 * "invented" by Fred N. van Kempen..
 */
#define DDIOCSDBG	0x9000

/*==========================================================================*/
/*
 * "private" IOCTL functions
 */
#define CDROMAUDIOBUFSIZ	0x5382 /* set the audio buffer size */

/*==========================================================================*/
/*
 * Debug output levels
 */
#define DBG_INF	1	/* necessary information */
#define DBG_BSZ	2	/* BLOCK_SIZE trace */
#define DBG_REA	3	/* READ status trace */
#define DBG_CHK	4	/* MEDIA CHECK trace */
#define DBG_TIM	5	/* datarate timer test */
#define DBG_INI	6	/* initialization trace */
#define DBG_TOC	7	/* tell TocEntry values */
#define DBG_IOC	8	/* ioctl trace */
#define DBG_STA	9	/* ResponseStatus() trace */
#define DBG_ERR	10	/* cc_ReadError() trace */
#define DBG_CMD	11	/* cmd_out() trace */
#define DBG_WRN	12	/* give explanation before auto-probing */
#define DBG_MUL	13	/* multi session code test */
#define DBG_IDX	14	/* test code for drive_id !=0 */
#define DBG_IOX	15	/* some special information */
#define DBG_DID	16	/* drive ID test */
#define DBG_RES	17	/* drive reset info */
#define DBG_SPI	18	/* SpinUp test */
#define DBG_IOS	19	/* ioctl trace: subchannel functions */
#define DBG_IO2	20	/* ioctl trace: general */
#define DBG_UPC	21	/* show UPC information */
#define DBG_XA1	22	/* XA mode debugging */
#define DBG_LCK	23	/* door (un)lock info */
#define DBG_SQ1	24	/* dump SubQ frame */
#define DBG_AUD	25	/* READ AUDIO debugging */
#define DBG_SEQ	26	/* Sequoia interface configuration trace */
#define DBG_LCS	27	/* Longshine LCS-7260 debugging trace */
#define DBG_CD2	28	/* MKE/Funai CD200 debugging trace */
#define DBG_TEA	29	/* TEAC CD-55A debugging trace */
#define DBG_ECS	30	/* ECS-AT (Vertos 100) debugging trace */
#define DBG_000	31	/* unnecessary information */

/*==========================================================================*/
/*==========================================================================*/

/*
 * bits of flags_cmd_out:
 */
#define f_respo3		0x100
#define f_putcmd		0x80
#define f_respo2		0x40
#define f_lopsta		0x20
#define f_getsta		0x10
#define f_ResponseStatus	0x08
#define f_obey_p_check		0x04
#define f_bit1			0x02
#define f_wait_if_busy		0x01

/*
 * diskstate_flags:
 */
#define x80_bit			0x80
#define upc_bit			0x40
#define volume_bit		0x20
#define toc_bit			0x10
#define multisession_bit	0x08
#define cd_size_bit		0x04
#define subq_bit		0x02
#define frame_size_bit		0x01

/*
 * disk states (bits of diskstate_flags):
 */
#define upc_valid		(D_S[d].diskstate_flags&upc_bit)
#define volume_valid		(D_S[d].diskstate_flags&volume_bit)
#define toc_valid		(D_S[d].diskstate_flags&toc_bit)
#define cd_size_valid		(D_S[d].diskstate_flags&cd_size_bit)
#define subq_valid		(D_S[d].diskstate_flags&subq_bit)
#define frame_size_valid	(D_S[d].diskstate_flags&frame_size_bit)

/*
 * the status_bits variable
 */
#define p_success	0x100
#define p_door_closed	0x80
#define p_caddy_in	0x40
#define p_spinning	0x20
#define p_check		0x10
#define p_busy_new	0x08
#define p_door_locked	0x04
#define p_disk_ok	0x01

/*
 * LCS-7260 special status result bits:
 */
#define p_lcs_door_locked	0x02
#define p_lcs_door_closed	0x01 /* probably disk_in */

/*
 * CR-52x special status result bits:
 */
#define p_caddin_old	0x40
#define p_success_old	0x08
#define p_busy_old	0x04
#define p_bit_1		0x02	/* hopefully unused now */

/*
 * "generation specific" defs of the status result bits:
 */
#define p0_door_closed	0x80
#define p0_caddy_in	0x40
#define p0_spinning	0x20
#define p0_check	0x10
#define p0_success	0x08 /* unused */
#define p0_busy		0x04
#define p0_bit_1	0x02 /* unused */
#define p0_disk_ok	0x01

#define pL_disk_in	0x40
#define pL_spinning	0x20
#define pL_check	0x10
#define pL_success	0x08 /* unused ?? */
#define pL_busy		0x04
#define pL_door_locked	0x02
#define pL_door_closed	0x01

#define pV_door_closed	0x40
#define pV_spinning	0x20
#define pV_check	0x10
#define pV_success	0x08
#define pV_busy		0x04
#define pV_door_locked	0x02
#define pV_disk_ok	0x01

#define p1_door_closed	0x80
#define p1_disk_in	0x40
#define p1_spinning	0x20
#define p1_check	0x10
#define p1_busy		0x08
#define p1_door_locked	0x04
#define p1_bit_1	0x02 /* unused */
#define p1_disk_ok	0x01

#define p2_disk_ok	0x80
#define p2_door_locked	0x40
#define p2_spinning	0x20
#define p2_busy2	0x10
#define p2_busy1	0x08
#define p2_door_closed	0x04
#define p2_disk_in	0x02
#define p2_check	0x01

/*
 * used drive states:
 */
#define st_door_closed	(D_S[d].status_bits&p_door_closed)
#define st_caddy_in	(D_S[d].status_bits&p_caddy_in)
#define st_spinning	(D_S[d].status_bits&p_spinning)
#define st_check	(D_S[d].status_bits&p_check)
#define st_busy		(D_S[d].status_bits&p_busy_new)
#define st_door_locked	(D_S[d].status_bits&p_door_locked)
#define st_diskok	(D_S[d].status_bits&p_disk_ok)

/*
 * bits of the CDi_status register:
 */
#define s_not_result_ready	0x04 /* 0: "result ready" */
#define s_not_data_ready	0x02 /* 0: "data ready"   */
#define s_attention		0x01 /* 1: "attention required" */
/*
 * usable as:
 */
#define DRV_ATTN	((inb(CDi_status)&s_attention)!=0)
#define DATA_READY	((inb(CDi_status)&s_not_data_ready)==0)
#define RESULT_READY	((inb(CDi_status)&s_not_result_ready)==0)

/*
 * drive families and types (firmware versions):
 */
#define drv_fam0	0x0100		/* CR-52x family */
#define drv_199		(drv_fam0+0x01)	/* <200 */
#define drv_200		(drv_fam0+0x02)	/* <201 */
#define drv_201		(drv_fam0+0x03)	/* <210 */
#define drv_210		(drv_fam0+0x04)	/* <211 */
#define drv_211		(drv_fam0+0x05)	/* <300 */
#define drv_300		(drv_fam0+0x06)	/* >=300 */

#define drv_fam1	0x0200		/* CR-56x family */
#define drv_099		(drv_fam1+0x01)	/* <100 */
#define drv_100		(drv_fam1+0x02)	/* >=100, only 1.02 and 5.00 known */

#define drv_fam2	0x0400		/* CD200 family */

#define drv_famT	0x0800		/* TEAC CD-55A */

#define drv_famL	0x1000		/* Longshine family */
#define drv_260		(drv_famL+0x01)	/* LCS-7260 */
#define drv_e1		(drv_famL+0x01)	/* LCS-7260, firmware "A E1" */
#define drv_f4		(drv_famL+0x02)	/* LCS-7260, firmware "A4F4" */

#define drv_famV	0x2000		/* ECS-AT (vertos-100) family */
#define drv_at		(drv_famV+0x01)	/* ECS-AT, firmware "1.00" */

#define fam0_drive	(D_S[d].drv_type&drv_fam0)
#define famL_drive	(D_S[d].drv_type&drv_famL)
#define famV_drive	(D_S[d].drv_type&drv_famV)
#define fam1_drive	(D_S[d].drv_type&drv_fam1)
#define fam2_drive	(D_S[d].drv_type&drv_fam2)
#define famT_drive	(D_S[d].drv_type&drv_famT)
#define fam0L_drive	(D_S[d].drv_type&(drv_fam0|drv_famL))
#define fam0V_drive	(D_S[d].drv_type&(drv_fam0|drv_famV))
#define famLV_drive	(D_S[d].drv_type&(drv_famL|drv_famV))
#define fam0LV_drive	(D_S[d].drv_type&(drv_fam0|drv_famL|drv_famV))
#define fam1L_drive	(D_S[d].drv_type&(drv_fam1|drv_famL))
#define fam1V_drive	(D_S[d].drv_type&(drv_fam1|drv_famV))
#define fam1LV_drive	(D_S[d].drv_type&(drv_fam1|drv_famL|drv_famV))
#define fam01_drive	(D_S[d].drv_type&(drv_fam0|drv_fam1))
#define fam12_drive	(D_S[d].drv_type&(drv_fam1|drv_fam2))
#define fam2T_drive	(D_S[d].drv_type&(drv_fam2|drv_famT))

/*
 * audio states:
 */
#define audio_playing	2
#define audio_pausing	1

/*
 * drv_pattern, drv_options:
 */
#define speed_auto	0x80
#define speed_300	0x40
#define speed_150	0x20
#define audio_mono	0x04

/*
 * values of cmd_type (0 else):
 */
#define READ_M1	0x01	/* "data mode 1": 2048 bytes per frame */
#define READ_M2	0x02	/* "data mode 2": 12+2048+280 bytes per frame */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -