Commit 32ad372a authored by Jeff Garzik's avatar Jeff Garzik

Merge pobox.com:/garz/repo/linux-2.6

into pobox.com:/garz/repo/libata-2.6
parents 3160222e 539bc6a4
......@@ -213,14 +213,14 @@ static void __init
reserve_std_resources(void)
{
static struct resource standard_io_resources[] = {
{ "rtc", -1, -1 },
{ "dma1", 0x00, 0x1f },
{ "pic1", 0x20, 0x3f },
{ "timer", 0x40, 0x5f },
{ "keyboard", 0x60, 0x6f },
{ "dma page reg", 0x80, 0x8f },
{ "pic2", 0xa0, 0xbf },
{ "dma2", 0xc0, 0xdf },
{ .name = "rtc", .start = -1, .end = -1 },
{ .name = "dma1", .start = 0x00, .end = 0x1f },
{ .name = "pic1", .start = 0x20, .end = 0x3f },
{ .name = "timer", .start = 0x40, .end = 0x5f },
{ .name = "keyboard", .start = 0x60, .end = 0x6f },
{ .name = "dma page reg", .start = 0x80, .end = 0x8f },
{ .name = "pic2", .start = 0xa0, .end = 0xbf },
{ .name = "dma2", .start = 0xc0, .end = 0xdf },
};
struct resource *io = &ioport_resource;
......
/*
* linux/arch/arm/kernel/debug-armv.S
* linux/arch/arm/kernel/debug.S
*
* Copyright (C) 1994-1999 Russell King
*
......
......@@ -160,6 +160,9 @@ void __init ixp2000_map_io(void)
iotable_init(ixp2000_small_io_desc, ARRAY_SIZE(ixp2000_small_io_desc));
iotable_init(ixp2000_large_io_desc, ARRAY_SIZE(ixp2000_large_io_desc));
early_serial_setup(&ixp2000_serial_port);
/* Set slowport to 8-bit mode. */
ixp2000_reg_write(IXP2000_SLOWPORT_FRM, 1);
}
/*************************************************************************
......
......@@ -124,20 +124,28 @@ static int __init enp2611_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;
if (dev->bus->number == 0x00 && PCI_SLOT(dev->devfn) == 0x01) {
if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 0) {
/* IXP2400. */
irq = IRQ_IXP2000_PCIA;
} else if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 1) {
/* 21555 non-transparent bridge. */
irq = IRQ_IXP2000_PCIB;
} else if (dev->bus->number == 0x01 && PCI_SLOT(dev->devfn) == 0x00) {
} else if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 4) {
/* PCI2050B transparent bridge. */
irq = -1;
} else if (dev->bus->number == 1 && PCI_SLOT(dev->devfn) == 0) {
/* 82559 ethernet. */
irq = IRQ_IXP2000_PCIA;
} else if (dev->bus->number == 1 && PCI_SLOT(dev->devfn) == 1) {
/* SPI-3 option board. */
irq = IRQ_IXP2000_PCIB;
} else {
printk(KERN_INFO "enp2611_pci_map_irq for unknown device\n");
irq = IRQ_IXP2000_PCI;
printk(KERN_ERR "enp2611_pci_map_irq() called for unknown "
"device PCI:%d:%d:%d\n", dev->bus->number,
PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
irq = -1;
}
printk(KERN_INFO "Assigned IRQ %d to PCI:%d:%d:%d\n", irq,
dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
return irq;
}
......@@ -151,7 +159,9 @@ struct hw_pci enp2611_pci __initdata = {
int __init enp2611_pci_init(void)
{
pci_common_init(&enp2611_pci);
if (machine_is_enp2611())
pci_common_init(&enp2611_pci);
return 0;
}
......
......@@ -91,7 +91,7 @@ static void ixdp2x00_irq_unmask(unsigned int irq)
unsigned long dummy;
static struct slowport_cfg old_cfg;
#ifdef CONFGI_ARCH_IXDP2400
#ifdef CONFIG_ARCH_IXDP2400
if (machine_is_ixdp2400())
ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg);
#endif
......
......@@ -284,13 +284,15 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
spin_unlock_irqrestore(&consistent_lock, flags);
if (c) {
unsigned long off = vma->vm_pgoff;
kern_size = (c->vm_end - c->vm_start) >> PAGE_SHIFT;
if (vma->vm_pgoff < kern_size &&
user_size <= (kern_size - vma->vm_pgoff)) {
if (off < kern_size &&
user_size <= (kern_size - off)) {
vma->vm_flags |= VM_RESERVED;
ret = remap_pfn_range(vma, vma->vm_start,
page_to_pfn(c->vm_pages),
page_to_pfn(c->vm_pages) + off,
user_size, vma->vm_page_prot);
}
}
......
......@@ -123,13 +123,13 @@ static void mca_configure_adapter_status(struct mca_device *mca_dev) {
/*--------------------------------------------------------------------*/
static struct resource mca_standard_resources[] = {
{ "system control port B (MCA)", 0x60, 0x60 },
{ "arbitration (MCA)", 0x90, 0x90 },
{ "card Select Feedback (MCA)", 0x91, 0x91 },
{ "system Control port A (MCA)", 0x92, 0x92 },
{ "system board setup (MCA)", 0x94, 0x94 },
{ "POS (MCA)", 0x96, 0x97 },
{ "POS (MCA)", 0x100, 0x107 }
{ .start = 0x60, .end = 0x60, .name = "system control port B (MCA)" },
{ .start = 0x90, .end = 0x90, .name = "arbitration (MCA)" },
{ .start = 0x91, .end = 0x91, .name = "card Select Feedback (MCA)" },
{ .start = 0x92, .end = 0x92, .name = "system Control port A (MCA)" },
{ .start = 0x94, .end = 0x94, .name = "system board setup (MCA)" },
{ .start = 0x96, .end = 0x97, .name = "POS (MCA)" },
{ .start = 0x100, .end = 0x107, .name = "POS (MCA)" }
};
#define MCA_STANDARD_RESOURCES (sizeof(mca_standard_resources)/sizeof(struct resource))
......
......@@ -1166,9 +1166,10 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
/*
* Request address space for all standard resources
*/
static void __init register_memory(unsigned long max_low_pfn)
static void __init register_memory(void)
{
unsigned long low_mem_size;
unsigned long gapstart, gapsize;
unsigned long long last;
int i;
if (efi_enabled)
......@@ -1183,10 +1184,46 @@ static void __init register_memory(unsigned long max_low_pfn)
for (i = 0; i < STANDARD_IO_RESOURCES; i++)
request_resource(&ioport_resource, &standard_io_resources[i]);
/* Tell the PCI layer not to allocate too close to the RAM area.. */
low_mem_size = ((max_low_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff;
if (low_mem_size > pci_mem_start)
pci_mem_start = low_mem_size;
/*
* Search for the bigest gap in the low 32 bits of the e820
* memory space.
*/
last = 0x100000000ull;
gapstart = 0x10000000;
gapsize = 0x400000;
i = e820.nr_map;
while (--i >= 0) {
unsigned long long start = e820.map[i].addr;
unsigned long long end = start + e820.map[i].size;
/*
* Since "last" is at most 4GB, we know we'll
* fit in 32 bits if this condition is true
*/
if (last > end) {
unsigned long gap = last - end;
if (gap > gapsize) {
gapsize = gap;
gapstart = end;
}
}
if (start < last)
last = start;
}
/*
* Start allocating dynamic PCI memory a bit into the gap,
* aligned up to the nearest megabyte.
*
* Question: should we try to pad it up a bit (do something
* like " + (gapsize >> 3)" in there too?). We now have the
* technology.
*/
pci_mem_start = (gapstart + 0xfffff) & ~0xfffff;
printk("Allocating PCI resources starting at %08lx (gap: %08lx:%08lx)\n",
pci_mem_start, gapstart, gapsize);
}
/* Use inline assembly to define this because the nops are defined
......@@ -1432,7 +1469,7 @@ void __init setup_arch(char **cmdline_p)
get_smp_config();
#endif
register_memory(max_low_pfn);
register_memory();
#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
......
......@@ -140,15 +140,24 @@ struct hw_interrupt_type i8259_pic = {
};
static struct resource pic1_iores = {
"8259 (master)", 0x20, 0x21, IORESOURCE_BUSY
.name = "8259 (master)",
.start = 0x20,
.end = 0x21,
.flags = IORESOURCE_BUSY,
};
static struct resource pic2_iores = {
"8259 (slave)", 0xa0, 0xa1, IORESOURCE_BUSY
.name = "8259 (slave)",
.start = 0xa0,
.end = 0xa1,
.flags = IORESOURCE_BUSY,
};
static struct resource pic_edgectrl_iores = {
"8259 edge control", 0x4d0, 0x4d1, IORESOURCE_BUSY
.name = "8259 edge control",
.start = 0x4d0,
.end = 0x4d1,
.flags = IORESOURCE_BUSY,
};
static struct irqaction i8259_irqaction = {
......
......@@ -264,6 +264,10 @@ static int open_low_hpage_segs(struct mm_struct *mm, u16 newsegs)
return -EBUSY;
mm->context.htlb_segs |= newsegs;
/* update the paca copy of the context struct */
get_paca()->context = mm->context;
/* the context change must make it to memory before the flush,
* so that further SLB misses do the right thing. */
mb();
......
......@@ -18,6 +18,11 @@ config TIME_INTERPOLATION
source "init/Kconfig"
config SYSVIPC_COMPAT
bool
depends on COMPAT && SYSVIPC
default y
menu "General machine setup"
config BBC_I2C
......
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.11-rc3
# Mon Feb 7 15:29:00 2005
# Linux kernel version: 2.6.11-rc4
# Thu Feb 17 15:32:19 2005
#
CONFIG_64BIT=y
CONFIG_MMU=y
......@@ -53,6 +53,7 @@ CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_KMOD=y
CONFIG_STOP_MACHINE=y
CONFIG_SYSVIPC_COMPAT=y
#
# General machine setup
......
......@@ -17,7 +17,7 @@
#include <asm/auxio.h>
/* This cannot be static, as it is referenced in entry.S */
void __iomem *auxio_register = 0UL;
void __iomem *auxio_register = NULL;
enum auxio_type {
AUXIO_TYPE_NODEV,
......
This diff is collapsed.
......@@ -119,6 +119,9 @@
.globl FUNC_NAME
.type FUNC_NAME,#function
FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
srlx %o2, 31, %g2
cmp %g2, 0
tne %xcc, 5
PREAMBLE
mov %o0, %g5
cmp %o2, 0
......
......@@ -80,6 +80,9 @@
.globl FUNC_NAME
.type FUNC_NAME,#function
FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
srlx %o2, 31, %g2
cmp %g2, 0
tne %xcc, 5
PREAMBLE
mov %o0, %g5
cmp %o2, 0
......
......@@ -7,4 +7,4 @@ EXTRA_AFLAGS := -ansi
EXTRA_CFLAGS := -Werror
lib-y := bootstr.o devops.o init.o memory.o misc.o \
tree.o console.o printf.o p1275.o map.o
tree.o console.o printf.o p1275.o map.o cif.o
/* cif.S: PROM entry/exit assembler trampolines.
*
* Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
* Copyright (C) 2005 David S. Miller <davem@davemloft.net>
*/
#include <asm/pstate.h>
.text
.globl prom_cif_interface
prom_cif_interface:
sethi %hi(p1275buf), %o0
or %o0, %lo(p1275buf), %o0
ldx [%o0 + 0x010], %o1 ! prom_cif_stack
save %o1, -0x190, %sp
ldx [%i0 + 0x008], %l2 ! prom_cif_handler
rdpr %pstate, %l4
wrpr %g0, 0x15, %pstate ! save alternate globals
stx %g1, [%sp + 2047 + 0x0b0]
stx %g2, [%sp + 2047 + 0x0b8]
stx %g3, [%sp + 2047 + 0x0c0]
stx %g4, [%sp + 2047 + 0x0c8]
stx %g5, [%sp + 2047 + 0x0d0]
stx %g6, [%sp + 2047 + 0x0d8]
stx %g7, [%sp + 2047 + 0x0e0]
wrpr %g0, 0x814, %pstate ! save interrupt globals
stx %g1, [%sp + 2047 + 0x0e8]
stx %g2, [%sp + 2047 + 0x0f0]
stx %g3, [%sp + 2047 + 0x0f8]
stx %g4, [%sp + 2047 + 0x100]
stx %g5, [%sp + 2047 + 0x108]
stx %g6, [%sp + 2047 + 0x110]
stx %g7, [%sp + 2047 + 0x118]
wrpr %g0, 0x14, %pstate ! save normal globals
stx %g1, [%sp + 2047 + 0x120]
stx %g2, [%sp + 2047 + 0x128]
stx %g3, [%sp + 2047 + 0x130]
stx %g4, [%sp + 2047 + 0x138]
stx %g5, [%sp + 2047 + 0x140]
stx %g6, [%sp + 2047 + 0x148]
stx %g7, [%sp + 2047 + 0x150]
wrpr %g0, 0x414, %pstate ! save mmu globals
stx %g1, [%sp + 2047 + 0x158]
stx %g2, [%sp + 2047 + 0x160]
stx %g3, [%sp + 2047 + 0x168]
stx %g4, [%sp + 2047 + 0x170]
stx %g5, [%sp + 2047 + 0x178]
stx %g6, [%sp + 2047 + 0x180]
stx %g7, [%sp + 2047 + 0x188]
mov %g1, %l0 ! also save to locals, so we can handle
mov %g2, %l1 ! tlb faults later on, when accessing
mov %g3, %l3 ! the stack.
mov %g7, %l5
wrpr %l4, PSTATE_IE, %pstate ! turn off interrupts
call %l2
add %i0, 0x018, %o0 ! prom_args
wrpr %g0, 0x414, %pstate ! restore mmu globals
mov %l0, %g1
mov %l1, %g2
mov %l3, %g3
mov %l5, %g7
wrpr %g0, 0x14, %pstate ! restore normal globals
ldx [%sp + 2047 + 0x120], %g1
ldx [%sp + 2047 + 0x128], %g2
ldx [%sp + 2047 + 0x130], %g3
ldx [%sp + 2047 + 0x138], %g4
ldx [%sp + 2047 + 0x140], %g5
ldx [%sp + 2047 + 0x148], %g6
ldx [%sp + 2047 + 0x150], %g7
wrpr %g0, 0x814, %pstate ! restore interrupt globals
ldx [%sp + 2047 + 0x0e8], %g1
ldx [%sp + 2047 + 0x0f0], %g2
ldx [%sp + 2047 + 0x0f8], %g3
ldx [%sp + 2047 + 0x100], %g4
ldx [%sp + 2047 + 0x108], %g5
ldx [%sp + 2047 + 0x110], %g6
ldx [%sp + 2047 + 0x118], %g7
wrpr %g0, 0x15, %pstate ! restore alternate globals
ldx [%sp + 2047 + 0x0b0], %g1
ldx [%sp + 2047 + 0x0b8], %g2
ldx [%sp + 2047 + 0x0c0], %g3
ldx [%sp + 2047 + 0x0c8], %g4
ldx [%sp + 2047 + 0x0d0], %g5
ldx [%sp + 2047 + 0x0d8], %g6
ldx [%sp + 2047 + 0x0e0], %g7
wrpr %l4, 0, %pstate ! restore original pstate
ret
restore
.globl prom_cif_callback
prom_cif_callback:
sethi %hi(p1275buf), %o1
or %o1, %lo(p1275buf), %o1
save %sp, -0x270, %sp
rdpr %pstate, %l4
wrpr %g0, 0x15, %pstate ! save PROM alternate globals
stx %g1, [%sp + 2047 + 0x0b0]
stx %g2, [%sp + 2047 + 0x0b8]
stx %g3, [%sp + 2047 + 0x0c0]
stx %g4, [%sp + 2047 + 0x0c8]
stx %g5, [%sp + 2047 + 0x0d0]
stx %g6, [%sp + 2047 + 0x0d8]
stx %g7, [%sp + 2047 + 0x0e0]
! restore Linux alternate globals
ldx [%sp + 2047 + 0x190], %g1
ldx [%sp + 2047 + 0x198], %g2
ldx [%sp + 2047 + 0x1a0], %g3
ldx [%sp + 2047 + 0x1a8], %g4
ldx [%sp + 2047 + 0x1b0], %g5
ldx [%sp + 2047 + 0x1b8], %g6
ldx [%sp + 2047 + 0x1c0], %g7
wrpr %g0, 0x814, %pstate ! save PROM interrupt globals
stx %g1, [%sp + 2047 + 0x0e8]
stx %g2, [%sp + 2047 + 0x0f0]
stx %g3, [%sp + 2047 + 0x0f8]
stx %g4, [%sp + 2047 + 0x100]
stx %g5, [%sp + 2047 + 0x108]
stx %g6, [%sp + 2047 + 0x110]
stx %g7, [%sp + 2047 + 0x118]
! restore Linux interrupt globals
ldx [%sp + 2047 + 0x1c8], %g1
ldx [%sp + 2047 + 0x1d0], %g2
ldx [%sp + 2047 + 0x1d8], %g3
ldx [%sp + 2047 + 0x1e0], %g4
ldx [%sp + 2047 + 0x1e8], %g5
ldx [%sp + 2047 + 0x1f0], %g6
ldx [%sp + 2047 + 0x1f8], %g7
wrpr %g0, 0x14, %pstate ! save PROM normal globals
stx %g1, [%sp + 2047 + 0x120]
stx %g2, [%sp + 2047 + 0x128]
stx %g3, [%sp + 2047 + 0x130]
stx %g4, [%sp + 2047 + 0x138]
stx %g5, [%sp + 2047 + 0x140]
stx %g6, [%sp + 2047 + 0x148]
stx %g7, [%sp + 2047 + 0x150]
! restore Linux normal globals
ldx [%sp + 2047 + 0x200], %g1
ldx [%sp + 2047 + 0x208], %g2
ldx [%sp + 2047 + 0x210], %g3
ldx [%sp + 2047 + 0x218], %g4
ldx [%sp + 2047 + 0x220], %g5
ldx [%sp + 2047 + 0x228], %g6
ldx [%sp + 2047 + 0x230], %g7
wrpr %g0, 0x414, %pstate ! save PROM mmu globals
stx %g1, [%sp + 2047 + 0x158]
stx %g2, [%sp + 2047 + 0x160]
stx %g3, [%sp + 2047 + 0x168]
stx %g4, [%sp + 2047 + 0x170]
stx %g5, [%sp + 2047 + 0x178]
stx %g6, [%sp + 2047 + 0x180]
stx %g7, [%sp + 2047 + 0x188]
! restore Linux mmu globals
ldx [%sp + 2047 + 0x238], %o0
ldx [%sp + 2047 + 0x240], %o1
ldx [%sp + 2047 + 0x248], %l2
ldx [%sp + 2047 + 0x250], %l3
ldx [%sp + 2047 + 0x258], %l5
ldx [%sp + 2047 + 0x260], %l6
ldx [%sp + 2047 + 0x268], %l7
! switch to Linux tba
sethi %hi(sparc64_ttable_tl0), %l1
rdpr %tba, %l0 ! save PROM tba
mov %o0, %g1
mov %o1, %g2
mov %l2, %g3
mov %l3, %g4
mov %l5, %g5
mov %l6, %g6
mov %l7, %g7
wrpr %l1, %tba ! install Linux tba
wrpr %l4, 0, %pstate ! restore PSTATE
call prom_world
mov %g0, %o0
ldx [%i1 + 0x000], %l2
call %l2
mov %i0, %o0
mov %o0, %l1
call prom_world
or %g0, 1, %o0
wrpr %g0, 0x14, %pstate ! interrupts off
! restore PROM mmu globals
ldx [%sp + 2047 + 0x158], %o0
ldx [%sp + 2047 + 0x160], %o1
ldx [%sp + 2047 + 0x168], %l2
ldx [%sp + 2047 + 0x170], %l3
ldx [%sp + 2047 + 0x178], %l5
ldx [%sp + 2047 + 0x180], %l6
ldx [%sp + 2047 + 0x188], %l7
wrpr %g0, 0x414, %pstate ! restore PROM mmu globals
mov %o0, %g1
mov %o1, %g2
mov %l2, %g3
mov %l3, %g4
mov %l5, %g5
mov %l6, %g6
mov %l7, %g7
wrpr %l0, %tba ! restore PROM tba
wrpr %g0, 0x14, %pstate ! restore PROM normal globals
ldx [%sp + 2047 + 0x120], %g1
ldx [%sp + 2047 + 0x128], %g2
ldx [%sp + 2047 + 0x130], %g3
ldx [%sp + 2047 + 0x138], %g4
ldx [%sp + 2047 + 0x140], %g5
ldx [%sp + 2047 + 0x148], %g6
ldx [%sp + 2047 + 0x150], %g7
wrpr %g0, 0x814, %pstate ! restore PROM interrupt globals
ldx [%sp + 2047 + 0x0e8], %g1
ldx [%sp + 2047 + 0x0f0], %g2
ldx [%sp + 2047 + 0x0f8], %g3
ldx [%sp + 2047 + 0x100], %g4
ldx [%sp + 2047 + 0x108], %g5
ldx [%sp + 2047 + 0x110], %g6
ldx [%sp + 2047 + 0x118], %g7
wrpr %g0, 0x15, %pstate ! restore PROM alternate globals
ldx [%sp + 2047 + 0x0b0], %g1
ldx [%sp + 2047 + 0x0b8], %g2
ldx [%sp + 2047 + 0x0c0], %g3
ldx [%sp + 2047 + 0x0c8], %g4
ldx [%sp + 2047 + 0x0d0], %g5
ldx [%sp + 2047 + 0x0d8], %g6
ldx [%sp + 2047 + 0x0e0], %g7
wrpr %l4, 0, %pstate
ret
restore %l1, 0, %o0
......@@ -27,225 +27,8 @@ struct {
extern void prom_world(int);
void prom_cif_interface (void)
{
__asm__ __volatile__ (
" mov %0, %%o0\n"
" ldx [%%o0 + 0x010], %%o1 ! prom_cif_stack\n"
" save %%o1, -0x190, %%sp\n"
" ldx [%%i0 + 0x008], %%l2 ! prom_cif_handler\n"
" rdpr %%pstate, %%l4\n"
" wrpr %%g0, 0x15, %%pstate ! save alternate globals\n"
" stx %%g1, [%%sp + 2047 + 0x0b0]\n"
" stx %%g2, [%%sp + 2047 + 0x0b8]\n"
" stx %%g3, [%%sp + 2047 + 0x0c0]\n"
" stx %%g4, [%%sp + 2047 + 0x0c8]\n"
" stx %%g5, [%%sp + 2047 + 0x0d0]\n"
" stx %%g6, [%%sp + 2047 + 0x0d8]\n"
" stx %%g7, [%%sp + 2047 + 0x0e0]\n"
" wrpr %%g0, 0x814, %%pstate ! save interrupt globals\n"
" stx %%g1, [%%sp + 2047 + 0x0e8]\n"
" stx %%g2, [%%sp + 2047 + 0x0f0]\n"
" stx %%g3, [%%sp + 2047 + 0x0f8]\n"
" stx %%g4, [%%sp + 2047 + 0x100]\n"
" stx %%g5, [%%sp + 2047 + 0x108]\n"
" stx %%g6, [%%sp + 2047 + 0x110]\n"
" stx %%g7, [%%sp + 2047 + 0x118]\n"
" wrpr %%g0, 0x14, %%pstate ! save normal globals\n"
" stx %%g1, [%%sp + 2047 + 0x120]\n"
" stx %%g2, [%%sp + 2047 + 0x128]\n"
" stx %%g3, [%%sp + 2047 + 0x130]\n"
" stx %%g4, [%%sp + 2047 + 0x138]\n"
" stx %%g5, [%%sp + 2047 + 0x140]\n"
" stx %%g6, [%%sp + 2047 + 0x148]\n"
" stx %%g7, [%%sp + 2047 + 0x150]\n"
" wrpr %%g0, 0x414, %%pstate ! save mmu globals\n"
" stx %%g1, [%%sp + 2047 + 0x158]\n"
" stx %%g2, [%%sp + 2047 + 0x160]\n"
" stx %%g3, [%%sp + 2047 + 0x168]\n"
" stx %%g4, [%%sp + 2047 + 0x170]\n"
" stx %%g5, [%%sp + 2047 + 0x178]\n"
" stx %%g6, [%%sp + 2047 + 0x180]\n"
" stx %%g7, [%%sp + 2047 + 0x188]\n"
" mov %%g1, %%l0 ! also save to locals, so we can handle\n"
" mov %%g2, %%l1 ! tlb faults later on, when accessing\n"
" mov %%g3, %%l3 ! the stack.\n"
" mov %%g7, %%l5\n"
" wrpr %%l4, %1, %%pstate ! turn off interrupts\n"
" call %%l2\n"
" add %%i0, 0x018, %%o0 ! prom_args\n"
" wrpr %%g0, 0x414, %%pstate ! restore mmu globals\n"
" mov %%l0, %%g1\n"
" mov %%l1, %%g2\n"
" mov %%l3, %%g3\n"
" mov %%l5, %%g7\n"
" wrpr %%g0, 0x14, %%pstate ! restore normal globals\n"
" ldx [%%sp + 2047 + 0x120], %%g1\n"
" ldx [%%sp + 2047 + 0x128], %%g2\n"
" ldx [%%sp + 2047 + 0x130], %%g3\n"
" ldx [%%sp + 2047 + 0x138], %%g4\n"
" ldx [%%sp + 2047 + 0x140], %%g5\n"
" ldx [%%sp + 2047 + 0x148], %%g6\n"
" ldx [%%sp + 2047 + 0x150], %%g7\n"
" wrpr %%g0, 0x814, %%pstate ! restore interrupt globals\n"
" ldx [%%sp + 2047 + 0x0e8], %%g1\n"
" ldx [%%sp + 2047 + 0x0f0], %%g2\n"
" ldx [%%sp + 2047 + 0x0f8], %%g3\n"
" ldx [%%sp + 2047 + 0x100], %%g4\n"
" ldx [%%sp + 2047 + 0x108], %%g5\n"
" ldx [%%sp + 2047 + 0x110], %%g6\n"
" ldx [%%sp + 2047 + 0x118], %%g7\n"
" wrpr %%g0, 0x15, %%pstate ! restore alternate globals\n"
" ldx [%%sp + 2047 + 0x0b0], %%g1\n"
" ldx [%%sp + 2047 + 0x0b8], %%g2\n"
" ldx [%%sp + 2047 + 0x0c0], %%g3\n"
" ldx [%%sp + 2047 + 0x0c8], %%g4\n"
" ldx [%%sp + 2047 + 0x0d0], %%g5\n"
" ldx [%%sp + 2047 + 0x0d8], %%g6\n"
" ldx [%%sp + 2047 + 0x0e0], %%g7\n"
" wrpr %%l4, 0, %%pstate ! restore original pstate\n"
" ret\n"
" restore\n"
" " : : "r" (&p1275buf), "i" (PSTATE_IE));
}
void prom_cif_callback(void)
{
__asm__ __volatile__ (
" mov %0, %%o1\n"
" save %%sp, -0x270, %%sp\n"
" rdpr %%pstate, %%l4\n"
" wrpr %%g0, 0x15, %%pstate ! save PROM alternate globals\n"
" stx %%g1, [%%sp + 2047 + 0x0b0]\n"
" stx %%g2, [%%sp + 2047 + 0x0b8]\n"
" stx %%g3, [%%sp + 2047 + 0x0c0]\n"
" stx %%g4, [%%sp + 2047 + 0x0c8]\n"
" stx %%g5, [%%sp + 2047 + 0x0d0]\n"
" stx %%g6, [%%sp + 2047 + 0x0d8]\n"
" stx %%g7, [%%sp + 2047 + 0x0e0]\n"
" ! restore Linux alternate globals\n"
" ldx [%%sp + 2047 + 0x190], %%g1\n"
" ldx [%%sp + 2047 + 0x198], %%g2\n"
" ldx [%%sp + 2047 + 0x1a0], %%g3\n"
" ldx [%%sp + 2047 + 0x1a8], %%g4\n"
" ldx [%%sp + 2047 + 0x1b0], %%g5\n"
" ldx [%%sp + 2047 + 0x1b8], %%g6\n"
" ldx [%%sp + 2047 + 0x1c0], %%g7\n"
" wrpr %%g0, 0x814, %%pstate ! save PROM interrupt globals\n"
" stx %%g1, [%%sp + 2047 + 0x0e8]\n"
" stx %%g2, [%%sp + 2047 + 0x0f0]\n"
" stx %%g3, [%%sp + 2047 + 0x0f8]\n"
" stx %%g4, [%%sp + 2047 + 0x100]\n"
" stx %%g5, [%%sp + 2047 + 0x108]\n"
" stx %%g6, [%%sp + 2047 + 0x110]\n"
" stx %%g7, [%%sp + 2047 + 0x118]\n"
" ! restore Linux interrupt globals\n"
" ldx [%%sp + 2047 + 0x1c8], %%g1\n"
" ldx [%%sp + 2047 + 0x1d0], %%g2\n"
" ldx [%%sp + 2047 + 0x1d8], %%g3\n"
" ldx [%%sp + 2047 + 0x1e0], %%g4\n"
" ldx [%%sp + 2047 + 0x1e8], %%g5\n"
" ldx [%%sp + 2047 + 0x1f0], %%g6\n"
" ldx [%%sp + 2047 + 0x1f8], %%g7\n"
" wrpr %%g0, 0x14, %%pstate ! save PROM normal globals\n"
" stx %%g1, [%%sp + 2047 + 0x120]\n"
" stx %%g2, [%%sp + 2047 + 0x128]\n"
" stx %%g3, [%%sp + 2047 + 0x130]\n"
" stx %%g4, [%%sp + 2047 + 0x138]\n"
" stx %%g5, [%%sp + 2047 + 0x140]\n"
" stx %%g6, [%%sp + 2047 + 0x148]\n"
" stx %%g7, [%%sp + 2047 + 0x150]\n"
" ! restore Linux normal globals\n"
" ldx [%%sp + 2047 + 0x200], %%g1\n"
" ldx [%%sp + 2047 + 0x208], %%g2\n"
" ldx [%%sp + 2047 + 0x210], %%g3\n"
" ldx [%%sp + 2047 + 0x218], %%g4\n"
" ldx [%%sp + 2047 + 0x220], %%g5\n"
" ldx [%%sp + 2047 + 0x228], %%g6\n"
" ldx [%%sp + 2047 + 0x230], %%g7\n"
" wrpr %%g0, 0x414, %%pstate ! save PROM mmu globals\n"
" stx %%g1, [%%sp + 2047 + 0x158]\n"
" stx %%g2, [%%sp + 2047 + 0x160]\n"
" stx %%g3, [%%sp + 2047 + 0x168]\n"
" stx %%g4, [%%sp + 2047 + 0x170]\n"
" stx %%g5, [%%sp + 2047 + 0x178]\n"
" stx %%g6, [%%sp + 2047 + 0x180]\n"
" stx %%g7, [%%sp + 2047 + 0x188]\n"
" ! restore Linux mmu globals\n"
" ldx [%%sp + 2047 + 0x238], %%o0\n"
" ldx [%%sp + 2047 + 0x240], %%o1\n"
" ldx [%%sp + 2047 + 0x248], %%l2\n"
" ldx [%%sp + 2047 + 0x250], %%l3\n"
" ldx [%%sp + 2047 + 0x258], %%l5\n"
" ldx [%%sp + 2047 + 0x260], %%l6\n"
" ldx [%%sp + 2047 + 0x268], %%l7\n"
" ! switch to Linux tba\n"
" sethi %%hi(sparc64_ttable_tl0), %%l1\n"
" rdpr %%tba, %%l0 ! save PROM tba\n"
" mov %%o0, %%g1\n"
" mov %%o1, %%g2\n"
" mov %%l2, %%g3\n"
" mov %%l3, %%g4\n"
" mov %%l5, %%g5\n"
" mov %%l6, %%g6\n"
" mov %%l7, %%g7\n"
" wrpr %%l1, %%tba ! install Linux tba\n"
" wrpr %%l4, 0, %%pstate ! restore PSTATE\n"
" call prom_world\n"
" mov %%g0, %%o0\n"
" ldx [%%i1 + 0x000], %%l2\n"
" call %%l2\n"
" mov %%i0, %%o0\n"
" mov %%o0, %%l1\n"
" call prom_world\n"
" or %%g0, 1, %%o0\n"
" wrpr %%g0, 0x14, %%pstate ! interrupts off\n"
" ! restore PROM mmu globals\n"
" ldx [%%sp + 2047 + 0x158], %%o0\n"
" ldx [%%sp + 2047 + 0x160], %%o1\n"
" ldx [%%sp + 2047 + 0x168], %%l2\n"
" ldx [%%sp + 2047 + 0x170], %%l3\n"
" ldx [%%sp + 2047 + 0x178], %%l5\n"
" ldx [%%sp + 2047 + 0x180], %%l6\n"
" ldx [%%sp + 2047 + 0x188], %%l7\n"
" wrpr %%g0, 0x414, %%pstate ! restore PROM mmu globals\n"
" mov %%o0, %%g1\n"
" mov %%o1, %%g2\n"
" mov %%l2, %%g3\n"
" mov %%l3, %%g4\n"
" mov %%l5, %%g5\n"
" mov %%l6, %%g6\n"
" mov %%l7, %%g7\n"
" wrpr %%l0, %%tba ! restore PROM tba\n"
" wrpr %%g0, 0x14, %%pstate ! restore PROM normal globals\n"
" ldx [%%sp + 2047 + 0x120], %%g1\n"
" ldx [%%sp + 2047 + 0x128], %%g2\n"
" ldx [%%sp + 2047 + 0x130], %%g3\n"
" ldx [%%sp + 2047 + 0x138], %%g4\n"
" ldx [%%sp + 2047 + 0x140], %%g5\n"
" ldx [%%sp + 2047 + 0x148], %%g6\n"
" ldx [%%sp + 2047 + 0x150], %%g7\n"
" wrpr %%g0, 0x814, %%pstate ! restore PROM interrupt globals\n"
" ldx [%%sp + 2047 + 0x0e8], %%g1\n"
" ldx [%%sp + 2047 + 0x0f0], %%g2\n"
" ldx [%%sp + 2047 + 0x0f8], %%g3\n"
" ldx [%%sp + 2047 + 0x100], %%g4\n"
" ldx [%%sp + 2047 + 0x108], %%g5\n"
" ldx [%%sp + 2047 + 0x110], %%g6\n"
" ldx [%%sp + 2047 + 0x118], %%g7\n"
" wrpr %%g0, 0x15, %%pstate ! restore PROM alternate globals\n"
" ldx [%%sp + 2047 + 0x0b0], %%g1\n"
" ldx [%%sp + 2047 + 0x0b8], %%g2\n"
" ldx [%%sp + 2047 + 0x0c0], %%g3\n"
" ldx [%%sp + 2047 + 0x0c8], %%g4\n"
" ldx [%%sp + 2047 + 0x0d0], %%g5\n"
" ldx [%%sp + 2047 + 0x0d8], %%g6\n"
" ldx [%%sp + 2047 + 0x0e0], %%g7\n"
" wrpr %%l4, 0, %%pstate\n"
" ret\n"
" restore %%l1, 0, %%o0\n"
" " : : "r" (&p1275buf), "i" (PSTATE_PRIV));
}
extern void prom_cif_interface(void);
extern void prom_cif_callback(void);
/*
* This provides SMP safety on the p1275buf. prom_callback() drops this lock
......
......@@ -111,15 +111,24 @@ extern char _text, _etext, _edata, _end;
char command_line[COMMAND_LINE_SIZE];
struct resource standard_io_resources[] = {
{ "dma1", 0x00, 0x1f, IORESOURCE_BUSY | IORESOURCE_IO },
{ "pic1", 0x20, 0x21, IORESOURCE_BUSY | IORESOURCE_IO },
{ "timer0", 0x40, 0x43, IORESOURCE_BUSY | IORESOURCE_IO },
{ "timer1", 0x50, 0x53, IORESOURCE_BUSY | IORESOURCE_IO },
{ "keyboard", 0x60, 0x6f, IORESOURCE_BUSY | IORESOURCE_IO },
{ "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY | IORESOURCE_IO },
{ "pic2", 0xa0, 0xa1, IORESOURCE_BUSY | IORESOURCE_IO },
{ "dma2", 0xc0, 0xdf, IORESOURCE_BUSY | IORESOURCE_IO },
{ "fpu", 0xf0, 0xff, IORESOURCE_BUSY | IORESOURCE_IO }
{ .name = "dma1", .start = 0x00, .end = 0x1f,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
{ .name = "pic1", .start = 0x20, .end = 0x21,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
{ .name = "timer0", .start = 0x40, .end = 0x43,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
{ .name = "timer1", .start = 0x50, .end = 0x53,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
{ .name = "keyboard", .start = 0x60, .end = 0x6f,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
{ .name = "dma page reg", .start = 0x80, .end = 0x8f,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
{ .name = "pic2", .start = 0xa0, .end = 0xa1,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
{ .name = "dma2", .start = 0xc0, .end = 0xdf,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
{ .name = "fpu", .start = 0xf0, .end = 0xff,
.flags = IORESOURCE_BUSY | IORESOURCE_IO }
};
#define STANDARD_IO_RESOURCES \
......@@ -127,28 +136,66 @@ struct resource standard_io_resources[] = {
#define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM)
struct resource data_resource = { "Kernel data", 0, 0, IORESOURCE_RAM };
struct resource code_resource = { "Kernel code", 0, 0, IORESOURCE_RAM };
struct resource data_resource = {
.name = "Kernel data",
.start = 0,
.end = 0,
.flags = IORESOURCE_RAM,
};
struct resource code_resource = {
.name = "Kernel code",
.start = 0,
.end = 0,
.flags = IORESOURCE_RAM,
};
#define IORESOURCE_ROM (IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM)
static struct resource system_rom_resource = { "System ROM", 0xf0000, 0xfffff, IORESOURCE_ROM };
static struct resource extension_rom_resource = { "Extension ROM", 0xe0000, 0xeffff, IORESOURCE_ROM };
static struct resource system_rom_resource = {
.name = "System ROM",
.start = 0xf0000,
.end = 0xfffff,
.flags = IORESOURCE_ROM,
};
static struct resource extension_rom_resource = {
.name = "Extension ROM",
.start = 0xe0000,
.end = 0xeffff,
.flags = IORESOURCE_ROM,
};
static struct resource adapter_rom_resources[] = {
{ "Adapter ROM", 0xc8000, 0, IORESOURCE_ROM },
{ "Adapter ROM", 0, 0, IORESOURCE_ROM },
{ "Adapter ROM", 0, 0, IORESOURCE_ROM },
{ "Adapter ROM", 0, 0, IORESOURCE_ROM },
{ "Adapter ROM", 0, 0, IORESOURCE_ROM },
{ "Adapter ROM", 0, 0, IORESOURCE_ROM }
{ .name = "Adapter ROM", .start = 0xc8000, .end = 0,
.flags = IORESOURCE_ROM },
{ .name = "Adapter ROM", .start = 0, .end = 0,
.flags = IORESOURCE_ROM },
{ .name = "Adapter ROM", .start = 0, .end = 0,
.flags = IORESOURCE_ROM },
{ .name = "Adapter ROM", .start = 0, .end = 0,
.flags = IORESOURCE_ROM },
{ .name = "Adapter ROM", .start = 0, .end = 0,
.flags = IORESOURCE_ROM },
{ .name = "Adapter ROM", .start = 0, .end = 0,
.flags = IORESOURCE_ROM }
};
#define ADAPTER_ROM_RESOURCES \
(sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])
static struct resource video_rom_resource = { "Video ROM", 0xc0000, 0xc7fff, IORESOURCE_ROM };
static struct resource video_ram_resource = { "Video RAM area", 0xa0000, 0xbffff, IORESOURCE_RAM };
static struct resource video_rom_resource = {
.name = "Video ROM",
.start = 0xc0000,
.end = 0xc7fff,
.flags = IORESOURCE_ROM,
};
static struct resource video_ram_resource = {
.name = "Video RAM area",
.start = 0xa0000,
.end = 0xbffff,
.flags = IORESOURCE_RAM,
};
#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
......
......@@ -108,7 +108,7 @@ static struct usb_device_id blacklist_ids[] = {
{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
/* Microsoft Wireless Transceiver for Bluetooth 2.0 */
{ USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_BCM92035 },
{ USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
/* ISSC Bluetooth Adapter v3.1 */
{ USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
......
......@@ -812,7 +812,7 @@ config BLK_DEV_IDE_RAPIDE
config BLK_DEV_IDE_BAST
tristate "Simtec BAST / Thorcom VR1000 IDE support"
depends on ARM && (ARCH_BAST || MACH_VR100)
depends on ARM && (ARCH_BAST || MACH_VR1000)
help
Say Y here if you want to support the onboard IDE channels on the
Simtec BAST or the Thorcom VR1000
......
......@@ -238,9 +238,10 @@ u64 ide_get_error_location(ide_drive_t *drive, char *args)
high = ide_read_24(drive);
} else {
u8 cur = HWIF(drive)->INB(IDE_SELECT_REG);
if (cur & 0x40)
if (cur & 0x40) {
high = cur & 0xf;
low = (hcyl << 16) | (lcyl << 8) | sect;
else {
} else {
low = hcyl * drive->head * drive->sect;
low += lcyl * drive->sect;
low += sect - 1;
......
......@@ -335,10 +335,14 @@ static void __init init_ide_data (void)
static int ide_system_bus_speed(void)
{
#ifdef CONFIG_PCI
static struct pci_device_id pci_default[] = {
{ PCI_DEVICE(PCI_ANY_ID, PCI_ANY_ID) },
{ }
};
#else
#define pci_default 0
#endif /* CONFIG_PCI */
if (!system_bus_speed) {
if (idebus_parameter) {
......
......@@ -441,6 +441,7 @@ enum register_offsets {
#define DSPCFG_VAL 0x5040
#define SDCFG_VAL 0x008c /* set voltage thresholds for Signal Detect */
#define DSPCFG_LOCK 0x20 /* coefficient lock bit in DSPCFG */
#define DSPCFG_COEF 0x1000 /* see coefficient (in TSTDAT) bit in DSPCFG */
#define TSTDAT_FIXED 0xe8 /* magic number for bad coefficients */
/* misc PCI space registers */
......@@ -1243,7 +1244,8 @@ static void init_phy_fixup(struct net_device *dev)
writew(1, ioaddr + PGSEL);
writew(PMDCSR_VAL, ioaddr + PMDCSR);
writew(TSTDAT_VAL, ioaddr + TSTDAT);
np->dspcfg = DSPCFG_VAL;
np->dspcfg = (np->srr <= SRR_DP83815_C)?
DSPCFG_VAL : (DSPCFG_COEF | readw(ioaddr + DSPCFG));
writew(np->dspcfg, ioaddr + DSPCFG);
writew(SDCFG_VAL, ioaddr + SDCFG);
writew(0, ioaddr + PGSEL);
......
......@@ -3025,6 +3025,8 @@ static void s2io_set_multicast(struct net_device *dev)
for (i = 0; i < prev_cnt; i++) {
writeq(RMAC_ADDR_DATA0_MEM_ADDR(dis_addr),
&bar0->rmac_addr_data0_mem);
writeq(RMAC_ADDR_DATA1_MEM_MASK(0ULL),
&bar0->rmac_addr_data1_mem);
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
RMAC_ADDR_CMD_MEM_OFFSET
......@@ -3049,8 +3051,11 @@ static void s2io_set_multicast(struct net_device *dev)
mac_addr |= mclist->dmi_addr[j];
mac_addr <<= 8;
}
mac_addr >>= 8;
writeq(RMAC_ADDR_DATA0_MEM_ADDR(mac_addr),
&bar0->rmac_addr_data0_mem);
writeq(RMAC_ADDR_DATA1_MEM_MASK(0ULL),
&bar0->rmac_addr_data1_mem);
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
......
......@@ -2398,7 +2398,7 @@ static int set_mac_address(struct strip *strip_info,
return 0;
}
static int dev_set_mac_address(struct net_device *dev, void *addr)
static int strip_set_mac_address(struct net_device *dev, void *addr)
{
struct strip *strip_info = (struct strip *) (dev->priv);
struct sockaddr *sa = addr;
......@@ -2552,7 +2552,7 @@ static void strip_dev_setup(struct net_device *dev)
dev->hard_start_xmit = strip_xmit;
dev->hard_header = strip_header;
dev->rebuild_header = strip_rebuild_header;
dev->set_mac_address = dev_set_mac_address;
dev->set_mac_address = strip_set_mac_address;
dev->get_stats = strip_get_stats;
dev->change_mtu = strip_change_mtu;
}
......
......@@ -268,7 +268,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
return -EIO;
pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc);
if ((pmc & PCI_PM_CAP_VER_MASK) != 2) {
if ((pmc & PCI_PM_CAP_VER_MASK) > 2) {
printk(KERN_DEBUG
"PCI: %s has unsupported PM cap regs version (%u)\n",
dev->slot_name, pmc & PCI_PM_CAP_VER_MASK);
......
......@@ -7,7 +7,12 @@
#include <linux/ctype.h>
#include <linux/pnp.h>
#include <linux/pnpbios.h>
#ifdef CONFIG_PCI
#include <linux/pci.h>
#else
inline void pcibios_penalize_isa_irq(int irq) {}
#endif /* CONFIG_PCI */
#include "pnpbios.h"
......
......@@ -2818,7 +2818,7 @@ static inline int ata_should_dma_map(struct ata_queued_cmd *qc)
return 1;
/* fall through */
default:
return 0;
}
......@@ -3804,16 +3804,13 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
if (legacy_mode) {
if (legacy_mode & (1 << 0))
ata_device_add(probe_ent);
else
kfree(probe_ent);
if (legacy_mode & (1 << 1))
ata_device_add(probe_ent2);
else
kfree(probe_ent2);
} else {
} else
ata_device_add(probe_ent);
}
kfree(probe_ent);
kfree(probe_ent2);
return 0;
......
......@@ -39,6 +39,7 @@
#include <asm/scatterlist.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <asm/irq.h>
#include <asm/byteorder.h>
#include <linux/usb.h>
......
......@@ -4,6 +4,41 @@
* "ACCEL_MMIO" ifdef branches in XFree86
* --dte
*/
static void radeon_fixup_offset(struct radeonfb_info *rinfo)
{
u32 local_base;
/* *** Ugly workaround *** */
/*
* On some platforms, the video memory is mapped at 0 in radeon chip space
* (like PPCs) by the firmware. X will always move it up so that it's seen
* by the chip to be at the same address as the PCI BAR.
* That means that when switching back from X, there is a mismatch between
* the offsets programmed into the engine. This means that potentially,
* accel operations done before radeonfb has a chance to re-init the engine
* will have incorrect offsets, and potentially trash system memory !
*
* The correct fix is for fbcon to never call any accel op before the engine
* has properly been re-initialized (by a call to set_var), but this is a
* complex fix. This workaround in the meantime, called before every accel
* operation, makes sure the offsets are in sync.
*/
radeon_fifo_wait (1);
local_base = INREG(MC_FB_LOCATION) << 16;
if (local_base == rinfo->fb_local_base)
return;
rinfo->fb_local_base = local_base;
radeon_fifo_wait (3);
OUTREG(DEFAULT_PITCH_OFFSET, (rinfo->pitch << 0x16) |
(rinfo->fb_local_base >> 10));
OUTREG(DST_PITCH_OFFSET, (rinfo->pitch << 0x16) | (rinfo->fb_local_base >> 10));
OUTREG(SRC_PITCH_OFFSET, (rinfo->pitch << 0x16) | (rinfo->fb_local_base >> 10));
}
static void radeonfb_prim_fillrect(struct radeonfb_info *rinfo,
const struct fb_fillrect *region)
{
......@@ -38,6 +73,8 @@ void radeonfb_fillrect(struct fb_info *info, const struct fb_fillrect *region)
return;
}
radeon_fixup_offset(rinfo);
vxres = info->var.xres_virtual;
vyres = info->var.yres_virtual;
......@@ -105,6 +142,8 @@ void radeonfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
return;
}
radeon_fixup_offset(rinfo);
vxres = info->var.xres_virtual;
vyres = info->var.yres_virtual;
......
......@@ -408,7 +408,7 @@ au1100fb_mmap(struct fb_info *_fb,
/* This is an IO map - tell maydump to skip this VMA */
vma->vm_flags |= VM_IO;
if (io_remap_page_range(vma->vm_start, off,
if (io_remap_page_range(vma, vma->vm_start, off,
vma->vm_end - vma->vm_start,
vma->vm_page_prot)) {
return -EAGAIN;
......
......@@ -550,7 +550,8 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
set_buffer_uptodate(bh);
} else {
clear_buffer_uptodate(bh);
buffer_io_error(bh);
if (printk_ratelimit())
buffer_io_error(bh);
SetPageError(page);
}
......
......@@ -405,9 +405,10 @@ static __inline__ unsigned long ffz(unsigned long word)
* @offset: The bitnumber to start searching at
* @size: The maximum size to search
*/
static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
static __inline__ int find_next_zero_bit(const unsigned long *addr,
int size, int offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
const unsigned long *p = addr + (offset >> 5);
unsigned long result = offset & ~31UL;
unsigned long tmp;
......
......@@ -560,12 +560,12 @@ extern void flush_hash_one_pte(pte_t *ptep);
static inline int ptep_test_and_clear_young(pte_t *ptep)
{
unsigned long old;
old = (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED);
old = pte_update(ptep, _PAGE_ACCESSED, 0);
#if _PAGE_HASHPTE != 0
if (old & _PAGE_HASHPTE)
flush_hash_one_pte(ptep);
#endif
return old != 0;
return (old & _PAGE_ACCESSED) != 0;
}
static inline int ptep_test_and_clear_dirty(pte_t *ptep)
......
......@@ -24,6 +24,7 @@ typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
typedef s32 compat_key_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
......@@ -139,4 +140,62 @@ static __inline__ void __user *compat_alloc_user_space(long len)
return (void __user *) (usp - len);
}
struct compat_ipc64_perm {
compat_key_t key;
__kernel_uid_t uid;
__kernel_gid_t gid;
__kernel_uid_t cuid;
__kernel_gid_t cgid;
unsigned short __pad1;
compat_mode_t mode;
unsigned short __pad2;
unsigned short seq;
unsigned long __unused1; /* yes they really are 64bit pads */
unsigned long __unused2;
};
struct compat_semid64_ds {
struct compat_ipc64_perm sem_perm;
unsigned int __pad1;
compat_time_t sem_otime;
unsigned int __pad2;
compat_time_t sem_ctime;
u32 sem_nsems;
u32 __unused1;
u32 __unused2;
};
struct compat_msqid64_ds {
struct compat_ipc64_perm msg_perm;
unsigned int __pad1;
compat_time_t msg_stime;
unsigned int __pad2;
compat_time_t msg_rtime;
unsigned int __pad3;
compat_time_t msg_ctime;
unsigned int msg_cbytes;
unsigned int msg_qnum;
unsigned int msg_qbytes;
compat_pid_t msg_lspid;
compat_pid_t msg_lrpid;
unsigned int __unused1;
unsigned int __unused2;
};
struct compat_shmid64_ds {
struct compat_ipc64_perm shm_perm;
unsigned int __pad1;
compat_time_t shm_atime;
unsigned int __pad2;
compat_time_t shm_dtime;
unsigned int __pad3;
compat_time_t shm_ctime;
compat_size_t shm_segsz;
compat_pid_t shm_cpid;
compat_pid_t shm_lpid;
unsigned int shm_nattch;
unsigned int __unused1;
unsigned int __unused2;
};
#endif /* _ASM_SPARC64_COMPAT_H */
......@@ -49,10 +49,10 @@ do { \
__asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" ((val).seg)); \
} while(0)
#define __user_ok(addr,size) 1
#define __user_ok(addr,size) ((void)(addr), (void)(size), 1)
#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
#define __access_ok(addr,size) 1
#define access_ok(type,addr,size) 1
#define __access_ok(addr,size) ((void)(addr), (void)(size), 1)
#define access_ok(type,addr,size) ((void)(type), (void)(addr), (void)(size), 1)
static inline int verify_area(int type, const void __user * addr, unsigned long size)
{
......
......@@ -18,6 +18,8 @@
#define compat_jiffies_to_clock_t(x) \
(((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
struct rusage;
struct compat_itimerspec {
struct compat_timespec it_interval;
struct compat_timespec it_value;
......
......@@ -7,25 +7,8 @@
*/
#include <linux/config.h>
#include <linux/linkage.h>
#include <linux/limits.h>
#include <linux/wait.h>
#include <linux/types.h>
#include <linux/kdev_t.h>
#include <linux/ioctl.h>
#include <linux/dcache.h>
#include <linux/stat.h>
#include <linux/cache.h>
#include <linux/kobject.h>
#include <asm/atomic.h>
struct iovec;
struct nameidata;
struct pipe_inode_info;
struct poll_table_struct;
struct kstatfs;
struct vm_area_struct;
struct vfsmount;
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
......@@ -216,14 +199,32 @@ extern int dir_notify_enable;
#ifdef __KERNEL__
#include <linux/linkage.h>
#include <linux/wait.h>
#include <linux/types.h>
#include <linux/kdev_t.h>
#include <linux/dcache.h>
#include <linux/stat.h>
#include <linux/cache.h>
#include <linux/kobject.h>
#include <linux/list.h>
#include <linux/radix-tree.h>
#include <linux/prio_tree.h>
#include <linux/audit.h>
#include <linux/init.h>
#include <asm/atomic.h>
#include <asm/semaphore.h>
#include <asm/byteorder.h>
struct iovec;
struct nameidata;
struct pipe_inode_info;
struct poll_table_struct;
struct kstatfs;
struct vm_area_struct;
struct vfsmount;
/* Used to be a macro which just called the function, now just a function */
extern void update_atime (struct inode *);
......
......@@ -344,6 +344,7 @@ enum
NET_TCP_DEFAULT_WIN_SCALE=105,
NET_TCP_MODERATE_RCVBUF=106,
NET_TCP_TSO_WIN_DIVISOR=107,
NET_TCP_BIC_BETA=108,
};
enum {
......
......@@ -210,6 +210,27 @@ enum tcp_congestion_algo {
TCP_BIC,
};
struct tcp_options_received {
/* PAWS/RTTM data */
long ts_recent_stamp;/* Time we stored ts_recent (for aging) */
__u32 ts_recent; /* Time stamp to echo next */
__u32 rcv_tsval; /* Time stamp value */
__u32 rcv_tsecr; /* Time stamp echo reply */
char saw_tstamp; /* Saw TIMESTAMP on last packet */
char tstamp_ok; /* TIMESTAMP seen on SYN packet */
char sack_ok; /* SACK seen on SYN packet */
char wscale_ok; /* Wscale seen on SYN packet */
__u8 snd_wscale; /* Window scaling received from sender */
__u8 rcv_wscale; /* Window scaling to send to receiver */
/* SACKs data */
__u8 dsack; /* D-SACK is scheduled */
__u8 eff_sacks; /* Size of SACK array to send with next packet */
__u8 num_sacks; /* Number of SACK blocks */
__u8 __pad;
__u16 user_mss; /* mss requested by user in ioctl */
__u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
};
struct tcp_sock {
/* inet_sock has to be the first member of tcp_sock */
struct inet_sock inet;
......@@ -262,22 +283,19 @@ struct tcp_sock {
__u32 pmtu_cookie; /* Last pmtu seen by socket */
__u32 mss_cache; /* Cached effective mss, not including SACKS */
__u16 mss_cache_std; /* Like mss_cache, but without TSO */
__u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
__u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */
__u16 ext2_header_len;/* Options depending on route */
__u8 ca_state; /* State of fast-retransmit machine */
__u8 retransmits; /* Number of unrecovered RTO timeouts. */
__u32 frto_highmark; /* snd_nxt when RTO occurred */
__u8 reordering; /* Packet reordering metric. */
__u8 frto_counter; /* Number of new acks after RTO */
__u32 frto_highmark; /* snd_nxt when RTO occurred */
__u8 adv_cong; /* Using Vegas, Westwood, or BIC */
__u8 defer_accept; /* User waits for some data after accept() */
/* one byte hole, try to pack */
/* RTT measurement */
__u8 backoff; /* backoff */
__u32 srtt; /* smoothed round trip time << 3 */
__u32 mdev; /* medium deviation */
__u32 mdev_max; /* maximal mdev for the last rtt period */
......@@ -288,7 +306,15 @@ struct tcp_sock {
__u32 packets_out; /* Packets which are "in flight" */
__u32 left_out; /* Packets which leaved network */
__u32 retrans_out; /* Retransmitted packets out */
__u8 backoff; /* backoff */
/*
* Options received (usually on last packet, some only on SYN packets).
*/
__u8 nonagle; /* Disable Nagle algorithm? */
__u8 keepalive_probes; /* num of allowed keep alive probes */
__u8 probes_out; /* unanswered 0 window probes */
struct tcp_options_received rx_opt;
/*
* Slow start and congestion control (see also Nagle, and Karn & Partridge)
......@@ -314,40 +340,19 @@ struct tcp_sock {
__u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
__u32 pushed_seq; /* Last pushed seq, required to talk to windows */
__u32 copied_seq; /* Head of yet unread data */
/*
* Options received (usually on last packet, some only on SYN packets).
*/
char tstamp_ok, /* TIMESTAMP seen on SYN packet */
wscale_ok, /* Wscale seen on SYN packet */
sack_ok; /* SACK seen on SYN packet */
char saw_tstamp; /* Saw TIMESTAMP on last packet */
__u8 snd_wscale; /* Window scaling received from sender */
__u8 rcv_wscale; /* Window scaling to send to receiver */
__u8 nonagle; /* Disable Nagle algorithm? */
__u8 keepalive_probes; /* num of allowed keep alive probes */
/* PAWS/RTTM data */
__u32 rcv_tsval; /* Time stamp value */
__u32 rcv_tsecr; /* Time stamp echo reply */
__u32 ts_recent; /* Time stamp to echo next */
long ts_recent_stamp;/* Time we stored ts_recent (for aging) */
/* SACKs data */
__u16 user_mss; /* mss requested by user in ioctl */
__u8 dsack; /* D-SACK is scheduled */
__u8 eff_sacks; /* Size of SACK array to send with next packet */
struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
__u32 window_clamp; /* Maximal window to advertise */
__u32 rcv_ssthresh; /* Current window clamp */
__u8 probes_out; /* unanswered 0 window probes */
__u8 num_sacks; /* Number of SACK blocks */
__u16 advmss; /* Advertised MSS */
__u8 syn_retries; /* num of allowed syn retries */
__u8 ecn_flags; /* ECN status bits. */
__u16 prior_ssthresh; /* ssthresh saved at recovery start */
__u16 __pad1;
__u32 lost_out; /* Lost packets */
__u32 sacked_out; /* SACK'd packets */
__u32 fackets_out; /* FACK'd packets */
......
......@@ -505,9 +505,8 @@ static __inline__ int tcp_sk_listen_hashfn(struct sock *sk)
# define TCP_TW_RECYCLE_TICK (12+2-TCP_TW_RECYCLE_SLOTS_LOG)
#endif
#define BICTCP_1_OVER_BETA 8 /*
* Fast recovery
* multiplicative decrease factor
#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation
* max_cwnd = snd_cwnd * beta
*/
#define BICTCP_MAX_INCREMENT 32 /*
* Limit on the amount of
......@@ -606,6 +605,7 @@ extern int sysctl_tcp_nometrics_save;
extern int sysctl_tcp_bic;
extern int sysctl_tcp_bic_fast_convergence;
extern int sysctl_tcp_bic_low_window;
extern int sysctl_tcp_bic_beta;
extern int sysctl_tcp_moderate_rcvbuf;
extern int sysctl_tcp_tso_win_divisor;
......@@ -832,9 +832,9 @@ static __inline__ void tcp_delack_init(struct tcp_sock *tp)
memset(&tp->ack, 0, sizeof(tp->ack));
}
static inline void tcp_clear_options(struct tcp_sock *tp)
static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
{
tp->tstamp_ok = tp->sack_ok = tp->wscale_ok = tp->snd_wscale = 0;
rx_opt->tstamp_ok = rx_opt->sack_ok = rx_opt->wscale_ok = rx_opt->snd_wscale = 0;
}
enum tcp_tw_status
......@@ -883,7 +883,7 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk,
extern int tcp_listen_start(struct sock *sk);
extern void tcp_parse_options(struct sk_buff *skb,
struct tcp_sock *tp,
struct tcp_options_received *opt_rx,
int estab);
/*
......@@ -1071,7 +1071,7 @@ static __inline__ void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
static __inline__ void tcp_fast_path_on(struct tcp_sock *tp)
{
__tcp_fast_path_on(tp, tp->snd_wnd>>tp->snd_wscale);
__tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale);
}
static inline void tcp_fast_path_check(struct sock *sk, struct tcp_sock *tp)
......@@ -1244,15 +1244,16 @@ static inline __u32 tcp_recalc_ssthresh(struct tcp_sock *tp)
if (tcp_is_bic(tp)) {
if (sysctl_tcp_bic_fast_convergence &&
tp->snd_cwnd < tp->bictcp.last_max_cwnd)
tp->bictcp.last_max_cwnd
= (tp->snd_cwnd * (2*BICTCP_1_OVER_BETA-1))
/ (BICTCP_1_OVER_BETA/2);
tp->bictcp.last_max_cwnd = (tp->snd_cwnd *
(BICTCP_BETA_SCALE
+ sysctl_tcp_bic_beta))
/ (2 * BICTCP_BETA_SCALE);
else
tp->bictcp.last_max_cwnd = tp->snd_cwnd;
if (tp->snd_cwnd > sysctl_tcp_bic_low_window)
return max(tp->snd_cwnd - (tp->snd_cwnd/BICTCP_1_OVER_BETA),
2U);
return max((tp->snd_cwnd * sysctl_tcp_bic_beta)
/ BICTCP_BETA_SCALE, 2U);
}
return max(tp->snd_cwnd >> 1U, 2U);
......@@ -1322,7 +1323,7 @@ static inline __u32 tcp_current_ssthresh(struct tcp_sock *tp)
static inline void tcp_sync_left_out(struct tcp_sock *tp)
{
if (tp->sack_ok &&
if (tp->rx_opt.sack_ok &&
(tp->sacked_out >= tp->packets_out - tp->lost_out))
tp->sacked_out = tp->packets_out - tp->lost_out;
tp->left_out = tp->sacked_out + tp->lost_out;
......@@ -1648,39 +1649,39 @@ static __inline__ void tcp_done(struct sock *sk)
tcp_destroy_sock(sk);
}
static __inline__ void tcp_sack_reset(struct tcp_sock *tp)
static __inline__ void tcp_sack_reset(struct tcp_options_received *rx_opt)
{
tp->dsack = 0;
tp->eff_sacks = 0;
tp->num_sacks = 0;
rx_opt->dsack = 0;
rx_opt->eff_sacks = 0;
rx_opt->num_sacks = 0;
}
static __inline__ void tcp_build_and_update_options(__u32 *ptr, struct tcp_sock *tp, __u32 tstamp)
{
if (tp->tstamp_ok) {
if (tp->rx_opt.tstamp_ok) {
*ptr++ = __constant_htonl((TCPOPT_NOP << 24) |
(TCPOPT_NOP << 16) |
(TCPOPT_TIMESTAMP << 8) |
TCPOLEN_TIMESTAMP);
*ptr++ = htonl(tstamp);
*ptr++ = htonl(tp->ts_recent);
*ptr++ = htonl(tp->rx_opt.ts_recent);
}
if (tp->eff_sacks) {
struct tcp_sack_block *sp = tp->dsack ? tp->duplicate_sack : tp->selective_acks;
if (tp->rx_opt.eff_sacks) {
struct tcp_sack_block *sp = tp->rx_opt.dsack ? tp->duplicate_sack : tp->selective_acks;
int this_sack;
*ptr++ = __constant_htonl((TCPOPT_NOP << 24) |
(TCPOPT_NOP << 16) |
(TCPOPT_SACK << 8) |
(TCPOLEN_SACK_BASE +
(tp->eff_sacks * TCPOLEN_SACK_PERBLOCK)));
for(this_sack = 0; this_sack < tp->eff_sacks; this_sack++) {
(tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK)));
for(this_sack = 0; this_sack < tp->rx_opt.eff_sacks; this_sack++) {
*ptr++ = htonl(sp[this_sack].start_seq);
*ptr++ = htonl(sp[this_sack].end_seq);
}
if (tp->dsack) {
tp->dsack = 0;
tp->eff_sacks--;
if (tp->rx_opt.dsack) {
tp->rx_opt.dsack = 0;
tp->rx_opt.eff_sacks--;
}
}
}
......@@ -1826,17 +1827,17 @@ static inline void tcp_synq_drop(struct sock *sk, struct open_request *req,
}
static __inline__ void tcp_openreq_init(struct open_request *req,
struct tcp_sock *tp,
struct tcp_options_received *rx_opt,
struct sk_buff *skb)
{
req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */
req->rcv_isn = TCP_SKB_CB(skb)->seq;
req->mss = tp->mss_clamp;
req->ts_recent = tp->saw_tstamp ? tp->rcv_tsval : 0;
req->tstamp_ok = tp->tstamp_ok;
req->sack_ok = tp->sack_ok;
req->snd_wscale = tp->snd_wscale;
req->wscale_ok = tp->wscale_ok;
req->mss = rx_opt->mss_clamp;
req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0;
req->tstamp_ok = rx_opt->tstamp_ok;
req->sack_ok = rx_opt->sack_ok;
req->snd_wscale = rx_opt->snd_wscale;
req->wscale_ok = rx_opt->wscale_ok;
req->acked = 0;
req->ecn_ok = 0;
req->rmt_port = skb->h.th->source;
......@@ -1885,11 +1886,11 @@ static inline int tcp_fin_time(const struct tcp_sock *tp)
return fin_timeout;
}
static inline int tcp_paws_check(const struct tcp_sock *tp, int rst)
static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, int rst)
{
if ((s32)(tp->rcv_tsval - tp->ts_recent) >= 0)
if ((s32)(rx_opt->rcv_tsval - rx_opt->ts_recent) >= 0)
return 0;
if (xtime.tv_sec >= tp->ts_recent_stamp + TCP_PAWS_24DAYS)
if (xtime.tv_sec >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)
return 0;
/* RST segments are not recommended to carry timestamp,
......@@ -1904,7 +1905,7 @@ static inline int tcp_paws_check(const struct tcp_sock *tp, int rst)
However, we can relax time bounds for RST segments to MSL.
*/
if (rst && xtime.tv_sec >= tp->ts_recent_stamp + TCP_PAWS_MSL)
if (rst && xtime.tv_sec >= rx_opt->ts_recent_stamp + TCP_PAWS_MSL)
return 0;
return 1;
}
......
......@@ -682,6 +682,14 @@ ctl_table ipv4_table[] = {
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_TCP_BIC_BETA,
.procname = "tcp_bic_beta",
.data = &sysctl_tcp_bic_beta,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{ .ctl_name = 0 }
};
......
......@@ -1829,8 +1829,8 @@ int tcp_disconnect(struct sock *sk, int flags)
tcp_clear_retrans(tp);
tcp_delack_init(tp);
sk->sk_send_head = NULL;
tp->saw_tstamp = 0;
tcp_sack_reset(tp);
tp->rx_opt.saw_tstamp = 0;
tcp_sack_reset(&tp->rx_opt);
__sk_dst_reset(sk);
BUG_TRAP(!inet->num || tp->bind_hash);
......@@ -1969,7 +1969,7 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
err = -EINVAL;
break;
}
tp->user_mss = val;
tp->rx_opt.user_mss = val;
break;
case TCP_NODELAY:
......@@ -2119,14 +2119,14 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
info->tcpi_probes = tp->probes_out;
info->tcpi_backoff = tp->backoff;
if (tp->tstamp_ok)
if (tp->rx_opt.tstamp_ok)
info->tcpi_options |= TCPI_OPT_TIMESTAMPS;
if (tp->sack_ok)
if (tp->rx_opt.sack_ok)
info->tcpi_options |= TCPI_OPT_SACK;
if (tp->wscale_ok) {
if (tp->rx_opt.wscale_ok) {
info->tcpi_options |= TCPI_OPT_WSCALE;
info->tcpi_snd_wscale = tp->snd_wscale;
info->tcpi_rcv_wscale = tp->rcv_wscale;
info->tcpi_snd_wscale = tp->rx_opt.snd_wscale;
info->tcpi_rcv_wscale = tp->rx_opt.rcv_wscale;
}
if (tp->ecn_flags&TCP_ECN_OK)
......@@ -2186,7 +2186,7 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval,
case TCP_MAXSEG:
val = tp->mss_cache_std;
if (!val && ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)))
val = tp->user_mss;
val = tp->rx_opt.user_mss;
break;
case TCP_NODELAY:
val = !!(tp->nonagle&TCP_NAGLE_OFF);
......
This diff is collapsed.
......@@ -591,8 +591,8 @@ static int __tcp_v4_check_established(struct sock *sk, __u16 lport,
if ((tp->write_seq =
tw->tw_snd_nxt + 65535 + 2) == 0)
tp->write_seq = 1;
tp->ts_recent = tw->tw_ts_recent;
tp->ts_recent_stamp = tw->tw_ts_recent_stamp;
tp->rx_opt.ts_recent = tw->tw_ts_recent;
tp->rx_opt.ts_recent_stamp = tw->tw_ts_recent_stamp;
sock_hold(sk2);
goto unique;
} else
......@@ -783,25 +783,25 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
inet->saddr = rt->rt_src;
inet->rcv_saddr = inet->saddr;
if (tp->ts_recent_stamp && inet->daddr != daddr) {
if (tp->rx_opt.ts_recent_stamp && inet->daddr != daddr) {
/* Reset inherited state */
tp->ts_recent = 0;
tp->ts_recent_stamp = 0;
tp->write_seq = 0;
tp->rx_opt.ts_recent = 0;
tp->rx_opt.ts_recent_stamp = 0;
tp->write_seq = 0;
}
if (sysctl_tcp_tw_recycle &&
!tp->ts_recent_stamp && rt->rt_dst == daddr) {
!tp->rx_opt.ts_recent_stamp && rt->rt_dst == daddr) {
struct inet_peer *peer = rt_get_peer(rt);
/* VJ's idea. We save last timestamp seen from
* the destination in peer table, when entering state TIME-WAIT
* and initialize ts_recent from it, when trying new connection.
* and initialize rx_opt.ts_recent from it, when trying new connection.
*/
if (peer && peer->tcp_ts_stamp + TCP_PAWS_MSL >= xtime.tv_sec) {
tp->ts_recent_stamp = peer->tcp_ts_stamp;
tp->ts_recent = peer->tcp_ts;
tp->rx_opt.ts_recent_stamp = peer->tcp_ts_stamp;
tp->rx_opt.ts_recent = peer->tcp_ts;
}
}
......@@ -812,7 +812,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
if (inet->opt)
tp->ext_header_len = inet->opt->optlen;
tp->mss_clamp = 536;
tp->rx_opt.mss_clamp = 536;
/* Socket identity is still unknown (sport may be zero).
* However we set state to SYN-SENT and not releasing socket
......@@ -1393,7 +1393,7 @@ struct or_calltable or_ipv4 = {
int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock tp;
struct tcp_options_received tmp_opt;
struct open_request *req;
__u32 saddr = skb->nh.iph->saddr;
__u32 daddr = skb->nh.iph->daddr;
......@@ -1435,29 +1435,29 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
if (!req)
goto drop;
tcp_clear_options(&tp);
tp.mss_clamp = 536;
tp.user_mss = tcp_sk(sk)->user_mss;
tcp_clear_options(&tmp_opt);
tmp_opt.mss_clamp = 536;
tmp_opt.user_mss = tcp_sk(sk)->rx_opt.user_mss;
tcp_parse_options(skb, &tp, 0);
tcp_parse_options(skb, &tmp_opt, 0);
if (want_cookie) {
tcp_clear_options(&tp);
tp.saw_tstamp = 0;
tcp_clear_options(&tmp_opt);
tmp_opt.saw_tstamp = 0;
}
if (tp.saw_tstamp && !tp.rcv_tsval) {
if (tmp_opt.saw_tstamp && !tmp_opt.rcv_tsval) {
/* Some OSes (unknown ones, but I see them on web server, which
* contains information interesting only for windows'
* users) do not send their stamp in SYN. It is easy case.
* We simply do not advertise TS support.
*/
tp.saw_tstamp = 0;
tp.tstamp_ok = 0;
tmp_opt.saw_tstamp = 0;
tmp_opt.tstamp_ok = 0;
}
tp.tstamp_ok = tp.saw_tstamp;
tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
tcp_openreq_init(req, &tp, skb);
tcp_openreq_init(req, &tmp_opt, skb);
req->af.v4_req.loc_addr = daddr;
req->af.v4_req.rmt_addr = saddr;
......@@ -1483,7 +1483,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
* timewait bucket, so that all the necessary checks
* are made in the function processing timewait state.
*/
if (tp.saw_tstamp &&
if (tmp_opt.saw_tstamp &&
sysctl_tcp_tw_recycle &&
(dst = tcp_v4_route_req(sk, req)) != NULL &&
(peer = rt_get_peer((struct rtable *)dst)) != NULL &&
......@@ -1987,11 +1987,11 @@ int tcp_v4_remember_stamp(struct sock *sk)
}
if (peer) {
if ((s32)(peer->tcp_ts - tp->ts_recent) <= 0 ||
if ((s32)(peer->tcp_ts - tp->rx_opt.ts_recent) <= 0 ||
(peer->tcp_ts_stamp + TCP_PAWS_MSL < xtime.tv_sec &&
peer->tcp_ts_stamp <= tp->ts_recent_stamp)) {
peer->tcp_ts_stamp = tp->ts_recent_stamp;
peer->tcp_ts = tp->ts_recent;
peer->tcp_ts_stamp <= tp->rx_opt.ts_recent_stamp)) {
peer->tcp_ts_stamp = tp->rx_opt.ts_recent_stamp;
peer->tcp_ts = tp->rx_opt.ts_recent;
}
if (release_it)
inet_putpeer(peer);
......
......@@ -125,17 +125,17 @@ enum tcp_tw_status
tcp_timewait_state_process(struct tcp_tw_bucket *tw, struct sk_buff *skb,
struct tcphdr *th, unsigned len)
{
struct tcp_sock tp;
struct tcp_options_received tmp_opt;
int paws_reject = 0;
tp.saw_tstamp = 0;
tmp_opt.saw_tstamp = 0;
if (th->doff > (sizeof(struct tcphdr) >> 2) && tw->tw_ts_recent_stamp) {
tcp_parse_options(skb, &tp, 0);
tcp_parse_options(skb, &tmp_opt, 0);
if (tp.saw_tstamp) {
tp.ts_recent = tw->tw_ts_recent;
tp.ts_recent_stamp = tw->tw_ts_recent_stamp;
paws_reject = tcp_paws_check(&tp, th->rst);
if (tmp_opt.saw_tstamp) {
tmp_opt.ts_recent = tw->tw_ts_recent;
tmp_opt.ts_recent_stamp = tw->tw_ts_recent_stamp;
paws_reject = tcp_paws_check(&tmp_opt, th->rst);
}
}
......@@ -176,9 +176,9 @@ tcp_timewait_state_process(struct tcp_tw_bucket *tw, struct sk_buff *skb,
/* FIN arrived, enter true time-wait state. */
tw->tw_substate = TCP_TIME_WAIT;
tw->tw_rcv_nxt = TCP_SKB_CB(skb)->end_seq;
if (tp.saw_tstamp) {
if (tmp_opt.saw_tstamp) {
tw->tw_ts_recent_stamp = xtime.tv_sec;
tw->tw_ts_recent = tp.rcv_tsval;
tw->tw_ts_recent = tmp_opt.rcv_tsval;
}
/* I am shamed, but failed to make it more elegant.
......@@ -231,8 +231,8 @@ tcp_timewait_state_process(struct tcp_tw_bucket *tw, struct sk_buff *skb,
}
tcp_tw_schedule(tw, TCP_TIMEWAIT_LEN);
if (tp.saw_tstamp) {
tw->tw_ts_recent = tp.rcv_tsval;
if (tmp_opt.saw_tstamp) {
tw->tw_ts_recent = tmp_opt.rcv_tsval;
tw->tw_ts_recent_stamp = xtime.tv_sec;
}
......@@ -259,7 +259,7 @@ tcp_timewait_state_process(struct tcp_tw_bucket *tw, struct sk_buff *skb,
if (th->syn && !th->rst && !th->ack && !paws_reject &&
(after(TCP_SKB_CB(skb)->seq, tw->tw_rcv_nxt) ||
(tp.saw_tstamp && (s32)(tw->tw_ts_recent - tp.rcv_tsval) < 0))) {
(tmp_opt.saw_tstamp && (s32)(tw->tw_ts_recent - tmp_opt.rcv_tsval) < 0))) {
u32 isn = tw->tw_snd_nxt + 65535 + 2;
if (isn == 0)
isn++;
......@@ -332,7 +332,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
struct tcp_sock *tp = tcp_sk(sk);
int recycle_ok = 0;
if (sysctl_tcp_tw_recycle && tp->ts_recent_stamp)
if (sysctl_tcp_tw_recycle && tp->rx_opt.ts_recent_stamp)
recycle_ok = tp->af_specific->remember_stamp(sk);
if (tcp_tw_count < sysctl_tcp_max_tw_buckets)
......@@ -353,15 +353,15 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
tw->tw_dport = inet->dport;
tw->tw_family = sk->sk_family;
tw->tw_reuse = sk->sk_reuse;
tw->tw_rcv_wscale = tp->rcv_wscale;
tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale;
atomic_set(&tw->tw_refcnt, 1);
tw->tw_hashent = sk->sk_hashent;
tw->tw_rcv_nxt = tp->rcv_nxt;
tw->tw_snd_nxt = tp->snd_nxt;
tw->tw_rcv_wnd = tcp_receive_window(tp);
tw->tw_ts_recent = tp->ts_recent;
tw->tw_ts_recent_stamp = tp->ts_recent_stamp;
tw->tw_ts_recent = tp->rx_opt.ts_recent;
tw->tw_ts_recent_stamp = tp->rx_opt.ts_recent_stamp;
tw_dead_node_init(tw);
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
......@@ -780,13 +780,13 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
newtp->pushed_seq = newtp->write_seq;
newtp->copied_seq = req->rcv_isn + 1;
newtp->saw_tstamp = 0;
newtp->rx_opt.saw_tstamp = 0;
newtp->dsack = 0;
newtp->eff_sacks = 0;
newtp->rx_opt.dsack = 0;
newtp->rx_opt.eff_sacks = 0;
newtp->probes_out = 0;
newtp->num_sacks = 0;
newtp->rx_opt.num_sacks = 0;
newtp->urg_data = 0;
newtp->listen_opt = NULL;
newtp->accept_queue = newtp->accept_queue_tail = NULL;
......@@ -809,36 +809,36 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
newsk->sk_sleep = NULL;
newsk->sk_owner = NULL;
newtp->tstamp_ok = req->tstamp_ok;
if((newtp->sack_ok = req->sack_ok) != 0) {
newtp->rx_opt.tstamp_ok = req->tstamp_ok;
if((newtp->rx_opt.sack_ok = req->sack_ok) != 0) {
if (sysctl_tcp_fack)
newtp->sack_ok |= 2;
newtp->rx_opt.sack_ok |= 2;
}
newtp->window_clamp = req->window_clamp;
newtp->rcv_ssthresh = req->rcv_wnd;
newtp->rcv_wnd = req->rcv_wnd;
newtp->wscale_ok = req->wscale_ok;
if (newtp->wscale_ok) {
newtp->snd_wscale = req->snd_wscale;
newtp->rcv_wscale = req->rcv_wscale;
newtp->rx_opt.wscale_ok = req->wscale_ok;
if (newtp->rx_opt.wscale_ok) {
newtp->rx_opt.snd_wscale = req->snd_wscale;
newtp->rx_opt.rcv_wscale = req->rcv_wscale;
} else {
newtp->snd_wscale = newtp->rcv_wscale = 0;
newtp->rx_opt.snd_wscale = newtp->rx_opt.rcv_wscale = 0;
newtp->window_clamp = min(newtp->window_clamp, 65535U);
}
newtp->snd_wnd = ntohs(skb->h.th->window) << newtp->snd_wscale;
newtp->snd_wnd = ntohs(skb->h.th->window) << newtp->rx_opt.snd_wscale;
newtp->max_window = newtp->snd_wnd;
if (newtp->tstamp_ok) {
newtp->ts_recent = req->ts_recent;
newtp->ts_recent_stamp = xtime.tv_sec;
if (newtp->rx_opt.tstamp_ok) {
newtp->rx_opt.ts_recent = req->ts_recent;
newtp->rx_opt.ts_recent_stamp = xtime.tv_sec;
newtp->tcp_header_len = sizeof(struct tcphdr) + TCPOLEN_TSTAMP_ALIGNED;
} else {
newtp->ts_recent_stamp = 0;
newtp->rx_opt.ts_recent_stamp = 0;
newtp->tcp_header_len = sizeof(struct tcphdr);
}
if (skb->len >= TCP_MIN_RCVMSS+newtp->tcp_header_len)
newtp->ack.last_seg_size = skb->len-newtp->tcp_header_len;
newtp->mss_clamp = req->mss;
newtp->rx_opt.mss_clamp = req->mss;
TCP_ECN_openreq_child(newtp, req);
if (newtp->ecn_flags&TCP_ECN_OK)
newsk->sk_no_largesend = 1;
......@@ -863,21 +863,21 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
struct tcp_sock *tp = tcp_sk(sk);
u32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK);
int paws_reject = 0;
struct tcp_sock ttp;
struct tcp_options_received tmp_opt;
struct sock *child;
ttp.saw_tstamp = 0;
tmp_opt.saw_tstamp = 0;
if (th->doff > (sizeof(struct tcphdr)>>2)) {
tcp_parse_options(skb, &ttp, 0);
tcp_parse_options(skb, &tmp_opt, 0);
if (ttp.saw_tstamp) {
ttp.ts_recent = req->ts_recent;
if (tmp_opt.saw_tstamp) {
tmp_opt.ts_recent = req->ts_recent;
/* We do not store true stamp, but it is not required,
* it can be estimated (approximately)
* from another data.
*/
ttp.ts_recent_stamp = xtime.tv_sec - ((TCP_TIMEOUT_INIT/HZ)<<req->retrans);
paws_reject = tcp_paws_check(&ttp, th->rst);
tmp_opt.ts_recent_stamp = xtime.tv_sec - ((TCP_TIMEOUT_INIT/HZ)<<req->retrans);
paws_reject = tcp_paws_check(&tmp_opt, th->rst);
}
}
......@@ -982,63 +982,63 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
/* In sequence, PAWS is OK. */
if (ttp.saw_tstamp && !after(TCP_SKB_CB(skb)->seq, req->rcv_isn+1))
req->ts_recent = ttp.rcv_tsval;
if (tmp_opt.saw_tstamp && !after(TCP_SKB_CB(skb)->seq, req->rcv_isn+1))
req->ts_recent = tmp_opt.rcv_tsval;
if (TCP_SKB_CB(skb)->seq == req->rcv_isn) {
/* Truncate SYN, it is out of window starting
at req->rcv_isn+1. */
flg &= ~TCP_FLAG_SYN;
}
if (TCP_SKB_CB(skb)->seq == req->rcv_isn) {
/* Truncate SYN, it is out of window starting
at req->rcv_isn+1. */
flg &= ~TCP_FLAG_SYN;
}
/* RFC793: "second check the RST bit" and
* "fourth, check the SYN bit"
*/
if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN))
goto embryonic_reset;
/* RFC793: "second check the RST bit" and
* "fourth, check the SYN bit"
*/
if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN))
goto embryonic_reset;
/* ACK sequence verified above, just make sure ACK is
* set. If ACK not set, just silently drop the packet.
*/
if (!(flg & TCP_FLAG_ACK))
return NULL;
/* ACK sequence verified above, just make sure ACK is
* set. If ACK not set, just silently drop the packet.
*/
if (!(flg & TCP_FLAG_ACK))
return NULL;
/* If TCP_DEFER_ACCEPT is set, drop bare ACK. */
if (tp->defer_accept && TCP_SKB_CB(skb)->end_seq == req->rcv_isn+1) {
req->acked = 1;
return NULL;
}
/* If TCP_DEFER_ACCEPT is set, drop bare ACK. */
if (tp->defer_accept && TCP_SKB_CB(skb)->end_seq == req->rcv_isn+1) {
req->acked = 1;
return NULL;
}
/* OK, ACK is valid, create big socket and
* feed this segment to it. It will repeat all
* the tests. THIS SEGMENT MUST MOVE SOCKET TO
* ESTABLISHED STATE. If it will be dropped after
* socket is created, wait for troubles.
*/
child = tp->af_specific->syn_recv_sock(sk, skb, req, NULL);
if (child == NULL)
goto listen_overflow;
/* OK, ACK is valid, create big socket and
* feed this segment to it. It will repeat all
* the tests. THIS SEGMENT MUST MOVE SOCKET TO
* ESTABLISHED STATE. If it will be dropped after
* socket is created, wait for troubles.
*/
child = tp->af_specific->syn_recv_sock(sk, skb, req, NULL);
if (child == NULL)
goto listen_overflow;
sk_set_owner(child, sk->sk_owner);
tcp_synq_unlink(tp, req, prev);
tcp_synq_removed(sk, req);
sk_set_owner(child, sk->sk_owner);
tcp_synq_unlink(tp, req, prev);
tcp_synq_removed(sk, req);
tcp_acceptq_queue(sk, req, child);
return child;
tcp_acceptq_queue(sk, req, child);
return child;
listen_overflow:
if (!sysctl_tcp_abort_on_overflow) {
req->acked = 1;
return NULL;
}
listen_overflow:
if (!sysctl_tcp_abort_on_overflow) {
req->acked = 1;
return NULL;
}
embryonic_reset:
NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS);
if (!(flg & TCP_FLAG_RST))
req->class->send_reset(skb);
embryonic_reset:
NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS);
if (!(flg & TCP_FLAG_RST))
req->class->send_reset(skb);
tcp_synq_drop(sk, req, prev);
return NULL;
tcp_synq_drop(sk, req, prev);
return NULL;
}
/*
......
......@@ -236,13 +236,13 @@ static __inline__ u16 tcp_select_window(struct sock *sk)
/* Make sure we do not exceed the maximum possible
* scaled window.
*/
if (!tp->rcv_wscale)
if (!tp->rx_opt.rcv_wscale)
new_win = min(new_win, MAX_TCP_WINDOW);
else
new_win = min(new_win, (65535U << tp->rcv_wscale));
new_win = min(new_win, (65535U << tp->rx_opt.rcv_wscale));
/* RFC1323 scaling applied */
new_win >>= tp->rcv_wscale;
new_win >>= tp->rx_opt.rcv_wscale;
/* If we advertise zero window, disable fast path. */
if (new_win == 0)
......@@ -296,12 +296,12 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
if(!(sysctl_flags & SYSCTL_FLAG_TSTAMPS))
tcp_header_size += TCPOLEN_SACKPERM_ALIGNED;
}
} else if (tp->eff_sacks) {
} else if (tp->rx_opt.eff_sacks) {
/* A SACK is 2 pad bytes, a 2 byte header, plus
* 2 32-bit sequence numbers for each SACK block.
*/
tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED +
(tp->eff_sacks * TCPOLEN_SACK_PERBLOCK));
(tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK));
}
/*
......@@ -349,9 +349,9 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
(sysctl_flags & SYSCTL_FLAG_TSTAMPS),
(sysctl_flags & SYSCTL_FLAG_SACK),
(sysctl_flags & SYSCTL_FLAG_WSCALE),
tp->rcv_wscale,
tp->rx_opt.rcv_wscale,
tcb->when,
tp->ts_recent);
tp->rx_opt.ts_recent);
} else {
tcp_build_and_update_options((__u32 *)(th + 1),
tp, tcb->when);
......@@ -607,10 +607,10 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
/* This function synchronize snd mss to current pmtu/exthdr set.
tp->user_mss is mss set by user by TCP_MAXSEG. It does NOT counts
tp->rx_opt.user_mss is mss set by user by TCP_MAXSEG. It does NOT counts
for TCP options, but includes only bare TCP header.
tp->mss_clamp is mss negotiated at connection setup.
tp->rx_opt.mss_clamp is mss negotiated at connection setup.
It is minumum of user_mss and mss received with SYN.
It also does not include TCP options.
......@@ -619,7 +619,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
tp->mss_cache is current effective sending mss, including
all tcp options except for SACKs. It is evaluated,
taking into account current pmtu, but never exceeds
tp->mss_clamp.
tp->rx_opt.mss_clamp.
NOTE1. rfc1122 clearly states that advertised MSS
DOES NOT include either tcp or ip options.
......@@ -643,8 +643,8 @@ unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu)
mss_now = pmtu - tp->af_specific->net_header_len - sizeof(struct tcphdr);
/* Clamp it (mss_clamp does not include tcp options) */
if (mss_now > tp->mss_clamp)
mss_now = tp->mss_clamp;
if (mss_now > tp->rx_opt.mss_clamp)
mss_now = tp->rx_opt.mss_clamp;
/* Now subtract optional transport overhead */
mss_now -= tp->ext_header_len + tp->ext2_header_len;
......@@ -723,9 +723,9 @@ unsigned int tcp_current_mss(struct sock *sk, int large)
mss_now = tp->mss_cache;
}
if (tp->eff_sacks)
if (tp->rx_opt.eff_sacks)
mss_now -= (TCPOLEN_SACK_BASE_ALIGNED +
(tp->eff_sacks * TCPOLEN_SACK_PERBLOCK));
(tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK));
return mss_now;
}
......@@ -875,16 +875,16 @@ u32 __tcp_select_window(struct sock *sk)
* scaled window will not line up with the MSS boundary anyway.
*/
window = tp->rcv_wnd;
if (tp->rcv_wscale) {
if (tp->rx_opt.rcv_wscale) {
window = free_space;
/* Advertise enough space so that it won't get scaled away.
* Import case: prevent zero window announcement if
* 1<<rcv_wscale > mss.
*/
if (((window >> tp->rcv_wscale) << tp->rcv_wscale) != window)
window = (((window >> tp->rcv_wscale) + 1)
<< tp->rcv_wscale);
if (((window >> tp->rx_opt.rcv_wscale) << tp->rx_opt.rcv_wscale) != window)
window = (((window >> tp->rx_opt.rcv_wscale) + 1)
<< tp->rx_opt.rcv_wscale);
} else {
/* Get the largest window that is a nice multiple of mss.
* Window clamp already applied above.
......@@ -962,7 +962,7 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
tp->left_out -= tcp_skb_pcount(next_skb);
}
/* Reno case is special. Sigh... */
if (!tp->sack_ok && tp->sacked_out) {
if (!tp->rx_opt.sack_ok && tp->sacked_out) {
tcp_dec_pcount_approx(&tp->sacked_out, next_skb);
tp->left_out -= tcp_skb_pcount(next_skb);
}
......@@ -1200,7 +1200,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
return;
/* No forward retransmissions in Reno are possible. */
if (!tp->sack_ok)
if (!tp->rx_opt.sack_ok)
return;
/* Yeah, we have to make difficult choice between forward transmission
......@@ -1439,8 +1439,8 @@ static inline void tcp_connect_init(struct sock *sk)
(sysctl_tcp_timestamps ? TCPOLEN_TSTAMP_ALIGNED : 0);
/* If user gave his TCP_MAXSEG, record it to clamp */
if (tp->user_mss)
tp->mss_clamp = tp->user_mss;
if (tp->rx_opt.user_mss)
tp->rx_opt.mss_clamp = tp->rx_opt.user_mss;
tp->max_window = 0;
tcp_sync_mss(sk, dst_pmtu(dst));
......@@ -1451,11 +1451,11 @@ static inline void tcp_connect_init(struct sock *sk)
tcp_ca_init(tp);
tcp_select_initial_window(tcp_full_space(sk),
tp->advmss - (tp->ts_recent_stamp ? tp->tcp_header_len - sizeof(struct tcphdr) : 0),
tp->advmss - (tp->rx_opt.ts_recent_stamp ? tp->tcp_header_len - sizeof(struct tcphdr) : 0),
&tp->rcv_wnd,
&tp->window_clamp,
sysctl_tcp_window_scaling,
&tp->rcv_wscale);
&tp->rx_opt.rcv_wscale);
tp->rcv_ssthresh = tp->rcv_wnd;
......
......@@ -353,7 +353,7 @@ static void tcp_retransmit_timer(struct sock *sk)
if (tp->retransmits == 0) {
if (tp->ca_state == TCP_CA_Disorder || tp->ca_state == TCP_CA_Recovery) {
if (tp->sack_ok) {
if (tp->rx_opt.sack_ok) {
if (tp->ca_state == TCP_CA_Recovery)
NET_INC_STATS_BH(LINUX_MIB_TCPSACKRECOVERYFAIL);
else
......
......@@ -473,8 +473,8 @@ static int tcp_v6_check_established(struct sock *sk)
tp->write_seq = tw->tw_snd_nxt + 65535 + 2;
if (!tp->write_seq)
tp->write_seq = 1;
tp->ts_recent = tw->tw_ts_recent;
tp->ts_recent_stamp = tw->tw_ts_recent_stamp;
tp->rx_opt.ts_recent = tw->tw_ts_recent;
tp->rx_opt.ts_recent_stamp = tw->tw_ts_recent_stamp;
sock_hold(sk2);
goto unique;
} else
......@@ -609,10 +609,10 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
return -EINVAL;
}
if (tp->ts_recent_stamp &&
if (tp->rx_opt.ts_recent_stamp &&
!ipv6_addr_equal(&np->daddr, &usin->sin6_addr)) {
tp->ts_recent = 0;
tp->ts_recent_stamp = 0;
tp->rx_opt.ts_recent = 0;
tp->rx_opt.ts_recent_stamp = 0;
tp->write_seq = 0;
}
......@@ -703,7 +703,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
tp->ext_header_len = np->opt->opt_flen + np->opt->opt_nflen;
tp->ext2_header_len = dst->header_len;
tp->mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr);
tp->rx_opt.mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr);
inet->dport = usin->sin6_port;
......@@ -1202,7 +1202,8 @@ static void tcp_v6_synq_add(struct sock *sk, struct open_request *req)
static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
{
struct ipv6_pinfo *np = inet6_sk(sk);
struct tcp_sock tmptp, *tp = tcp_sk(sk);
struct tcp_options_received tmp_opt;
struct tcp_sock *tp = tcp_sk(sk);
struct open_request *req = NULL;
__u32 isn = TCP_SKB_CB(skb)->when;
......@@ -1228,14 +1229,14 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
if (req == NULL)
goto drop;
tcp_clear_options(&tmptp);
tmptp.mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr);
tmptp.user_mss = tp->user_mss;
tcp_clear_options(&tmp_opt);
tmp_opt.mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr);
tmp_opt.user_mss = tp->rx_opt.user_mss;
tcp_parse_options(skb, &tmptp, 0);
tcp_parse_options(skb, &tmp_opt, 0);
tmptp.tstamp_ok = tmptp.saw_tstamp;
tcp_openreq_init(req, &tmptp, skb);
tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
tcp_openreq_init(req, &tmp_opt, skb);
req->class = &or_ipv6;
ipv6_addr_copy(&req->af.v6_req.rmt_addr, &skb->nh.ipv6h->saddr);
......
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