mirror of https://gitee.com/openkylin/linux.git
Merge branch 'trivial-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block
* 'trivial-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block: Documentation/block/barrier.txt is not in sync with the actual code: - blk_queue_ordered() no longer has a gfp_mask parameter - blk_queue_ordered_locked() no longer exists - sd_prepare_flush() looks slightly different Use list_for_each_entry() instead of list_for_each() in the block device Make a "menuconfig" out of the Kconfig objects "menu, ..., endmenu", block/Kconfig already has its own "menuconfig" so remove these Use menuconfigs instead of menus, so the whole menu can be disabled at once cfq-iosched: fix async queue behaviour unexport bio_{,un}map_user Remove legacy CDROM drivers [PATCH] fix request->cmd == INT cases cciss: add new controller support for P700m [PATCH] Remove acsi.c [BLOCK] drop unnecessary bvec rewinding from flush_dry_bio_endio [PATCH] cdrom_sysctl_info fix blk_hw_contig_segment(): bad segment size checks [TRIVIAL PATCH] Kill blk_congestion_wait() stub for !CONFIG_BLOCK
This commit is contained in:
commit
5cbc39a726
|
@ -82,23 +82,12 @@ including draining and flushing.
|
|||
typedef void (prepare_flush_fn)(request_queue_t *q, struct request *rq);
|
||||
|
||||
int blk_queue_ordered(request_queue_t *q, unsigned ordered,
|
||||
prepare_flush_fn *prepare_flush_fn,
|
||||
unsigned gfp_mask);
|
||||
|
||||
int blk_queue_ordered_locked(request_queue_t *q, unsigned ordered,
|
||||
prepare_flush_fn *prepare_flush_fn,
|
||||
unsigned gfp_mask);
|
||||
|
||||
The only difference between the two functions is whether or not the
|
||||
caller is holding q->queue_lock on entry. The latter expects the
|
||||
caller is holding the lock.
|
||||
prepare_flush_fn *prepare_flush_fn);
|
||||
|
||||
@q : the queue in question
|
||||
@ordered : the ordered mode the driver/device supports
|
||||
@prepare_flush_fn : this function should prepare @rq such that it
|
||||
flushes cache to physical medium when executed
|
||||
@gfp_mask : gfp_mask used when allocating data structures
|
||||
for ordered processing
|
||||
|
||||
For example, SCSI disk driver's prepare_flush_fn looks like the
|
||||
following.
|
||||
|
@ -106,9 +95,10 @@ following.
|
|||
static void sd_prepare_flush(request_queue_t *q, struct request *rq)
|
||||
{
|
||||
memset(rq->cmd, 0, sizeof(rq->cmd));
|
||||
rq->flags |= REQ_BLOCK_PC;
|
||||
rq->cmd_type = REQ_TYPE_BLOCK_PC;
|
||||
rq->timeout = SD_TIMEOUT;
|
||||
rq->cmd[0] = SYNCHRONIZE_CACHE;
|
||||
rq->cmd_len = 10;
|
||||
}
|
||||
|
||||
The following seven ordered modes are supported. The following table
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# Block layer core configuration
|
||||
#
|
||||
config BLOCK
|
||||
menuconfig BLOCK
|
||||
bool "Enable the block layer" if EMBEDDED
|
||||
default y
|
||||
help
|
||||
|
@ -49,6 +49,6 @@ config LSF
|
|||
|
||||
If unsure, say Y.
|
||||
|
||||
endif
|
||||
endif # BLOCK
|
||||
|
||||
source block/Kconfig.iosched
|
||||
|
|
|
@ -92,6 +92,8 @@ struct cfq_data {
|
|||
struct cfq_queue *active_queue;
|
||||
struct cfq_io_context *active_cic;
|
||||
|
||||
struct cfq_queue *async_cfqq[IOPRIO_BE_NR];
|
||||
|
||||
struct timer_list idle_class_timer;
|
||||
|
||||
sector_t last_position;
|
||||
|
@ -1351,8 +1353,8 @@ static void cfq_ioc_set_ioprio(struct io_context *ioc)
|
|||
}
|
||||
|
||||
static struct cfq_queue *
|
||||
cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
|
||||
gfp_t gfp_mask)
|
||||
cfq_find_alloc_queue(struct cfq_data *cfqd, int is_sync,
|
||||
struct task_struct *tsk, gfp_t gfp_mask)
|
||||
{
|
||||
struct cfq_queue *cfqq, *new_cfqq = NULL;
|
||||
struct cfq_io_context *cic;
|
||||
|
@ -1405,12 +1407,35 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
|
|||
if (new_cfqq)
|
||||
kmem_cache_free(cfq_pool, new_cfqq);
|
||||
|
||||
atomic_inc(&cfqq->ref);
|
||||
out:
|
||||
WARN_ON((gfp_mask & __GFP_WAIT) && !cfqq);
|
||||
return cfqq;
|
||||
}
|
||||
|
||||
static struct cfq_queue *
|
||||
cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
|
||||
gfp_t gfp_mask)
|
||||
{
|
||||
const int ioprio = task_ioprio(tsk);
|
||||
struct cfq_queue *cfqq = NULL;
|
||||
|
||||
if (!is_sync)
|
||||
cfqq = cfqd->async_cfqq[ioprio];
|
||||
if (!cfqq)
|
||||
cfqq = cfq_find_alloc_queue(cfqd, is_sync, tsk, gfp_mask);
|
||||
|
||||
/*
|
||||
* pin the queue now that it's allocated, scheduler exit will prune it
|
||||
*/
|
||||
if (!is_sync && !cfqd->async_cfqq[ioprio]) {
|
||||
atomic_inc(&cfqq->ref);
|
||||
cfqd->async_cfqq[ioprio] = cfqq;
|
||||
}
|
||||
|
||||
atomic_inc(&cfqq->ref);
|
||||
return cfqq;
|
||||
}
|
||||
|
||||
/*
|
||||
* We drop cfq io contexts lazily, so we may find a dead one.
|
||||
*/
|
||||
|
@ -2019,6 +2044,7 @@ static void cfq_exit_queue(elevator_t *e)
|
|||
{
|
||||
struct cfq_data *cfqd = e->elevator_data;
|
||||
request_queue_t *q = cfqd->queue;
|
||||
int i;
|
||||
|
||||
cfq_shutdown_timer_wq(cfqd);
|
||||
|
||||
|
@ -2035,6 +2061,13 @@ static void cfq_exit_queue(elevator_t *e)
|
|||
__cfq_exit_single_io_context(cfqd, cic);
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the async queues
|
||||
*/
|
||||
for (i = 0; i < IOPRIO_BE_NR; i++)
|
||||
if (cfqd->async_cfqq[i])
|
||||
cfq_put_queue(cfqd->async_cfqq[i]);
|
||||
|
||||
spin_unlock_irq(q->queue_lock);
|
||||
|
||||
cfq_shutdown_timer_wq(cfqd);
|
||||
|
|
|
@ -112,12 +112,8 @@ static inline int elv_try_merge(struct request *__rq, struct bio *bio)
|
|||
static struct elevator_type *elevator_find(const char *name)
|
||||
{
|
||||
struct elevator_type *e;
|
||||
struct list_head *entry;
|
||||
|
||||
list_for_each(entry, &elv_list) {
|
||||
|
||||
e = list_entry(entry, struct elevator_type, list);
|
||||
|
||||
list_for_each_entry(e, &elv_list, list) {
|
||||
if (!strcmp(e->elevator_name, name))
|
||||
return e;
|
||||
}
|
||||
|
@ -1116,14 +1112,11 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
|
|||
{
|
||||
elevator_t *e = q->elevator;
|
||||
struct elevator_type *elv = e->elevator_type;
|
||||
struct list_head *entry;
|
||||
struct elevator_type *__e;
|
||||
int len = 0;
|
||||
|
||||
spin_lock(&elv_list_lock);
|
||||
list_for_each(entry, &elv_list) {
|
||||
struct elevator_type *__e;
|
||||
|
||||
__e = list_entry(entry, struct elevator_type, list);
|
||||
list_for_each_entry(__e, &elv_list, list) {
|
||||
if (!strcmp(elv->elevator_name, __e->elevator_name))
|
||||
len += sprintf(name+len, "[%s] ", elv->elevator_name);
|
||||
else
|
||||
|
|
|
@ -527,8 +527,6 @@ int blk_do_ordered(request_queue_t *q, struct request **rqp)
|
|||
static int flush_dry_bio_endio(struct bio *bio, unsigned int bytes, int error)
|
||||
{
|
||||
request_queue_t *q = bio->bi_private;
|
||||
struct bio_vec *bvec;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* This is dry run, restore bio_sector and size. We'll finish
|
||||
|
@ -540,13 +538,6 @@ static int flush_dry_bio_endio(struct bio *bio, unsigned int bytes, int error)
|
|||
if (bio->bi_size)
|
||||
return 1;
|
||||
|
||||
/* Rewind bvec's */
|
||||
bio->bi_idx = 0;
|
||||
bio_for_each_segment(bvec, bio, i) {
|
||||
bvec->bv_len += bvec->bv_offset;
|
||||
bvec->bv_offset = 0;
|
||||
}
|
||||
|
||||
/* Reset bio */
|
||||
set_bit(BIO_UPTODATE, &bio->bi_flags);
|
||||
bio->bi_size = q->bi_size;
|
||||
|
@ -1304,9 +1295,9 @@ static int blk_hw_contig_segment(request_queue_t *q, struct bio *bio,
|
|||
if (unlikely(!bio_flagged(nxt, BIO_SEG_VALID)))
|
||||
blk_recount_segments(q, nxt);
|
||||
if (!BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt)) ||
|
||||
BIOVEC_VIRT_OVERSIZE(bio->bi_hw_front_size + bio->bi_hw_back_size))
|
||||
BIOVEC_VIRT_OVERSIZE(bio->bi_hw_back_size + nxt->bi_hw_front_size))
|
||||
return 0;
|
||||
if (bio->bi_size + nxt->bi_size > q->max_segment_size)
|
||||
if (bio->bi_hw_back_size + nxt->bi_hw_front_size > q->max_segment_size)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -24,8 +24,6 @@ source "drivers/scsi/Kconfig"
|
|||
|
||||
source "drivers/ata/Kconfig"
|
||||
|
||||
source "drivers/cdrom/Kconfig"
|
||||
|
||||
source "drivers/md/Kconfig"
|
||||
|
||||
source "drivers/message/fusion/Kconfig"
|
||||
|
|
|
@ -1246,7 +1246,7 @@ static void redo_fd_request(void)
|
|||
del_timer(&motor_off_timer);
|
||||
|
||||
ReqCnt = 0;
|
||||
ReqCmd = CURRENT->cmd;
|
||||
ReqCmd = rq_data_dir(CURRENT);
|
||||
ReqBlock = CURRENT->sector;
|
||||
ReqBuffer = CURRENT->buffer;
|
||||
setup_req_params(drive);
|
||||
|
|
|
@ -439,7 +439,7 @@ static void mfm_rw_intr(void)
|
|||
a choice of command end or some data which is ready to be collected */
|
||||
/* I think we have to transfer data while the interrupt line is on and its
|
||||
not any other type of interrupt */
|
||||
if (CURRENT->cmd == WRITE) {
|
||||
if (rq_data_dir(CURRENT) == WRITE) {
|
||||
extern void hdc63463_writedma(void);
|
||||
if ((hdc63463_dataleft <= 0) && (!(mfm_status & STAT_CED))) {
|
||||
printk("mfm_rw_intr: Apparent DMA write request when no more to DMA\n");
|
||||
|
@ -799,7 +799,7 @@ static void issue_request(unsigned int block, unsigned int nsect,
|
|||
raw_cmd.head = start_head;
|
||||
raw_cmd.cylinder = track / p->heads;
|
||||
raw_cmd.cmdtype = CURRENT->cmd;
|
||||
raw_cmd.cmdcode = CURRENT->cmd == WRITE ? CMD_WD : CMD_RD;
|
||||
raw_cmd.cmdcode = rq_data_dir(CURRENT) == WRITE ? CMD_WD : CMD_RD;
|
||||
raw_cmd.cmddata[0] = dev + 1; /* DAG: +1 to get US */
|
||||
raw_cmd.cmddata[1] = raw_cmd.head;
|
||||
raw_cmd.cmddata[2] = raw_cmd.cylinder >> 8;
|
||||
|
@ -830,7 +830,7 @@ static void issue_request(unsigned int block, unsigned int nsect,
|
|||
hdc63463_dataleft = nsect * 256; /* Better way? */
|
||||
|
||||
DBG("mfm%c: %sing: CHS=%d/%d/%d, sectors=%d, buffer=0x%08lx (%p)\n",
|
||||
raw_cmd.dev + 'a', (CURRENT->cmd == READ) ? "read" : "writ",
|
||||
raw_cmd.dev + 'a', rq_data_dir(CURRENT) == READ ? "read" : "writ",
|
||||
raw_cmd.cylinder,
|
||||
raw_cmd.head,
|
||||
raw_cmd.sector, nsect, (unsigned long) Copy_buffer, CURRENT);
|
||||
|
@ -917,13 +917,6 @@ static void mfm_request(void)
|
|||
|
||||
DBG("mfm_request: block after offset=%d\n", block);
|
||||
|
||||
if (CURRENT->cmd != READ && CURRENT->cmd != WRITE) {
|
||||
printk("unknown mfm-command %d\n", CURRENT->cmd);
|
||||
end_request(CURRENT, 0);
|
||||
Busy = 0;
|
||||
printk("mfm: continue 4\n");
|
||||
continue;
|
||||
}
|
||||
issue_request(block, nsect, CURRENT);
|
||||
|
||||
break;
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
# Block device driver configuration
|
||||
#
|
||||
|
||||
if BLOCK
|
||||
menuconfig BLK_DEV
|
||||
bool "Block devices"
|
||||
depends on BLOCK
|
||||
default y
|
||||
|
||||
menu "Block devices"
|
||||
if BLK_DEV
|
||||
|
||||
config BLK_DEV_FD
|
||||
tristate "Normal floppy disk support"
|
||||
|
@ -56,40 +59,9 @@ config AMIGA_Z2RAM
|
|||
To compile this driver as a module, choose M here: the
|
||||
module will be called z2ram.
|
||||
|
||||
config ATARI_ACSI
|
||||
tristate "Atari ACSI support"
|
||||
depends on ATARI && BROKEN
|
||||
---help---
|
||||
This enables support for the Atari ACSI interface. The driver
|
||||
supports hard disks and CD-ROMs, which have 512-byte sectors, or can
|
||||
be switched to that mode. Due to the ACSI command format, only disks
|
||||
up to 1 GB are supported. Special support for certain ACSI to SCSI
|
||||
adapters, which could relax that, isn't included yet. The ACSI
|
||||
driver is also the basis for certain other drivers for devices
|
||||
attached to the ACSI bus: Atari SLM laser printer, BioNet-100
|
||||
Ethernet, and PAMsNet Ethernet. If you want to use one of these
|
||||
devices, you need ACSI support, too.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called acsi.
|
||||
|
||||
comment "Some devices (e.g. CD jukebox) support multiple LUNs"
|
||||
depends on ATARI && ATARI_ACSI
|
||||
|
||||
config ACSI_MULTI_LUN
|
||||
bool "Probe all LUNs on each ACSI device"
|
||||
depends on ATARI_ACSI
|
||||
help
|
||||
If you have a ACSI device that supports more than one LUN (Logical
|
||||
Unit Number), e.g. a CD jukebox, you should say Y here so that all
|
||||
will be found by the ACSI driver. An ACSI device with multiple LUNs
|
||||
acts logically like multiple ACSI devices. The vast majority of ACSI
|
||||
devices have only one LUN, and so most people can say N here and
|
||||
should in fact do so, because it is safer.
|
||||
|
||||
config ATARI_SLM
|
||||
tristate "Atari SLM laser printer support"
|
||||
depends on ATARI && ATARI_ACSI!=n
|
||||
depends on ATARI
|
||||
help
|
||||
If you have an Atari SLM laser printer, say Y to include support for
|
||||
it in the kernel. Otherwise, say N. This driver is also available as
|
||||
|
@ -453,6 +425,4 @@ config ATA_OVER_ETH
|
|||
|
||||
source "drivers/s390/block/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
endif # BLK_DEV
|
||||
|
|
|
@ -9,7 +9,6 @@ obj-$(CONFIG_MAC_FLOPPY) += swim3.o
|
|||
obj-$(CONFIG_BLK_DEV_FD) += floppy.o
|
||||
obj-$(CONFIG_AMIGA_FLOPPY) += amiflop.o
|
||||
obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o
|
||||
obj-$(CONFIG_ATARI_ACSI) += acsi.o
|
||||
obj-$(CONFIG_ATARI_SLM) += acsi_slm.o
|
||||
obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
|
||||
obj-$(CONFIG_BLK_DEV_RAM) += rd.o
|
||||
|
|
1825
drivers/block/acsi.c
1825
drivers/block/acsi.c
File diff suppressed because it is too large
Load Diff
|
@ -1363,7 +1363,7 @@ static void redo_fd_request(void)
|
|||
#ifdef DEBUG
|
||||
printk("fd: sector %ld + %d requested for %s\n",
|
||||
CURRENT->sector,cnt,
|
||||
(CURRENT->cmd==READ)?"read":"write");
|
||||
(rq_data_dir(CURRENT) == READ) ? "read" : "write");
|
||||
#endif
|
||||
block = CURRENT->sector + cnt;
|
||||
if ((int)block > floppy->blocks) {
|
||||
|
|
|
@ -87,6 +87,7 @@ static const struct pci_device_id cciss_pci_device_id[] = {
|
|||
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSD, 0x103C, 0x3214},
|
||||
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSD, 0x103C, 0x3215},
|
||||
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSC, 0x103C, 0x3237},
|
||||
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSC, 0x103C, 0x323D},
|
||||
{PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0},
|
||||
{0,}
|
||||
|
@ -119,6 +120,7 @@ static struct board_type products[] = {
|
|||
{0x3214103C, "Smart Array E200i", &SA5_access, 120},
|
||||
{0x3215103C, "Smart Array E200i", &SA5_access, 120},
|
||||
{0x3237103C, "Smart Array E500", &SA5_access, 512},
|
||||
{0x323D103C, "Smart Array P700m", &SA5_access, 512},
|
||||
{0xFFFF103C, "Unknown Smart Array", &SA5_access, 120},
|
||||
};
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ static void nbd_clear_que(struct nbd_device *lo)
|
|||
/*
|
||||
* We always wait for result of write, for now. It would be nice to make it optional
|
||||
* in future
|
||||
* if ((req->cmd == WRITE) && (lo->flags & NBD_WRITE_NOCHK))
|
||||
* if ((rq_data_dir(req) == WRITE) && (lo->flags & NBD_WRITE_NOCHK))
|
||||
* { printk( "Warning: Ignoring result!\n"); nbd_end_request( req ); }
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,213 +0,0 @@
|
|||
#
|
||||
# CDROM driver configuration
|
||||
#
|
||||
|
||||
menu "Old CD-ROM drivers (not SCSI, not IDE)"
|
||||
depends on ISA && BLOCK
|
||||
|
||||
config CD_NO_IDESCSI
|
||||
bool "Support non-SCSI/IDE/ATAPI CDROM drives"
|
||||
---help---
|
||||
If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
|
||||
here, otherwise N. Read the CD-ROM-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
Note that the answer to this question doesn't directly affect the
|
||||
kernel: saying N will just cause the configurator to skip all
|
||||
the questions about these CD-ROM drives. If you are unsure what you
|
||||
have, say Y and find out whether you have one of the following
|
||||
drives.
|
||||
|
||||
For each of these drivers, a <file:Documentation/cdrom/{driver_name}>
|
||||
exists. Especially in cases where you do not know exactly which kind
|
||||
of drive you have you should read there. Most of these drivers use a
|
||||
file drivers/cdrom/{driver_name}.h where you can define your
|
||||
interface parameters and switch some internal goodies.
|
||||
|
||||
To compile these CD-ROM drivers as a module, choose M instead of Y.
|
||||
|
||||
If you want to use any of these CD-ROM drivers, you also have to
|
||||
answer Y or M to "ISO 9660 CD-ROM file system support" below (this
|
||||
answer will get "defaulted" for you if you enable any of the Linux
|
||||
CD-ROM drivers).
|
||||
|
||||
config AZTCD
|
||||
tristate "Aztech/Orchid/Okano/Wearnes/TXC/CyDROM CDROM support"
|
||||
depends on CD_NO_IDESCSI
|
||||
---help---
|
||||
This is your driver if you have an Aztech CDA268-01A, Orchid
|
||||
CD-3110, Okano or Wearnes CDD110, Conrad TXC, or CyCD-ROM CR520 or
|
||||
CR540 CD-ROM drive. This driver -- just like all these CD-ROM
|
||||
drivers -- is NOT for CD-ROM drives with IDE/ATAPI interfaces, such
|
||||
as Aztech CDA269-031SE. Please read the file
|
||||
<file:Documentation/cdrom/aztcd>.
|
||||
|
||||
If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM
|
||||
file system support" below, because that's the file system used on
|
||||
CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called aztcd.
|
||||
|
||||
config GSCD
|
||||
tristate "Goldstar R420 CDROM support"
|
||||
depends on CD_NO_IDESCSI
|
||||
---help---
|
||||
If this is your CD-ROM drive, say Y here. As described in the file
|
||||
<file:Documentation/cdrom/gscd>, you might have to change a setting
|
||||
in the file <file:drivers/cdrom/gscd.h> before compiling the
|
||||
kernel. Please read the file <file:Documentation/cdrom/gscd>.
|
||||
|
||||
If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM
|
||||
file system support" below, because that's the file system used on
|
||||
CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called gscd.
|
||||
|
||||
config SBPCD
|
||||
tristate "Matsushita/Panasonic/Creative, Longshine, TEAC CDROM support"
|
||||
depends on CD_NO_IDESCSI && BROKEN_ON_SMP
|
||||
---help---
|
||||
This driver supports most of the drives which use the Panasonic or
|
||||
Sound Blaster interface. Please read the file
|
||||
<file:Documentation/cdrom/sbpcd>.
|
||||
|
||||
The Matsushita CR-521, CR-522, CR-523, CR-562, CR-563 drives
|
||||
(sometimes labeled "Creative"), the Creative Labs CD200, the
|
||||
Longshine LCS-7260, the "IBM External ISA CD-ROM" (in fact a CR-56x
|
||||
model), the TEAC CD-55A fall under this category. Some other
|
||||
"electrically compatible" drives (Vertos, Genoa, some Funai models)
|
||||
are currently not supported; for the Sanyo H94A drive currently a
|
||||
separate driver (asked later) is responsible. Most drives have a
|
||||
uniquely shaped faceplate, with a caddyless motorized drawer, but
|
||||
without external brand markings. The older CR-52x drives have a
|
||||
caddy and manual loading/eject, but still no external markings. The
|
||||
driver is able to do an extended auto-probing for interface
|
||||
addresses and drive types; this can help to find facts in cases you
|
||||
are not sure, but can consume some time during the boot process if
|
||||
none of the supported drives gets found. Once your drive got found,
|
||||
you should enter the reported parameters into
|
||||
<file:drivers/cdrom/sbpcd.h> and set "DISTRIBUTION 0" there.
|
||||
|
||||
This driver can support up to four CD-ROM controller cards, and each
|
||||
card can support up to four CD-ROM drives; if you say Y here, you
|
||||
will be asked how many controller cards you have. If compiled as a
|
||||
module, only one controller card (but with up to four drives) is
|
||||
usable.
|
||||
|
||||
If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM
|
||||
file system support" below, because that's the file system used on
|
||||
CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called sbpcd.
|
||||
|
||||
config MCDX
|
||||
tristate "Mitsumi CDROM support"
|
||||
depends on CD_NO_IDESCSI
|
||||
---help---
|
||||
Use this driver if you want to be able to use your Mitsumi LU-005,
|
||||
FX-001 or FX-001D CD-ROM drive.
|
||||
|
||||
Please read the file <file:Documentation/cdrom/mcdx>.
|
||||
|
||||
If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM
|
||||
file system support" below, because that's the file system used on
|
||||
CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called mcdx.
|
||||
|
||||
config OPTCD
|
||||
tristate "Optics Storage DOLPHIN 8000AT CDROM support"
|
||||
depends on CD_NO_IDESCSI
|
||||
---help---
|
||||
This is the driver for the 'DOLPHIN' drive with a 34-pin Sony
|
||||
compatible interface. It also works with the Lasermate CR328A. If
|
||||
you have one of those, say Y. This driver does not work for the
|
||||
Optics Storage 8001 drive; use the IDE-ATAPI CD-ROM driver for that
|
||||
one. Please read the file <file:Documentation/cdrom/optcd>.
|
||||
|
||||
If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM
|
||||
file system support" below, because that's the file system used on
|
||||
CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called optcd.
|
||||
|
||||
config CM206
|
||||
tristate "Philips/LMS CM206 CDROM support"
|
||||
depends on CD_NO_IDESCSI && BROKEN_ON_SMP
|
||||
---help---
|
||||
If you have a Philips/LMS CD-ROM drive cm206 in combination with a
|
||||
cm260 host adapter card, say Y here. Please also read the file
|
||||
<file:Documentation/cdrom/cm206>.
|
||||
|
||||
If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM
|
||||
file system support" below, because that's the file system used on
|
||||
CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called cm206.
|
||||
|
||||
config SJCD
|
||||
tristate "Sanyo CDR-H94A CDROM support"
|
||||
depends on CD_NO_IDESCSI
|
||||
help
|
||||
If this is your CD-ROM drive, say Y here and read the file
|
||||
<file:Documentation/cdrom/sjcd>. You should then also say Y or M to
|
||||
"ISO 9660 CD-ROM file system support" below, because that's the
|
||||
file system used on CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called sjcd.
|
||||
|
||||
config ISP16_CDI
|
||||
tristate "ISP16/MAD16/Mozart soft configurable cdrom interface support"
|
||||
depends on CD_NO_IDESCSI
|
||||
---help---
|
||||
These are sound cards with built-in cdrom interfaces using the OPTi
|
||||
82C928 or 82C929 chips. Say Y here to have them detected and
|
||||
possibly configured at boot time. In addition, You'll have to say Y
|
||||
to a driver for the particular cdrom drive you have attached to the
|
||||
card. Read <file:Documentation/cdrom/isp16> for details.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called isp16.
|
||||
|
||||
config CDU31A
|
||||
tristate "Sony CDU31A/CDU33A CDROM support"
|
||||
depends on CD_NO_IDESCSI && BROKEN_ON_SMP
|
||||
---help---
|
||||
These CD-ROM drives have a spring-pop-out caddyless drawer, and a
|
||||
rectangular green LED centered beneath it. NOTE: these CD-ROM
|
||||
drives will not be auto detected by the kernel at boot time; you
|
||||
have to provide the interface address as an option to the kernel at
|
||||
boot time as described in <file:Documentation/cdrom/cdu31a> or fill
|
||||
in your parameters into <file:drivers/cdrom/cdu31a.c>. Try "man
|
||||
bootparam" or see the documentation of your boot loader (lilo or
|
||||
loadlin) about how to pass options to the kernel.
|
||||
|
||||
If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM
|
||||
file system support" below, because that's the file system used on
|
||||
CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called cdu31a.
|
||||
|
||||
config CDU535
|
||||
tristate "Sony CDU535 CDROM support"
|
||||
depends on CD_NO_IDESCSI
|
||||
---help---
|
||||
This is the driver for the older Sony CDU-535 and CDU-531 CD-ROM
|
||||
drives. Please read the file <file:Documentation/cdrom/sonycd535>.
|
||||
|
||||
If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM
|
||||
file system support" below, because that's the file system used on
|
||||
CD-ROMs.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called sonycd535.
|
||||
|
||||
endmenu
|
|
@ -10,14 +10,4 @@ obj-$(CONFIG_BLK_DEV_SR) += cdrom.o
|
|||
obj-$(CONFIG_PARIDE_PCD) += cdrom.o
|
||||
obj-$(CONFIG_CDROM_PKTCDVD) += cdrom.o
|
||||
|
||||
obj-$(CONFIG_AZTCD) += aztcd.o
|
||||
obj-$(CONFIG_CDU31A) += cdu31a.o cdrom.o
|
||||
obj-$(CONFIG_CM206) += cm206.o cdrom.o
|
||||
obj-$(CONFIG_GSCD) += gscd.o
|
||||
obj-$(CONFIG_ISP16_CDI) += isp16.o
|
||||
obj-$(CONFIG_MCDX) += mcdx.o cdrom.o
|
||||
obj-$(CONFIG_OPTCD) += optcd.o
|
||||
obj-$(CONFIG_SBPCD) += sbpcd.o cdrom.o
|
||||
obj-$(CONFIG_SJCD) += sjcd.o
|
||||
obj-$(CONFIG_CDU535) += sonycd535.o
|
||||
obj-$(CONFIG_VIOCD) += viocd.o cdrom.o
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,162 +0,0 @@
|
|||
/* $Id: aztcd.h,v 2.60 1997/11/29 09:51:22 root Exp root $
|
||||
*
|
||||
* Definitions for a AztechCD268 CD-ROM interface
|
||||
* Copyright (C) 1994-98 Werner Zimmermann
|
||||
*
|
||||
* based on Mitsumi CDROM driver by Martin Harriss
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* History: W.Zimmermann adaption to Aztech CD268-01A Version 1.3
|
||||
* October 1994 Email: Werner.Zimmermann@fht-esslingen.de
|
||||
*/
|
||||
|
||||
/* *** change this to set the I/O port address of your CD-ROM drive,
|
||||
set to '-1', if you want autoprobing */
|
||||
#define AZT_BASE_ADDR -1
|
||||
|
||||
/* list of autoprobing addresses (not more than 15), last value must be 0x000
|
||||
Note: Autoprobing is only enabled, if AZT_BASE_ADDR is set to '-1' ! */
|
||||
#define AZT_BASE_AUTO { 0x320, 0x300, 0x310, 0x330, 0x000 }
|
||||
|
||||
/* Uncomment this, if your CDROM is connected to a Soundwave32-soundcard
|
||||
and configure AZT_BASE_ADDR and AZT_SW32_BASE_ADDR */
|
||||
/*#define AZT_SW32 1
|
||||
*/
|
||||
|
||||
#ifdef AZT_SW32
|
||||
#define AZT_SW32_BASE_ADDR 0x220 /*I/O port base address of your soundcard*/
|
||||
#endif
|
||||
|
||||
/* Set this to 1, if you want your tray to be locked, set to 0 to prevent tray
|
||||
from locking */
|
||||
#define AZT_ALLOW_TRAY_LOCK 1
|
||||
|
||||
/*Set this to 1 to allow auto-eject when unmounting a disk, set to 0, if you
|
||||
don't want the auto-eject feature*/
|
||||
#define AZT_AUTO_EJECT 0
|
||||
|
||||
/*Set this to 1, if you want to use incompatible ioctls for reading in raw and
|
||||
cooked mode */
|
||||
#define AZT_PRIVATE_IOCTLS 1
|
||||
|
||||
/*Set this to 1, if you want multisession support by the ISO fs. Even if you set
|
||||
this value to '0' you can use multisession CDs. In that case the drive's firm-
|
||||
ware will do the appropriate redirection automatically. The CD will then look
|
||||
like a single session CD (but nevertheless all data may be read). Please read
|
||||
chapter '5.1 Multisession support' in README.aztcd for details. Normally it's
|
||||
uncritical to leave this setting untouched */
|
||||
#define AZT_MULTISESSION 1
|
||||
|
||||
/*Uncomment this, if you are using a linux kernel version prior to 2.1.0 */
|
||||
/*#define AZT_KERNEL_PRIOR_2_1 */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*-----nothing to be configured for normal applications below this line------*/
|
||||
|
||||
|
||||
/* Increase this if you get lots of timeouts; if you get kernel panic, replace
|
||||
STEN_LOW_WAIT by STEN_LOW in the source code */
|
||||
#define AZT_STATUS_DELAY 400 /*for timer wait, STEN_LOW_WAIT*/
|
||||
#define AZT_TIMEOUT 8000000 /*for busy wait STEN_LOW, DTEN_LOW*/
|
||||
#define AZT_FAST_TIMEOUT 10000 /*for reading the version string*/
|
||||
|
||||
/* number of times to retry a command before giving up */
|
||||
#define AZT_RETRY_ATTEMPTS 3
|
||||
|
||||
/* port access macros */
|
||||
#define CMD_PORT azt_port
|
||||
#define DATA_PORT azt_port
|
||||
#define STATUS_PORT azt_port+1
|
||||
#define MODE_PORT azt_port+2
|
||||
#ifdef AZT_SW32
|
||||
#define AZT_SW32_INIT (unsigned int) (0xFF00 & (AZT_BASE_ADDR*16))
|
||||
#define AZT_SW32_CONFIG_REG AZT_SW32_BASE_ADDR+0x16 /*Soundwave32 Config. Register*/
|
||||
#define AZT_SW32_ID_REG AZT_SW32_BASE_ADDR+0x04 /*Soundwave32 ID Version Register*/
|
||||
#endif
|
||||
|
||||
/* status bits */
|
||||
#define AST_CMD_CHECK 0x80 /* 1 = command error */
|
||||
#define AST_DOOR_OPEN 0x40 /* 1 = door is open */
|
||||
#define AST_NOT_READY 0x20 /* 1 = no disk in the drive */
|
||||
#define AST_DSK_CHG 0x02 /* 1 = disk removed or changed */
|
||||
#define AST_MODE 0x01 /* 0=MODE1, 1=MODE2 */
|
||||
#define AST_MODE_BITS 0x1C /* Mode Bits */
|
||||
#define AST_INITIAL 0x0C /* initial, only valid ... */
|
||||
#define AST_BUSY 0x04 /* now playing, only valid
|
||||
in combination with mode
|
||||
bits */
|
||||
/* flag bits */
|
||||
#define AFL_DATA 0x02 /* data available if low */
|
||||
#define AFL_STATUS 0x04 /* status available if low */
|
||||
#define AFL_OP_OK 0x01 /* OP_OK command correct*/
|
||||
#define AFL_PA_OK 0x02 /* PA_OK parameter correct*/
|
||||
#define AFL_OP_ERR 0x05 /* error in command*/
|
||||
#define AFL_PA_ERR 0x06 /* error in parameters*/
|
||||
#define POLLED 0x04 /* polled mode */
|
||||
|
||||
/* commands */
|
||||
#define ACMD_SOFT_RESET 0x10 /* reset drive */
|
||||
#define ACMD_PLAY_READ 0x20 /* read data track in cooked mode */
|
||||
#define ACMD_PLAY_READ_RAW 0x21 /* reading in raw mode*/
|
||||
#define ACMD_SEEK 0x30 /* seek msf address*/
|
||||
#define ACMD_SEEK_TO_LEADIN 0x31 /* seek to leadin track*/
|
||||
#define ACMD_GET_ERROR 0x40 /* get error code */
|
||||
#define ACMD_GET_STATUS 0x41 /* get status */
|
||||
#define ACMD_GET_Q_CHANNEL 0x50 /* read info from q channel */
|
||||
#define ACMD_EJECT 0x60 /* eject/open tray */
|
||||
#define ACMD_CLOSE 0x61 /* close tray */
|
||||
#define ACMD_LOCK 0x71 /* lock tray closed */
|
||||
#define ACMD_UNLOCK 0x72 /* unlock tray */
|
||||
#define ACMD_PAUSE 0x80 /* pause */
|
||||
#define ACMD_STOP 0x81 /* stop play */
|
||||
#define ACMD_PLAY_AUDIO 0x90 /* play audio track */
|
||||
#define ACMD_SET_VOLUME 0x93 /* set audio level */
|
||||
#define ACMD_GET_VERSION 0xA0 /* get firmware version */
|
||||
#define ACMD_SET_DISK_TYPE 0xA1 /* set disk data mode */
|
||||
|
||||
#define MAX_TRACKS 104
|
||||
|
||||
struct msf {
|
||||
unsigned char min;
|
||||
unsigned char sec;
|
||||
unsigned char frame;
|
||||
};
|
||||
|
||||
struct azt_Play_msf {
|
||||
struct msf start;
|
||||
struct msf end;
|
||||
};
|
||||
|
||||
struct azt_DiskInfo {
|
||||
unsigned char first;
|
||||
unsigned char next;
|
||||
unsigned char last;
|
||||
struct msf diskLength;
|
||||
struct msf firstTrack;
|
||||
unsigned char multi;
|
||||
struct msf nextSession;
|
||||
struct msf lastSession;
|
||||
unsigned char xa;
|
||||
unsigned char audio;
|
||||
};
|
||||
|
||||
struct azt_Toc {
|
||||
unsigned char ctrl_addr;
|
||||
unsigned char track;
|
||||
unsigned char pointIndex;
|
||||
struct msf trackTime;
|
||||
struct msf diskTime;
|
||||
};
|
|
@ -302,7 +302,7 @@ module_param(lockdoor, bool, 0);
|
|||
module_param(check_media_type, bool, 0);
|
||||
module_param(mrw_format_restart, bool, 0);
|
||||
|
||||
static DEFINE_SPINLOCK(cdrom_lock);
|
||||
static DEFINE_MUTEX(cdrom_mutex);
|
||||
|
||||
static const char *mrw_format_status[] = {
|
||||
"not mrw",
|
||||
|
@ -438,10 +438,10 @@ int register_cdrom(struct cdrom_device_info *cdi)
|
|||
cdo->generic_packet = cdrom_dummy_generic_packet;
|
||||
|
||||
cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name);
|
||||
spin_lock(&cdrom_lock);
|
||||
mutex_lock(&cdrom_mutex);
|
||||
cdi->next = topCdromPtr;
|
||||
topCdromPtr = cdi;
|
||||
spin_unlock(&cdrom_lock);
|
||||
mutex_unlock(&cdrom_mutex);
|
||||
return 0;
|
||||
}
|
||||
#undef ENSURE
|
||||
|
@ -452,7 +452,7 @@ int unregister_cdrom(struct cdrom_device_info *unreg)
|
|||
cdinfo(CD_OPEN, "entering unregister_cdrom\n");
|
||||
|
||||
prev = NULL;
|
||||
spin_lock(&cdrom_lock);
|
||||
mutex_lock(&cdrom_mutex);
|
||||
cdi = topCdromPtr;
|
||||
while (cdi && cdi != unreg) {
|
||||
prev = cdi;
|
||||
|
@ -460,7 +460,7 @@ int unregister_cdrom(struct cdrom_device_info *unreg)
|
|||
}
|
||||
|
||||
if (cdi == NULL) {
|
||||
spin_unlock(&cdrom_lock);
|
||||
mutex_unlock(&cdrom_mutex);
|
||||
return -2;
|
||||
}
|
||||
if (prev)
|
||||
|
@ -468,7 +468,7 @@ int unregister_cdrom(struct cdrom_device_info *unreg)
|
|||
else
|
||||
topCdromPtr = cdi->next;
|
||||
|
||||
spin_unlock(&cdrom_lock);
|
||||
mutex_unlock(&cdrom_mutex);
|
||||
|
||||
if (cdi->exit)
|
||||
cdi->exit(cdi);
|
||||
|
@ -3289,103 +3289,137 @@ static struct cdrom_sysctl_settings {
|
|||
int check; /* check media type */
|
||||
} cdrom_sysctl_settings;
|
||||
|
||||
enum cdrom_print_option {
|
||||
CTL_NAME,
|
||||
CTL_SPEED,
|
||||
CTL_SLOTS,
|
||||
CTL_CAPABILITY
|
||||
};
|
||||
|
||||
static int cdrom_print_info(const char *header, int val, char *info,
|
||||
int *pos, enum cdrom_print_option option)
|
||||
{
|
||||
const int max_size = sizeof(cdrom_sysctl_settings.info);
|
||||
struct cdrom_device_info *cdi;
|
||||
int ret;
|
||||
|
||||
ret = scnprintf(info + *pos, max_size - *pos, header);
|
||||
if (!ret)
|
||||
return 1;
|
||||
|
||||
*pos += ret;
|
||||
|
||||
for (cdi = topCdromPtr; cdi; cdi = cdi->next) {
|
||||
switch (option) {
|
||||
case CTL_NAME:
|
||||
ret = scnprintf(info + *pos, max_size - *pos,
|
||||
"\t%s", cdi->name);
|
||||
break;
|
||||
case CTL_SPEED:
|
||||
ret = scnprintf(info + *pos, max_size - *pos,
|
||||
"\t%d", cdi->speed);
|
||||
break;
|
||||
case CTL_SLOTS:
|
||||
ret = scnprintf(info + *pos, max_size - *pos,
|
||||
"\t%d", cdi->capacity);
|
||||
break;
|
||||
case CTL_CAPABILITY:
|
||||
ret = scnprintf(info + *pos, max_size - *pos,
|
||||
"\t%d", CDROM_CAN(val) != 0);
|
||||
break;
|
||||
default:
|
||||
printk(KERN_INFO "cdrom: invalid option%d\n", option);
|
||||
return 1;
|
||||
}
|
||||
if (!ret)
|
||||
return 1;
|
||||
*pos += ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int pos;
|
||||
struct cdrom_device_info *cdi;
|
||||
int pos;
|
||||
char *info = cdrom_sysctl_settings.info;
|
||||
const int max_size = sizeof(cdrom_sysctl_settings.info);
|
||||
|
||||
if (!*lenp || (*ppos && !write)) {
|
||||
*lenp = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_lock(&cdrom_mutex);
|
||||
|
||||
pos = sprintf(info, "CD-ROM information, " VERSION "\n");
|
||||
|
||||
pos += sprintf(info+pos, "\ndrive name:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%s", cdi->name);
|
||||
|
||||
pos += sprintf(info+pos, "\ndrive speed:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", cdi->speed);
|
||||
|
||||
pos += sprintf(info+pos, "\ndrive # of slots:");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", cdi->capacity);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan close tray:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_CLOSE_TRAY) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan open tray:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_OPEN_TRAY) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan lock tray:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_LOCK) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan change speed:");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_SELECT_SPEED) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan select disk:");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_SELECT_DISC) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan read multisession:");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_MULTI_SESSION) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan read MCN:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_MCN) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nReports media changed:");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_MEDIA_CHANGED) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan play audio:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_PLAY_AUDIO) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan write CD-R:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_CD_R) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan write CD-RW:");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_CD_RW) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan read DVD:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_DVD) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan write DVD-R:");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_DVD_R) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan write DVD-RAM:");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_DVD_RAM) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan read MRW:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_MRW) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan write MRW:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_MRW_W) != 0);
|
||||
|
||||
pos += sprintf(info+pos, "\nCan write RAM:\t");
|
||||
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
|
||||
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_RAM) != 0);
|
||||
|
||||
strcpy(info+pos,"\n\n");
|
||||
|
||||
return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
|
||||
if (cdrom_print_info("\ndrive name:\t", 0, info, &pos, CTL_NAME))
|
||||
goto done;
|
||||
if (cdrom_print_info("\ndrive speed:\t", 0, info, &pos, CTL_SPEED))
|
||||
goto done;
|
||||
if (cdrom_print_info("\ndrive # of slots:", 0, info, &pos, CTL_SLOTS))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan close tray:\t",
|
||||
CDC_CLOSE_TRAY, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan open tray:\t",
|
||||
CDC_OPEN_TRAY, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan lock tray:\t",
|
||||
CDC_LOCK, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan change speed:",
|
||||
CDC_SELECT_SPEED, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan select disk:",
|
||||
CDC_SELECT_DISC, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan read multisession:",
|
||||
CDC_MULTI_SESSION, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan read MCN:\t",
|
||||
CDC_MCN, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nReports media changed:",
|
||||
CDC_MEDIA_CHANGED, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan play audio:\t",
|
||||
CDC_PLAY_AUDIO, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan write CD-R:\t",
|
||||
CDC_CD_R, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan write CD-RW:",
|
||||
CDC_CD_RW, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan read DVD:\t",
|
||||
CDC_DVD, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan write DVD-R:",
|
||||
CDC_DVD_R, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan write DVD-RAM:",
|
||||
CDC_DVD_RAM, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan read MRW:\t",
|
||||
CDC_MRW, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan write MRW:\t",
|
||||
CDC_MRW_W, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (cdrom_print_info("\nCan write RAM:\t",
|
||||
CDC_RAM, info, &pos, CTL_CAPABILITY))
|
||||
goto done;
|
||||
if (!scnprintf(info + pos, max_size - pos, "\n\n"))
|
||||
goto done;
|
||||
doit:
|
||||
mutex_unlock(&cdrom_mutex);
|
||||
return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
|
||||
done:
|
||||
printk(KERN_INFO "cdrom: info buffer too small\n");
|
||||
goto doit;
|
||||
}
|
||||
|
||||
/* Unfortunately, per device settings are not implemented through
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,411 +0,0 @@
|
|||
/*
|
||||
* Definitions for a Sony interface CDROM drive.
|
||||
*
|
||||
* Corey Minyard (minyard@wf-rch.cirr.com)
|
||||
*
|
||||
* Copyright (C) 1993 Corey Minyard
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* General defines.
|
||||
*/
|
||||
#define SONY_XA_DISK_TYPE 0x20
|
||||
|
||||
/*
|
||||
* Offsets (from the base address) and bits for the various write registers
|
||||
* of the drive.
|
||||
*/
|
||||
#define SONY_CMD_REG_OFFSET 0
|
||||
#define SONY_PARAM_REG_OFFSET 1
|
||||
#define SONY_WRITE_REG_OFFSET 2
|
||||
#define SONY_CONTROL_REG_OFFSET 3
|
||||
# define SONY_ATTN_CLR_BIT 0x01
|
||||
# define SONY_RES_RDY_CLR_BIT 0x02
|
||||
# define SONY_DATA_RDY_CLR_BIT 0x04
|
||||
# define SONY_ATTN_INT_EN_BIT 0x08
|
||||
# define SONY_RES_RDY_INT_EN_BIT 0x10
|
||||
# define SONY_DATA_RDY_INT_EN_BIT 0x20
|
||||
# define SONY_PARAM_CLR_BIT 0x40
|
||||
# define SONY_DRIVE_RESET_BIT 0x80
|
||||
|
||||
/*
|
||||
* Offsets (from the base address) and bits for the various read registers
|
||||
* of the drive.
|
||||
*/
|
||||
#define SONY_STATUS_REG_OFFSET 0
|
||||
# define SONY_ATTN_BIT 0x01
|
||||
# define SONY_RES_RDY_BIT 0x02
|
||||
# define SONY_DATA_RDY_BIT 0x04
|
||||
# define SONY_ATTN_INT_ST_BIT 0x08
|
||||
# define SONY_RES_RDY_INT_ST_BIT 0x10
|
||||
# define SONY_DATA_RDY_INT_ST_BIT 0x20
|
||||
# define SONY_DATA_REQUEST_BIT 0x40
|
||||
# define SONY_BUSY_BIT 0x80
|
||||
#define SONY_RESULT_REG_OFFSET 1
|
||||
#define SONY_READ_REG_OFFSET 2
|
||||
#define SONY_FIFOST_REG_OFFSET 3
|
||||
# define SONY_PARAM_WRITE_RDY_BIT 0x01
|
||||
# define SONY_PARAM_REG_EMPTY_BIT 0x02
|
||||
# define SONY_RES_REG_NOT_EMP_BIT 0x04
|
||||
# define SONY_RES_REG_FULL_BIT 0x08
|
||||
|
||||
#define LOG_START_OFFSET 150 /* Offset of first logical sector */
|
||||
|
||||
#define SONY_DETECT_TIMEOUT (8*HZ/10) /* Maximum amount of time
|
||||
that drive detection code
|
||||
will wait for response
|
||||
from drive (in 1/100th's
|
||||
of seconds). */
|
||||
|
||||
#define SONY_JIFFIES_TIMEOUT (10*HZ) /* Maximum number of times the
|
||||
drive will wait/try for an
|
||||
operation */
|
||||
#define SONY_RESET_TIMEOUT HZ /* Maximum number of times the
|
||||
drive will wait/try a reset
|
||||
operation */
|
||||
#define SONY_READY_RETRIES 20000 /* How many times to retry a
|
||||
spin waiting for a register
|
||||
to come ready */
|
||||
|
||||
#define MAX_CDU31A_RETRIES 3 /* How many times to retry an
|
||||
operation */
|
||||
|
||||
/* Commands to request or set drive control parameters and disc information */
|
||||
#define SONY_REQ_DRIVE_CONFIG_CMD 0x00 /* Returns s_sony_drive_config */
|
||||
#define SONY_REQ_DRIVE_MODE_CMD 0x01
|
||||
#define SONY_REQ_DRIVE_PARAM_CMD 0x02
|
||||
#define SONY_REQ_MECH_STATUS_CMD 0x03
|
||||
#define SONY_REQ_AUDIO_STATUS_CMD 0x04
|
||||
#define SONY_SET_DRIVE_PARAM_CMD 0x10
|
||||
#define SONY_REQ_TOC_DATA_CMD 0x20 /* Returns s_sony_toc */
|
||||
#define SONY_REQ_SUBCODE_ADDRESS_CMD 0x21 /* Returns s_sony_subcode */
|
||||
#define SONY_REQ_UPC_EAN_CMD 0x22
|
||||
#define SONY_REQ_ISRC_CMD 0x23
|
||||
#define SONY_REQ_TOC_DATA_SPEC_CMD 0x24 /* Returns s_sony_session_toc */
|
||||
|
||||
/* Commands to request information from the drive */
|
||||
#define SONY_READ_TOC_CMD 0x30 /* let the drive firmware grab the TOC */
|
||||
#define SONY_SEEK_CMD 0x31
|
||||
#define SONY_READ_CMD 0x32
|
||||
#define SONY_READ_BLKERR_STAT_CMD 0x34
|
||||
#define SONY_ABORT_CMD 0x35
|
||||
#define SONY_READ_TOC_SPEC_CMD 0x36
|
||||
|
||||
/* Commands to control audio */
|
||||
#define SONY_AUDIO_PLAYBACK_CMD 0x40
|
||||
#define SONY_AUDIO_STOP_CMD 0x41
|
||||
#define SONY_AUDIO_SCAN_CMD 0x42
|
||||
|
||||
/* Miscellaneous control commands */
|
||||
#define SONY_EJECT_CMD 0x50
|
||||
#define SONY_SPIN_UP_CMD 0x51
|
||||
#define SONY_SPIN_DOWN_CMD 0x52
|
||||
|
||||
/* Diagnostic commands */
|
||||
#define SONY_WRITE_BUFFER_CMD 0x60
|
||||
#define SONY_READ_BUFFER_CMD 0x61
|
||||
#define SONY_DIAGNOSTICS_CMD 0x62
|
||||
|
||||
|
||||
/*
|
||||
* The following are command parameters for the set drive parameter command
|
||||
*/
|
||||
#define SONY_SD_DECODE_PARAM 0x00
|
||||
#define SONY_SD_INTERFACE_PARAM 0x01
|
||||
#define SONY_SD_BUFFERING_PARAM 0x02
|
||||
#define SONY_SD_AUDIO_PARAM 0x03
|
||||
#define SONY_SD_AUDIO_VOLUME 0x04
|
||||
#define SONY_SD_MECH_CONTROL 0x05
|
||||
#define SONY_SD_AUTO_SPIN_DOWN_TIME 0x06
|
||||
|
||||
/*
|
||||
* The following are parameter bits for the mechanical control command
|
||||
*/
|
||||
#define SONY_AUTO_SPIN_UP_BIT 0x01
|
||||
#define SONY_AUTO_EJECT_BIT 0x02
|
||||
#define SONY_DOUBLE_SPEED_BIT 0x04
|
||||
|
||||
/*
|
||||
* The following extract information from the drive configuration about
|
||||
* the drive itself.
|
||||
*/
|
||||
#define SONY_HWC_GET_LOAD_MECH(c) (c.hw_config[0] & 0x03)
|
||||
#define SONY_HWC_EJECT(c) (c.hw_config[0] & 0x04)
|
||||
#define SONY_HWC_LED_SUPPORT(c) (c.hw_config[0] & 0x08)
|
||||
#define SONY_HWC_DOUBLE_SPEED(c) (c.hw_config[0] & 0x10)
|
||||
#define SONY_HWC_GET_BUF_MEM_SIZE(c) ((c.hw_config[0] & 0xc0) >> 6)
|
||||
#define SONY_HWC_AUDIO_PLAYBACK(c) (c.hw_config[1] & 0x01)
|
||||
#define SONY_HWC_ELECTRIC_VOLUME(c) (c.hw_config[1] & 0x02)
|
||||
#define SONY_HWC_ELECTRIC_VOLUME_CTL(c) (c.hw_config[1] & 0x04)
|
||||
|
||||
#define SONY_HWC_CADDY_LOAD_MECH 0x00
|
||||
#define SONY_HWC_TRAY_LOAD_MECH 0x01
|
||||
#define SONY_HWC_POPUP_LOAD_MECH 0x02
|
||||
#define SONY_HWC_UNKWN_LOAD_MECH 0x03
|
||||
|
||||
#define SONY_HWC_8KB_BUFFER 0x00
|
||||
#define SONY_HWC_32KB_BUFFER 0x01
|
||||
#define SONY_HWC_64KB_BUFFER 0x02
|
||||
#define SONY_HWC_UNKWN_BUFFER 0x03
|
||||
|
||||
/*
|
||||
* This is the complete status returned from the drive configuration request
|
||||
* command.
|
||||
*/
|
||||
struct s_sony_drive_config
|
||||
{
|
||||
unsigned char exec_status[2];
|
||||
char vendor_id[8];
|
||||
char product_id[16];
|
||||
char product_rev_level[8];
|
||||
unsigned char hw_config[2];
|
||||
};
|
||||
|
||||
/* The following is returned from the request subcode address command */
|
||||
struct s_sony_subcode
|
||||
{
|
||||
unsigned char exec_status[2];
|
||||
unsigned char address :4;
|
||||
unsigned char control :4;
|
||||
unsigned char track_num;
|
||||
unsigned char index_num;
|
||||
unsigned char rel_msf[3];
|
||||
unsigned char reserved1;
|
||||
unsigned char abs_msf[3];
|
||||
};
|
||||
|
||||
#define MAX_TRACKS 100 /* The maximum tracks a disk may have. */
|
||||
/*
|
||||
* The following is returned from the request TOC (Table Of Contents) command.
|
||||
* (last_track_num-first_track_num+1) values are valid in tracks.
|
||||
*/
|
||||
struct s_sony_toc
|
||||
{
|
||||
unsigned char exec_status[2];
|
||||
unsigned char address0 :4;
|
||||
unsigned char control0 :4;
|
||||
unsigned char point0;
|
||||
unsigned char first_track_num;
|
||||
unsigned char disk_type;
|
||||
unsigned char dummy0;
|
||||
unsigned char address1 :4;
|
||||
unsigned char control1 :4;
|
||||
unsigned char point1;
|
||||
unsigned char last_track_num;
|
||||
unsigned char dummy1;
|
||||
unsigned char dummy2;
|
||||
unsigned char address2 :4;
|
||||
unsigned char control2 :4;
|
||||
unsigned char point2;
|
||||
unsigned char lead_out_start_msf[3];
|
||||
struct
|
||||
{
|
||||
unsigned char address :4;
|
||||
unsigned char control :4;
|
||||
unsigned char track;
|
||||
unsigned char track_start_msf[3];
|
||||
} tracks[MAX_TRACKS];
|
||||
|
||||
unsigned int lead_out_start_lba;
|
||||
};
|
||||
|
||||
struct s_sony_session_toc
|
||||
{
|
||||
unsigned char exec_status[2];
|
||||
unsigned char session_number;
|
||||
unsigned char address0 :4;
|
||||
unsigned char control0 :4;
|
||||
unsigned char point0;
|
||||
unsigned char first_track_num;
|
||||
unsigned char disk_type;
|
||||
unsigned char dummy0;
|
||||
unsigned char address1 :4;
|
||||
unsigned char control1 :4;
|
||||
unsigned char point1;
|
||||
unsigned char last_track_num;
|
||||
unsigned char dummy1;
|
||||
unsigned char dummy2;
|
||||
unsigned char address2 :4;
|
||||
unsigned char control2 :4;
|
||||
unsigned char point2;
|
||||
unsigned char lead_out_start_msf[3];
|
||||
unsigned char addressb0 :4;
|
||||
unsigned char controlb0 :4;
|
||||
unsigned char pointb0;
|
||||
unsigned char next_poss_prog_area_msf[3];
|
||||
unsigned char num_mode_5_pointers;
|
||||
unsigned char max_start_outer_leadout_msf[3];
|
||||
unsigned char addressb1 :4;
|
||||
unsigned char controlb1 :4;
|
||||
unsigned char pointb1;
|
||||
unsigned char dummyb0_1[4];
|
||||
unsigned char num_skip_interval_pointers;
|
||||
unsigned char num_skip_track_assignments;
|
||||
unsigned char dummyb0_2;
|
||||
unsigned char addressb2 :4;
|
||||
unsigned char controlb2 :4;
|
||||
unsigned char pointb2;
|
||||
unsigned char tracksb2[7];
|
||||
unsigned char addressb3 :4;
|
||||
unsigned char controlb3 :4;
|
||||
unsigned char pointb3;
|
||||
unsigned char tracksb3[7];
|
||||
unsigned char addressb4 :4;
|
||||
unsigned char controlb4 :4;
|
||||
unsigned char pointb4;
|
||||
unsigned char tracksb4[7];
|
||||
unsigned char addressc0 :4;
|
||||
unsigned char controlc0 :4;
|
||||
unsigned char pointc0;
|
||||
unsigned char dummyc0[7];
|
||||
struct
|
||||
{
|
||||
unsigned char address :4;
|
||||
unsigned char control :4;
|
||||
unsigned char track;
|
||||
unsigned char track_start_msf[3];
|
||||
} tracks[MAX_TRACKS];
|
||||
|
||||
unsigned int start_track_lba;
|
||||
unsigned int lead_out_start_lba;
|
||||
unsigned int mint;
|
||||
unsigned int maxt;
|
||||
};
|
||||
|
||||
struct s_all_sessions_toc
|
||||
{
|
||||
unsigned char sessions;
|
||||
unsigned int track_entries;
|
||||
unsigned char first_track_num;
|
||||
unsigned char last_track_num;
|
||||
unsigned char disk_type;
|
||||
unsigned char lead_out_start_msf[3];
|
||||
struct
|
||||
{
|
||||
unsigned char address :4;
|
||||
unsigned char control :4;
|
||||
unsigned char track;
|
||||
unsigned char track_start_msf[3];
|
||||
} tracks[MAX_TRACKS];
|
||||
|
||||
unsigned int start_track_lba;
|
||||
unsigned int lead_out_start_lba;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* The following are errors returned from the drive.
|
||||
*/
|
||||
|
||||
/* Command error group */
|
||||
#define SONY_ILL_CMD_ERR 0x10
|
||||
#define SONY_ILL_PARAM_ERR 0x11
|
||||
|
||||
/* Mechanism group */
|
||||
#define SONY_NOT_LOAD_ERR 0x20
|
||||
#define SONY_NO_DISK_ERR 0x21
|
||||
#define SONY_NOT_SPIN_ERR 0x22
|
||||
#define SONY_SPIN_ERR 0x23
|
||||
#define SONY_SPINDLE_SERVO_ERR 0x25
|
||||
#define SONY_FOCUS_SERVO_ERR 0x26
|
||||
#define SONY_EJECT_MECH_ERR 0x29
|
||||
#define SONY_AUDIO_PLAYING_ERR 0x2a
|
||||
#define SONY_EMERGENCY_EJECT_ERR 0x2c
|
||||
|
||||
/* Seek error group */
|
||||
#define SONY_FOCUS_ERR 0x30
|
||||
#define SONY_FRAME_SYNC_ERR 0x31
|
||||
#define SONY_SUBCODE_ADDR_ERR 0x32
|
||||
#define SONY_BLOCK_SYNC_ERR 0x33
|
||||
#define SONY_HEADER_ADDR_ERR 0x34
|
||||
|
||||
/* Read error group */
|
||||
#define SONY_ILL_TRACK_R_ERR 0x40
|
||||
#define SONY_MODE_0_R_ERR 0x41
|
||||
#define SONY_ILL_MODE_R_ERR 0x42
|
||||
#define SONY_ILL_BLOCK_SIZE_R_ERR 0x43
|
||||
#define SONY_MODE_R_ERR 0x44
|
||||
#define SONY_FORM_R_ERR 0x45
|
||||
#define SONY_LEAD_OUT_R_ERR 0x46
|
||||
#define SONY_BUFFER_OVERRUN_R_ERR 0x47
|
||||
|
||||
/* Data error group */
|
||||
#define SONY_UNREC_CIRC_ERR 0x53
|
||||
#define SONY_UNREC_LECC_ERR 0x57
|
||||
|
||||
/* Subcode error group */
|
||||
#define SONY_NO_TOC_ERR 0x60
|
||||
#define SONY_SUBCODE_DATA_NVAL_ERR 0x61
|
||||
#define SONY_FOCUS_ON_TOC_READ_ERR 0x63
|
||||
#define SONY_FRAME_SYNC_ON_TOC_READ_ERR 0x64
|
||||
#define SONY_TOC_DATA_ERR 0x65
|
||||
|
||||
/* Hardware failure group */
|
||||
#define SONY_HW_FAILURE_ERR 0x70
|
||||
#define SONY_LEAD_IN_A_ERR 0x91
|
||||
#define SONY_LEAD_OUT_A_ERR 0x92
|
||||
#define SONY_DATA_TRACK_A_ERR 0x93
|
||||
|
||||
/*
|
||||
* The following are returned from the Read With Block Error Status command.
|
||||
* They are not errors but information (Errors from the 0x5x group above may
|
||||
* also be returned
|
||||
*/
|
||||
#define SONY_NO_CIRC_ERR_BLK_STAT 0x50
|
||||
#define SONY_NO_LECC_ERR_BLK_STAT 0x54
|
||||
#define SONY_RECOV_LECC_ERR_BLK_STAT 0x55
|
||||
#define SONY_NO_ERR_DETECTION_STAT 0x59
|
||||
|
||||
/*
|
||||
* The following is not an error returned by the drive, but by the code
|
||||
* that talks to the drive. It is returned because of a timeout.
|
||||
*/
|
||||
#define SONY_TIMEOUT_OP_ERR 0x01
|
||||
#define SONY_SIGNAL_OP_ERR 0x02
|
||||
#define SONY_BAD_DATA_ERR 0x03
|
||||
|
||||
|
||||
/*
|
||||
* The following are attention code for asynchronous events from the drive.
|
||||
*/
|
||||
|
||||
/* Standard attention group */
|
||||
#define SONY_EMER_EJECT_ATTN 0x2c
|
||||
#define SONY_HW_FAILURE_ATTN 0x70
|
||||
#define SONY_MECH_LOADED_ATTN 0x80
|
||||
#define SONY_EJECT_PUSHED_ATTN 0x81
|
||||
|
||||
/* Audio attention group */
|
||||
#define SONY_AUDIO_PLAY_DONE_ATTN 0x90
|
||||
#define SONY_LEAD_IN_ERR_ATTN 0x91
|
||||
#define SONY_LEAD_OUT_ERR_ATTN 0x92
|
||||
#define SONY_DATA_TRACK_ERR_ATTN 0x93
|
||||
#define SONY_AUDIO_PLAYBACK_ERR_ATTN 0x94
|
||||
|
||||
/* Auto spin up group */
|
||||
#define SONY_SPIN_UP_COMPLETE_ATTN 0x24
|
||||
#define SONY_SPINDLE_SERVO_ERR_ATTN 0x25
|
||||
#define SONY_FOCUS_SERVO_ERR_ATTN 0x26
|
||||
#define SONY_TOC_READ_DONE_ATTN 0x62
|
||||
#define SONY_FOCUS_ON_TOC_READ_ERR_ATTN 0x63
|
||||
#define SONY_SYNC_ON_TOC_READ_ERR_ATTN 0x65
|
||||
|
||||
/* Auto eject group */
|
||||
#define SONY_SPIN_DOWN_COMPLETE_ATTN 0x27
|
||||
#define SONY_EJECT_COMPLETE_ATTN 0x28
|
||||
#define SONY_EJECT_MECH_ERR_ATTN 0x29
|
File diff suppressed because it is too large
Load Diff
|
@ -1,171 +0,0 @@
|
|||
/* cm206.h Header file for cm206.c.
|
||||
Copyright (c) 1995 David van Leeuwen
|
||||
*/
|
||||
|
||||
#ifndef LINUX_CM206_H
|
||||
#define LINUX_CM206_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
/* First, the cm260 stuff */
|
||||
/* The ports and irq used. Although CM206_BASE and CM206_IRQ are defined
|
||||
below, the values are not used unless autoprobing is turned off and
|
||||
no LILO boot options or module command line options are given. Change
|
||||
these values to your own as last resort if autoprobing and options
|
||||
don't work. */
|
||||
|
||||
#define CM206_BASE 0x340
|
||||
#define CM206_IRQ 11
|
||||
|
||||
#define r_data_status (cm206_base)
|
||||
#define r_uart_receive (cm206_base+0x2)
|
||||
#define r_fifo_output_buffer (cm206_base+0x4)
|
||||
#define r_line_status (cm206_base+0x6)
|
||||
#define r_data_control (cm206_base+0x8)
|
||||
#define r_uart_transmit (cm206_base+0xa)
|
||||
#define r_test_clock (cm206_base+0xc)
|
||||
#define r_test_control (cm206_base+0xe)
|
||||
|
||||
/* the data_status flags */
|
||||
#define ds_ram_size 0x4000
|
||||
#define ds_toc_ready 0x2000
|
||||
#define ds_fifo_empty 0x1000
|
||||
#define ds_sync_error 0x800
|
||||
#define ds_crc_error 0x400
|
||||
#define ds_data_error 0x200
|
||||
#define ds_fifo_overflow 0x100
|
||||
#define ds_data_ready 0x80
|
||||
|
||||
/* the line_status flags */
|
||||
#define ls_attention 0x10
|
||||
#define ls_parity_error 0x8
|
||||
#define ls_overrun 0x4
|
||||
#define ls_receive_buffer_full 0x2
|
||||
#define ls_transmitter_buffer_empty 0x1
|
||||
|
||||
/* the data control register flags */
|
||||
#define dc_read_q_channel 0x4000
|
||||
#define dc_mask_sync_error 0x2000
|
||||
#define dc_toc_enable 0x1000
|
||||
#define dc_no_stop_on_error 0x800
|
||||
#define dc_break 0x400
|
||||
#define dc_initialize 0x200
|
||||
#define dc_mask_transmit_ready 0x100
|
||||
#define dc_flag_enable 0x80
|
||||
|
||||
/* Define the default data control register flags here */
|
||||
#define dc_normal (dc_mask_sync_error | dc_no_stop_on_error | \
|
||||
dc_mask_transmit_ready)
|
||||
|
||||
/* now some constants related to the cm206 */
|
||||
/* another drive status byte, echoed by the cm206 on most commands */
|
||||
|
||||
#define dsb_error_condition 0x1
|
||||
#define dsb_play_in_progress 0x4
|
||||
#define dsb_possible_media_change 0x8
|
||||
#define dsb_disc_present 0x10
|
||||
#define dsb_drive_not_ready 0x20
|
||||
#define dsb_tray_locked 0x40
|
||||
#define dsb_tray_not_closed 0x80
|
||||
|
||||
#define dsb_not_useful (dsb_drive_not_ready | dsb_tray_not_closed)
|
||||
|
||||
/* the cm206 command set */
|
||||
|
||||
#define c_close_tray 0
|
||||
#define c_lock_tray 0x01
|
||||
#define c_unlock_tray 0x04
|
||||
#define c_open_tray 0x05
|
||||
#define c_seek 0x10
|
||||
#define c_read_data 0x20
|
||||
#define c_force_1x 0x21
|
||||
#define c_force_2x 0x22
|
||||
#define c_auto_mode 0x23
|
||||
#define c_play 0x30
|
||||
#define c_set_audio_mode 0x31
|
||||
#define c_read_current_q 0x41
|
||||
#define c_stream_q 0x42
|
||||
#define c_drive_status 0x50
|
||||
#define c_disc_status 0x51
|
||||
#define c_audio_status 0x52
|
||||
#define c_drive_configuration 0x53
|
||||
#define c_read_upc 0x60
|
||||
#define c_stop 0x70
|
||||
#define c_calc_checksum 0xe5
|
||||
|
||||
#define c_gimme 0xf8
|
||||
|
||||
/* finally, the (error) condition that the drive can be in *
|
||||
* OK, this is not always an error, but let's prefix it with e_ */
|
||||
|
||||
#define e_none 0
|
||||
#define e_illegal_command 0x01
|
||||
#define e_sync 0x02
|
||||
#define e_seek 0x03
|
||||
#define e_parity 0x04
|
||||
#define e_focus 0x05
|
||||
#define e_header_sync 0x06
|
||||
#define e_code_incompatibility 0x07
|
||||
#define e_reset_done 0x08
|
||||
#define e_bad_parameter 0x09
|
||||
#define e_radial 0x0a
|
||||
#define e_sub_code 0x0b
|
||||
#define e_no_data_track 0x0c
|
||||
#define e_scan 0x0d
|
||||
#define e_tray_open 0x0f
|
||||
#define e_no_disc 0x10
|
||||
#define e_tray stalled 0x11
|
||||
|
||||
/* drive configuration masks */
|
||||
|
||||
#define dcf_revision_code 0x7
|
||||
#define dcf_transfer_rate 0x60
|
||||
#define dcf_motorized_tray 0x80
|
||||
|
||||
/* disc status byte */
|
||||
|
||||
#define cds_multi_session 0x2
|
||||
#define cds_all_audio 0x8
|
||||
#define cds_xa_mode 0xf0
|
||||
|
||||
/* finally some ioctls for the driver */
|
||||
|
||||
#define CM206CTL_GET_STAT _IO( 0x20, 0 )
|
||||
#define CM206CTL_GET_LAST_STAT _IO( 0x20, 1 )
|
||||
|
||||
#ifdef STATISTICS
|
||||
|
||||
/* This is an ugly way to guarantee that the names of the statistics
|
||||
* are the same in the code and in the diagnostics program. */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define x(a) st_ ## a
|
||||
#define y enum
|
||||
#else
|
||||
#define x(a) #a
|
||||
#define y char * stats_name[] =
|
||||
#endif
|
||||
|
||||
y {x(interrupt), x(data_ready), x(fifo_overflow), x(data_error),
|
||||
x(crc_error), x(sync_error), x(lost_intr), x(echo),
|
||||
x(write_timeout), x(receive_timeout), x(read_timeout),
|
||||
x(dsb_timeout), x(stop_0xff), x(back_read_timeout),
|
||||
x(sector_transferred), x(read_restarted), x(read_background),
|
||||
x(bh), x(open), x(ioctl_multisession), x(attention)
|
||||
#ifdef __KERNEL__
|
||||
, x(last_entry)
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define NR_STATS st_last_entry
|
||||
#else
|
||||
#define NR_STATS (sizeof(stats_name)/sizeof(char*))
|
||||
#endif
|
||||
|
||||
#undef y
|
||||
#undef x
|
||||
|
||||
#endif /* STATISTICS */
|
||||
|
||||
#endif /* LINUX_CM206_H */
|
1029
drivers/cdrom/gscd.c
1029
drivers/cdrom/gscd.c
File diff suppressed because it is too large
Load Diff
|
@ -1,108 +0,0 @@
|
|||
/*
|
||||
* Definitions for a GoldStar R420 CD-ROM interface
|
||||
*
|
||||
* Copyright (C) 1995 Oliver Raupach <raupach@nwfs1.rz.fh-hannover.de>
|
||||
* Eberhard Moenkeberg <emoenke@gwdg.de>
|
||||
*
|
||||
* Published under the GPL.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* The Interface Card default address is 0x340. This will work for most
|
||||
applications. Address selection is accomplished by jumpers PN801-1 to
|
||||
PN801-4 on the GoldStar Interface Card.
|
||||
Appropriate settings are: 0x300, 0x310, 0x320, 0x330, 0x340, 0x350, 0x360
|
||||
0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0 */
|
||||
|
||||
/* insert here the I/O port address and extent */
|
||||
#define GSCD_BASE_ADDR 0x340
|
||||
#define GSCD_IO_EXTENT 4
|
||||
|
||||
|
||||
/************** nothing to set up below here *********************/
|
||||
|
||||
/* port access macro */
|
||||
#define GSCDPORT(x) (gscd_port + (x))
|
||||
|
||||
/*
|
||||
* commands
|
||||
* the lower nibble holds the command length
|
||||
*/
|
||||
#define CMD_STATUS 0x01
|
||||
#define CMD_READSUBQ 0x02 /* 1: ?, 2: UPC, 5: ? */
|
||||
#define CMD_SEEK 0x05 /* read_mode M-S-F */
|
||||
#define CMD_READ 0x07 /* read_mode M-S-F nsec_h nsec_l */
|
||||
#define CMD_RESET 0x11
|
||||
#define CMD_SETMODE 0x15
|
||||
#define CMD_PLAY 0x17 /* M-S-F M-S-F */
|
||||
#define CMD_LOCK_CTL 0x22 /* 0: unlock, 1: lock */
|
||||
#define CMD_IDENT 0x31
|
||||
#define CMD_SETSPEED 0x32 /* 0: auto */ /* ??? */
|
||||
#define CMD_GETMODE 0x41
|
||||
#define CMD_PAUSE 0x51
|
||||
#define CMD_READTOC 0x61
|
||||
#define CMD_DISKINFO 0x71
|
||||
#define CMD_TRAY_CTL 0x81
|
||||
|
||||
/*
|
||||
* disk_state:
|
||||
*/
|
||||
#define ST_PLAYING 0x80
|
||||
#define ST_UNLOCKED 0x40
|
||||
#define ST_NO_DISK 0x20
|
||||
#define ST_DOOR_OPEN 0x10
|
||||
#define ST_x08 0x08
|
||||
#define ST_x04 0x04
|
||||
#define ST_INVALID 0x02
|
||||
#define ST_x01 0x01
|
||||
|
||||
/*
|
||||
* cmd_type:
|
||||
*/
|
||||
#define TYPE_INFO 0x01
|
||||
#define TYPE_DATA 0x02
|
||||
|
||||
/*
|
||||
* read_mode:
|
||||
*/
|
||||
#define MOD_POLLED 0x80
|
||||
#define MOD_x08 0x08
|
||||
#define MOD_RAW 0x04
|
||||
|
||||
#define READ_DATA(port, buf, nr) insb(port, buf, nr)
|
||||
|
||||
#define SET_TIMER(func, jifs) \
|
||||
((mod_timer(&gscd_timer, jiffies + jifs)), \
|
||||
(gscd_timer.function = func))
|
||||
|
||||
#define CLEAR_TIMER del_timer_sync(&gscd_timer)
|
||||
|
||||
#define MAX_TRACKS 104
|
||||
|
||||
struct msf {
|
||||
unsigned char min;
|
||||
unsigned char sec;
|
||||
unsigned char frame;
|
||||
};
|
||||
|
||||
struct gscd_Play_msf {
|
||||
struct msf start;
|
||||
struct msf end;
|
||||
};
|
||||
|
||||
struct gscd_DiskInfo {
|
||||
unsigned char first;
|
||||
unsigned char last;
|
||||
struct msf diskLength;
|
||||
struct msf firstTrack;
|
||||
};
|
||||
|
||||
struct gscd_Toc {
|
||||
unsigned char ctrl_addr;
|
||||
unsigned char track;
|
||||
unsigned char pointIndex;
|
||||
struct msf trackTime;
|
||||
struct msf diskTime;
|
||||
};
|
||||
|
|
@ -1,374 +0,0 @@
|
|||
/* -- ISP16 cdrom detection and configuration
|
||||
*
|
||||
* Copyright (c) 1995,1996 Eric van der Maarel <H.T.M.v.d.Maarel@marin.nl>
|
||||
*
|
||||
* Version 0.6
|
||||
*
|
||||
* History:
|
||||
* 0.5 First release.
|
||||
* Was included in the sjcd and optcd cdrom drivers.
|
||||
* 0.6 First "stand-alone" version.
|
||||
* Removed sound configuration.
|
||||
* Added "module" support.
|
||||
*
|
||||
* 9 November 1999 -- Make kernel-parameter implementation work with 2.3.x
|
||||
* Removed init_module & cleanup_module in favor of
|
||||
* module_init & module_exit.
|
||||
* Torben Mathiasen <tmm@image.dk>
|
||||
*
|
||||
* 19 June 2004 -- check_region() converted to request_region()
|
||||
* and return statement cleanups.
|
||||
* - Jesper Juhl
|
||||
*
|
||||
* Detect cdrom interface on ISP16 sound card.
|
||||
* Configure cdrom interface.
|
||||
*
|
||||
* Algorithm for the card with OPTi 82C928 taken
|
||||
* from the CDSETUP.SYS driver for MSDOS,
|
||||
* by OPTi Computers, version 2.03.
|
||||
* Algorithm for the card with OPTi 82C929 as communicated
|
||||
* to me by Vadim Model and Leo Spiekman.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#define ISP16_VERSION_MAJOR 0
|
||||
#define ISP16_VERSION_MINOR 6
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/io.h>
|
||||
#include "isp16.h"
|
||||
|
||||
static short isp16_detect(void);
|
||||
static short isp16_c928__detect(void);
|
||||
static short isp16_c929__detect(void);
|
||||
static short isp16_cdi_config(int base, u_char drive_type, int irq,
|
||||
int dma);
|
||||
static short isp16_type; /* dependent on type of interface card */
|
||||
static u_char isp16_ctrl;
|
||||
static u_short isp16_enable_port;
|
||||
|
||||
static int isp16_cdrom_base = ISP16_CDROM_IO_BASE;
|
||||
static int isp16_cdrom_irq = ISP16_CDROM_IRQ;
|
||||
static int isp16_cdrom_dma = ISP16_CDROM_DMA;
|
||||
static char *isp16_cdrom_type = ISP16_CDROM_TYPE;
|
||||
|
||||
module_param(isp16_cdrom_base, int, 0);
|
||||
module_param(isp16_cdrom_irq, int, 0);
|
||||
module_param(isp16_cdrom_dma, int, 0);
|
||||
module_param(isp16_cdrom_type, charp, 0);
|
||||
|
||||
#define ISP16_IN(p) (outb(isp16_ctrl,ISP16_CTRL_PORT), inb(p))
|
||||
#define ISP16_OUT(p,b) (outb(isp16_ctrl,ISP16_CTRL_PORT), outb(b,p))
|
||||
|
||||
#ifndef MODULE
|
||||
|
||||
static int
|
||||
__init isp16_setup(char *str)
|
||||
{
|
||||
int ints[4];
|
||||
|
||||
(void) get_options(str, ARRAY_SIZE(ints), ints);
|
||||
if (ints[0] > 0)
|
||||
isp16_cdrom_base = ints[1];
|
||||
if (ints[0] > 1)
|
||||
isp16_cdrom_irq = ints[2];
|
||||
if (ints[0] > 2)
|
||||
isp16_cdrom_dma = ints[3];
|
||||
if (str)
|
||||
isp16_cdrom_type = str;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("isp16=", isp16_setup);
|
||||
|
||||
#endif /* MODULE */
|
||||
|
||||
/*
|
||||
* ISP16 initialisation.
|
||||
*
|
||||
*/
|
||||
static int __init isp16_init(void)
|
||||
{
|
||||
u_char expected_drive;
|
||||
|
||||
printk(KERN_INFO
|
||||
"ISP16: configuration cdrom interface, version %d.%d.\n",
|
||||
ISP16_VERSION_MAJOR, ISP16_VERSION_MINOR);
|
||||
|
||||
if (!strcmp(isp16_cdrom_type, "noisp16")) {
|
||||
printk("ISP16: no cdrom interface configured.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!request_region(ISP16_IO_BASE, ISP16_IO_SIZE, "isp16")) {
|
||||
printk("ISP16: i/o ports already in use.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((isp16_type = isp16_detect()) < 0) {
|
||||
printk("ISP16: no cdrom interface found.\n");
|
||||
goto cleanup_out;
|
||||
}
|
||||
|
||||
printk(KERN_INFO
|
||||
"ISP16: cdrom interface (with OPTi 82C92%d chip) detected.\n",
|
||||
(isp16_type == 2) ? 9 : 8);
|
||||
|
||||
if (!strcmp(isp16_cdrom_type, "Sanyo"))
|
||||
expected_drive =
|
||||
(isp16_type ? ISP16_SANYO1 : ISP16_SANYO0);
|
||||
else if (!strcmp(isp16_cdrom_type, "Sony"))
|
||||
expected_drive = ISP16_SONY;
|
||||
else if (!strcmp(isp16_cdrom_type, "Panasonic"))
|
||||
expected_drive =
|
||||
(isp16_type ? ISP16_PANASONIC1 : ISP16_PANASONIC0);
|
||||
else if (!strcmp(isp16_cdrom_type, "Mitsumi"))
|
||||
expected_drive = ISP16_MITSUMI;
|
||||
else {
|
||||
printk("ISP16: %s not supported by cdrom interface.\n",
|
||||
isp16_cdrom_type);
|
||||
goto cleanup_out;
|
||||
}
|
||||
|
||||
if (isp16_cdi_config(isp16_cdrom_base, expected_drive,
|
||||
isp16_cdrom_irq, isp16_cdrom_dma) < 0) {
|
||||
printk
|
||||
("ISP16: cdrom interface has not been properly configured.\n");
|
||||
goto cleanup_out;
|
||||
}
|
||||
printk(KERN_INFO
|
||||
"ISP16: cdrom interface set up with io base 0x%03X, irq %d, dma %d,"
|
||||
" type %s.\n", isp16_cdrom_base, isp16_cdrom_irq,
|
||||
isp16_cdrom_dma, isp16_cdrom_type);
|
||||
return 0;
|
||||
|
||||
cleanup_out:
|
||||
release_region(ISP16_IO_BASE, ISP16_IO_SIZE);
|
||||
out:
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
static short __init isp16_detect(void)
|
||||
{
|
||||
|
||||
if (isp16_c929__detect() >= 0)
|
||||
return 2;
|
||||
else
|
||||
return (isp16_c928__detect());
|
||||
}
|
||||
|
||||
static short __init isp16_c928__detect(void)
|
||||
{
|
||||
u_char ctrl;
|
||||
u_char enable_cdrom;
|
||||
u_char io;
|
||||
short i = -1;
|
||||
|
||||
isp16_ctrl = ISP16_C928__CTRL;
|
||||
isp16_enable_port = ISP16_C928__ENABLE_PORT;
|
||||
|
||||
/* read' and write' are a special read and write, respectively */
|
||||
|
||||
/* read' ISP16_CTRL_PORT, clear last two bits and write' back the result */
|
||||
ctrl = ISP16_IN(ISP16_CTRL_PORT) & 0xFC;
|
||||
ISP16_OUT(ISP16_CTRL_PORT, ctrl);
|
||||
|
||||
/* read' 3,4 and 5-bit from the cdrom enable port */
|
||||
enable_cdrom = ISP16_IN(ISP16_C928__ENABLE_PORT) & 0x38;
|
||||
|
||||
if (!(enable_cdrom & 0x20)) { /* 5-bit not set */
|
||||
/* read' last 2 bits of ISP16_IO_SET_PORT */
|
||||
io = ISP16_IN(ISP16_IO_SET_PORT) & 0x03;
|
||||
if (((io & 0x01) << 1) == (io & 0x02)) { /* bits are the same */
|
||||
if (io == 0) { /* ...the same and 0 */
|
||||
i = 0;
|
||||
enable_cdrom |= 0x20;
|
||||
} else { /* ...the same and 1 *//* my card, first time 'round */
|
||||
i = 1;
|
||||
enable_cdrom |= 0x28;
|
||||
}
|
||||
ISP16_OUT(ISP16_C928__ENABLE_PORT, enable_cdrom);
|
||||
} else { /* bits are not the same */
|
||||
ISP16_OUT(ISP16_CTRL_PORT, ctrl);
|
||||
return i; /* -> not detected: possibly incorrect conclusion */
|
||||
}
|
||||
} else if (enable_cdrom == 0x20)
|
||||
i = 0;
|
||||
else if (enable_cdrom == 0x28) /* my card, already initialised */
|
||||
i = 1;
|
||||
|
||||
ISP16_OUT(ISP16_CTRL_PORT, ctrl);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static short __init isp16_c929__detect(void)
|
||||
{
|
||||
u_char ctrl;
|
||||
u_char tmp;
|
||||
|
||||
isp16_ctrl = ISP16_C929__CTRL;
|
||||
isp16_enable_port = ISP16_C929__ENABLE_PORT;
|
||||
|
||||
/* read' and write' are a special read and write, respectively */
|
||||
|
||||
/* read' ISP16_CTRL_PORT and save */
|
||||
ctrl = ISP16_IN(ISP16_CTRL_PORT);
|
||||
|
||||
/* write' zero to the ctrl port and get response */
|
||||
ISP16_OUT(ISP16_CTRL_PORT, 0);
|
||||
tmp = ISP16_IN(ISP16_CTRL_PORT);
|
||||
|
||||
if (tmp != 2) /* isp16 with 82C929 not detected */
|
||||
return -1;
|
||||
|
||||
/* restore ctrl port value */
|
||||
ISP16_OUT(ISP16_CTRL_PORT, ctrl);
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
static short __init
|
||||
isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
|
||||
{
|
||||
u_char base_code;
|
||||
u_char irq_code;
|
||||
u_char dma_code;
|
||||
u_char i;
|
||||
|
||||
if ((drive_type == ISP16_MITSUMI) && (dma != 0))
|
||||
printk("ISP16: Mitsumi cdrom drive has no dma support.\n");
|
||||
|
||||
switch (base) {
|
||||
case 0x340:
|
||||
base_code = ISP16_BASE_340;
|
||||
break;
|
||||
case 0x330:
|
||||
base_code = ISP16_BASE_330;
|
||||
break;
|
||||
case 0x360:
|
||||
base_code = ISP16_BASE_360;
|
||||
break;
|
||||
case 0x320:
|
||||
base_code = ISP16_BASE_320;
|
||||
break;
|
||||
default:
|
||||
printk
|
||||
("ISP16: base address 0x%03X not supported by cdrom interface.\n",
|
||||
base);
|
||||
return -1;
|
||||
}
|
||||
switch (irq) {
|
||||
case 0:
|
||||
irq_code = ISP16_IRQ_X;
|
||||
break; /* disable irq */
|
||||
case 5:
|
||||
irq_code = ISP16_IRQ_5;
|
||||
printk("ISP16: irq 5 shouldn't be used by cdrom interface,"
|
||||
" due to possible conflicts with the sound card.\n");
|
||||
break;
|
||||
case 7:
|
||||
irq_code = ISP16_IRQ_7;
|
||||
printk("ISP16: irq 7 shouldn't be used by cdrom interface,"
|
||||
" due to possible conflicts with the sound card.\n");
|
||||
break;
|
||||
case 3:
|
||||
irq_code = ISP16_IRQ_3;
|
||||
break;
|
||||
case 9:
|
||||
irq_code = ISP16_IRQ_9;
|
||||
break;
|
||||
case 10:
|
||||
irq_code = ISP16_IRQ_10;
|
||||
break;
|
||||
case 11:
|
||||
irq_code = ISP16_IRQ_11;
|
||||
break;
|
||||
default:
|
||||
printk("ISP16: irq %d not supported by cdrom interface.\n",
|
||||
irq);
|
||||
return -1;
|
||||
}
|
||||
switch (dma) {
|
||||
case 0:
|
||||
dma_code = ISP16_DMA_X;
|
||||
break; /* disable dma */
|
||||
case 1:
|
||||
printk("ISP16: dma 1 cannot be used by cdrom interface,"
|
||||
" due to conflict with the sound card.\n");
|
||||
return -1;
|
||||
break;
|
||||
case 3:
|
||||
dma_code = ISP16_DMA_3;
|
||||
break;
|
||||
case 5:
|
||||
dma_code = ISP16_DMA_5;
|
||||
break;
|
||||
case 6:
|
||||
dma_code = ISP16_DMA_6;
|
||||
break;
|
||||
case 7:
|
||||
dma_code = ISP16_DMA_7;
|
||||
break;
|
||||
default:
|
||||
printk("ISP16: dma %d not supported by cdrom interface.\n",
|
||||
dma);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (drive_type != ISP16_SONY && drive_type != ISP16_PANASONIC0 &&
|
||||
drive_type != ISP16_PANASONIC1 && drive_type != ISP16_SANYO0 &&
|
||||
drive_type != ISP16_SANYO1 && drive_type != ISP16_MITSUMI &&
|
||||
drive_type != ISP16_DRIVE_X) {
|
||||
printk
|
||||
("ISP16: drive type (code 0x%02X) not supported by cdrom"
|
||||
" interface.\n", drive_type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* set type of interface */
|
||||
i = ISP16_IN(ISP16_DRIVE_SET_PORT) & ISP16_DRIVE_SET_MASK; /* clear some bits */
|
||||
ISP16_OUT(ISP16_DRIVE_SET_PORT, i | drive_type);
|
||||
|
||||
/* enable cdrom on interface with 82C929 chip */
|
||||
if (isp16_type > 1)
|
||||
ISP16_OUT(isp16_enable_port, ISP16_ENABLE_CDROM);
|
||||
|
||||
/* set base address, irq and dma */
|
||||
i = ISP16_IN(ISP16_IO_SET_PORT) & ISP16_IO_SET_MASK; /* keep some bits */
|
||||
ISP16_OUT(ISP16_IO_SET_PORT, i | base_code | irq_code | dma_code);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit isp16_exit(void)
|
||||
{
|
||||
release_region(ISP16_IO_BASE, ISP16_IO_SIZE);
|
||||
printk(KERN_INFO "ISP16: module released.\n");
|
||||
}
|
||||
|
||||
module_init(isp16_init);
|
||||
module_exit(isp16_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
|
@ -1,72 +0,0 @@
|
|||
/* -- isp16.h
|
||||
*
|
||||
* Header for detection and initialisation of cdrom interface (only) on
|
||||
* ISP16 (MAD16, Mozart) sound card.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/* These are the default values */
|
||||
#define ISP16_CDROM_TYPE "Sanyo"
|
||||
#define ISP16_CDROM_IO_BASE 0x340
|
||||
#define ISP16_CDROM_IRQ 0
|
||||
#define ISP16_CDROM_DMA 0
|
||||
|
||||
/* Some (Media)Magic */
|
||||
/* define types of drive the interface on an ISP16 card may be looking at */
|
||||
#define ISP16_DRIVE_X 0x00
|
||||
#define ISP16_SONY 0x02
|
||||
#define ISP16_PANASONIC0 0x02
|
||||
#define ISP16_SANYO0 0x02
|
||||
#define ISP16_MITSUMI 0x04
|
||||
#define ISP16_PANASONIC1 0x06
|
||||
#define ISP16_SANYO1 0x06
|
||||
#define ISP16_DRIVE_NOT_USED 0x08 /* not used */
|
||||
#define ISP16_DRIVE_SET_MASK 0xF1 /* don't change 0-bit or 4-7-bits*/
|
||||
/* ...for port */
|
||||
#define ISP16_DRIVE_SET_PORT 0xF8D
|
||||
/* set io parameters */
|
||||
#define ISP16_BASE_340 0x00
|
||||
#define ISP16_BASE_330 0x40
|
||||
#define ISP16_BASE_360 0x80
|
||||
#define ISP16_BASE_320 0xC0
|
||||
#define ISP16_IRQ_X 0x00
|
||||
#define ISP16_IRQ_5 0x04 /* shouldn't be used to avoid sound card conflicts */
|
||||
#define ISP16_IRQ_7 0x08 /* shouldn't be used to avoid sound card conflicts */
|
||||
#define ISP16_IRQ_3 0x0C
|
||||
#define ISP16_IRQ_9 0x10
|
||||
#define ISP16_IRQ_10 0x14
|
||||
#define ISP16_IRQ_11 0x18
|
||||
#define ISP16_DMA_X 0x03
|
||||
#define ISP16_DMA_3 0x00
|
||||
#define ISP16_DMA_5 0x00
|
||||
#define ISP16_DMA_6 0x01
|
||||
#define ISP16_DMA_7 0x02
|
||||
#define ISP16_IO_SET_MASK 0x20 /* don't change 5-bit */
|
||||
/* ...for port */
|
||||
#define ISP16_IO_SET_PORT 0xF8E
|
||||
/* enable the card */
|
||||
#define ISP16_C928__ENABLE_PORT 0xF90 /* ISP16 with OPTi 82C928 chip */
|
||||
#define ISP16_C929__ENABLE_PORT 0xF91 /* ISP16 with OPTi 82C929 chip */
|
||||
#define ISP16_ENABLE_CDROM 0x80 /* seven bit */
|
||||
|
||||
/* the magic stuff */
|
||||
#define ISP16_CTRL_PORT 0xF8F
|
||||
#define ISP16_C928__CTRL 0xE2 /* ISP16 with OPTi 82C928 chip */
|
||||
#define ISP16_C929__CTRL 0xE3 /* ISP16 with OPTi 82C929 chip */
|
||||
|
||||
#define ISP16_IO_BASE 0xF8D
|
||||
#define ISP16_IO_SIZE 5 /* ports used from 0xF8D up to 0xF91 */
|
1943
drivers/cdrom/mcdx.c
1943
drivers/cdrom/mcdx.c
File diff suppressed because it is too large
Load Diff
|
@ -1,185 +0,0 @@
|
|||
/*
|
||||
* Definitions for the Mitsumi CDROM interface
|
||||
* Copyright (C) 1995 1996 Heiko Schlittermann <heiko@lotte.sax.de>
|
||||
* VERSION: @VERSION@
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* Thanks to
|
||||
* The Linux Community at all and ...
|
||||
* Martin Harris (he wrote the first Mitsumi Driver)
|
||||
* Eberhard Moenkeberg (he gave me much support and the initial kick)
|
||||
* Bernd Huebner, Ruediger Helsch (Unifix-Software Gmbh, they
|
||||
* improved the original driver)
|
||||
* Jon Tombs, Bjorn Ekwall (module support)
|
||||
* Daniel v. Mosnenck (he sent me the Technical and Programming Reference)
|
||||
* Gerd Knorr (he lent me his PhotoCD)
|
||||
* Nils Faerber and Roger E. Wolff (extensively tested the LU portion)
|
||||
* Andreas Kies (testing the mysterious hang up's)
|
||||
* ... somebody forgotten?
|
||||
* Marcin Dalecki
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following lines are for user configuration
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* {0|1} -- 1 if you want the driver detect your drive, may crash and
|
||||
* needs a long time to seek. The higher the address the longer the
|
||||
* seek.
|
||||
*
|
||||
* WARNING: AUTOPROBE doesn't work.
|
||||
*/
|
||||
#define MCDX_AUTOPROBE 0
|
||||
|
||||
/*
|
||||
* Drive specific settings according to the jumpers on the controller
|
||||
* board(s).
|
||||
* o MCDX_NDRIVES : number of used entries of the following table
|
||||
* o MCDX_DRIVEMAP : table of {i/o base, irq} per controller
|
||||
*
|
||||
* NOTE: I didn't get a drive at irq 9(2) working. Not even alone.
|
||||
*/
|
||||
#if MCDX_AUTOPROBE == 0
|
||||
#define MCDX_NDRIVES 1
|
||||
#define MCDX_DRIVEMAP { \
|
||||
{0x300, 11}, \
|
||||
{0x304, 05}, \
|
||||
{0x000, 00}, \
|
||||
{0x000, 00}, \
|
||||
{0x000, 00}, \
|
||||
}
|
||||
#else
|
||||
#error Autoprobing is not implemented yet.
|
||||
#endif
|
||||
|
||||
#ifndef MCDX_QUIET
|
||||
#define MCDX_QUIET 1
|
||||
#endif
|
||||
|
||||
#ifndef MCDX_DEBUG
|
||||
#define MCDX_DEBUG 0
|
||||
#endif
|
||||
|
||||
/* *** make the following line uncommented, if you're sure,
|
||||
* *** all configuration is done */
|
||||
/* #define I_WAS_HERE */
|
||||
|
||||
/* The name of the device */
|
||||
#define MCDX "mcdx"
|
||||
|
||||
/* Flags for DEBUGGING */
|
||||
#define INIT 0
|
||||
#define MALLOC 0
|
||||
#define IOCTL 0
|
||||
#define PLAYTRK 0
|
||||
#define SUBCHNL 0
|
||||
#define TOCHDR 0
|
||||
#define MS 0
|
||||
#define PLAYMSF 0
|
||||
#define READTOC 0
|
||||
#define OPENCLOSE 0
|
||||
#define HW 0
|
||||
#define TALK 0
|
||||
#define IRQ 0
|
||||
#define XFER 0
|
||||
#define REQUEST 0
|
||||
#define SLEEP 0
|
||||
|
||||
/* The following addresses are taken from the Mitsumi Reference
|
||||
* and describe the possible i/o range for the controller.
|
||||
*/
|
||||
#define MCDX_IO_BEGIN ((char*) 0x300) /* first base of i/o addr */
|
||||
#define MCDX_IO_END ((char*) 0x3fc) /* last base of i/o addr */
|
||||
|
||||
/* Per controller 4 bytes i/o are needed. */
|
||||
#define MCDX_IO_SIZE 4
|
||||
|
||||
/*
|
||||
* Bits
|
||||
*/
|
||||
|
||||
/* The status byte, returned from every command, set if
|
||||
* the description is true */
|
||||
#define MCDX_RBIT_OPEN 0x80 /* door is open */
|
||||
#define MCDX_RBIT_DISKSET 0x40 /* disk set (recognised) */
|
||||
#define MCDX_RBIT_CHANGED 0x20 /* disk was changed */
|
||||
#define MCDX_RBIT_CHECK 0x10 /* disk rotates, servo is on */
|
||||
#define MCDX_RBIT_AUDIOTR 0x08 /* current track is audio */
|
||||
#define MCDX_RBIT_RDERR 0x04 /* read error, refer SENSE KEY */
|
||||
#define MCDX_RBIT_AUDIOBS 0x02 /* currently playing audio */
|
||||
#define MCDX_RBIT_CMDERR 0x01 /* command, param or format error */
|
||||
|
||||
/* The I/O Register holding the h/w status of the drive,
|
||||
* can be read at i/o base + 1 */
|
||||
#define MCDX_RBIT_DOOR 0x10 /* door is open */
|
||||
#define MCDX_RBIT_STEN 0x04 /* if 0, i/o base contains drive status */
|
||||
#define MCDX_RBIT_DTEN 0x02 /* if 0, i/o base contains data */
|
||||
|
||||
/*
|
||||
* The commands.
|
||||
*/
|
||||
|
||||
#define OPCODE 1 /* offset of opcode */
|
||||
#define MCDX_CMD_REQUEST_TOC 1, 0x10
|
||||
#define MCDX_CMD_REQUEST_STATUS 1, 0x40
|
||||
#define MCDX_CMD_RESET 1, 0x60
|
||||
#define MCDX_CMD_REQUEST_DRIVE_MODE 1, 0xc2
|
||||
#define MCDX_CMD_SET_INTERLEAVE 2, 0xc8, 0
|
||||
#define MCDX_CMD_DATAMODE_SET 2, 0xa0, 0
|
||||
#define MCDX_DATAMODE1 0x01
|
||||
#define MCDX_DATAMODE2 0x02
|
||||
#define MCDX_CMD_LOCK_DOOR 2, 0xfe, 0
|
||||
|
||||
#define READ_AHEAD 4 /* 8 Sectors (4K) */
|
||||
|
||||
/* Useful macros */
|
||||
#define e_door(x) ((x) & MCDX_RBIT_OPEN)
|
||||
#define e_check(x) (~(x) & MCDX_RBIT_CHECK)
|
||||
#define e_notset(x) (~(x) & MCDX_RBIT_DISKSET)
|
||||
#define e_changed(x) ((x) & MCDX_RBIT_CHANGED)
|
||||
#define e_audio(x) ((x) & MCDX_RBIT_AUDIOTR)
|
||||
#define e_audiobusy(x) ((x) & MCDX_RBIT_AUDIOBS)
|
||||
#define e_cmderr(x) ((x) & MCDX_RBIT_CMDERR)
|
||||
#define e_readerr(x) ((x) & MCDX_RBIT_RDERR)
|
||||
|
||||
/** no drive specific */
|
||||
#define MCDX_CDBLK 2048 /* 2048 cooked data each blk */
|
||||
|
||||
#define MCDX_DATA_TIMEOUT (HZ/10) /* 0.1 second */
|
||||
|
||||
/*
|
||||
* Access to the msf array
|
||||
*/
|
||||
#define MSF_MIN 0 /* minute */
|
||||
#define MSF_SEC 1 /* second */
|
||||
#define MSF_FRM 2 /* frame */
|
||||
|
||||
/*
|
||||
* Errors
|
||||
*/
|
||||
#define MCDX_E 1 /* unspec error */
|
||||
#define MCDX_ST_EOM 0x0100 /* end of media */
|
||||
#define MCDX_ST_DRV 0x00ff /* mask to query the drive status */
|
||||
|
||||
#ifndef I_WAS_HERE
|
||||
#ifndef MODULE
|
||||
#warning You have not edited mcdx.h
|
||||
#warning Perhaps irq and i/o settings are wrong.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ex:set ts=4 sw=4: */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,52 +0,0 @@
|
|||
/* linux/include/linux/optcd.h - Optics Storage 8000 AT CDROM driver
|
||||
$Id: optcd.h,v 1.2 1996/01/15 18:43:44 root Exp root $
|
||||
|
||||
Copyright (C) 1995 Leo Spiekman (spiekman@dutette.et.tudelft.nl)
|
||||
|
||||
|
||||
Configuration file for linux/drivers/cdrom/optcd.c
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_OPTCD_H
|
||||
#define _LINUX_OPTCD_H
|
||||
|
||||
|
||||
/* I/O base of drive. Drive uses base to base+2.
|
||||
This setting can be overridden with the kernel or insmod command
|
||||
line option 'optcd=<portbase>'. Use address of 0 to disable driver. */
|
||||
#define OPTCD_PORTBASE 0x340
|
||||
|
||||
|
||||
/* enable / disable parts of driver by define / undef */
|
||||
#define MULTISESSION /* multisession support (ALPHA) */
|
||||
|
||||
|
||||
/* Change 0 to 1 to debug various parts of the driver */
|
||||
#define DEBUG_DRIVE_IF 0 /* Low level drive interface */
|
||||
#define DEBUG_CONV 0 /* Address conversions */
|
||||
#define DEBUG_BUFFERS 0 /* Buffering and block size conversion */
|
||||
#define DEBUG_REQUEST 0 /* Request mechanism */
|
||||
#define DEBUG_STATE 0 /* State machine */
|
||||
#define DEBUG_TOC 0 /* Q-channel and Table of Contents */
|
||||
#define DEBUG_MULTIS 0 /* Multisession code */
|
||||
#define DEBUG_VFS 0 /* VFS interface */
|
||||
|
||||
|
||||
/* Don't touch these unless you know what you're doing. */
|
||||
|
||||
/* Various timeout loop repetition counts. */
|
||||
#define BUSY_TIMEOUT 10000000 /* for busy wait */
|
||||
#define FAST_TIMEOUT 100000 /* ibid. for probing */
|
||||
#define SLEEP_TIMEOUT 6000 /* for timer wait */
|
||||
#define MULTI_SEEK_TIMEOUT 1000 /* for timer wait */
|
||||
#define READ_TIMEOUT 6000 /* for poll wait */
|
||||
#define STOP_TIMEOUT 2000 /* for poll wait */
|
||||
#define RESET_WAIT 5000 /* busy wait at drive reset */
|
||||
|
||||
/* # of buffers for block size conversion. 6 is optimal for my setup (P75),
|
||||
giving 280 kb/s, with 0.4% CPU usage. Experiment to find your optimal
|
||||
setting */
|
||||
#define N_BUFS 6
|
||||
|
||||
|
||||
#endif /* _LINUX_OPTCD_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,839 +0,0 @@
|
|||
/*
|
||||
* 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 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
|
||||
*/
|
||||
#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 */
|
||||
|
||||
/*
|
||||
* 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´t 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 (current_drive->diskstate_flags&upc_bit)
|
||||
#define volume_valid (current_drive->diskstate_flags&volume_bit)
|
||||
#define toc_valid (current_drive->diskstate_flags&toc_bit)
|
||||
#define cd_size_valid (current_drive->diskstate_flags&cd_size_bit)
|
||||
#define subq_valid (current_drive->diskstate_flags&subq_bit)
|
||||
#define frame_size_valid (current_drive->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 (current_drive->status_bits&p_door_closed)
|
||||
#define st_caddy_in (current_drive->status_bits&p_caddy_in)
|
||||
#define st_spinning (current_drive->status_bits&p_spinning)
|
||||
#define st_check (current_drive->status_bits&p_check)
|
||||
#define st_busy (current_drive->status_bits&p_busy_new)
|
||||
#define st_door_locked (current_drive->status_bits&p_door_locked)
|
||||
#define st_diskok (current_drive->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 (current_drive->drv_type&drv_fam0)
|
||||
#define famL_drive (current_drive->drv_type&drv_famL)
|
||||
#define famV_drive (current_drive->drv_type&drv_famV)
|
||||
#define fam1_drive (current_drive->drv_type&drv_fam1)
|
||||
#define fam2_drive (current_drive->drv_type&drv_fam2)
|
||||
#define famT_drive (current_drive->drv_type&drv_famT)
|
||||
#define fam0L_drive (current_drive->drv_type&(drv_fam0|drv_famL))
|
||||
#define fam0V_drive (current_drive->drv_type&(drv_fam0|drv_famV))
|
||||
#define famLV_drive (current_drive->drv_type&(drv_famL|drv_famV))
|
||||
#define fam0LV_drive (current_drive->drv_type&(drv_fam0|drv_famL|drv_famV))
|
||||
#define fam1L_drive (current_drive->drv_type&(drv_fam1|drv_famL))
|
||||
#define fam1V_drive (current_drive->drv_type&(drv_fam1|drv_famV))
|
||||
#define fam1LV_drive (current_drive->drv_type&(drv_fam1|drv_famL|drv_famV))
|
||||
#define fam01_drive (current_drive->drv_type&(drv_fam0|drv_fam1))
|
||||
#define fam12_drive (current_drive->drv_type&(drv_fam1|drv_fam2))
|
||||
#define fam2T_drive (current_drive->drv_type&(drv_fam2|drv_famT))
|
||||
|
||||
/*
|
||||
* audio states:
|
||||
*/
|
||||
#define audio_completed 3 /* Forgot this one! --AJK */
|
||||
#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 */
|
||||
#define READ_SC 0x04 /* "subchannel info": 96 bytes per frame */
|
||||
#define READ_AU 0x08 /* "audio frame": 2352 bytes per frame */
|
||||
|
||||
/*
|
||||
* sense_byte:
|
||||
*
|
||||
* values: 00
|
||||
* 01
|
||||
* 81
|
||||
* 82 "raw audio" mode
|
||||
* xx from infobuf[0] after 85 00 00 00 00 00 00
|
||||
*/
|
||||
|
||||
/* audio status (bin) */
|
||||
#define aud_00 0x00 /* Audio status byte not supported or not valid */
|
||||
#define audx11 0x0b /* Audio play operation in progress */
|
||||
#define audx12 0x0c /* Audio play operation paused */
|
||||
#define audx13 0x0d /* Audio play operation successfully completed */
|
||||
#define audx14 0x0e /* Audio play operation stopped due to error */
|
||||
#define audx15 0x0f /* No current audio status to return */
|
||||
/* audio status (bcd) */
|
||||
#define aud_11 0x11 /* Audio play operation in progress */
|
||||
#define aud_12 0x12 /* Audio play operation paused */
|
||||
#define aud_13 0x13 /* Audio play operation successfully completed */
|
||||
#define aud_14 0x14 /* Audio play operation stopped due to error */
|
||||
#define aud_15 0x15 /* No current audio status to return */
|
||||
|
||||
/*
|
||||
* highest allowed drive number (MINOR+1)
|
||||
*/
|
||||
#define NR_SBPCD 4
|
||||
|
||||
/*
|
||||
* we try to never disable interrupts - seems to work
|
||||
*/
|
||||
#define SBPCD_DIS_IRQ 0
|
||||
|
||||
/*
|
||||
* "write byte to port"
|
||||
*/
|
||||
#define OUT(x,y) outb(y,x)
|
||||
|
||||
/*==========================================================================*/
|
||||
|
||||
#define MIXER_addr SOUND_BASE+4 /* sound card's address register */
|
||||
#define MIXER_data SOUND_BASE+5 /* sound card's data register */
|
||||
#define MIXER_CD_Volume 0x28 /* internal SB Pro register address */
|
||||
|
||||
/*==========================================================================*/
|
||||
|
||||
#define MAX_TRACKS 99
|
||||
|
||||
#define ERR_DISKCHANGE 615
|
||||
|
||||
/*==========================================================================*/
|
||||
/*
|
||||
* To make conversions easier (machine dependent!)
|
||||
*/
|
||||
typedef union _msf
|
||||
{
|
||||
u_int n;
|
||||
u_char c[4];
|
||||
} MSF;
|
||||
|
||||
typedef union _blk
|
||||
{
|
||||
u_int n;
|
||||
u_char c[4];
|
||||
} BLK;
|
||||
|
||||
/*==========================================================================*/
|
||||
|
||||
/*============================================================================
|
||||
==============================================================================
|
||||
|
||||
COMMAND SET of "old" drives like CR-521, CR-522
|
||||
(the CR-562 family is different):
|
||||
|
||||
No. Command Code
|
||||
--------------------------------------------
|
||||
|
||||
Drive Commands:
|
||||
1 Seek 01
|
||||
2 Read Data 02
|
||||
3 Read XA-Data 03
|
||||
4 Read Header 04
|
||||
5 Spin Up 05
|
||||
6 Spin Down 06
|
||||
7 Diagnostic 07
|
||||
8 Read UPC 08
|
||||
9 Read ISRC 09
|
||||
10 Play Audio 0A
|
||||
11 Play Audio MSF 0B
|
||||
12 Play Audio Track/Index 0C
|
||||
|
||||
Status Commands:
|
||||
13 Read Status 81
|
||||
14 Read Error 82
|
||||
15 Read Drive Version 83
|
||||
16 Mode Select 84
|
||||
17 Mode Sense 85
|
||||
18 Set XA Parameter 86
|
||||
19 Read XA Parameter 87
|
||||
20 Read Capacity 88
|
||||
21 Read SUB_Q 89
|
||||
22 Read Disc Code 8A
|
||||
23 Read Disc Information 8B
|
||||
24 Read TOC 8C
|
||||
25 Pause/Resume 8D
|
||||
26 Read Packet 8E
|
||||
27 Read Path Check 00
|
||||
|
||||
|
||||
all numbers (lba, msf-bin, msf-bcd, counts) to transfer high byte first
|
||||
|
||||
mnemo 7-byte command #bytes response (r0...rn)
|
||||
________ ____________________ ____
|
||||
|
||||
Read Status:
|
||||
status: 81. (1) one-byte command, gives the main
|
||||
status byte
|
||||
Read Error:
|
||||
check1: 82 00 00 00 00 00 00. (6) r1: audio status
|
||||
|
||||
Read Packet:
|
||||
check2: 8e xx 00 00 00 00 00. (xx) gets xx bytes response, relating
|
||||
to commands 01 04 05 07 08 09
|
||||
|
||||
Play Audio:
|
||||
play: 0a ll-bb-aa nn-nn-nn. (0) play audio, ll-bb-aa: starting block (lba),
|
||||
nn-nn-nn: #blocks
|
||||
Play Audio MSF:
|
||||
0b mm-ss-ff mm-ss-ff (0) play audio from/to
|
||||
|
||||
Play Audio Track/Index:
|
||||
0c ...
|
||||
|
||||
Pause/Resume:
|
||||
pause: 8d pr 00 00 00 00 00. (0) pause (pr=00)
|
||||
resume (pr=80) audio playing
|
||||
|
||||
Mode Select:
|
||||
84 00 nn-nn ??.?? 00 (0) nn-nn: 2048 or 2340
|
||||
possibly defines transfer size
|
||||
|
||||
set_vol: 84 83 00 00 sw le 00. (0) sw(itch): lrxxxxxx (off=1)
|
||||
le(vel): min=0, max=FF, else half
|
||||
(firmware 2.11)
|
||||
|
||||
Mode Sense:
|
||||
get_vol: 85 03 00 00 00 00 00. (2) tell current audio volume setting
|
||||
|
||||
Read Disc Information:
|
||||
tocdesc: 8b 00 00 00 00 00 00. (6) read the toc descriptor ("msf-bin"-format)
|
||||
|
||||
Read TOC:
|
||||
tocent: 8c fl nn 00 00 00 00. (8) read toc entry #nn
|
||||
(fl=0:"lba"-, =2:"msf-bin"-format)
|
||||
|
||||
Read Capacity:
|
||||
capacit: 88 00 00 00 00 00 00. (5) "read CD-ROM capacity"
|
||||
|
||||
|
||||
Read Path Check:
|
||||
ping: 00 00 00 00 00 00 00. (2) r0=AA, r1=55
|
||||
("ping" if the drive is connected)
|
||||
|
||||
Read Drive Version:
|
||||
ident: 83 00 00 00 00 00 00. (12) gives "MATSHITAn.nn"
|
||||
(n.nn = 2.01, 2.11., 3.00, ...)
|
||||
|
||||
Seek:
|
||||
seek: 01 00 ll-bb-aa 00 00. (0)
|
||||
seek: 01 02 mm-ss-ff 00 00. (0)
|
||||
|
||||
Read Data:
|
||||
read: 02 xx-xx-xx nn-nn fl. (?) read nn-nn blocks of 2048 bytes,
|
||||
starting at block xx-xx-xx
|
||||
fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx
|
||||
|
||||
Read XA-Data:
|
||||
read: 03 xx-xx-xx nn-nn fl. (?) read nn-nn blocks of 2340 bytes,
|
||||
starting at block xx-xx-xx
|
||||
fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx
|
||||
|
||||
Read SUB_Q:
|
||||
89 fl 00 00 00 00 00. (13) r0: audio status, r4-r7: lba/msf,
|
||||
fl=0: "lba", fl=2: "msf"
|
||||
|
||||
Read Disc Code:
|
||||
8a 00 00 00 00 00 00. (14) possibly extended "check condition"-info
|
||||
|
||||
Read Header:
|
||||
04 00 ll-bb-aa 00 00. (0) 4 bytes response with "check2"
|
||||
04 02 mm-ss-ff 00 00. (0) 4 bytes response with "check2"
|
||||
|
||||
Spin Up:
|
||||
05 00 ll-bb-aa 00 00. (0) possibly implies a "seek"
|
||||
|
||||
Spin Down:
|
||||
06 ...
|
||||
|
||||
Diagnostic:
|
||||
07 00 ll-bb-aa 00 00. (2) 2 bytes response with "check2"
|
||||
07 02 mm-ss-ff 00 00. (2) 2 bytes response with "check2"
|
||||
|
||||
Read UPC:
|
||||
08 00 ll-bb-aa 00 00. (16)
|
||||
08 02 mm-ss-ff 00 00. (16)
|
||||
|
||||
Read ISRC:
|
||||
09 00 ll-bb-aa 00 00. (15) 15 bytes response with "check2"
|
||||
09 02 mm-ss-ff 00 00. (15) 15 bytes response with "check2"
|
||||
|
||||
Set XA Parameter:
|
||||
86 ...
|
||||
|
||||
Read XA Parameter:
|
||||
87 ...
|
||||
|
||||
==============================================================================
|
||||
============================================================================*/
|
||||
|
||||
/*
|
||||
* commands
|
||||
*
|
||||
* CR-52x: CMD0_
|
||||
* CR-56x: CMD1_
|
||||
* CD200: CMD2_
|
||||
* LCS-7260: CMDL_
|
||||
* TEAC CD-55A: CMDT_
|
||||
* ECS-AT: CMDV_
|
||||
*/
|
||||
#define CMD1_RESET 0x0a
|
||||
#define CMD2_RESET 0x01
|
||||
#define CMDT_RESET 0xc0
|
||||
|
||||
#define CMD1_LOCK_CTL 0x0c
|
||||
#define CMD2_LOCK_CTL 0x1e
|
||||
#define CMDT_LOCK_CTL CMD2_LOCK_CTL
|
||||
#define CMDL_LOCK_CTL 0x0e
|
||||
#define CMDV_LOCK_CTL CMDL_LOCK_CTL
|
||||
|
||||
#define CMD1_TRAY_CTL 0x07
|
||||
#define CMD2_TRAY_CTL 0x1b
|
||||
#define CMDT_TRAY_CTL CMD2_TRAY_CTL
|
||||
#define CMDL_TRAY_CTL 0x0d
|
||||
#define CMDV_TRAY_CTL CMDL_TRAY_CTL
|
||||
|
||||
#define CMD1_MULTISESS 0x8d
|
||||
#define CMDL_MULTISESS 0x8c
|
||||
#define CMDV_MULTISESS CMDL_MULTISESS
|
||||
|
||||
#define CMD1_SUBCHANINF 0x11
|
||||
#define CMD2_SUBCHANINF 0x??
|
||||
|
||||
#define CMD1_ABORT 0x08
|
||||
#define CMD2_ABORT 0x08
|
||||
#define CMDT_ABORT 0x08
|
||||
|
||||
#define CMD2_x02 0x02
|
||||
|
||||
#define CMD2_SETSPEED 0xda
|
||||
|
||||
#define CMD0_PATH_CHECK 0x00
|
||||
#define CMD1_PATH_CHECK 0x???
|
||||
#define CMD2_PATH_CHECK 0x???
|
||||
#define CMDT_PATH_CHECK 0x???
|
||||
#define CMDL_PATH_CHECK CMD0_PATH_CHECK
|
||||
#define CMDV_PATH_CHECK CMD0_PATH_CHECK
|
||||
|
||||
#define CMD0_SEEK 0x01
|
||||
#define CMD1_SEEK CMD0_SEEK
|
||||
#define CMD2_SEEK 0x2b
|
||||
#define CMDT_SEEK CMD2_SEEK
|
||||
#define CMDL_SEEK CMD0_SEEK
|
||||
#define CMDV_SEEK CMD0_SEEK
|
||||
|
||||
#define CMD0_READ 0x02
|
||||
#define CMD1_READ 0x10
|
||||
#define CMD2_READ 0x28
|
||||
#define CMDT_READ CMD2_READ
|
||||
#define CMDL_READ CMD0_READ
|
||||
#define CMDV_READ CMD0_READ
|
||||
|
||||
#define CMD0_READ_XA 0x03
|
||||
#define CMD2_READ_XA 0xd4
|
||||
#define CMD2_READ_XA2 0xd5
|
||||
#define CMDL_READ_XA CMD0_READ_XA /* really ?? */
|
||||
#define CMDV_READ_XA CMD0_READ_XA
|
||||
|
||||
#define CMD0_READ_HEAD 0x04
|
||||
|
||||
#define CMD0_SPINUP 0x05
|
||||
#define CMD1_SPINUP 0x02
|
||||
#define CMD2_SPINUP CMD2_TRAY_CTL
|
||||
#define CMDL_SPINUP CMD0_SPINUP
|
||||
#define CMDV_SPINUP CMD0_SPINUP
|
||||
|
||||
#define CMD0_SPINDOWN 0x06 /* really??? */
|
||||
#define CMD1_SPINDOWN 0x06
|
||||
#define CMD2_SPINDOWN CMD2_TRAY_CTL
|
||||
#define CMDL_SPINDOWN 0x0d
|
||||
#define CMDV_SPINDOWN CMD0_SPINDOWN
|
||||
|
||||
#define CMD0_DIAG 0x07
|
||||
|
||||
#define CMD0_READ_UPC 0x08
|
||||
#define CMD1_READ_UPC 0x88
|
||||
#define CMD2_READ_UPC 0x???
|
||||
#define CMDL_READ_UPC CMD0_READ_UPC
|
||||
#define CMDV_READ_UPC 0x8f
|
||||
|
||||
#define CMD0_READ_ISRC 0x09
|
||||
|
||||
#define CMD0_PLAY 0x0a
|
||||
#define CMD1_PLAY 0x???
|
||||
#define CMD2_PLAY 0x???
|
||||
#define CMDL_PLAY CMD0_PLAY
|
||||
#define CMDV_PLAY CMD0_PLAY
|
||||
|
||||
#define CMD0_PLAY_MSF 0x0b
|
||||
#define CMD1_PLAY_MSF 0x0e
|
||||
#define CMD2_PLAY_MSF 0x47
|
||||
#define CMDT_PLAY_MSF CMD2_PLAY_MSF
|
||||
#define CMDL_PLAY_MSF 0x???
|
||||
|
||||
#define CMD0_PLAY_TI 0x0c
|
||||
#define CMD1_PLAY_TI 0x0f
|
||||
|
||||
#define CMD0_STATUS 0x81
|
||||
#define CMD1_STATUS 0x05
|
||||
#define CMD2_STATUS 0x00
|
||||
#define CMDT_STATUS CMD2_STATUS
|
||||
#define CMDL_STATUS CMD0_STATUS
|
||||
#define CMDV_STATUS CMD0_STATUS
|
||||
#define CMD2_SEEK_LEADIN 0x00
|
||||
|
||||
#define CMD0_READ_ERR 0x82
|
||||
#define CMD1_READ_ERR CMD0_READ_ERR
|
||||
#define CMD2_READ_ERR 0x03
|
||||
#define CMDT_READ_ERR CMD2_READ_ERR /* get audio status */
|
||||
#define CMDL_READ_ERR CMD0_READ_ERR
|
||||
#define CMDV_READ_ERR CMD0_READ_ERR
|
||||
|
||||
#define CMD0_READ_VER 0x83
|
||||
#define CMD1_READ_VER CMD0_READ_VER
|
||||
#define CMD2_READ_VER 0x12
|
||||
#define CMDT_READ_VER CMD2_READ_VER /* really ?? */
|
||||
#define CMDL_READ_VER CMD0_READ_VER
|
||||
#define CMDV_READ_VER CMD0_READ_VER
|
||||
|
||||
#define CMD0_SETMODE 0x84
|
||||
#define CMD1_SETMODE 0x09
|
||||
#define CMD2_SETMODE 0x55
|
||||
#define CMDT_SETMODE CMD2_SETMODE
|
||||
#define CMDL_SETMODE CMD0_SETMODE
|
||||
|
||||
#define CMD0_GETMODE 0x85
|
||||
#define CMD1_GETMODE 0x84
|
||||
#define CMD2_GETMODE 0x5a
|
||||
#define CMDT_GETMODE CMD2_GETMODE
|
||||
#define CMDL_GETMODE CMD0_GETMODE
|
||||
|
||||
#define CMD0_SET_XA 0x86
|
||||
|
||||
#define CMD0_GET_XA 0x87
|
||||
|
||||
#define CMD0_CAPACITY 0x88
|
||||
#define CMD1_CAPACITY 0x85
|
||||
#define CMD2_CAPACITY 0x25
|
||||
#define CMDL_CAPACITY CMD0_CAPACITY /* missing in some firmware versions */
|
||||
|
||||
#define CMD0_READSUBQ 0x89
|
||||
#define CMD1_READSUBQ 0x87
|
||||
#define CMD2_READSUBQ 0x42
|
||||
#define CMDT_READSUBQ CMD2_READSUBQ
|
||||
#define CMDL_READSUBQ CMD0_READSUBQ
|
||||
#define CMDV_READSUBQ CMD0_READSUBQ
|
||||
|
||||
#define CMD0_DISKCODE 0x8a
|
||||
|
||||
#define CMD0_DISKINFO 0x8b
|
||||
#define CMD1_DISKINFO CMD0_DISKINFO
|
||||
#define CMD2_DISKINFO 0x43
|
||||
#define CMDT_DISKINFO CMD2_DISKINFO
|
||||
#define CMDL_DISKINFO CMD0_DISKINFO
|
||||
#define CMDV_DISKINFO CMD0_DISKINFO
|
||||
|
||||
#define CMD0_READTOC 0x8c
|
||||
#define CMD1_READTOC CMD0_READTOC
|
||||
#define CMD2_READTOC 0x???
|
||||
#define CMDL_READTOC CMD0_READTOC
|
||||
#define CMDV_READTOC CMD0_READTOC
|
||||
|
||||
#define CMD0_PAU_RES 0x8d
|
||||
#define CMD1_PAU_RES 0x0d
|
||||
#define CMD2_PAU_RES 0x4b
|
||||
#define CMDT_PAUSE CMD2_PAU_RES
|
||||
#define CMDL_PAU_RES CMD0_PAU_RES
|
||||
#define CMDV_PAUSE CMD0_PAU_RES
|
||||
|
||||
#define CMD0_PACKET 0x8e
|
||||
#define CMD1_PACKET CMD0_PACKET
|
||||
#define CMD2_PACKET 0x???
|
||||
#define CMDL_PACKET CMD0_PACKET
|
||||
#define CMDV_PACKET 0x???
|
||||
|
||||
/*==========================================================================*/
|
||||
/*==========================================================================*/
|
||||
#endif /* _LINUX_SBPCD_H */
|
||||
/*==========================================================================*/
|
||||
/*
|
||||
* Overrides for Emacs so that we follow Linus's tabbing style.
|
||||
* Emacs will notice this stuff at the end of the file and automatically
|
||||
* adjust the settings for this buffer only. This must remain at the end
|
||||
* of the file.
|
||||
* ---------------------------------------------------------------------------
|
||||
* Local variables:
|
||||
* c-indent-level: 8
|
||||
* c-brace-imaginary-offset: 0
|
||||
* c-brace-offset: -8
|
||||
* c-argdecl-indent: 8
|
||||
* c-label-offset: -8
|
||||
* c-continued-statement-offset: 8
|
||||
* c-continued-brace-offset: 0
|
||||
* End:
|
||||
*/
|
1815
drivers/cdrom/sjcd.c
1815
drivers/cdrom/sjcd.c
File diff suppressed because it is too large
Load Diff
|
@ -1,181 +0,0 @@
|
|||
/*
|
||||
* Definitions for a Sanyo CD-ROM interface.
|
||||
*
|
||||
* Copyright (C) 1995 Vadim V. Model
|
||||
* model@cecmow.enet.dec.com
|
||||
* vadim@rbrf.msk.su
|
||||
* vadim@ipsun.ras.ru
|
||||
* Eric van der Maarel
|
||||
* H.T.M.v.d.Maarel@marin.nl
|
||||
*
|
||||
* This information is based on mcd.c from M. Harriss and sjcd102.lst from
|
||||
* E. Moenkeberg.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SJCD_H__
|
||||
#define __SJCD_H__
|
||||
|
||||
/*
|
||||
* Change this to set the I/O port address as default. More flexibility
|
||||
* come with setup implementation.
|
||||
*/
|
||||
#define SJCD_BASE_ADDR 0x340
|
||||
|
||||
/*
|
||||
* Change this to set the irq as default. Really SANYO do not use interrupts
|
||||
* at all.
|
||||
*/
|
||||
#define SJCD_INTR_NR 0
|
||||
|
||||
/*
|
||||
* Change this to set the dma as default value. really SANYO does not use
|
||||
* direct memory access at all.
|
||||
*/
|
||||
#define SJCD_DMA_NR 0
|
||||
|
||||
/*
|
||||
* Macros which allow us to find out the status of the drive.
|
||||
*/
|
||||
#define SJCD_STATUS_AVAILABLE( x ) (((x)&0x02)==0)
|
||||
#define SJCD_DATA_AVAILABLE( x ) (((x)&0x01)==0)
|
||||
|
||||
/*
|
||||
* Port access macro. Three ports are available: S-data port (command port),
|
||||
* status port (read only) and D-data port (read only).
|
||||
*/
|
||||
#define SJCDPORT( x ) ( sjcd_base + ( x ) )
|
||||
#define SJCD_STATUS_PORT SJCDPORT( 1 )
|
||||
#define SJCD_S_DATA_PORT SJCDPORT( 0 )
|
||||
#define SJCD_COMMAND_PORT SJCDPORT( 0 )
|
||||
#define SJCD_D_DATA_PORT SJCDPORT( 2 )
|
||||
|
||||
/*
|
||||
* Drive info bits. Drive info available as first (mandatory) byte of
|
||||
* command completion status.
|
||||
*/
|
||||
#define SST_NOT_READY 0x10 /* no disk in the drive (???) */
|
||||
#define SST_MEDIA_CHANGED 0x20 /* disk is changed */
|
||||
#define SST_DOOR_OPENED 0x40 /* door is open */
|
||||
|
||||
/* commands */
|
||||
|
||||
#define SCMD_EJECT_TRAY 0xD0 /* eject tray if not locked */
|
||||
#define SCMD_LOCK_TRAY 0xD2 /* lock tray when in */
|
||||
#define SCMD_UNLOCK_TRAY 0xD4 /* unlock tray when in */
|
||||
#define SCMD_CLOSE_TRAY 0xD6 /* load tray in */
|
||||
|
||||
#define SCMD_RESET 0xFA /* soft reset */
|
||||
#define SCMD_GET_STATUS 0x80
|
||||
#define SCMD_GET_VERSION 0xCC
|
||||
|
||||
#define SCMD_DATA_READ 0xA0 /* are the same, depend on mode&args */
|
||||
#define SCMD_SEEK 0xA0
|
||||
#define SCMD_PLAY 0xA0
|
||||
|
||||
#define SCMD_GET_QINFO 0xA8
|
||||
|
||||
#define SCMD_SET_MODE 0xC4
|
||||
#define SCMD_MODE_PLAY 0xE0
|
||||
#define SCMD_MODE_COOKED (0xF8 & ~0x20)
|
||||
#define SCMD_MODE_RAW 0xF9
|
||||
#define SCMD_MODE_x20_BIT 0x20 /* What is it for ? */
|
||||
|
||||
#define SCMD_SET_VOLUME 0xAE
|
||||
#define SCMD_PAUSE 0xE0
|
||||
#define SCMD_STOP 0xE0
|
||||
|
||||
#define SCMD_GET_DISK_INFO 0xAA
|
||||
|
||||
/*
|
||||
* Some standard arguments for SCMD_GET_DISK_INFO.
|
||||
*/
|
||||
#define SCMD_GET_1_TRACK 0xA0 /* get the first track information */
|
||||
#define SCMD_GET_L_TRACK 0xA1 /* get the last track information */
|
||||
#define SCMD_GET_D_SIZE 0xA2 /* get the whole disk information */
|
||||
|
||||
/*
|
||||
* Borrowed from hd.c. Allows to optimize multiple port read commands.
|
||||
*/
|
||||
#define S_READ_DATA( port, buf, nr ) insb( port, buf, nr )
|
||||
|
||||
/*
|
||||
* We assume that there are no audio disks with TOC length more than this
|
||||
* number (I personally have never seen disks with more than 20 fragments).
|
||||
*/
|
||||
#define SJCD_MAX_TRACKS 100
|
||||
|
||||
struct msf {
|
||||
unsigned char min;
|
||||
unsigned char sec;
|
||||
unsigned char frame;
|
||||
};
|
||||
|
||||
struct sjcd_hw_disk_info {
|
||||
unsigned char track_control;
|
||||
unsigned char track_no;
|
||||
unsigned char x, y, z;
|
||||
union {
|
||||
unsigned char track_no;
|
||||
struct msf track_msf;
|
||||
} un;
|
||||
};
|
||||
|
||||
struct sjcd_hw_qinfo {
|
||||
unsigned char track_control;
|
||||
unsigned char track_no;
|
||||
unsigned char x;
|
||||
struct msf rel;
|
||||
struct msf abs;
|
||||
};
|
||||
|
||||
struct sjcd_play_msf {
|
||||
struct msf start;
|
||||
struct msf end;
|
||||
};
|
||||
|
||||
struct sjcd_disk_info {
|
||||
unsigned char first;
|
||||
unsigned char last;
|
||||
struct msf disk_length;
|
||||
struct msf first_track;
|
||||
};
|
||||
|
||||
struct sjcd_toc {
|
||||
unsigned char ctrl_addr;
|
||||
unsigned char track;
|
||||
unsigned char point_index;
|
||||
struct msf track_time;
|
||||
struct msf disk_time;
|
||||
};
|
||||
|
||||
#if defined( SJCD_GATHER_STAT )
|
||||
|
||||
struct sjcd_stat {
|
||||
int ticks;
|
||||
int tticks[ 8 ];
|
||||
int idle_ticks;
|
||||
int start_ticks;
|
||||
int mode_ticks;
|
||||
int read_ticks;
|
||||
int data_ticks;
|
||||
int stop_ticks;
|
||||
int stopping_ticks;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -1,183 +0,0 @@
|
|||
#ifndef SONYCD535_H
|
||||
#define SONYCD535_H
|
||||
|
||||
/*
|
||||
* define all the commands recognized by the CDU-531/5
|
||||
*/
|
||||
#define SONY535_REQUEST_DRIVE_STATUS_1 (0x80)
|
||||
#define SONY535_REQUEST_SENSE (0x82)
|
||||
#define SONY535_REQUEST_DRIVE_STATUS_2 (0x84)
|
||||
#define SONY535_REQUEST_ERROR_STATUS (0x86)
|
||||
#define SONY535_REQUEST_AUDIO_STATUS (0x88)
|
||||
#define SONY535_INQUIRY (0x8a)
|
||||
|
||||
#define SONY535_SET_INACTIVITY_TIME (0x90)
|
||||
|
||||
#define SONY535_SEEK_AND_READ_N_BLOCKS_1 (0xa0)
|
||||
#define SONY535_SEEK_AND_READ_N_BLOCKS_2 (0xa4)
|
||||
#define SONY535_PLAY_AUDIO (0xa6)
|
||||
|
||||
#define SONY535_REQUEST_DISC_CAPACITY (0xb0)
|
||||
#define SONY535_REQUEST_TOC_DATA (0xb2)
|
||||
#define SONY535_REQUEST_SUB_Q_DATA (0xb4)
|
||||
#define SONY535_REQUEST_ISRC (0xb6)
|
||||
#define SONY535_REQUEST_UPC_EAN (0xb8)
|
||||
|
||||
#define SONY535_SET_DRIVE_MODE (0xc0)
|
||||
#define SONY535_REQUEST_DRIVE_MODE (0xc2)
|
||||
#define SONY535_SET_RETRY_COUNT (0xc4)
|
||||
|
||||
#define SONY535_DIAGNOSTIC_1 (0xc6)
|
||||
#define SONY535_DIAGNOSTIC_4 (0xcc)
|
||||
#define SONY535_DIAGNOSTIC_5 (0xce)
|
||||
|
||||
#define SONY535_EJECT_CADDY (0xd0)
|
||||
#define SONY535_DISABLE_EJECT_BUTTON (0xd2)
|
||||
#define SONY535_ENABLE_EJECT_BUTTON (0xd4)
|
||||
|
||||
#define SONY535_HOLD (0xe0)
|
||||
#define SONY535_AUDIO_PAUSE_ON_OFF (0xe2)
|
||||
#define SONY535_SET_VOLUME (0xe8)
|
||||
|
||||
#define SONY535_STOP (0xf0)
|
||||
#define SONY535_SPIN_UP (0xf2)
|
||||
#define SONY535_SPIN_DOWN (0xf4)
|
||||
|
||||
#define SONY535_CLEAR_PARAMETERS (0xf6)
|
||||
#define SONY535_CLEAR_ENDING_ADDRESS (0xf8)
|
||||
|
||||
/*
|
||||
* define some masks
|
||||
*/
|
||||
#define SONY535_DATA_NOT_READY_BIT (0x1)
|
||||
#define SONY535_RESULT_NOT_READY_BIT (0x2)
|
||||
|
||||
/*
|
||||
* drive status 1
|
||||
*/
|
||||
#define SONY535_STATUS1_COMMAND_ERROR (0x1)
|
||||
#define SONY535_STATUS1_DATA_ERROR (0x2)
|
||||
#define SONY535_STATUS1_SEEK_ERROR (0x4)
|
||||
#define SONY535_STATUS1_DISC_TYPE_ERROR (0x8)
|
||||
#define SONY535_STATUS1_NOT_SPINNING (0x10)
|
||||
#define SONY535_STATUS1_EJECT_BUTTON_PRESSED (0x20)
|
||||
#define SONY535_STATUS1_CADDY_NOT_INSERTED (0x40)
|
||||
#define SONY535_STATUS1_BYTE_TWO_FOLLOWS (0x80)
|
||||
|
||||
/*
|
||||
* drive status 2
|
||||
*/
|
||||
#define SONY535_CDD_LOADING_ERROR (0x7)
|
||||
#define SONY535_CDD_NO_DISC (0x8)
|
||||
#define SONY535_CDD_UNLOADING_ERROR (0x9)
|
||||
#define SONY535_CDD_CADDY_NOT_INSERTED (0xd)
|
||||
#define SONY535_ATN_RESET_OCCURRED (0x2)
|
||||
#define SONY535_ATN_DISC_CHANGED (0x4)
|
||||
#define SONY535_ATN_RESET_AND_DISC_CHANGED (0x6)
|
||||
#define SONY535_ATN_EJECT_IN_PROGRESS (0xe)
|
||||
#define SONY535_ATN_BUSY (0xf)
|
||||
|
||||
/*
|
||||
* define some parameters
|
||||
*/
|
||||
#define SONY535_AUDIO_DRIVE_MODE (0)
|
||||
#define SONY535_CDROM_DRIVE_MODE (0xe0)
|
||||
|
||||
#define SONY535_PLAY_OP_PLAYBACK (0)
|
||||
#define SONY535_PLAY_OP_ENTER_HOLD (1)
|
||||
#define SONY535_PLAY_OP_SET_AUDIO_ENDING_ADDR (2)
|
||||
#define SONY535_PLAY_OP_SCAN_FORWARD (3)
|
||||
#define SONY535_PLAY_OP_SCAN_BACKWARD (4)
|
||||
|
||||
/*
|
||||
* convert from msf format to block number
|
||||
*/
|
||||
#define SONY_BLOCK_NUMBER(m,s,f) (((m)*60L+(s))*75L+(f))
|
||||
#define SONY_BLOCK_NUMBER_MSF(x) (((x)[0]*60L+(x)[1])*75L+(x)[2])
|
||||
|
||||
/*
|
||||
* error return values from the doSonyCmd() routines
|
||||
*/
|
||||
#define TIME_OUT (-1)
|
||||
#define NO_CDROM (-2)
|
||||
#define BAD_STATUS (-3)
|
||||
#define CD_BUSY (-4)
|
||||
#define NOT_DATA_CD (-5)
|
||||
#define NO_ROOM (-6)
|
||||
|
||||
#define LOG_START_OFFSET 150 /* Offset of first logical sector */
|
||||
|
||||
#define SONY_JIFFIES_TIMEOUT (5*HZ) /* Maximum time
|
||||
the drive will wait/try for an
|
||||
operation */
|
||||
#define SONY_READY_RETRIES (50000) /* How many times to retry a
|
||||
spin waiting for a register
|
||||
to come ready */
|
||||
#define SONY535_FAST_POLLS (10000) /* how many times recheck
|
||||
status waiting for a data
|
||||
to become ready */
|
||||
|
||||
typedef unsigned char Byte;
|
||||
|
||||
/*
|
||||
* This is the complete status returned from the drive configuration request
|
||||
* command.
|
||||
*/
|
||||
struct s535_sony_drive_config
|
||||
{
|
||||
char vendor_id[8];
|
||||
char product_id[16];
|
||||
char product_rev_level[4];
|
||||
};
|
||||
|
||||
/* The following is returned from the request sub-q data command */
|
||||
struct s535_sony_subcode
|
||||
{
|
||||
unsigned char address :4;
|
||||
unsigned char control :4;
|
||||
unsigned char track_num;
|
||||
unsigned char index_num;
|
||||
unsigned char rel_msf[3];
|
||||
unsigned char abs_msf[3];
|
||||
};
|
||||
|
||||
struct s535_sony_disc_capacity
|
||||
{
|
||||
Byte mFirstTrack, sFirstTrack, fFirstTrack;
|
||||
Byte mLeadOut, sLeadOut, fLeadOut;
|
||||
};
|
||||
|
||||
/*
|
||||
* The following is returned from the request TOC (Table Of Contents) command.
|
||||
* (last_track_num-first_track_num+1) values are valid in tracks.
|
||||
*/
|
||||
struct s535_sony_toc
|
||||
{
|
||||
unsigned char reserved0 :4;
|
||||
unsigned char control0 :4;
|
||||
unsigned char point0;
|
||||
unsigned char first_track_num;
|
||||
unsigned char reserved0a;
|
||||
unsigned char reserved0b;
|
||||
unsigned char reserved1 :4;
|
||||
unsigned char control1 :4;
|
||||
unsigned char point1;
|
||||
unsigned char last_track_num;
|
||||
unsigned char dummy1;
|
||||
unsigned char dummy2;
|
||||
unsigned char reserved2 :4;
|
||||
unsigned char control2 :4;
|
||||
unsigned char point2;
|
||||
unsigned char lead_out_start_msf[3];
|
||||
struct
|
||||
{
|
||||
unsigned char reserved :4;
|
||||
unsigned char control :4;
|
||||
unsigned char track;
|
||||
unsigned char track_start_msf[3];
|
||||
} tracks[100];
|
||||
|
||||
unsigned int lead_out_start_lba;
|
||||
};
|
||||
|
||||
#endif /* SONYCD535_H */
|
|
@ -623,7 +623,8 @@ static void hd_request(void)
|
|||
cyl = track / disk->head;
|
||||
#ifdef DEBUG
|
||||
printk("%s: %sing: CHS=%d/%d/%d, sectors=%d, buffer=%p\n",
|
||||
req->rq_disk->disk_name, (req->cmd == READ)?"read":"writ",
|
||||
req->rq_disk->disk_name,
|
||||
req_data_dir(req) == READ ? "read" : "writ",
|
||||
cyl, head, sec, nsect, req->buffer);
|
||||
#endif
|
||||
if (blk_fs_request(req)) {
|
||||
|
|
2
fs/bio.c
2
fs/bio.c
|
@ -1223,8 +1223,6 @@ EXPORT_SYMBOL(bio_hw_segments);
|
|||
EXPORT_SYMBOL(bio_add_page);
|
||||
EXPORT_SYMBOL(bio_add_pc_page);
|
||||
EXPORT_SYMBOL(bio_get_nr_vecs);
|
||||
EXPORT_SYMBOL(bio_map_user);
|
||||
EXPORT_SYMBOL(bio_unmap_user);
|
||||
EXPORT_SYMBOL(bio_map_kern);
|
||||
EXPORT_SYMBOL(bio_pair_release);
|
||||
EXPORT_SYMBOL(bio_split);
|
||||
|
|
|
@ -868,11 +868,6 @@ void kblockd_flush_work(struct work_struct *work);
|
|||
*/
|
||||
#define buffer_heads_over_limit 0
|
||||
|
||||
static inline long blk_congestion_wait(int rw, long timeout)
|
||||
{
|
||||
return io_schedule_timeout(timeout);
|
||||
}
|
||||
|
||||
static inline long nr_blockdev_pages(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -47,8 +47,10 @@ enum {
|
|||
#define IOPRIO_NORM (4)
|
||||
static inline int task_ioprio(struct task_struct *task)
|
||||
{
|
||||
WARN_ON(!ioprio_valid(task->ioprio));
|
||||
return IOPRIO_PRIO_DATA(task->ioprio);
|
||||
if (ioprio_valid(task->ioprio))
|
||||
return IOPRIO_PRIO_DATA(task->ioprio);
|
||||
|
||||
return IOPRIO_NORM;
|
||||
}
|
||||
|
||||
static inline int task_nice_ioprio(struct task_struct *task)
|
||||
|
|
|
@ -686,6 +686,4 @@ config STOP_MACHINE
|
|||
Need stop_machine() primitive.
|
||||
endmenu
|
||||
|
||||
menu "Block layer"
|
||||
source "block/Kconfig"
|
||||
endmenu
|
||||
|
|
Loading…
Reference in New Issue