Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5e4a8497
Commit
5e4a8497
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 1.1.24
parent
2651e5f8
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
265 additions
and
196 deletions
+265
-196
Makefile
Makefile
+1
-1
boot/setup.S
boot/setup.S
+2
-2
drivers/block/README.sbpcd
drivers/block/README.sbpcd
+20
-9
drivers/block/floppy.c
drivers/block/floppy.c
+26
-23
drivers/block/sbpcd.c
drivers/block/sbpcd.c
+102
-54
fs/buffer.c
fs/buffer.c
+0
-98
fs/devices.c
fs/devices.c
+105
-0
include/linux/cdrom.h
include/linux/cdrom.h
+5
-6
include/linux/fs.h
include/linux/fs.h
+2
-1
include/linux/mcd.h
include/linux/mcd.h
+1
-1
include/linux/sbpcd.h
include/linux/sbpcd.h
+1
-1
No files found.
Makefile
View file @
5e4a8497
VERSION
=
1
PATCHLEVEL
=
1
SUBLEVEL
=
2
3
SUBLEVEL
=
2
4
all
:
Version zImage
...
...
boot/setup.S
View file @
5e4a8497
...
...
@@ -825,7 +825,7 @@ idVRAM: .ascii "Stealth VRAM"
!
Number
of
modes
is
the
number
of
chip
-
specific
svga
modes
plus
the
extended
!
modes
available
on
any
vga
(
currently
2
)
moati
:
.
byte
0x0
4
,
0x23
,
0x33
moati
:
.
byte
0x0
6
,
0x23
,
0x33
,
0x22
,
0x21
moahead
:
.
byte
0x07
,
0x22
,
0x23
,
0x24
,
0x2f
,
0x34
mocandt
:
.
byte
0x04
,
0x60
,
0x61
mocirrus
:
.
byte
0x06
,
0x1f
,
0x20
,
0x22
,
0x31
...
...
@@ -844,7 +844,7 @@ mounknown: .byte 0x02
!
The
first
two
modes
are
standard
vga
modes
available
on
any
vga
.
!
mode
0
is
80
x50
and
mode
1
is
80
x28
dscati
:
.
word
0x5032
,
0x501c
,
0x8419
,
0x842c
dscati
:
.
word
0x5032
,
0x501c
,
0x8419
,
0x842c
,
0x641e
,
0x6419
dscahead
:
.
word
0x5032
,
0x501c
,
0x842c
,
0x8419
,
0x841c
,
0xa032
,
0x5042
dsccandt
:
.
word
0x5032
,
0x501c
,
0x8419
,
0x8432
dsccirrus
:
.
word
0x5032
,
0x501c
,
0x8419
,
0x842c
,
0x841e
,
0x6425
...
...
drivers/block/README.sbpcd
View file @
5e4a8497
This
README
belongs
to
release
2.
0
of
the
SoundBlaster
Pro
(
Matsushita
,
This README belongs to release 2.
1
of the SoundBlaster Pro (Matsushita,
Kotobuki, Panasonic, CreativeLabs) CD-ROM driver for Linux.
The driver is able to drive the whole family of IDE-style
...
...
@@ -48,14 +48,21 @@ CDplayer and WorkBone - tell me if it is not compatible with other software.
With the "new" drive family CR-562 and CR-563, the reading of audio frames is
possible. This is currently implemented by an IOCTL function which reads only
one frame of 2352 bytes at a time. The transfer rate is as slow as 32 kB/sec.
This will get better, and the software interface may change. We have to
standardize it the day the SCSI driver supports it too.
MultiSession is supported (even my "old" CR-521 can handle it), "ManySession"
(not recommended, see below) alternatively.
Photo CDs work, too. At ftp.gwdg.de:/pub/linux/hpcdtoppm/ is Hadmut Danisch'
s
package
to
convert
photo
CD
image
files
.
up to 4 frames of 2352 bytes at once. Reading more than 1 frame at once gives
very poor quality. Reading the same frame a second time gives different data;
it seems that the drive is out-of-sync at the beginning. See the program
example below. This lack has to get corrected by higher level software.
The transfer rate with reading audio (1-frame-pieces) is as slow as 32 kB/sec.
This could be better reading bigger chunks, but the out-of-sync parts occur at
the beginning of each single frame.
The software interface possibly may change a bit the day the SCSI driver
supports it too.
MultiSession is supported, "ManySession" (not recommended, see below)
alternatively.
Photo CDs work, too (even with my "old" CR-521).
At ftp.gwdg.de:/pub/linux/hpcdtoppm/ is Hadmut Danisch's package to convert
photo CD image files.
The transfer rate will reach 150 kB/sec with "old" drives and 300 kB/sec with
double-speed drives. XA (PhotoCD) disks with "old" drives give only 50 kB/sec.
...
...
@@ -340,6 +347,10 @@ entry[track+1].cdte_addr.lba=190;
}
/*===================== end program ========================================*/
At ftp.gwdg.de:/pub/linux/misc/cdda2wav-sbpcd.tar.gz is an adapted version of
Heiko Eissfeldt's digital-audio to .WAV converter (the original is there, too).
This is preliminary, as Heiko himself will care about it.
Known problems:
---------------
...
...
drivers/block/floppy.c
View file @
5e4a8497
...
...
@@ -407,7 +407,7 @@ void request_done(int uptodate)
* to the desired drive, but it will probably not survive the sleep if
* several floppies are used at the same time: thus the loop.
*/
int
floppy_change
(
struct
buffer_head
*
bh
)
static
int
floppy_change
(
struct
buffer_head
*
bh
)
{
unsigned
int
mask
=
1
<<
(
bh
->
b_dev
&
0x03
);
...
...
@@ -1289,14 +1289,13 @@ static int floppy_open(struct inode * inode, struct file * filp)
int
drive
;
int
old_dev
;
if
(
floppy_grab_irq_and_dma
())
{
return
-
EBUSY
;
}
drive
=
inode
->
i_rdev
&
3
;
old_dev
=
fd_device
[
drive
];
if
(
fd_ref
[
drive
])
if
(
old_dev
!=
inode
->
i_rdev
)
return
-
EBUSY
;
if
(
floppy_grab_irq_and_dma
())
return
-
EBUSY
;
fd_ref
[
drive
]
++
;
fd_device
[
drive
]
=
inode
->
i_rdev
;
buffer_drive
=
buffer_track
=
-
1
;
...
...
@@ -1309,7 +1308,7 @@ static int floppy_open(struct inode * inode, struct file * filp)
static
void
floppy_release
(
struct
inode
*
inode
,
struct
file
*
filp
)
{
sync_dev
(
inode
->
i_rdev
);
f
sync_dev
(
inode
->
i_rdev
);
if
(
!
fd_ref
[
inode
->
i_rdev
&
3
]
--
)
{
printk
(
"floppy_release with fd_ref == 0"
);
fd_ref
[
inode
->
i_rdev
&
3
]
=
0
;
...
...
@@ -1317,6 +1316,18 @@ static void floppy_release(struct inode * inode, struct file * filp)
floppy_release_irq_and_dma
();
}
static
int
check_floppy_change
(
dev_t
dev
)
{
int
i
;
struct
buffer_head
*
bh
;
if
(
!
(
bh
=
getblk
(
dev
,
0
,
1024
)))
return
0
;
i
=
floppy_change
(
bh
);
brelse
(
bh
);
return
i
;
}
static
struct
file_operations
floppy_fops
=
{
NULL
,
/* lseek - default */
block_read
,
/* read - general block-dev read */
...
...
@@ -1327,26 +1338,13 @@ static struct file_operations floppy_fops = {
NULL
,
/* mmap */
floppy_open
,
/* open */
floppy_release
,
/* release */
block_fsync
/* fsync */
block_fsync
,
/* fsync */
NULL
,
/* fasync */
check_floppy_change
,
/* media_change */
NULL
/* revalidate */
};
/*
* The version command is not supposed to generate an interrupt, but
* my FDC does, except when booting in SVGA screen mode.
* When it does generate an interrupt, it doesn't return any status bytes.
* It appears to have something to do with the version command...
*
* This should never be called, because of the reset after the version check.
*/
static
void
ignore_interrupt
(
void
)
{
printk
(
DEVICE_NAME
": weird interrupt ignored (%d)
\n
"
,
result
());
reset
=
1
;
CLEAR_INTR
;
/* ignore only once */
}
static
void
floppy_interrupt
(
int
unused
)
{
void
(
*
handler
)(
void
)
=
DEVICE_INTR
;
...
...
@@ -1381,7 +1379,6 @@ void floppy_init(void)
timer_active
&=
~
(
1
<<
FLOPPY_TIMER
);
config_types
();
/* Try to determine the floppy controller type */
DEVICE_INTR
=
ignore_interrupt
;
/* don't ask ... */
output_byte
(
FD_VERSION
);
/* get FDC version code */
if
(
result
()
!=
1
)
{
printk
(
DEVICE_NAME
": FDC failed to return version byte
\n
"
);
...
...
@@ -1404,8 +1401,12 @@ void floppy_init(void)
}
}
static
int
usage_count
=
0
;
static
int
floppy_grab_irq_and_dma
(
void
)
{
if
(
usage_count
++
)
return
0
;
if
(
irqaction
(
FLOPPY_IRQ
,
&
floppy_sigaction
))
{
printk
(
"Unable to grab IRQ%d for the floppy driver
\n
"
,
FLOPPY_IRQ
);
return
-
1
;
...
...
@@ -1421,6 +1422,8 @@ static int floppy_grab_irq_and_dma(void)
static
void
floppy_release_irq_and_dma
(
void
)
{
if
(
--
usage_count
)
return
;
disable_dma
(
FLOPPY_DMA
);
free_dma
(
FLOPPY_DMA
);
disable_irq
(
FLOPPY_IRQ
);
...
...
drivers/block/sbpcd.c
View file @
5e4a8497
This diff is collapsed.
Click to expand it.
fs/buffer.c
View file @
5e4a8497
...
...
@@ -29,25 +29,6 @@
#include <asm/segment.h>
#include <asm/io.h>
#ifdef CONFIG_SCSI
#ifdef CONFIG_BLK_DEV_SR
extern
int
check_cdrom_media_change
(
int
,
int
);
#endif
#ifdef CONFIG_BLK_DEV_SD
extern
int
check_scsidisk_media_change
(
int
,
int
);
extern
int
revalidate_scsidisk
(
int
,
int
);
#endif
#endif
#ifdef CONFIG_CDU31A
extern
int
check_cdu31a_media_change
(
int
,
int
);
#endif
#ifdef CONFIG_MCD
extern
int
check_mcd_media_change
(
int
,
int
);
#endif
#ifdef CONFIG_SBPCD
extern
int
check_sbpcd_media_change
(
int
,
int
);
#endif
#define NR_SIZES 4
static
char
buffersize_index
[
9
]
=
{
-
1
,
0
,
1
,
-
1
,
2
,
-
1
,
-
1
,
-
1
,
3
};
static
short
int
bufferindex_size
[
NR_SIZES
]
=
{
512
,
1024
,
2048
,
4096
};
...
...
@@ -286,85 +267,6 @@ void invalidate_buffers(dev_t dev)
}
}
/*
* This routine checks whether a floppy has been changed, and
* invalidates all buffer-cache-entries in that case. This
* is a relatively slow routine, so we have to try to minimize using
* it. Thus it is called only upon a 'mount' or 'open'. This
* is the best way of combining speed and utility, I think.
* People changing diskettes in the middle of an operation deserve
* to loose :-)
*
* NOTE! Although currently this is only for floppies, the idea is
* that any additional removable block-device will use this routine,
* and that mount/open needn't know that floppies/whatever are
* special.
*/
void
check_disk_change
(
dev_t
dev
)
{
int
i
;
struct
buffer_head
*
bh
;
switch
(
MAJOR
(
dev
)){
case
FLOPPY_MAJOR
:
if
(
!
(
bh
=
getblk
(
dev
,
0
,
1024
)))
return
;
i
=
floppy_change
(
bh
);
brelse
(
bh
);
break
;
#if defined(CONFIG_BLK_DEV_SD) && defined(CONFIG_SCSI)
case
SCSI_DISK_MAJOR
:
i
=
check_scsidisk_media_change
(
dev
,
0
);
break
;
#endif
#if defined(CONFIG_BLK_DEV_SR) && defined(CONFIG_SCSI)
case
SCSI_CDROM_MAJOR
:
i
=
check_cdrom_media_change
(
dev
,
0
);
break
;
#endif
#if defined(CONFIG_CDU31A)
case
CDU31A_CDROM_MAJOR
:
i
=
check_cdu31a_media_change
(
dev
,
0
);
break
;
#endif
#if defined(CONFIG_MCD)
case
MITSUMI_CDROM_MAJOR
:
i
=
check_mcd_media_change
(
dev
,
0
);
break
;
#endif
#if defined(CONFIG_SBPCD)
case
MATSUSHITA_CDROM_MAJOR
:
i
=
check_sbpcd_media_change
(
dev
,
0
);
break
;
#endif
default:
return
;
};
if
(
!
i
)
return
;
printk
(
"VFS: Disk change detected on device %d/%d
\n
"
,
MAJOR
(
dev
),
MINOR
(
dev
));
for
(
i
=
0
;
i
<
NR_SUPER
;
i
++
)
if
(
super_blocks
[
i
].
s_dev
==
dev
)
put_super
(
super_blocks
[
i
].
s_dev
);
invalidate_inodes
(
dev
);
invalidate_buffers
(
dev
);
#if defined(CONFIG_BLK_DEV_SD) && defined(CONFIG_SCSI)
/* This is trickier for a removable hardisk, because we have to invalidate
all of the partitions that lie on the disk. */
if
(
MAJOR
(
dev
)
==
SCSI_DISK_MAJOR
)
revalidate_scsidisk
(
dev
,
0
);
#endif
}
#define _hashfn(dev,block) (((unsigned)(dev^block))%nr_hash)
#define hash(dev,block) hash_table[_hashfn(dev,block)]
...
...
fs/devices.c
View file @
5e4a8497
...
...
@@ -15,6 +15,29 @@
#include <linux/fcntl.h>
#include <linux/errno.h>
/*
* Ugly. We'll fix this once all the drivers use the f_ops->check_media_change()
* stuff instead..
*/
#ifdef CONFIG_SCSI
#ifdef CONFIG_BLK_DEV_SR
extern
int
check_cdrom_media_change
(
int
,
int
);
#endif
#ifdef CONFIG_BLK_DEV_SD
extern
int
check_scsidisk_media_change
(
int
,
int
);
extern
int
revalidate_scsidisk
(
int
,
int
);
#endif
#endif
#ifdef CONFIG_CDU31A
extern
int
check_cdu31a_media_change
(
int
,
int
);
#endif
#ifdef CONFIG_MCD
extern
int
check_mcd_media_change
(
int
,
int
);
#endif
#ifdef CONFIG_SBPCD
extern
int
check_sbpcd_media_change
(
int
,
int
);
#endif
struct
device_struct
{
const
char
*
name
;
struct
file_operations
*
fops
;
...
...
@@ -110,6 +133,88 @@ int unregister_blkdev(unsigned int major, const char * name)
return
0
;
}
/*
* This routine checks whether a removable media has been changed,
* and invalidates all buffer-cache-entries in that case. This
* is a relatively slow routine, so we have to try to minimize using
* it. Thus it is called only upon a 'mount' or 'open'. This
* is the best way of combining speed and utility, I think.
* People changing diskettes in the middle of an operation deserve
* to loose :-)
*/
void
check_disk_change
(
dev_t
dev
)
{
int
i
;
struct
file_operations
*
fops
;
i
=
MAJOR
(
dev
);
if
(
i
>=
MAX_BLKDEV
||
(
fops
=
blkdevs
[
i
].
fops
)
==
NULL
)
return
;
if
(
fops
->
check_media_change
!=
NULL
)
{
if
(
!
fops
->
check_media_change
(
dev
))
return
;
}
#if 1
/* this will go soon.. */
else
switch
(
MAJOR
(
dev
)){
#if defined(CONFIG_BLK_DEV_SD) && defined(CONFIG_SCSI)
case
SCSI_DISK_MAJOR
:
if
(
!
check_scsidisk_media_change
(
dev
,
0
))
return
;
break
;
#endif
#if defined(CONFIG_BLK_DEV_SR) && defined(CONFIG_SCSI)
case
SCSI_CDROM_MAJOR
:
if
(
!
check_cdrom_media_change
(
dev
,
0
))
return
;
break
;
#endif
#if defined(CONFIG_CDU31A)
case
CDU31A_CDROM_MAJOR
:
if
(
!
check_cdu31a_media_change
(
dev
,
0
))
return
;
break
;
#endif
#if defined(CONFIG_MCD)
case
MITSUMI_CDROM_MAJOR
:
if
(
!
check_mcd_media_change
(
dev
,
0
))
return
;
break
;
#endif
#if defined(CONFIG_SBPCD)
case
MATSUSHITA_CDROM_MAJOR
:
if
(
!
check_sbpcd_media_change
(
dev
,
0
))
return
;
break
;
#endif
default:
return
;
}
#endif
/* will go away */
printk
(
"VFS: Disk change detected on device %d/%d
\n
"
,
MAJOR
(
dev
),
MINOR
(
dev
));
for
(
i
=
0
;
i
<
NR_SUPER
;
i
++
)
if
(
super_blocks
[
i
].
s_dev
==
dev
)
put_super
(
super_blocks
[
i
].
s_dev
);
invalidate_inodes
(
dev
);
invalidate_buffers
(
dev
);
if
(
fops
->
revalidate
)
fops
->
revalidate
(
dev
);
#if defined(CONFIG_BLK_DEV_SD) && defined(CONFIG_SCSI)
/* This is trickier for a removable hardisk, because we have to invalidate
all of the partitions that lie on the disk. */
if
(
MAJOR
(
dev
)
==
SCSI_DISK_MAJOR
)
revalidate_scsidisk
(
dev
,
0
);
#endif
}
/*
* Called every time a block special file is opened
*/
...
...
include/linux/cdrom.h
View file @
5e4a8497
...
...
@@ -14,7 +14,7 @@
/*
* some fix numbers
*/
#define CD_MINS 7
5
/* minutes per CD
*/
#define CD_MINS 7
4
/* max. minutes per CD
*/
#define CD_SECS 60
/* seconds per minute */
#define CD_FRAMES 75
/* frames per second */
#define CD_FRAMESIZE 2048
/* bytes per frame, cooked mode */
...
...
@@ -238,9 +238,8 @@ struct cdrom_tocentry
/*
* CD-ROM address types (cdrom_tocentry.cdte_format)
*/
#define CDROM_LBA 0x01
#define CDROM_MSF 0x02
#define CDROM_LBA 0x01
/* "logical block": first frame is #0 */
#define CDROM_MSF 0x02
/* "minute-second-frame": binary, not bcd here! */
/*
* bit to tell whether track is data or audio
...
...
@@ -328,7 +327,7 @@ struct cdrom_read_audio
int
lba
;
}
addr
;
/* frame address */
u_char
addr_format
;
/* CDROM_LBA or CDROM_MSF */
int
nframes
;
/* number of 2352-byte-frames to read at once,
currently only 1 allowed
*/
int
nframes
;
/* number of 2352-byte-frames to read at once,
limited by the drivers
*/
u_char
*
buf
;
/* frame buffer (size: nframes*2352 bytes) */
};
...
...
@@ -366,7 +365,7 @@ struct cdrom_read_audio
/* vlume control */
#define CDROMSUBCHNL 0x530b
/* (struct cdrom_subchnl) */
/* read sub-channel data */
/* read
Q
sub-channel data */
#define CDROMREADMODE2 0x530c
/* (struct cdrom_read) */
/* read type-2 data (not suppt) */
...
...
include/linux/fs.h
View file @
5e4a8497
...
...
@@ -292,6 +292,8 @@ struct file_operations {
void
(
*
release
)
(
struct
inode
*
,
struct
file
*
);
int
(
*
fsync
)
(
struct
inode
*
,
struct
file
*
);
int
(
*
fasync
)
(
struct
inode
*
,
struct
file
*
,
int
);
int
(
*
check_media_change
)
(
dev_t
dev
);
int
(
*
revalidate
)
(
dev_t
dev
);
};
struct
inode_operations
{
...
...
@@ -414,7 +416,6 @@ extern inline void mark_buffer_dirty(struct buffer_head * bh, int flag)
extern
void
check_disk_change
(
dev_t
dev
);
extern
void
invalidate_inodes
(
dev_t
dev
);
extern
void
invalidate_buffers
(
dev_t
dev
);
extern
int
floppy_change
(
struct
buffer_head
*
first_block
);
extern
void
sync_inodes
(
dev_t
dev
);
extern
void
sync_dev
(
dev_t
dev
);
extern
int
fsync_dev
(
dev_t
dev
);
...
...
include/linux/mcd.h
View file @
5e4a8497
...
...
@@ -25,7 +25,7 @@
#define MCD_BASE_ADDR 0x300
/* *** change this to set the interrupt number */
#define MCD_INTR_NR 1
1
#define MCD_INTR_NR 1
0
/* Increase this if you get lots of timeouts */
#define MCD_STATUS_DELAY 100
...
...
include/linux/sbpcd.h
View file @
5e4a8497
...
...
@@ -23,7 +23,7 @@
* and specify the type of your interface in SBPRO.
*
* SBPRO addresses typically are 0x0230 (=0x220+0x10), 0x0250, ...
* LASERMATE (CI-101P) adresses typically are 0x0300, 0x0310, ...
* LASERMATE (CI-101P
, WDH-7001C
) adresses typically are 0x0300, 0x0310, ...
* SPEA addresses are 0x320, 0x330, 0x340, 0x350
* there are some soundcards on the market with 0x0630, 0x0650, ...
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment