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
50a32c2c
Commit
50a32c2c
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 0.99.14t
parent
7ec55aac
Changes
42
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
1622 additions
and
560 deletions
+1622
-560
Makefile
Makefile
+1
-1
config.in
config.in
+4
-0
drivers/block/hd.c
drivers/block/hd.c
+4
-4
drivers/char/atixlmouse.c
drivers/char/atixlmouse.c
+32
-11
drivers/char/mem.c
drivers/char/mem.c
+14
-0
drivers/char/serial.c
drivers/char/serial.c
+43
-4
drivers/char/tty_io.c
drivers/char/tty_io.c
+10
-0
drivers/net/slip.c
drivers/net/slip.c
+1
-0
drivers/sound/.indent.pro
drivers/sound/.indent.pro
+1
-4
drivers/sound/.indent.pro~
drivers/sound/.indent.pro~
+11
-0
drivers/sound/CHANGELOG
drivers/sound/CHANGELOG
+11
-1
drivers/sound/Makefile
drivers/sound/Makefile
+1
-1
drivers/sound/Readme
drivers/sound/Readme
+20
-16
drivers/sound/Readme.linux
drivers/sound/Readme.linux
+26
-20
drivers/sound/dev_table.h
drivers/sound/dev_table.h
+5
-5
drivers/sound/dmabuf.c
drivers/sound/dmabuf.c
+15
-12
drivers/sound/gus_card.c
drivers/sound/gus_card.c
+4
-0
drivers/sound/gus_vol.c
drivers/sound/gus_vol.c
+27
-16
drivers/sound/gus_wave.c
drivers/sound/gus_wave.c
+1241
-375
drivers/sound/sb16_dsp.c
drivers/sound/sb16_dsp.c
+11
-3
drivers/sound/sound_config.h
drivers/sound/sound_config.h
+1
-1
drivers/sound/sound_switch.c
drivers/sound/sound_switch.c
+6
-6
drivers/sound/soundcard.c
drivers/sound/soundcard.c
+1
-1
fs/open.c
fs/open.c
+18
-0
include/linux/if_ether.h
include/linux/if_ether.h
+1
-0
include/linux/sys.h
include/linux/sys.h
+1
-0
include/linux/termios.h
include/linux/termios.h
+1
-0
include/linux/tty.h
include/linux/tty.h
+7
-2
include/linux/ultrasound.h
include/linux/ultrasound.h
+3
-0
include/linux/unistd.h
include/linux/unistd.h
+1
-0
kernel/sched.c
kernel/sched.c
+1
-1
kernel/signal.c
kernel/signal.c
+2
-1
kernel/sys.c
kernel/sys.c
+1
-1
kernel/traps.c
kernel/traps.c
+1
-1
mm/vmalloc.c
mm/vmalloc.c
+11
-10
net/inet/dev.c
net/inet/dev.c
+47
-12
net/inet/ip.c
net/inet/ip.c
+1
-1
net/inet/raw.c
net/inet/raw.c
+2
-1
net/inet/sock.c
net/inet/sock.c
+8
-0
net/inet/sock.h
net/inet/sock.h
+2
-1
net/inet/tcp.c
net/inet/tcp.c
+13
-17
net/inet/tcp.h
net/inet/tcp.h
+11
-31
No files found.
Makefile
View file @
50a32c2c
VERSION
=
0.99
PATCHLEVEL
=
14
ALPHA
=
s
ALPHA
=
t
all
:
Version zImage
...
...
config.in
View file @
50a32c2c
...
...
@@ -115,6 +115,10 @@ bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION y
bool 'QIC-02 tape support' CONFIG_TAPE_QIC02 n
bool 'QIC-117 tape support' CONFIG_FTAPE n
if [ "$CONFIG_FTAPE" = "y" ]
int ' number of ftape buffers' NR_FTAPE_BUFFERS 3
fi
*
* Sound
*
...
...
drivers/block/hd.c
View file @
50a32c2c
...
...
@@ -227,8 +227,8 @@ static void reset_controller(void)
{
int
i
;
printk
(
"HD-controller reset
\n
"
);
outb
(
4
,
HD_CMD
);
printk
(
KERN_DEBUG
"HD-controller reset
\n
"
);
outb
_p
(
4
,
HD_CMD
);
for
(
i
=
0
;
i
<
1000
;
i
++
)
nop
();
outb
(
hd_info
[
0
].
ctl
&
0x0f
,
HD_CMD
);
if
(
drive_busy
())
...
...
@@ -269,7 +269,7 @@ static void reset_hd(void)
void
unexpected_hd_interrupt
(
void
)
{
sti
();
printk
(
"Unexpected HD interrupt
\n
"
);
printk
(
KERN_DEBUG
"Unexpected HD interrupt
\n
"
);
SET_TIMER
;
}
...
...
@@ -421,7 +421,7 @@ static void hd_times_out(void)
reset
=
1
;
if
(
!
CURRENT
)
return
;
printk
(
"HD timeout
\n
"
);
printk
(
KERN_DEBUG
"HD timeout
\n
"
);
cli
();
if
(
++
CURRENT
->
errors
>=
MAX_ERRORS
)
{
#ifdef DEBUG
...
...
drivers/char/atixlmouse.c
View file @
50a32c2c
...
...
@@ -4,6 +4,8 @@
*
* Uses VFS interface for linux 0.98 (01OCT92)
*
* Modified by Chris Colohan (colohan@eecg.toronto.edu)
*
* version 0.3
*/
...
...
@@ -52,8 +54,8 @@
/* Same general mouse structure */
static
struct
mouse_status
{
unsigned
char
buttons
;
unsigned
char
latch_buttons
;
char
buttons
;
char
latch_buttons
;
int
dx
;
int
dy
;
int
present
;
...
...
@@ -64,16 +66,23 @@ static struct mouse_status {
void
mouse_interrupt
(
int
unused
)
{
char
dx
,
dy
,
buttons
;
ATIXL_MSE_DISABLE_UPDATE
();
/* Note that interrupts are still enabled */
outb
(
ATIXL_MSE_READ_X
,
ATIXL_MSE_CONTROL_PORT
);
/* Select IR1 - X movement */
mouse
.
dx
+
=
inb
(
ATIXL_MSE_DATA_PORT
);
dx
=
inb
(
ATIXL_MSE_DATA_PORT
);
outb
(
ATIXL_MSE_READ_Y
,
ATIXL_MSE_CONTROL_PORT
);
/* Select IR2 - Y movement */
mouse
.
dy
+
=
inb
(
ATIXL_MSE_DATA_PORT
);
dy
=
inb
(
ATIXL_MSE_DATA_PORT
);
outb
(
ATIXL_MSE_READ_BUTTONS
,
ATIXL_MSE_CONTROL_PORT
);
/* Select IR0 - Button Status */
mouse
.
latch_buttons
|=
inb
(
ATIXL_MSE_DATA_PORT
);
buttons
=
inb
(
ATIXL_MSE_DATA_PORT
);
if
(
dx
!=
0
||
dy
!=
0
||
buttons
!=
mouse
.
latch_buttons
)
{
mouse
.
latch_buttons
|=
buttons
;
mouse
.
dx
+=
dx
;
mouse
.
dy
+=
dy
;
mouse
.
ready
=
1
;
wake_up_interruptible
(
&
mouse
.
wait
);
}
ATIXL_MSE_ENABLE_UPDATE
();
mouse
.
ready
=
1
;
wake_up_interruptible
(
&
mouse
.
wait
);
}
static
void
release_mouse
(
struct
inode
*
inode
,
struct
file
*
file
)
...
...
@@ -112,21 +121,33 @@ static int write_mouse(struct inode * inode, struct file * file, char * buffer,
static
int
read_mouse
(
struct
inode
*
inode
,
struct
file
*
file
,
char
*
buffer
,
int
count
)
{
int
i
;
if
(
count
<
3
)
return
-
EINVAL
;
if
(
!
mouse
.
ready
)
return
-
EAGAIN
;
ATIXL_MSE_DISABLE_UPDATE
();
/* Allowed interrupts to occur during data gathering - shouldn't hurt */
put_fs_byte
((
~
mouse
.
latch_buttons
&
7
)
|
0x80
,
buffer
);
put_fs_byte
(
mouse
.
dx
,
buffer
+
1
);
put_fs_byte
(
-
mouse
.
dy
,
buffer
+
2
);
put_fs_byte
((
char
)(
~
mouse
.
latch_buttons
&
7
)
|
0x80
,
buffer
);
if
(
mouse
.
dx
<
-
127
)
mouse
.
dx
=
-
127
;
if
(
mouse
.
dx
>
127
)
mouse
.
dx
=
127
;
put_fs_byte
((
char
)
mouse
.
dx
,
buffer
+
1
);
if
(
mouse
.
dy
<
-
127
)
mouse
.
dy
=
-
127
;
if
(
mouse
.
dy
>
127
)
mouse
.
dy
=
127
;
put_fs_byte
((
char
)
-
mouse
.
dy
,
buffer
+
2
);
for
(
i
=
3
;
i
<
count
;
i
++
)
put_fs_byte
(
0x00
,
buffer
+
i
);
mouse
.
dx
=
0
;
mouse
.
dy
=
0
;
mouse
.
latch_buttons
=
mouse
.
buttons
;
mouse
.
ready
=
0
;
ATIXL_MSE_ENABLE_UPDATE
();
return
3
;
/* 3
data bytes returned */
return
i
;
/* i
data bytes returned */
}
static
int
mouse_select
(
struct
inode
*
inode
,
struct
file
*
file
,
int
sel_type
,
select_table
*
wait
)
...
...
drivers/char/mem.c
View file @
50a32c2c
...
...
@@ -387,6 +387,10 @@ static struct file_operations memory_fops = {
NULL
/* fsync */
};
#ifdef CONFIG_FTAPE
char
*
ftape_big_buffer
;
#endif
long
chr_dev_init
(
long
mem_start
,
long
mem_end
)
{
if
(
register_chrdev
(
MEM_MAJOR
,
"mem"
,
&
memory_fops
))
...
...
@@ -406,5 +410,15 @@ long chr_dev_init(long mem_start, long mem_end)
#if CONFIG_TAPE_QIC02
mem_start
=
tape_qic02_init
(
mem_start
);
#endif
/*
* Rude way to allocate kernel memory buffer for tape device
*/
#ifdef CONFIG_FTAPE
/* allocate NR_FTAPE_BUFFERS 32Kb buffers at aligned address */
ftape_big_buffer
=
(
char
*
)
((
mem_start
+
0x7fff
)
&
~
0x7fff
);
printk
(
"ftape: allocated %d buffers alligned at: %p
\n
"
,
NR_FTAPE_BUFFERS
,
ftape_big_buffer
);
mem_start
=
(
long
)
ftape_big_buffer
+
NR_FTAPE_BUFFERS
*
0x8000
;
#endif
return
mem_start
;
}
drivers/char/serial.c
View file @
50a32c2c
...
...
@@ -492,6 +492,7 @@ static void rs_interrupt(int irq)
pass_number
=
0
;
while
(
info
)
{
if
(
info
->
tty
&&
info
->
tty
->
termios
&&
(
!
pass_number
||
!
(
serial_inp
(
info
,
UART_IIR
)
&
UART_IIR_NO_INT
)))
{
done
=
0
;
...
...
@@ -1489,7 +1490,24 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
#ifdef SERIAL_DEBUG_OPEN
printk
(
"rs_close ttys%d, count = %d
\n
"
,
info
->
line
,
info
->
count
);
#endif
if
(
--
info
->
count
>
0
)
if
((
tty
->
count
==
1
)
&&
(
info
->
count
!=
1
))
{
/*
* Uh, oh. tty->count is 1, which means that the tty
* structure will be freed. Info->count should always
* be one in these conditions. If it's greater than
* one, we've got real problems, since it means the
* serial port won't be shutdown.
*/
printk
(
"rs_close: bad serial port count; tty->count is 1, "
"info->count is %d
\n
"
,
info
->
count
);
info
->
count
=
1
;
}
if
(
--
info
->
count
<
0
)
{
printk
(
"rs_close: bad serial port count for ttys%d: %d
\n
"
,
info
->
line
,
info
->
count
);
info
->
count
=
0
;
}
if
(
info
->
count
)
return
;
info
->
flags
|=
ASYNC_CLOSING
;
/*
...
...
@@ -1502,8 +1520,16 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
info
->
callout_termios
=
*
tty
->
termios
;
tty
->
stopped
=
0
;
/* Force flush to succeed */
tty
->
hw_stopped
=
0
;
rs_start
(
tty
);
wait_until_sent
(
tty
);
if
(
info
->
flags
&
ASYNC_INITIALIZED
)
{
rs_start
(
tty
);
/*
* XXX There should be a timeout added to
* wait_until_sent, eventually. TYT 1/19/94
*/
wait_until_sent
(
tty
);
}
else
flush_output
(
tty
);
flush_input
(
tty
);
cli
();
/*
* Make sure the UART transmitter has completely drained; this
...
...
@@ -1517,7 +1543,6 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
shutdown
(
info
,
1
);
clear_bit
(
line
,
rs_event
);
info
->
event
=
0
;
info
->
count
=
0
;
info
->
tty
=
0
;
if
(
info
->
blocked_open
)
{
if
(
info
->
close_delay
)
{
...
...
@@ -1574,7 +1599,14 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
*/
if
(
info
->
flags
&
ASYNC_CLOSING
)
{
interruptible_sleep_on
(
&
info
->
close_wait
);
#ifdef SERIAL_DO_RESTART
if
(
info
->
flags
&
ASYNC_HUP_NOTIFY
)
return
-
EAGAIN
;
else
return
-
ERESTARTSYS
;
#else
return
-
EAGAIN
;
#endif
}
/*
...
...
@@ -1632,7 +1664,14 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
current
->
state
=
TASK_INTERRUPTIBLE
;
if
(
tty_hung_up_p
(
filp
)
||
!
(
info
->
flags
&
ASYNC_INITIALIZED
))
{
#ifdef SERIAL_DO_RESTART
if
(
info
->
flags
&
ASYNC_HUP_NOTIFY
)
retval
=
-
EAGAIN
;
else
retval
=
-
ERESTARTSYS
;
#else
retval
=
-
EAGAIN
;
#endif
break
;
}
if
(
!
(
info
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
&&
...
...
drivers/char/tty_io.c
View file @
50a32c2c
...
...
@@ -1430,6 +1430,15 @@ static int tty_select(struct inode * inode, struct file * filp, int sel_type, se
printk
(
"tty_select: tty struct for dev %d was NULL
\n
"
,
dev
);
return
0
;
}
if
(
ldiscs
[
tty
->
disc
].
select
)
return
(
ldiscs
[
tty
->
disc
].
select
)(
tty
,
inode
,
filp
,
sel_type
,
wait
);
return
0
;
}
static
int
normal_select
(
struct
tty_struct
*
tty
,
struct
inode
*
inode
,
struct
file
*
file
,
int
sel_type
,
select_table
*
wait
)
{
switch
(
sel_type
)
{
case
SEL_IN
:
if
(
L_CANON
(
tty
))
{
...
...
@@ -1681,6 +1690,7 @@ static struct tty_ldisc tty_ldisc_N_TTY = {
read_chan
,
/* read */
write_chan
,
/* write */
NULL
,
/* ioctl */
normal_select
,
/* select */
copy_to_cooked
/* handler */
};
...
...
drivers/net/slip.c
View file @
50a32c2c
...
...
@@ -1200,6 +1200,7 @@ slip_init(struct device *dev)
sl_ldisc
.
write
=
NULL
;
sl_ldisc
.
ioctl
=
(
int
(
*
)(
struct
tty_struct
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
))
slip_ioctl
;
sl_ldisc
.
select
=
NULL
;
sl_ldisc
.
handler
=
slip_recv
;
if
((
i
=
tty_register_ldisc
(
N_SLIP
,
&
sl_ldisc
))
!=
0
)
printk
(
"ERROR: %d
\n
"
,
i
);
...
...
drivers/sound/.indent.pro
View file @
50a32c2c
-
bad
-
bap
-
fca
-
fc1
-
cdb
-
sc
-
nfca
-
bl
-
psl
-
di16
...
...
drivers/sound/.indent.pro~
0 → 100644
View file @
50a32c2c
-bad
-bap
-fca
-fc1
-cdb
-sc
-bl
-psl
-di16
-lp
-ip5
drivers/sound/CHANGELOG
View file @
50a32c2c
Changelog for version 2.
3
Changelog for version 2.
4
-------------------------
Since 2.3b
- Fixed bug which made it impossible to make long recordings to disk.
Recording was not restarted after a buffer overflow situation.
- Limited mixer support for GUS.
- Numerous improvements to the GUS driver by Andrew Robinson. Including
some click removal etc.
Since 2.3
- Fixed some minor bugs in the SB16 driver.
Since 2.2b
- Full SB16 DSP support. 8/16 bit, mono/stereo
- The SCO and FreeBSD versions should be in sync now. There are some
...
...
drivers/sound/Makefile
View file @
50a32c2c
...
...
@@ -5,7 +5,7 @@
#
#
VERSION
=
2.
3b
VERSION
=
2.
4
TARGET_OS
=
linux
.c.s
:
...
...
drivers/sound/Readme
View file @
50a32c2c
Release notes for the Linux Sound Driver 2.3
-----------------------------------------------
This version has finally the SB16 support. It seems to work
well but there is some problems with recording. If the recording
process cannot read the data from the device fast enough the
driver will return EIO. Usually this happens when there is no more
memory for the disk buffers.
The SB16 DSP support is by Joerg Schubert (jsb@sth.ruhr-uni-bochum.de).
Currently the SB16 support is an ALPHA test version since it has been
tested just by me.
Release notes for the Linux Sound Driver 2.4
--------------------------------------------
NOTE! The sound driver is a part of the Linux kernel distribution also.
Check that your kernel doesn't have more recent version than this
when installing a separately distributed sound driver. The
version number of this driver is defined in the makefile.
This version contains a driver for the SB16 also.
The SB16 driver requires separate DMA channels for the 8 and 16 bit
modes. There should be a way to share the 8 bit DMA channels between
these modes but this feature is not supported yet.
The SB16 DSP support is by Joerg Schubert (jsb@sth.ruhr-uni-bochum.de).
The SB16 driver has also the Midi input capability even at the same
time with the /dev/dsp. Also the WaveBlaster daughter board is supported.
No support for the ASP chip yet (the ASP chip can be installed but it's
not used by the driver).
You will need the snd-util-2.
0
.tar.gz and snd-data-0.1.tar.Z
You will need the snd-util-2.
4
.tar.gz and snd-data-0.1.tar.Z
packages to use this driver. They should be in the same
ftp site or BBS from where you got this driver. For
example at nic.funet.fi:pub/OS/Linux/*.
There is a new version of the tracker program available (tracker-3
.19
) but
I don't know
how to find it
. The tracker 3.10 has bugs and it don't work
without some fixes. Look at the README of the snd-util-2.
0
.
There is a new version of the tracker program available (tracker-3
_19.lzh
) but
I don't know
where it is available
. The tracker 3.10 has bugs and it don't work
without some fixes. Look at the README of the snd-util-2.
3
.
If you are looking for the installation instructions, please
look at linux/Readme.
...
...
@@ -161,7 +159,12 @@ Mixer(s) installed
Known bugs/limitations
----------------------
- Midi input doesn't work with SB and SB Pro (SB16 works somehow).
- High speed recording of long audio samples (>20 second) to disk
is not possible. Everything works until next sync() which delays the
recording process too much. A delay longer than 0.1 to 0.3 seconds is
too much.
- The SB16 driver sometimes swaps the left and right channels together.
- Midi input doesn't work with SB and SB Pro (SB16 works).
- It's not possible to open /dev/dsp (or /dev/audio) while the
/dev/sequencer is open for output and GUS is the only soundcard
installed. It's possible if /dev/dsp is opened before /dev/sequencer
...
...
@@ -226,6 +229,7 @@ contributors. (I could have forgotten some names.)
Jim Lowe FreeBSD port
Anders Baekgaard Bughunting and valuable suggestions.
Joerg Schubert SB16 DSP support.
Andrew Robinson Improvements to the GUS driver
Regards,
...
...
drivers/sound/Readme.linux
View file @
50a32c2c
Sound Card Driver version 2.2
Sound Driver version 2.4 for Linux
----------------------------------
This directory contains the driver for various PC soundcards.
The following cards are supported:
AdLib
SoundBlaster (1.0-2.0) and compatibles, including
ThunderBoard and Ati Stereo F/X.
SoundBlaster Pro and SB Pro 2
SoundBlaster 16
ProAudioSpectrum 16
(The original ProAudioSpectrum and the PAS+ are not supported
(and propably will remain unsupported)).
If you have any problems, please contact me.
NOTE! The sound driver is now a part of the Linux kernel distribution.
Check that your kernel doesn't have more recent version than this
when installing a separately distributed sound driver. The
version number of this driver is defined in the makefile.
Installation
------------
...
...
@@ -20,14 +12,23 @@ Installation
- Since this driver is a part of the Linux kernel distribution, no
special steps are required to build the driver itself.
- To build the device files you need to run the enclosed shell scrip
(see below).
- In case you are installing a separately distributed sound driver,
you have to do some additional steps.
- Remove all files from the linux/drivers/sound. Old files could
sometimes cause trouble.
- cd linux/drivers.
- gunzip -c snd-driv-X.Y.tar.gz|tar xvf -
- cd ./sound
- cp soundcard.h ultrasound.h /usr/include/linux
- To build the device files for this driver, you need to run the enclosed
shell script (at the end of this file).
- C
opy the sound/ultrasound.h to /usr/include/sys
(Remove the old one from /usr/include/sys /usr/include/linux first).
- C
reate /usr/include/sys/soundcard.h whic contains just a line:
#include <linux/soundcard.h>
-
Ensure you have the following symlink
:
ln -s /usr/include/linux/soundcard.h /usr/include/sys/soundcard.h
-
Create /usr/include/sys/ultrasound.h whic contains just a line
:
#include <linux/ultrasound.h>
Boot time configuration (using lilo)
------------------------------------
...
...
@@ -190,6 +191,11 @@ if [ -e /dev/mixer ]; then
rm -f /dev/mixer
fi
mknod -m 666 /dev/mixer c 14 0
if [ -e /dev/mixer1 ]; then
rm -f /dev/mixer1
fi
mknod -m 666 /dev/mixer1 c 14 16
#
# Sequencer (14, 1)
#
...
...
drivers/sound/dev_table.h
View file @
50a32c2c
...
...
@@ -167,11 +167,6 @@ struct generic_midi_operations {
{
MPU_BASE
,
MPU_IRQ
,
0
},
SND_DEFAULT_ENABLE
},
#endif
#ifndef EXCLUDE_GUS
{
SNDCARD_GUS
,
"Gravis Ultrasound"
,
attach_gus_card
,
probe_gus
,
{
GUS_BASE
,
GUS_IRQ
,
GUS_DMA
},
SND_DEFAULT_ENABLE
},
#endif
#ifndef EXCLUDE_PAS
{
SNDCARD_PAS
,
"ProAudioSpectrum"
,
attach_pas_card
,
probe_pas
,
{
PAS_BASE
,
PAS_IRQ
,
PAS_DMA
},
SND_DEFAULT_ENABLE
},
...
...
@@ -193,6 +188,11 @@ struct generic_midi_operations {
#endif
#endif
#ifndef EXCLUDE_GUS
{
SNDCARD_GUS
,
"Gravis Ultrasound"
,
attach_gus_card
,
probe_gus
,
{
GUS_BASE
,
GUS_IRQ
,
GUS_DMA
},
SND_DEFAULT_ENABLE
},
#endif
#ifndef EXCLUDE_YM3812
{
SNDCARD_ADLIB
,
"AdLib"
,
attach_adlib_card
,
probe_adlib
,
{
FM_MONO
,
0
,
0
},
SND_DEFAULT_ENABLE
},
...
...
drivers/sound/dmabuf.c
View file @
50a32c2c
...
...
@@ -323,6 +323,15 @@ DMAbuf_getrdbuffer (int dev, char **buf, int *len)
unsigned
long
flags
;
int
err
=
EIO
;
DISABLE_INTR
(
flags
);
if
(
!
dev_qlen
[
dev
])
{
if
(
dev_needs_restart
[
dev
])
{
dma_reset
(
dev
);
dev_needs_restart
[
dev
]
=
0
;
}
if
(
dma_mode
[
dev
]
==
DMODE_OUTPUT
)
/* Was output -> direction change */
{
dma_sync
(
dev
);
...
...
@@ -339,19 +348,13 @@ DMAbuf_getrdbuffer (int dev, char **buf, int *len)
if
((
err
=
dsp_devs
[
dev
]
->
prepare_for_input
(
dev
,
dev_buffsize
[
dev
],
dev_nbufs
[
dev
]))
<
0
)
return
err
;
{
RESTORE_INTR
(
flags
);
return
err
;
}
dma_mode
[
dev
]
=
DMODE_INPUT
;
}
DISABLE_INTR
(
flags
);
if
(
!
dev_qlen
[
dev
])
{
if
(
dev_needs_restart
[
dev
])
{
dma_reset
(
dev
);
dev_needs_restart
[
dev
]
=
0
;
}
if
(
!
dev_active
[
dev
])
{
dsp_devs
[
dev
]
->
start_input
(
dev
,
dev_buf_phys
[
dev
][
dev_qtail
[
dev
]],
...
...
@@ -366,7 +369,7 @@ DMAbuf_getrdbuffer (int dev, char **buf, int *len)
DO_SLEEP
(
dev_sleeper
[
dev
],
dev_sleep_flag
[
dev
],
2
*
HZ
);
if
(
TIMED_OUT
(
dev_sleeper
[
dev
],
dev_sleep_flag
[
dev
]))
{
printk
(
"Sound: DMA timed out
\n
"
);
printk
(
"Sound: DMA timed out
- IRQ/DRQ config error?
\n
"
);
err
=
EIO
;
SET_ABORT_FLAG
(
dev_sleeper
[
dev
],
dev_sleep_flag
[
dev
]);
}
...
...
@@ -531,7 +534,7 @@ DMAbuf_getwrbuffer (int dev, char **buf, int *size)
DO_SLEEP
(
dev_sleeper
[
dev
],
dev_sleep_flag
[
dev
],
2
*
HZ
);
if
(
TIMED_OUT
(
dev_sleeper
[
dev
],
dev_sleep_flag
[
dev
]))
{
printk
(
"Sound: DMA timed out
\n
"
);
printk
(
"Sound: DMA timed out
- IRQ/DRQ config error?
\n
"
);
err
=
EIO
;
SET_ABORT_FLAG
(
dev_sleeper
[
dev
],
dev_sleep_flag
[
dev
]);
}
...
...
drivers/sound/gus_card.c
View file @
50a32c2c
...
...
@@ -105,6 +105,10 @@ gusintr (int unit)
{
unsigned
char
src
;
#ifdef linux
sti
();
#endif
while
(
1
)
{
if
(
!
(
src
=
INB
(
u_IrqStatus
)))
...
...
drivers/sound/gus_vol.c
View file @
50a32c2c
/*
/*
* gus_vol.c - Compute volume for GUS.
*
* Greg Lee 1993.
...
...
@@ -11,7 +11,7 @@
extern
int
gus_wave_volume
;
/*
/*
* Calculate gus volume from note velocity, main volume, expression, and
* intrinsic patch volume given in patch library. Expression is multiplied
* in, so it emphasizes differences in note velocity, while main volume is
...
...
@@ -31,35 +31,48 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev)
int
i
,
m
,
n
,
x
;
/*
/*
* A voice volume of 64 is considered neutral, so adjust the main volume if
* something other than this neutral value was assigned in the patch
* library.
*/
x
=
256
+
6
*
(
voicev
-
64
);
/* Boost expression by voice volume above neutral. */
/*
* Boost expression by voice volume above neutral.
*/
if
(
voicev
>
65
)
xpn
+=
voicev
-
64
;
xpn
+=
(
voicev
-
64
)
/
2
;
/* Combine multiplicative and level components. */
/*
* Combine multiplicative and level components.
*/
x
=
vel
*
xpn
*
6
+
(
voicev
/
4
)
*
x
;
#ifdef GUS_VOLUME
/*
/*
* Further adjustment by installation-specific master volume control
* (default
5
0).
* (default
6
0).
*/
x
=
(
x
*
GUS_VOLUME
*
GUS_VOLUME
)
/
10000
;
#endif
if
(
x
<
(
1
<<
11
))
return
(
11
<<
8
);
#ifdef GUS_USE_CHN_MAIN_VOLUME
/*
* Experimental support for the channel main volume
*/
mainv
=
(
mainv
/
2
)
+
64
;
/* Scale to 64 to 127 */
x
=
(
x
*
mainv
*
mainv
)
/
16384
;
#endif
if
(
x
<
2
)
return
(
0
);
else
if
(
x
>=
65535
)
return
((
15
<<
8
)
|
255
);
/*
/*
* Convert to gus's logarithmic form with 4 bit exponent i and 8 bit
* mantissa m.
*/
...
...
@@ -76,13 +89,15 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev)
n
>>=
1
;
i
++
;
}
/*
/*
* Mantissa is part of linear volume not expressed in exponent. (This is
* not quite like real logs -- I wonder if it's right.)
*/
m
=
x
-
(
1
<<
i
);
/* Adjust mantissa to 8 bits. */
/*
* Adjust mantissa to 8 bits.
*/
if
(
m
>
0
)
{
if
(
i
>
8
)
...
...
@@ -91,10 +106,6 @@ gus_adagio_vol (int vel, int mainv, int xpn, int voicev)
m
<<=
8
-
i
;
}
/* low volumes give occasional sour notes */
if
(
i
<
11
)
return
(
11
<<
8
);
return
((
i
<<
8
)
+
m
);
}
...
...
drivers/sound/gus_wave.c
View file @
50a32c2c
This diff is collapsed.
Click to expand it.
drivers/sound/sb16_dsp.c
View file @
50a32c2c
...
...
@@ -256,7 +256,7 @@ DEB(printk("sb16_dsp_open()\n"));
if
(
!
sb16_dsp_ok
)
{
printk
(
"SB16 Error: SoundBlaster board not installed
\n
"
);
return
RET_ERROR
(
EN
ODEV
);
return
RET_ERROR
(
EN
XIO
);
}
if
(
intr_active
)
...
...
@@ -459,8 +459,16 @@ sb16_dsp_reset (int dev)
static
void
sb16_dsp_halt
(
int
dev
)
{
sb_dsp_command01
(
0xd9
);
sb_dsp_command01
(
0xd5
);
if
(
dsp_16bit
)
{
sb_dsp_command01
(
0xd9
);
sb_dsp_command01
(
0xd5
);
}
else
{
sb_dsp_command01
(
0xda
);
sb_dsp_command01
(
0xd0
);
}
}
static
void
...
...
drivers/sound/sound_config.h
View file @
50a32c2c
...
...
@@ -195,7 +195,7 @@ If your card has nonstandard I/O address or IRQ number, change defines
#define OFF 0
#define MAX_DSP_DEV 4
#define MAX_MIXER_DEV
1
#define MAX_MIXER_DEV
2
#define MAX_SYNTH_DEV 3
#define MAX_MIDI_DEV 4
...
...
drivers/sound/sound_switch.c
View file @
50a32c2c
...
...
@@ -280,7 +280,7 @@ sound_open_sw (int dev, struct fileinfo *file)
if
((
dev
>=
SND_NDEVS
)
||
(
dev
<
0
))
{
printk
(
"Invalid minor device %d
\n
"
,
dev
);
return
RET_ERROR
(
EN
ODEV
);
return
RET_ERROR
(
EN
XIO
);
}
switch
(
dev
&
0x0f
)
...
...
@@ -320,7 +320,7 @@ sound_open_sw (int dev, struct fileinfo *file)
default:
printk
(
"Invalid minor device %d
\n
"
,
dev
);
return
RET_ERROR
(
EN
ODEV
);
return
RET_ERROR
(
EN
XIO
);
}
sbc_devices
[
dev
].
usecount
++
;
...
...
@@ -383,12 +383,12 @@ sound_ioctl_sw (int dev, struct fileinfo *file,
case
SND_DEV_CTL
:
if
(
!
num_mixers
)
return
RET_ERROR
(
EN
ODEV
);
return
RET_ERROR
(
EN
XIO
);
if
(
dev
>=
num_mixers
)
return
RET_ERROR
(
EN
ODEV
);
if
(
(
dev
>>
4
)
>=
num_mixers
)
return
RET_ERROR
(
EN
XIO
);
return
mixer_devs
[
dev
]
->
ioctl
(
dev
,
cmd
,
arg
);
return
mixer_devs
[
dev
>>
4
]
->
ioctl
(
dev
>>
4
,
cmd
,
arg
);
break
;
case
SND_DEV_SEQ
:
...
...
drivers/sound/soundcard.c
View file @
50a32c2c
...
...
@@ -95,7 +95,7 @@ sound_open (struct inode *inode, struct file *file)
if
(
!
soundcard_configured
&&
dev
!=
SND_DEV_CTL
&&
dev
!=
SND_DEV_STATUS
)
{
printk
(
"SoundCard Error: The soundcard system has not been configured
\n
"
);
return
RET_ERROR
(
EN
ODEV
);
return
RET_ERROR
(
EN
XIO
);
}
files
[
dev
].
mode
=
0
;
...
...
fs/open.c
View file @
50a32c2c
...
...
@@ -210,6 +210,24 @@ asmlinkage int sys_chdir(const char * filename)
return
(
0
);
}
asmlinkage
int
sys_fchdir
(
unsigned
int
fd
)
{
struct
inode
*
inode
;
struct
file
*
file
;
if
(
fd
>=
NR_OPEN
||
!
(
file
=
current
->
filp
[
fd
]))
return
-
EBADF
;
if
(
!
(
inode
=
file
->
f_inode
))
return
-
ENOENT
;
if
(
!
S_ISDIR
(
inode
->
i_mode
))
return
-
ENOTDIR
;
if
(
!
permission
(
inode
,
MAY_EXEC
))
return
-
EACCES
;
iput
(
current
->
pwd
);
current
->
pwd
=
inode
;
return
(
0
);
}
asmlinkage
int
sys_chroot
(
const
char
*
filename
)
{
struct
inode
*
inode
;
...
...
include/linux/if_ether.h
View file @
50a32c2c
...
...
@@ -36,6 +36,7 @@
#define ETH_P_IPX 0x8137
/* IPX over DIX */
#define ETH_P_802_3 0x0001
/* Dummy type for 802.3 frames */
#define ETH_P_AX25 0x0002
/* Dummy protocol id for AX.25 */
#define ETH_P_ALL 0x0003
/* Every packet (be careful!!!) */
/* Define the Ethernet Broadcast Address (48 bits set to "1"). */
#define ETH_A_BCAST "\377\377\377\377\377\377"
...
...
include/linux/sys.h
View file @
50a32c2c
...
...
@@ -143,6 +143,7 @@ extern int sys_delete_module();
extern
int
sys_get_kernel_syms
();
/* 130 */
extern
int
sys_quotactl
();
extern
int
sys_getpgid
();
extern
int
sys_fchdir
();
/*
* These are system calls that will be removed at some time
...
...
include/linux/termios.h
View file @
50a32c2c
...
...
@@ -237,5 +237,6 @@ struct termios {
#define N_TTY 0
#define N_SLIP 1
#define N_MOUSE 2
#define N_PPP 3
#endif
include/linux/tty.h
View file @
50a32c2c
...
...
@@ -78,8 +78,8 @@ struct serial_struct {
int
xmit_fifo_size
;
int
custom_divisor
;
int
baud_base
;
char
close_delay
;
char
reserved_char
[
3
];
unsigned
short
close_delay
;
char
reserved_char
[
2
];
int
hub6
;
int
reserved
[
5
];
};
...
...
@@ -97,6 +97,8 @@ struct serial_struct {
/*
* Definitions for async_struct (and serial_struct) flags field
*/
#define ASYNC_HUP_NOTIFY 0x0001
/* Notify getty on hangups and closes
on the callout port */
#define ASYNC_FOURPORT 0x0002
/* Set OU1, OUT2 per AST Fourport settings */
#define ASYNC_SAK 0x0004
/* Secure Attention Key (Orange book) */
#define ASYNC_SPLIT_TERMIOS 0x0008
/* Separate termios for dialin/callout */
...
...
@@ -259,6 +261,9 @@ struct tty_ldisc {
char
*
buf
,
int
nr
);
int
(
*
ioctl
)(
struct
tty_struct
*
tty
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
int
(
*
select
)(
struct
tty_struct
*
tty
,
struct
inode
*
inode
,
struct
file
*
file
,
int
sel_type
,
select_table
*
wait
);
/*
* The following routines are called from below.
*/
...
...
include/linux/ultrasound.h
View file @
50a32c2c
...
...
@@ -84,6 +84,7 @@
#define _GUS_VOICEFADE 0x0d
#define _GUS_VOLUME_SCALE 0x0e
#define _GUS_VOICEVOL2 0x0f
#define _GUS_VOICE_POS 0x10
/*
* GUS API macros
...
...
@@ -114,5 +115,7 @@
#define GUS_RAMPON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPON, (p1), 0)
#define GUS_RAMPOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_RAMPOFF, 0, 0)
#define GUS_VOLUME_SCALE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_VOLUME_SCALE, (p1), (p2))
#define GUS_VOICE_POS(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICE_POS, \
(p) & 0xffff, ((p) >> 16) & 0xffff)
#endif
include/linux/unistd.h
View file @
50a32c2c
...
...
@@ -139,6 +139,7 @@
#define __NR_get_kernel_syms 130
#define __NR_quotactl 131
#define __NR_getpgid 132
#define __NR_fchdir 133
extern
int
errno
;
...
...
kernel/sched.c
View file @
50a32c2c
...
...
@@ -138,7 +138,7 @@ sys_wait4, sys_swapoff, sys_sysinfo, sys_ipc, sys_fsync, sys_sigreturn,
sys_clone
,
sys_setdomainname
,
sys_newuname
,
sys_modify_ldt
,
sys_adjtimex
,
sys_mprotect
,
sys_sigprocmask
,
sys_create_module
,
sys_init_module
,
sys_delete_module
,
sys_get_kernel_syms
,
sys_quotactl
,
sys_getpgid
};
sys_getpgid
,
sys_fchdir
};
/* So we don't have to do any more manual updating.... */
int
NR_syscalls
=
sizeof
(
sys_call_table
)
/
sizeof
(
fn_ptr
);
...
...
kernel/signal.c
View file @
50a32c2c
...
...
@@ -252,7 +252,8 @@ static void setup_frame(struct sigaction * sa, unsigned long ** fp, unsigned lon
if
(
regs
->
ss
!=
USER_DS
)
frame
=
(
unsigned
long
*
)
sa
->
sa_restorer
;
frame
-=
32
;
verify_area
(
VERIFY_WRITE
,
frame
,
32
*
4
);
if
(
verify_area
(
VERIFY_WRITE
,
frame
,
32
*
4
))
do_exit
(
SIGSEGV
);
/* set up the "normal" stack seen by the signal handler (iBCS2) */
put_fs_long
(
__CODE
,
frame
);
put_fs_long
(
signr
,
frame
+
1
);
...
...
kernel/sys.c
View file @
50a32c2c
...
...
@@ -495,7 +495,7 @@ asmlinkage int sys_getpgid(pid_t pid)
struct
task_struct
*
p
;
if
(
!
pid
)
pid
=
current
->
pid
;
return
current
->
pgrp
;
for_each_task
(
p
)
{
if
(
p
->
pid
==
pid
)
return
p
->
pgrp
;
...
...
kernel/traps.c
View file @
50a32c2c
...
...
@@ -95,7 +95,7 @@ asmlinkage void alignment_check(void);
regs
->
ds
,
regs
->
es
,
regs
->
fs
,
regs
->
gs
);
store_TR
(
i
);
printk
(
"Pid: %d, process nr: %d
\n
"
,
current
->
pid
,
0xffff
&
i
);
for
(
i
=
0
;
i
<
1
0
;
i
++
)
for
(
i
=
0
;
i
<
2
0
;
i
++
)
printk
(
"%02x "
,
0xff
&
get_seg_byte
(
regs
->
cs
,(
i
+
(
char
*
)
regs
->
eip
)));
printk
(
"
\n
"
);
do_exit
(
SIGSEGV
);
...
...
mm/vmalloc.c
View file @
50a32c2c
...
...
@@ -53,19 +53,19 @@ static int free_area_pages(unsigned long dindex, unsigned long index, unsigned l
return
0
;
page
&=
PAGE_MASK
;
pte
=
index
+
(
unsigned
long
*
)
page
;
for
(
;
nr
>
0
;
nr
--
,
pte
++
)
{
do
{
unsigned
long
pg
=
*
pte
;
*
pte
=
0
;
if
(
!
(
pg
&
PAGE_PRESENT
)
)
continue
;
free_page
(
pg
)
;
}
if
(
pg
&
PAGE_PRESENT
)
free_page
(
pg
)
;
pte
++
;
}
while
(
--
nr
);
pte
=
(
unsigned
long
*
)
page
;
for
(
nr
=
0
;
nr
<
1024
;
nr
++
,
pte
++
)
if
(
*
pte
)
return
0
;
set_pgdir
(
dindex
,
0
);
mem_map
[
MAP_NR
(
page
)]
&=
~
MAP_PAGE_RESERVED
;
mem_map
[
MAP_NR
(
page
)]
=
1
;
free_page
(
page
);
return
0
;
}
...
...
@@ -83,20 +83,21 @@ static int alloc_area_pages(unsigned long dindex, unsigned long index, unsigned
free_page
(
page
);
page
=
swapper_pg_dir
[
dindex
];
}
else
{
mem_map
[
MAP_NR
(
page
)]
|
=
MAP_PAGE_RESERVED
;
mem_map
[
MAP_NR
(
page
)]
=
MAP_PAGE_RESERVED
;
set_pgdir
(
dindex
,
page
|
PAGE_SHARED
);
}
}
page
&=
PAGE_MASK
;
pte
=
index
+
(
unsigned
long
*
)
page
;
*
pte
=
PAGE_SHARED
;
/* remove a race with vfree() */
for
(
;
nr
>
0
;
nr
--
,
pte
++
)
{
do
{
unsigned
long
pg
=
get_free_page
(
GFP_KERNEL
);
if
(
!
pg
)
return
-
ENOMEM
;
*
pte
=
pg
|
PAGE_SHARED
;
}
pte
++
;
}
while
(
--
nr
);
return
0
;
}
...
...
@@ -113,9 +114,9 @@ static int do_area(void * addr, unsigned long size,
if
(
i
>
nr
)
i
=
nr
;
nr
-=
i
;
if
(
area_fn
(
dindex
,
index
,
i
))
return
-
1
;
nr
-=
i
;
index
=
0
;
dindex
++
;
}
...
...
net/inet/dev.c
View file @
50a32c2c
...
...
@@ -113,9 +113,13 @@ static struct packet_type arp_packet_type = {
#else
&
ax25_packet_type
#endif
#else
#ifdef CONFIG_AX25
&
ax25_packet_type
#else
NULL
/* next */
#endif
#endif
};
...
...
@@ -287,22 +291,49 @@ my_addr(void)
}
static
int
dev_nit
=
0
;
/* Number of network taps running */
/* Add a protocol ID to the list. This will change soon. */
void
dev_add_pack
(
struct
packet_type
*
pt
)
{
struct
packet_type
*
p1
;
pt
->
next
=
ptype_base
;
/* See if we need to copy it. */
for
(
p1
=
ptype_base
;
p1
!=
NULL
;
p1
=
p1
->
next
)
{
if
(
p1
->
type
==
pt
->
type
)
{
pt
->
copy
=
1
;
break
;
/* Don't use copy counts on ETH_P_ALL. Instead keep a global
count of number of these and use it and pt->copy to decide
copies */
pt
->
copy
=
0
;
if
(
pt
->
type
==
NET16
(
ETH_P_ALL
))
dev_nit
++
;
/* I'd like a /dev/nit too one day 8) */
else
{
/* See if we need to copy it. */
for
(
p1
=
ptype_base
;
p1
!=
NULL
;
p1
=
p1
->
next
)
{
if
(
p1
->
type
==
pt
->
type
)
{
pt
->
copy
=
1
;
break
;
}
}
}
/*
* NIT taps must go at the end or inet_bh will leak!
*/
if
(
pt
->
type
==
NET16
(
ETH_P_ALL
))
{
pt
->
next
=
NULL
;
if
(
ptype_base
==
NULL
)
ptype_base
=
pt
;
else
{
for
(
p1
=
ptype_base
;
p1
->
next
!=
NULL
;
p1
=
p1
->
next
);
p1
->
next
=
pt
;
}
}
ptype_base
=
pt
;
else
ptype_base
=
pt
;
}
...
...
@@ -312,6 +343,8 @@ dev_remove_pack(struct packet_type *pt)
{
struct
packet_type
*
lpt
,
*
pt1
;
if
(
pt
->
type
==
NET16
(
ETH_P_ALL
))
dev_nit
--
;
if
(
pt
==
ptype_base
)
{
ptype_base
=
pt
->
next
;
return
;
...
...
@@ -328,7 +361,7 @@ dev_remove_pack(struct packet_type *pt)
return
;
}
if
(
pt1
->
next
->
type
==
pt
->
type
)
{
if
(
pt1
->
next
->
type
==
pt
->
type
&&
pt
->
type
!=
NET16
(
ETH_P_ALL
)
)
{
lpt
=
pt1
->
next
;
}
}
...
...
@@ -594,7 +627,7 @@ inet_bh(void *tmp)
struct
packet_type
*
ptype
;
unsigned
short
type
;
unsigned
char
flag
=
0
;
int
nitcount
;
/* Atomically check and mark our BUSY state. */
if
(
set_bit
(
1
,
(
void
*
)
&
in_bh
))
...
...
@@ -606,6 +639,7 @@ inet_bh(void *tmp)
/* Any data left to process? */
while
((
skb
=
skb_dequeue
(
&
backlog
))
!=
NULL
)
{
nitcount
=
dev_nit
;
flag
=
0
;
sti
();
/*
...
...
@@ -625,7 +659,6 @@ inet_bh(void *tmp)
* header (the h_proto field in struct ethhdr), but drivers like
* SLIP and PLIP have no alternative but to force the type to be
* IP or something like that. Sigh- FvK
* FIXME: Ethernet drivers need potty training in 802.3 packets -AC
*/
type
=
skb
->
dev
->
type_trans
(
skb
,
skb
->
dev
);
...
...
@@ -636,10 +669,12 @@ inet_bh(void *tmp)
* to anyone who wants it.
*/
for
(
ptype
=
ptype_base
;
ptype
!=
NULL
;
ptype
=
ptype
->
next
)
{
if
(
ptype
->
type
==
type
)
{
if
(
ptype
->
type
==
type
||
ptype
->
type
==
NET16
(
ETH_P_ALL
)
)
{
struct
sk_buff
*
skb2
;
if
(
ptype
->
copy
)
{
/* copy if we need to */
if
(
ptype
->
type
==
NET16
(
ETH_P_ALL
))
nitcount
--
;
if
(
ptype
->
copy
||
nitcount
)
{
/* copy if we need to */
skb2
=
alloc_skb
(
skb
->
mem_len
,
GFP_ATOMIC
);
if
(
skb2
==
NULL
)
continue
;
...
...
net/inet/ip.c
View file @
50a32c2c
...
...
@@ -1544,7 +1544,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
sk
->
ip_tos
=
val
;
return
0
;
case
IP_TTL
:
if
(
val
<
1
||
val
<
255
)
if
(
val
<
1
||
val
>
255
)
return
-
EINVAL
;
sk
->
ip_ttl
=
val
;
return
0
;
...
...
net/inet/raw.c
View file @
50a32c2c
...
...
@@ -114,7 +114,8 @@ raw_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
/* Now we need to copy this into memory. */
skb
->
sk
=
sk
;
skb
->
len
=
len
;
skb
->
len
=
len
+
skb
->
ip_hdr
->
ihl
*
sizeof
(
long
);
skb
->
h
.
raw
=
skb
->
ip_hdr
;
skb
->
dev
=
dev
;
skb
->
saddr
=
daddr
;
skb
->
daddr
=
saddr
;
...
...
net/inet/sock.c
View file @
50a32c2c
...
...
@@ -51,6 +51,7 @@
* Alan Cox : inet sockets don't set sk->type!
* Alan Cox : Split socket option code
* Alan Cox : Callbacks
* Alan Cox : Nagle flag for Charles & Johannes stuff
*
* To Fix:
*
...
...
@@ -824,6 +825,11 @@ inet_create(struct socket *sock, int protocol)
return
(
-
ESOCKTNOSUPPORT
);
}
sk
->
socket
=
sock
;
#ifdef CONFIG_TCP_NAGLE_OFF
sk
->
nonagle
=
1
;
#else
sk
->
nonagle
=
0
;
#endif
sk
->
type
=
sock
->
type
;
sk
->
protocol
=
protocol
;
sk
->
wmem_alloc
=
0
;
...
...
@@ -1792,6 +1798,8 @@ inet_fioctl(struct inode *inode, struct file *file,
}
static
struct
file_operations
inet_fops
=
{
NULL
,
/* LSEEK */
NULL
,
/* READ */
...
...
net/inet/sock.h
View file @
50a32c2c
...
...
@@ -81,7 +81,8 @@ struct sock {
no_check
,
exp_growth
,
zapped
,
/* In ax25 & ipx means not linked */
broadcast
;
broadcast
,
nonagle
;
unsigned
long
lingertime
;
int
proc
;
struct
sock
*
next
;
...
...
net/inet/tcp.c
View file @
50a32c2c
...
...
@@ -57,6 +57,8 @@
* Alan Cox : Added tcp_select_window() aka NET2E
* window non shrink trick.
* Alan Cox : Added a couple of small NET2E timer fixes
* Charles Hedrick : TCP fixes
* Toomas Tamm : TCP window fixes
*
*
* To Fix:
...
...
@@ -99,8 +101,6 @@
#include <asm/segment.h>
#include <linux/mm.h>
#define USE_NAGLE
#define SEQ_TICK 3
unsigned
long
seq_offset
;
...
...
@@ -1018,20 +1018,17 @@ tcp_write(struct sock *sk, unsigned char *from,
sk
->
err
=
0
;
/*
* In its original form, the following code implements
* Nagle's rule. Everybody recommends it, and probably
* production code should use it. But it slows down response enough
* that I dont' like it. So as long as we're not bumping into
* the window, I go ahead and send it. If you want Nagle, just
* define USE_NAGLE --C. Hedrick
* Nagles rule. Turn Nagle off with TCP_NODELAY for highly
* interactive fast network servers. It's meant to be on and
* it really improves the throughput though not the echo time
* on my slow slip link - Alan
*/
/* Avoid possible race on send_tmp - c/o Johannes Stille */
if
(
sk
->
send_tmp
&&
((
!
sk
->
packets_out
)
#ifndef USE_NAGLE
||
before
(
sk
->
send_seq
,
sk
->
window_seq
)
#endif
/* If not nagling we can send on the before case too.. */
||
(
sk
->
nonagle
&&
before
(
sk
->
send_seq
,
sk
->
window_seq
))
))
tcp_send_partial
(
sk
);
/* -- */
...
...
@@ -1273,7 +1270,6 @@ tcp_read_urg(struct sock * sk, int nonblock,
amt
=
min
(
ntohs
(
skb
->
h
.
th
->
urg_ptr
),
len
);
if
(
amt
)
{
verify_area
(
VERIFY_WRITE
,
to
,
amt
);
memcpy_tofs
(
to
,(
unsigned
char
*
)(
skb
->
h
.
th
)
+
skb
->
h
.
th
->
doff
*
4
,
amt
);
}
...
...
@@ -2132,7 +2128,7 @@ tcp_write_xmit(struct sock *sk)
return
;
while
(
sk
->
wfront
!=
NULL
&&
before
(
sk
->
wfront
->
h
.
seq
,
sk
->
window_seq
)
&&
before
(
sk
->
wfront
->
h
.
seq
,
sk
->
window_seq
+
1
)
&&
(
sk
->
retransmits
==
0
||
sk
->
timeout
!=
TIME_WRITE
||
before
(
sk
->
wfront
->
h
.
seq
,
sk
->
rcv_ack_seq
+
1
))
...
...
@@ -2395,7 +2391,7 @@ tcp_ack(struct sock *sk, struct tcphdr *th, unsigned long saddr, int len)
* and put it onto the xmit queue.
*/
if
(
sk
->
wfront
!=
NULL
)
{
if
(
after
(
sk
->
window_seq
,
sk
->
wfront
->
h
.
seq
)
&&
if
(
after
(
sk
->
window_seq
+
1
,
sk
->
wfront
->
h
.
seq
)
&&
(
sk
->
retransmits
==
0
||
sk
->
timeout
!=
TIME_WRITE
||
before
(
sk
->
wfront
->
h
.
seq
,
sk
->
rcv_ack_seq
+
1
))
...
...
@@ -3534,12 +3530,12 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char *optval, int op
switch
(
optname
)
{
case
TCP_MSS
:
if
(
val
<
200
||
val
>
2048
)
if
(
val
<
200
||
val
>
2048
||
val
>
sk
->
mtu
)
return
-
EINVAL
;
sk
->
mss
=
val
;
return
0
;
case
TCP_NODELAY
:
/* Ready for Johannes delayed ACK code */
sk
->
nonagle
=
(
val
==
0
)
?
0
:
1
;
return
0
;
default:
return
(
-
ENOPROTOOPT
);
...
...
@@ -3559,7 +3555,7 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char *optval, int *o
val
=
sk
->
mss
;
break
;
case
TCP_NODELAY
:
val
=
1
;
/* Until Johannes stuff is in */
val
=
sk
->
nonagle
;
/* Until Johannes stuff is in */
break
;
default:
return
(
-
ENOPROTOOPT
);
...
...
net/inet/tcp.h
View file @
50a32c2c
...
...
@@ -71,47 +71,27 @@
/*
* The next routines deal with comparing 32 bit unsigned ints
* and worry about wraparound. The general strategy is to do a
* normal compare so long as neither of the numbers is within
* 4K of wrapping. Otherwise we must check for the wrap.
* and worry about wraparound (automatic with unsigned arithmetic).
*/
static
inline
int
before
(
unsigned
long
seq1
,
unsigned
long
seq2
)
static
inline
int
before
(
unsigned
long
seq1
,
unsigned
long
seq2
)
{
/* this inequality is strict. */
if
(
seq1
==
seq2
)
return
(
0
);
if
(
seq1
<
seq2
)
{
if
((
unsigned
long
)
seq2
-
(
unsigned
long
)
seq1
<
65536UL
)
{
return
(
1
);
}
else
{
return
(
0
);
}
}
/*
* Now we know seq1 > seq2. So all we need to do is check
* to see if seq1 has wrapped.
*/
if
(
seq2
<
8192UL
&&
seq1
>
(
0xffffffffUL
-
8192UL
))
{
return
(
1
);
}
return
(
0
);
/* this inequality is strict. */
if
(
seq1
==
seq2
)
return
0
;
seq2
-=
seq1
;
return
(
seq2
<
65536
);
}
static
inline
int
after
(
unsigned
long
seq1
,
unsigned
long
seq2
)
static
inline
int
after
(
unsigned
long
seq1
,
unsigned
long
seq2
)
{
return
(
before
(
seq2
,
seq1
)
);
return
before
(
seq2
,
seq1
);
}
/* is s2<=s1<=s3 ? */
static
inline
int
between
(
unsigned
long
seq1
,
unsigned
long
seq2
,
unsigned
long
seq3
)
static
inline
int
between
(
unsigned
long
seq1
,
unsigned
long
seq2
,
unsigned
long
seq3
)
{
return
(
after
(
seq1
+
1
,
seq2
)
&&
before
(
seq1
,
seq3
+
1
));
return
(
after
(
seq1
+
1
,
seq2
)
&&
before
(
seq1
,
seq3
+
1
));
}
...
...
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