Commit 58bf90a1 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.0.6

parent 83257356
VERSION = 2 VERSION = 2
PATCHLEVEL = 0 PATCHLEVEL = 0
SUBLEVEL = 5 SUBLEVEL = 6
ARCH = i386 ARCH = i386
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
OBJS = __divqu.o __remqu.o __divlu.o __remlu.o memset.o memcpy.o io.o \ OBJS = __divqu.o __remqu.o __divlu.o __remlu.o memset.o memcpy.o io.o \
checksum.o strlen.o checksum.o csum_partial_copy.o strlen.o
lib.a: $(OBJS) lib.a: $(OBJS)
$(AR) rcs lib.a $(OBJS) $(AR) rcs lib.a $(OBJS)
......
...@@ -138,28 +138,6 @@ unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum) ...@@ -138,28 +138,6 @@ unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum)
return result; return result;
} }
/*
* the same as csum_partial, but copies from src while it
* checksums
*
* here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary
*/
unsigned int csum_partial_copy(char *src, char *dst, int len, int sum)
{
/*
* The whole idea is to do the copy and the checksum at
* the same time, but we do it the easy way now.
*
* At least csum on the source, not destination, for cache
* reasons..
*/
sum = csum_partial(src, len, sum);
memcpy(dst, src, len);
return sum;
}
/* /*
* this routine is used for miscellaneous IP-like checksums, mainly * this routine is used for miscellaneous IP-like checksums, mainly
* in icmp.c * in icmp.c
......
/*
* csum_partial_copy - do IP checksumming and copy
*
* (C) Copyright 1996 Linus Torvalds
*
* Don't look at this too closely - you'll go mad. The things
* we do for performance..
*/
#define ldq_u(x,y) \
__asm__("ldq_u %0,%1":"=r" (x):"m" (*(unsigned long *)(y)))
#define stq_u(x,y) \
__asm__("stq_u %1,%0":"=m" (*(unsigned long *)(y)):"r" (x))
#define extql(x,y,z) \
__asm__ __volatile__("extql %1,%2,%0":"=r" (z):"r" (x),"r" (y))
#define extqh(x,y,z) \
__asm__ __volatile__("extqh %1,%2,%0":"=r" (z):"r" (x),"r" (y))
#define mskql(x,y,z) \
__asm__ __volatile__("mskql %1,%2,%0":"=r" (z):"r" (x),"r" (y))
#define mskqh(x,y,z) \
__asm__ __volatile__("mskqh %1,%2,%0":"=r" (z):"r" (x),"r" (y))
#define insql(x,y,z) \
__asm__ __volatile__("insql %1,%2,%0":"=r" (z):"r" (x),"r" (y))
#define insqh(x,y,z) \
__asm__ __volatile__("insqh %1,%2,%0":"=r" (z):"r" (x),"r" (y))
/*
* Ok. This isn't fun, but this is the EASY case.
*/
static inline unsigned long csum_partial_copy_aligned(
unsigned long *src, unsigned long *dst,
long len, unsigned long checksum)
{
unsigned long word, carry = 0;
len -= 8;
word = *src;
while (len >= 0) {
checksum += carry;
src++;
checksum += word;
len -= 8;
carry = checksum < word;
*dst = word;
word = *src;
dst++;
}
len += 8;
checksum += carry;
if (len) {
unsigned long tmp = *dst;
mskql(word, len, word);
checksum += word;
mskqh(tmp, len, tmp);
carry = checksum < word;
*dst = word | tmp;
checksum += carry;
}
return checksum;
}
/*
* This is even less fun, but this is still reasonably
* easy.
*/
static inline unsigned long csum_partial_copy_dest_aligned(
unsigned long *src, unsigned long *dst,
unsigned long soff,
long len, unsigned long checksum)
{
unsigned long first, word, carry = 0;
len -= 8;
first = src[0];
while (len >= 0) {
unsigned long second;
second = src[1];
extql(first, soff, word);
len -= 8;
extqh(second, soff, first);
src++;
word |= first;
checksum += carry;
first = second;
checksum += word;
*dst = word;
carry = checksum < word;
dst++;
}
len += 8;
checksum += carry;
if (len) {
unsigned long tmp;
unsigned long second;
second = src[1];
tmp = *dst;
extql(first, soff, word);
extqh(second, soff, first);
word |= first;
mskql(word, len, word);
checksum += word;
mskqh(tmp, len, tmp);
carry = checksum < word;
*dst = word | tmp;
checksum += carry;
}
return checksum;
}
/*
* This is slightly less fun than the above..
*/
static inline unsigned long csum_partial_copy_src_aligned(
unsigned long *src, unsigned long *dst,
unsigned long doff,
long len, unsigned long checksum)
{
unsigned long word, carry = 0;
unsigned long partial_dest;
partial_dest = *dst;
len -= 8;
mskql(partial_dest, doff, partial_dest);
word = *src;
while (len >= 0) {
unsigned long second_dest;
len -= 8;
checksum += carry;
src++;
checksum += word;
insql(word, doff, second_dest);
*dst = partial_dest | second_dest;
insqh(word, doff, partial_dest);
carry = checksum < word;
word = *src;
dst++;
}
len += doff;
checksum += carry;
if (len >= 0) {
unsigned long second_dest;
mskql(word, len-doff, word);
len -= 8;
src++;
checksum += word;
insql(word, doff, second_dest);
*dst = partial_dest | second_dest;
insqh(word, doff, partial_dest);
carry = checksum < word;
word = *src;
dst++;
checksum += carry;
} else if (len & 7) {
unsigned long second_dest;
second_dest = *dst;
mskql(word, len-doff, word);
checksum += word;
mskqh(second_dest, len, second_dest);
carry = checksum < word;
insql(word, doff, word);
*dst = partial_dest | word | second_dest;
checksum += carry;
}
return checksum;
}
/*
* This is so totally un-fun that it's frightening. Don't
* look at this too closely, you'll go blind.
*/
static inline unsigned long csum_partial_copy_unaligned(
unsigned long * src, unsigned long * dst,
unsigned long soff, unsigned long doff,
long len, unsigned long checksum)
{
unsigned long first, carry = 0;
unsigned long partial_dest;
partial_dest = dst[0];
len -= 8;
first = src[0];
mskql(partial_dest, doff, partial_dest);
while (len >= 0) {
unsigned long second, word;
unsigned long second_dest;
second = src[1];
extql(first, soff, word);
len -= 8;
checksum += carry;
src++;
extqh(second, soff, first);
word |= first;
first = second;
checksum += word;
insql(word, doff, second_dest);
*dst = partial_dest | second_dest;
carry = checksum < word;
insqh(word, doff, partial_dest);
dst++;
}
len += doff;
checksum += carry;
if (len >= 0) {
unsigned long second, word;
unsigned long second_dest;
second = src[1];
extql(first, soff, word);
len -= 8;
src++;
extqh(second, soff, first);
word |= first;
first = second;
mskql(word, len-doff, word);
checksum += word;
insql(word, doff, second_dest);
*dst = partial_dest | second_dest;
carry = checksum < word;
insqh(word, doff, partial_dest);
dst++;
} else if (len & 7) {
unsigned long second, word;
unsigned long second_dest;
second = src[1];
extql(first, soff, word);
extqh(second, soff, first);
word |= first;
second_dest = *dst;
mskql(word, len-doff, word);
checksum += word;
mskqh(second_dest, len, second_dest);
carry = checksum < word;
insql(word, doff, word);
*dst = partial_dest | word | second_dest;
checksum += carry;
}
return checksum;
}
unsigned int csum_partial_copy(char *src, char *dst, int len, int sum)
{
unsigned long checksum = (unsigned) sum;
unsigned long soff = 7 & (unsigned long) src;
unsigned long doff = 7 & (unsigned long) dst;
src = (char *) (~7UL & (unsigned long) src);
dst = (char *) (~7UL & (unsigned long) dst);
if (len) {
if (!soff) {
if (!doff)
checksum = csum_partial_copy_aligned(
(unsigned long *) src,
(unsigned long *) dst,
len, checksum);
else
checksum = csum_partial_copy_src_aligned(
(unsigned long *) src,
(unsigned long *) dst,
doff, len, checksum);
} else {
if (!doff)
checksum = csum_partial_copy_dest_aligned(
(unsigned long *) src,
(unsigned long *) dst,
soff, len, checksum);
else
checksum = csum_partial_copy_unaligned(
(unsigned long *) src,
(unsigned long *) dst,
soff, doff, len, checksum);
}
/* 64 -> 33 bits */
checksum = (checksum & 0xffffffff) + (checksum >> 32);
/* 33 -> < 32 bits */
checksum = (checksum & 0xffff) + (checksum >> 16);
/* 32 -> 16 bits */
checksum = (checksum & 0xffff) + (checksum >> 16);
checksum = (checksum & 0xffff) + (checksum >> 16);
}
return checksum;
}
...@@ -226,9 +226,10 @@ struct pci_dev_info dev_info[] = { ...@@ -226,9 +226,10 @@ struct pci_dev_info dev_info[] = {
DEVICE( INTEL, INTEL_82437, "82437"), DEVICE( INTEL, INTEL_82437, "82437"),
DEVICE( INTEL, INTEL_82371_0, "82371 Triton PIIX"), DEVICE( INTEL, INTEL_82371_0, "82371 Triton PIIX"),
DEVICE( INTEL, INTEL_82371_1, "82371 Triton PIIX"), DEVICE( INTEL, INTEL_82371_1, "82371 Triton PIIX"),
DEVICE( INTEL, INTEL_82441, "82441FX Natoma"),
DEVICE( INTEL, INTEL_82439, "82439HX Triton II"), DEVICE( INTEL, INTEL_82439, "82439HX Triton II"),
DEVICE( INTEL, INTEL_82371SB_0,"82371SB Triton II PIIX"), DEVICE( INTEL, INTEL_82371SB_0,"82371SB Natoma/Triton II PIIX"),
DEVICE( INTEL, INTEL_82371SB_1,"82371SB Triton II PIIX"), DEVICE( INTEL, INTEL_82371SB_1,"82371SB Natoma/Triton II PIIX"),
DEVICE( INTEL, INTEL_P6, "Orion P6"), DEVICE( INTEL, INTEL_P6, "Orion P6"),
DEVICE( ADAPTEC, ADAPTEC_7850, "AIC-7850"), DEVICE( ADAPTEC, ADAPTEC_7850, "AIC-7850"),
DEVICE( ADAPTEC, ADAPTEC_7855, "AIC-7855"), DEVICE( ADAPTEC, ADAPTEC_7855, "AIC-7855"),
......
...@@ -43,10 +43,10 @@ The original driver has been written for 386bsd and FreeBSD by ...@@ -43,10 +43,10 @@ The original driver has been written for 386bsd and FreeBSD by
Wolfgang Stanglmeier <wolf@cologne.de> Wolfgang Stanglmeier <wolf@cologne.de>
Stefan Esser <se@mi.Uni-Koeln.de> Stefan Esser <se@mi.Uni-Koeln.de>
You can find technical informations about the NCR 8xx family in the PCI-HOWTO You can find technical information about the NCR 8xx family in the PCI-HOWTO
written by Michael Will and in the SCSI-HOWTO written by Drew Eckhardt. written by Michael Will and in the SCSI-HOWTO written by Drew Eckhardt.
Informations about new chips is available at SYMBIOS web server: Information about new chips is available at SYMBIOS web server:
http://www.symbios.com http://www.symbios.com
This short documentation only describes the features of the NCR53C8XX driver, This short documentation only describes the features of the NCR53C8XX driver,
...@@ -153,16 +153,16 @@ Generally, only 1 board is used on hardware configuration, and the device is: ...@@ -153,16 +153,16 @@ Generally, only 1 board is used on hardware configuration, and the device is:
However, if the driver has been made as module, the number of the host is However, if the driver has been made as module, the number of the host is
incremented each time the driver is loaded. incremented each time the driver is loaded.
In order to display profiling informations, just enter: In order to display profiling information, just enter:
cat /proc/scsi/ncr53c8xx/0 cat /proc/scsi/ncr53c8xx/0
and you will get something like the following text: and you will get something like the following text:
------------------------------------------------------- -------------------------------------------------------
General informations: General information:
Chip NCR53C810, device id 0x1, revision id 0x2 Chip NCR53C810, device id 0x1, revision id 0x2
IO port address 0x6000, IRQ number 10 IO port address 0x6000, IRQ number 10
Using memory mapped IO at virtual address 0x282c000 Using memory mapped IO at virtual address 0x282c000
Profiling informations: Profiling information:
num_trans = 18014 num_trans = 18014
num_kbytes = 671314 num_kbytes = 671314
num_disc = 25763 num_disc = 25763
...@@ -175,8 +175,8 @@ Profiling informations: ...@@ -175,8 +175,8 @@ Profiling informations:
ms_post = 1320 ms_post = 1320
------------------------------------------------------- -------------------------------------------------------
General informations are easy to understand. The device id and the General information is easy to understand. The device id and the
revision id identify the scsi chip as follow: revision id identify the scsi chip as follows:
Chip Device id Revision Id Chip Device id Revision Id
---- --------- ----------- ---- --------- -----------
...@@ -188,7 +188,7 @@ Chip Device id Revision Id ...@@ -188,7 +188,7 @@ Chip Device id Revision Id
825A 0x3 >= 0x10 825A 0x3 >= 0x10
875 0xf 875 0xf
The profiling informations are updated upon completion of scsi commands. The profiling information is updated upon completion of scsi commands.
The data structure is allocated and zeroed when the host adapter is The data structure is allocated and zeroed when the host adapter is
attached. So, if the driver is a module, the profile counters are cleared each attached. So, if the driver is a module, the profile counters are cleared each
time the driver is loaded. time the driver is loaded.
...@@ -316,10 +316,10 @@ Available commands: ...@@ -316,10 +316,10 @@ Available commands:
result: print sense data on CHECK CONDITION status result: print sense data on CHECK CONDITION status
scatter: print infos about the scatter process scatter: print infos about the scatter process
scripts: print infos about the script binding process scripts: print infos about the script binding process
tiny: print minimal debugging informations tiny: print minimal debugging information
timing: print timing informations of the ncr chip. timing: print timing information of the ncr chip.
nego: print informations about scsi negotiations nego: print information about scsi negotiations
phase: print informations on script interruptions phase: print information on script interruptions
8.6 Clear profile counters 8.6 Clear profile counters
...@@ -399,7 +399,7 @@ SCSI_NCR_DISABLE_PARITY_CHECK (default: not defined) ...@@ -399,7 +399,7 @@ SCSI_NCR_DISABLE_PARITY_CHECK (default: not defined)
If defined, scsi parity checking is disabled. If defined, scsi parity checking is disabled.
SCSI_NCR_PROFILE (default: defined) SCSI_NCR_PROFILE (default: defined)
If defined, profile informations are gathered If defined, profile information are gathered
SCSI_NCR_MAX_SCATTER (default: 128) SCSI_NCR_MAX_SCATTER (default: 128)
Scatter list size of the driver ccb. Scatter list size of the driver ccb.
......
...@@ -8086,7 +8086,7 @@ static int copy_info(struct info_str *info, char *fmt, ...) ...@@ -8086,7 +8086,7 @@ static int copy_info(struct info_str *info, char *fmt, ...)
} }
/* /*
** Copy formatted profile informations into the input buffer. ** Copy formatted profile information into the input buffer.
*/ */
static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len) static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len)
...@@ -8098,7 +8098,7 @@ static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len) ...@@ -8098,7 +8098,7 @@ static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len)
info.offset = offset; info.offset = offset;
info.pos = 0; info.pos = 0;
copy_info(&info, "General informations:\n"); copy_info(&info, "General information:\n");
copy_info(&info, " Chip NCR53C%03d, ", np->chip); copy_info(&info, " Chip NCR53C%03d, ", np->chip);
copy_info(&info, "device id 0x%x, ", np->device_id); copy_info(&info, "device id 0x%x, ", np->device_id);
copy_info(&info, "revision id 0x%x\n", np->revision_id); copy_info(&info, "revision id 0x%x\n", np->revision_id);
...@@ -8113,7 +8113,7 @@ static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len) ...@@ -8113,7 +8113,7 @@ static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len)
#endif #endif
#ifdef SCSI_NCR_PROFILE #ifdef SCSI_NCR_PROFILE
copy_info(&info, "Profiling informations:\n"); copy_info(&info, "Profiling information:\n");
copy_info(&info, " %-12s = %lu\n", "num_trans",np->profile.num_trans); copy_info(&info, " %-12s = %lu\n", "num_trans",np->profile.num_trans);
copy_info(&info, " %-12s = %lu\n", "num_kbytes",np->profile.num_kbytes); copy_info(&info, " %-12s = %lu\n", "num_kbytes",np->profile.num_kbytes);
copy_info(&info, " %-12s = %lu\n", "num_disc", np->profile.num_disc); copy_info(&info, " %-12s = %lu\n", "num_disc", np->profile.num_disc);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994 Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994
(you can reference it, but it is incomplete and inaccurate in places) (you can reference it, but it is incomplete and inaccurate in places)
Version 0.44 5/7/96 - kernel 1.2.0+, pcmcia 2.5.4+ Version 0.45 6/9/96 - kernel 1.2.0+
Functions as standalone, loadable, and PCMCIA driver, the latter from Functions as standalone, loadable, and PCMCIA driver, the latter from
Dave Hind's PCMCIA package. Dave Hind's PCMCIA package.
...@@ -612,7 +612,7 @@ host->proc_dir = &proc_scsi_qlogicfas; ...@@ -612,7 +612,7 @@ host->proc_dir = &proc_scsi_qlogicfas;
if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, 0, "qlogicfas", NULL)) if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, 0, "qlogicfas", NULL))
host->can_queue = 1; host->can_queue = 1;
#endif #endif
request_region( qbase , 0x10 ,"qlogic"); request_region( qbase , 0x10 ,"qlogicfas");
hreg = scsi_register( host , 0 ); /* no host data */ hreg = scsi_register( host , 0 ); /* no host data */
hreg->io_port = qbase; hreg->io_port = qbase;
hreg->n_io_port = 16; hreg->n_io_port = 16;
...@@ -620,7 +620,7 @@ host->proc_dir = &proc_scsi_qlogicfas; ...@@ -620,7 +620,7 @@ host->proc_dir = &proc_scsi_qlogicfas;
if( qlirq != -1 ) if( qlirq != -1 )
hreg->irq = qlirq; hreg->irq = qlirq;
sprintf(qinfo, "Qlogicfas Driver version 0.44, chip %02X at %03X, IRQ %d, TPdma:%d", sprintf(qinfo, "Qlogicfas Driver version 0.45, chip %02X at %03X, IRQ %d, TPdma:%d",
qltyp, qbase, qlirq, QL_TURBO_PDMA ); qltyp, qbase, qlirq, QL_TURBO_PDMA );
host->name = qinfo; host->name = qinfo;
......
...@@ -642,9 +642,12 @@ void ...@@ -642,9 +642,12 @@ void
sb_dsp_init (struct address_info *hw_config) sb_dsp_init (struct address_info *hw_config)
{ {
sb_devc *devc; sb_devc *devc;
int n;
char name[100]; char name[100];
#ifndef NO_SB_IRQ_TEST
int n;
#endif
/* /*
* Check if we had detected a SB device earlier * Check if we had detected a SB device earlier
*/ */
...@@ -701,12 +704,13 @@ sb_dsp_init (struct address_info *hw_config) ...@@ -701,12 +704,13 @@ sb_dsp_init (struct address_info *hw_config)
} }
} }
#ifndef NO_SB_IRQ_TEST
for (n = 0; n < 3 && devc->irq_ok == 0; n++) for (n = 0; n < 3 && devc->irq_ok == 0; n++)
if (sb_dsp_command (devc, 0xf2)) /* Cause interrupt immediately */ if (sb_dsp_command (devc, 0xf2)) /* Cause interrupt immediately */
{ {
int i; int i;
for (i = 0; !devc->irq_ok && i < 10000000; i++); for (i = 0; !devc->irq_ok && i < 10000; i++);
} }
if (!devc->irq_ok) if (!devc->irq_ok)
...@@ -719,6 +723,7 @@ sb_dsp_init (struct address_info *hw_config) ...@@ -719,6 +723,7 @@ sb_dsp_init (struct address_info *hw_config)
{ {
DDB (printk ("IRQ test OK (IRQ%d)\n", devc->irq)); DDB (printk ("IRQ test OK (IRQ%d)\n", devc->irq));
} }
#endif
request_region (hw_config->io_base, 16, "sound blaster"); request_region (hw_config->io_base, 16, "sound blaster");
......
...@@ -289,7 +289,7 @@ sound_mmap (inode_handle * inode, file_handle * file, vm_area_handle * vma) ...@@ -289,7 +289,7 @@ sound_mmap (inode_handle * inode, file_handle * file, vm_area_handle * vma)
size, dmap->bytes_in_use); size, dmap->bytes_in_use);
} }
if (remap_page_range (vma_get_start (vma), dmap->raw_buf_phys, if (remap_page_range (vma_get_start (vma), virt_to_phys(dmap->raw_buf),
vma_get_end (vma) - vma_get_start (vma), vma_get_end (vma) - vma_get_start (vma),
vma_get_page_prot (vma))) vma_get_page_prot (vma)))
return -EAGAIN; return -EAGAIN;
...@@ -487,6 +487,10 @@ int ...@@ -487,6 +487,10 @@ int
snd_set_irq_handler (int interrupt_level, void (*iproc) (int, void *, struct pt_regs *), char *name, int *osp) snd_set_irq_handler (int interrupt_level, void (*iproc) (int, void *, struct pt_regs *), char *name, int *osp)
{ {
int retcode; int retcode;
unsigned long flags;
save_flags (flags);
cli ();
retcode = request_irq (interrupt_level, iproc, 0 /* SA_INTERRUPT */ , name, NULL); retcode = request_irq (interrupt_level, iproc, 0 /* SA_INTERRUPT */ , name, NULL);
if (retcode < 0) if (retcode < 0)
...@@ -496,6 +500,7 @@ snd_set_irq_handler (int interrupt_level, void (*iproc) (int, void *, struct pt_ ...@@ -496,6 +500,7 @@ snd_set_irq_handler (int interrupt_level, void (*iproc) (int, void *, struct pt_
else else
irqs |= (1ul << interrupt_level); irqs |= (1ul << interrupt_level);
restore_flags (flags);
return retcode; return retcode;
} }
......
...@@ -1739,7 +1739,7 @@ smb_proc_reconnect(struct smb_server *server) ...@@ -1739,7 +1739,7 @@ smb_proc_reconnect(struct smb_server *server)
DPRINTK("smb_proc_connect: Server wants %s protocol.\n", DPRINTK("smb_proc_connect: Server wants %s protocol.\n",
prots[i].name); prots[i].name);
if (server->protocol > PROTOCOL_LANMAN1) { if (server->protocol >= PROTOCOL_LANMAN1) {
word passlen = strlen(server->m.password); word passlen = strlen(server->m.password);
word userlen = strlen(server->m.username); word userlen = strlen(server->m.username);
......
...@@ -547,6 +547,7 @@ ...@@ -547,6 +547,7 @@
#define PCI_DEVICE_ID_INTEL_82437 0x122d #define PCI_DEVICE_ID_INTEL_82437 0x122d
#define PCI_DEVICE_ID_INTEL_82371_0 0x122e #define PCI_DEVICE_ID_INTEL_82371_0 0x122e
#define PCI_DEVICE_ID_INTEL_82371_1 0x1230 #define PCI_DEVICE_ID_INTEL_82371_1 0x1230
#define PCI_DEVICE_ID_INTEL_82441 0x1237
#define PCI_DEVICE_ID_INTEL_82439 0x1250 #define PCI_DEVICE_ID_INTEL_82439 0x1250
#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
......
...@@ -298,10 +298,8 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src, ...@@ -298,10 +298,8 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
return error; return error;
} }
static inline void forget_pte(pte_t page) static inline void free_pte(pte_t page)
{ {
if (pte_none(page))
return;
if (pte_present(page)) { if (pte_present(page)) {
unsigned long addr = pte_page(page); unsigned long addr = pte_page(page);
if (addr >= high_memory || PageReserved(mem_map+MAP_NR(addr))) if (addr >= high_memory || PageReserved(mem_map+MAP_NR(addr)))
...@@ -315,10 +313,17 @@ static inline void forget_pte(pte_t page) ...@@ -315,10 +313,17 @@ static inline void forget_pte(pte_t page)
swap_free(pte_val(page)); swap_free(pte_val(page));
} }
static inline void forget_pte(pte_t page)
{
if (!pte_none(page)) {
printk("forget_pte: old mapping existed!\n");
free_pte(page);
}
}
static inline void zap_pte_range(pmd_t * pmd, unsigned long address, unsigned long size) static inline void zap_pte_range(pmd_t * pmd, unsigned long address, unsigned long size)
{ {
pte_t * pte; pte_t * pte;
unsigned long end;
if (pmd_none(*pmd)) if (pmd_none(*pmd))
return; return;
...@@ -329,16 +334,21 @@ static inline void zap_pte_range(pmd_t * pmd, unsigned long address, unsigned lo ...@@ -329,16 +334,21 @@ static inline void zap_pte_range(pmd_t * pmd, unsigned long address, unsigned lo
} }
pte = pte_offset(pmd, address); pte = pte_offset(pmd, address);
address &= ~PMD_MASK; address &= ~PMD_MASK;
end = address + size; if (address + size > PMD_SIZE)
if (end >= PMD_SIZE) size = PMD_SIZE - address;
end = PMD_SIZE; size >>= PAGE_SHIFT;
do { for (;;) {
pte_t page = *pte; pte_t page;
pte_clear(pte); if (!size)
forget_pte(page); break;
address += PAGE_SIZE; page = *pte;
pte++; pte++;
} while (address < end); size--;
if (pte_none(page))
continue;
pte_clear(pte-1);
free_pte(page);
}
} }
static inline void zap_pmd_range(pgd_t * dir, unsigned long address, unsigned long size) static inline void zap_pmd_range(pgd_t * dir, unsigned long address, unsigned long size)
...@@ -934,7 +944,7 @@ void do_no_page(struct task_struct * tsk, struct vm_area_struct * vma, ...@@ -934,7 +944,7 @@ void do_no_page(struct task_struct * tsk, struct vm_area_struct * vma,
force_sig(SIGBUS, current); force_sig(SIGBUS, current);
flush_cache_page(vma, address); flush_cache_page(vma, address);
put_page(page_table, BAD_PAGE); put_page(page_table, BAD_PAGE);
flush_tlb_page(vma, address); /* no need to invalidate, wasn't present */
return; return;
} }
/* /*
...@@ -955,7 +965,7 @@ void do_no_page(struct task_struct * tsk, struct vm_area_struct * vma, ...@@ -955,7 +965,7 @@ void do_no_page(struct task_struct * tsk, struct vm_area_struct * vma,
entry = pte_wrprotect(entry); entry = pte_wrprotect(entry);
flush_cache_page(vma, address); flush_cache_page(vma, address);
put_page(page_table, entry); put_page(page_table, entry);
flush_tlb_page(vma, address); /* no need to invalidate: a not-present page shouldn't be cached */
} }
/* /*
......
...@@ -295,8 +295,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt ...@@ -295,8 +295,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
*/ */
if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL) if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL)
{ {
dev=rt->u.dst.dev; dev=rt->rt_dev;
atomic_dec(&rt->u.dst.use); atomic_dec(&rt->rt_use);
ip_rt_put(rt); ip_rt_put(rt);
} }
} }
...@@ -347,8 +347,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt ...@@ -347,8 +347,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
{ {
if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL) if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL)
{ {
dev=rt->u.dst.dev; dev=rt->rt_dev;
atomic_dec(&rt->u.dst.use); atomic_dec(&rt->rt_use);
ip_rt_put(rt); ip_rt_put(rt);
} }
} }
......
...@@ -878,24 +878,12 @@ void tcp_send_synack(struct sock * newsk, struct sock * sk, struct sk_buff * skb ...@@ -878,24 +878,12 @@ void tcp_send_synack(struct sock * newsk, struct sock * sk, struct sk_buff * skb
*/ */
void tcp_send_delayed_ack(struct sock * sk, int max_timeout, unsigned long timeout) void tcp_send_delayed_ack(struct sock * sk, int max_timeout, unsigned long timeout)
{ {
unsigned long now;
static int delack_guard=0;
if(delack_guard)
return;
delack_guard++;
/* Calculate new timeout */ /* Calculate new timeout */
now = jiffies;
if (timeout > max_timeout) if (timeout > max_timeout)
timeout = max_timeout; timeout = max_timeout;
timeout += now; if (sk->bytes_rcv >= sk->max_unacked)
if (sk->bytes_rcv >= sk->max_unacked) { timeout = 0;
tcp_send_ack(sk); timeout += jiffies;
delack_guard--;
return;
}
/* Use new timeout only if there wasn't a older one earlier */ /* Use new timeout only if there wasn't a older one earlier */
if (!del_timer(&sk->delack_timer) || timeout < sk->delack_timer.expires) if (!del_timer(&sk->delack_timer) || timeout < sk->delack_timer.expires)
...@@ -903,7 +891,6 @@ void tcp_send_delayed_ack(struct sock * sk, int max_timeout, unsigned long timeo ...@@ -903,7 +891,6 @@ void tcp_send_delayed_ack(struct sock * sk, int max_timeout, unsigned long timeo
sk->ack_backlog++; sk->ack_backlog++;
add_timer(&sk->delack_timer); add_timer(&sk->delack_timer);
delack_guard--;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment