Commit 0aa73428 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.49pre1

parent 6de12085
......@@ -1194,8 +1194,9 @@ S: Santa Clara, CA 95051
S: USA
N: Russell King
E: rmk@arm.uk.linux.org
E: rmk@arm.linux.org.uk
D: Linux/arm integrator, maintainer & hacker
D: Acornfb, Cyber2000fb author
S: Burgh Heath, Tadworth, Surrey.
S: England
......
......@@ -148,7 +148,7 @@ ARM PORT
P: Russell King
M: linux@arm.linux.org.uk
L: linux-arm@vger.rutgers.edu
W: http://www.arm.linux.org.uk/~rmk/armlinux.html
W: http://www.arm.linux.org.uk/
S: Maintained
ARPD SUPPORT
......@@ -234,6 +234,12 @@ P: John A. Martin
M: jam@acm.org
S: Maintained
CYBERPRO FB DRIVER
P: Russell King
M: linux@arm.linux.org.uk
W: http://www.arm.linux.org.uk/
S: Maintained
CYCLADES 2X SYNC CARD DRIVER
P: Arnaldo Carvalho de Melo
M: acme@conectiva.com.br
......
VERSION = 2
PATCHLEVEL = 3
SUBLEVEL = 48
SUBLEVEL = 49
EXTRAVERSION =
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
......
......@@ -14,7 +14,7 @@
O_TARGET := kernel.o
O_OBJS := entry.o traps.o process.o osf_sys.o irq.o signal.o setup.o \
ptrace.o time.o semaphore.o i8259.o
ptrace.o time.o semaphore.o i8259.o srm_irq.o alpha_irq.o
OX_OBJS := alpha_ksyms.o
......
/*
* Alpha specific irq code.
*/
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/irq.h>
#include <asm/machvec.h>
#include <asm/dma.h>
#include "proto.h"
#include "irq_impl.h"
/* Only uniprocessor needs this IRQ/BH locking depth, on SMP it lives
in the per-cpu structure for cache reasons. */
#ifndef CONFIG_SMP
int __local_irq_count;
int __local_bh_count;
unsigned long __irq_attempt[NR_IRQS];
#endif
/* Hack minimum IPL during interupt processing for broken hardware. */
#ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
int __min_ipl;
#endif
/*
* Performance counter hook. A module can override this to
* do something useful.
*/
static void
dummy_perf(unsigned long vector, struct pt_regs *regs)
{
irq_err_count++;
printk(KERN_CRIT "Performance counter interrupt!\n");
}
void (*perf_irq)(unsigned long, struct pt_regs *) = dummy_perf;
/*
* Dispatch device interrupts.
*/
/* Handle ISA interrupt via the PICs. */
#if defined(CONFIG_ALPHA_GENERIC)
# define IACK_SC alpha_mv.iack_sc
#elif defined(CONFIG_ALPHA_APECS)
# define IACK_SC APECS_IACK_SC
#elif defined(CONFIG_ALPHA_LCA)
# define IACK_SC LCA_IACK_SC
#elif defined(CONFIG_ALPHA_CIA)
# define IACK_SC CIA_IACK_SC
#elif defined(CONFIG_ALPHA_PYXIS)
# define IACK_SC PYXIS_IACK_SC
#elif defined(CONFIG_ALPHA_TSUNAMI)
# define IACK_SC TSUNAMI_IACK_SC
#elif defined(CONFIG_ALPHA_POLARIS)
# define IACK_SC POLARIS_IACK_SC
#elif defined(CONFIG_ALPHA_IRONGATE)
# define IACK_SC IRONGATE_IACK_SC
#endif
#if defined(IACK_SC)
void
isa_device_interrupt(unsigned long vector, struct pt_regs *regs)
{
/*
* Generate a PCI interrupt acknowledge cycle. The PIC will
* respond with the interrupt vector of the highest priority
* interrupt that is pending. The PALcode sets up the
* interrupts vectors such that irq level L generates vector L.
*/
int j = *(vuip) IACK_SC;
j &= 0xff;
if (j == 7) {
if (!(inb(0x20) & 0x80)) {
/* It's only a passive release... */
return;
}
}
handle_irq(j, regs);
}
#endif
#if defined(CONFIG_ALPHA_GENERIC) || !defined(IACK_SC)
void
isa_no_iack_sc_device_interrupt(unsigned long vector, struct pt_regs *regs)
{
unsigned long pic;
/*
* It seems to me that the probability of two or more *device*
* interrupts occurring at almost exactly the same time is
* pretty low. So why pay the price of checking for
* additional interrupts here if the common case can be
* handled so much easier?
*/
/*
* The first read of gives you *all* interrupting lines.
* Therefore, read the mask register and and out those lines
* not enabled. Note that some documentation has 21 and a1
* write only. This is not true.
*/
pic = inb(0x20) | (inb(0xA0) << 8); /* read isr */
pic &= 0xFFFB; /* mask out cascade & hibits */
while (pic) {
int j = ffz(~pic);
pic &= pic - 1;
handle_irq(j, regs);
}
}
#endif
/*
* The main interrupt entry point.
*/
asmlinkage void
do_entInt(unsigned long type, unsigned long vector, unsigned long la_ptr,
unsigned long a3, unsigned long a4, unsigned long a5,
struct pt_regs regs)
{
switch (type) {
case 0:
#ifdef CONFIG_SMP
handle_ipi(&regs);
return;
#else
irq_err_count++;
printk(KERN_CRIT "Interprocessor interrupt? "
"You must be kidding!\n");
#endif
break;
case 1:
#ifdef CONFIG_SMP
cpu_data[smp_processor_id()].smp_local_irq_count++;
smp_percpu_timer_interrupt(&regs);
if (smp_processor_id() == boot_cpuid)
#endif
handle_irq(RTC_IRQ, &regs);
return;
case 2:
irq_err_count++;
alpha_mv.machine_check(vector, la_ptr, &regs);
return;
case 3:
alpha_mv.device_interrupt(vector, &regs);
return;
case 4:
perf_irq(vector, &regs);
return;
default:
printk(KERN_CRIT "Hardware intr %ld %lx? Huh?\n",
type, vector);
}
printk("PC = %016lx PS=%04lx\n", regs.pc, regs.ps);
}
void __init
common_init_isa_dma(void)
{
outb(0, DMA1_RESET_REG);
outb(0, DMA2_RESET_REG);
outb(0, DMA1_CLR_MASK_REG);
outb(0, DMA2_CLR_MASK_REG);
}
void __init
init_IRQ(void)
{
alpha_mv.init_irq();
wrent(entInt, 0);
}
/*
* machine error checks
*/
#define MCHK_K_TPERR 0x0080
#define MCHK_K_TCPERR 0x0082
#define MCHK_K_HERR 0x0084
#define MCHK_K_ECC_C 0x0086
#define MCHK_K_ECC_NC 0x0088
#define MCHK_K_OS_BUGCHECK 0x008A
#define MCHK_K_PAL_BUGCHECK 0x0090
#ifndef CONFIG_SMP
struct mcheck_info __mcheck_info;
#endif
void
process_mcheck_info(unsigned long vector, unsigned long la_ptr,
struct pt_regs *regs, const char *machine,
int expected)
{
struct el_common *mchk_header;
const char *reason;
/*
* See if the machine check is due to a badaddr() and if so,
* ignore it.
*/
#if DEBUG_MCHECK > 0
printk(KERN_CRIT "%s machine check %s\n", machine,
expected ? "expected." : "NOT expected!!!");
#endif
if (expected) {
int cpu = smp_processor_id();
mcheck_expected(cpu) = 0;
mcheck_taken(cpu) = 1;
return;
}
mchk_header = (struct el_common *)la_ptr;
printk(KERN_CRIT "%s machine check: vector=0x%lx pc=0x%lx code=0x%lx\n",
machine, vector, regs->pc, mchk_header->code);
switch ((unsigned int) mchk_header->code) {
/* Machine check reasons. Defined according to PALcode sources. */
case 0x80: reason = "tag parity error"; break;
case 0x82: reason = "tag control parity error"; break;
case 0x84: reason = "generic hard error"; break;
case 0x86: reason = "correctable ECC error"; break;
case 0x88: reason = "uncorrectable ECC error"; break;
case 0x8A: reason = "OS-specific PAL bugcheck"; break;
case 0x90: reason = "callsys in kernel mode"; break;
case 0x96: reason = "i-cache read retryable error"; break;
case 0x98: reason = "processor detected hard error"; break;
/* System specific (these are for Alcor, at least): */
case 0x202: reason = "system detected hard error"; break;
case 0x203: reason = "system detected uncorrectable ECC error"; break;
case 0x204: reason = "SIO SERR occurred on PCI bus"; break;
case 0x205: reason = "parity error detected by CIA"; break;
case 0x206: reason = "SIO IOCHK occurred on ISA bus"; break;
case 0x207: reason = "non-existent memory error"; break;
case 0x208: reason = "MCHK_K_DCSR"; break;
case 0x209: reason = "PCI SERR detected"; break;
case 0x20b: reason = "PCI data parity error detected"; break;
case 0x20d: reason = "PCI address parity error detected"; break;
case 0x20f: reason = "PCI master abort error"; break;
case 0x211: reason = "PCI target abort error"; break;
case 0x213: reason = "scatter/gather PTE invalid error"; break;
case 0x215: reason = "flash ROM write error"; break;
case 0x217: reason = "IOA timeout detected"; break;
case 0x219: reason = "IOCHK#, EISA add-in board parity or other catastrophic error"; break;
case 0x21b: reason = "EISA fail-safe timer timeout"; break;
case 0x21d: reason = "EISA bus time-out"; break;
case 0x21f: reason = "EISA software generated NMI"; break;
case 0x221: reason = "unexpected ev5 IRQ[3] interrupt"; break;
default: reason = "unknown"; break;
}
printk(KERN_CRIT "machine check type: %s%s\n",
reason, mchk_header->retry ? " (retryable)" : "");
dik_show_regs(regs, NULL);
#if DEBUG_MCHECK > 1
{
/* Dump the logout area to give all info. */
unsigned long *ptr = (unsigned long *)la_ptr;
long i;
for (i = 0; i < mchk_header->size / sizeof(long); i += 2) {
printk(KERN_CRIT " +%8lx %016lx %016lx\n",
i*sizeof(long), ptr[i], ptr[i+1]);
}
}
#endif
}
/* RTC */
static void enable_rtc(unsigned int irq) { }
static unsigned int startup_rtc(unsigned int irq) { return 0; }
#define shutdown_rtc enable_rtc
#define end_rtc enable_rtc
#define ack_rtc enable_rtc
#define disable_rtc enable_rtc
struct irqaction timer_irqaction = { timer_interrupt,
SA_INTERRUPT, 0, "timer",
NULL, NULL};
void __init
init_rtc_irq(void)
{
static struct hw_interrupt_type rtc_irq_type = { "RTC",
startup_rtc,
shutdown_rtc,
enable_rtc,
disable_rtc,
ack_rtc,
end_rtc };
irq_desc[RTC_IRQ].status = IRQ_DISABLED;
irq_desc[RTC_IRQ].handler = &rtc_irq_type;
setup_irq(RTC_IRQ, &timer_irqaction);
}
/* dummy irqactions */
struct irqaction isa_cascade_irqaction = {
handler: no_action,
name: "isa-cascade"
};
struct irqaction timer_cascade_irqaction = {
handler: no_action,
name: "timer-cascade"
};
struct irqaction halt_switch_irqaction = {
handler: no_action,
name: "halt-switch"
};
......@@ -304,7 +304,7 @@ pyxis_enable_irq(unsigned int irq)
pyxis_update_irq_hw(cached_irq_mask |= 1UL << (irq - 16));
}
static inline void
static void
pyxis_disable_irq(unsigned int irq)
{
pyxis_update_irq_hw(cached_irq_mask &= ~(1UL << (irq - 16)));
......@@ -317,6 +317,13 @@ pyxis_startup_irq(unsigned int irq)
return 0;
}
static void
pyxis_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
pyxis_enable_irq(irq);
}
static void
pyxis_mask_and_ack_irq(unsigned int irq)
{
......@@ -340,7 +347,7 @@ static struct hw_interrupt_type pyxis_irq_type = {
enable: pyxis_enable_irq,
disable: pyxis_disable_irq,
ack: pyxis_mask_and_ack_irq,
end: pyxis_enable_irq,
end: pyxis_end_irq,
};
void
......
......@@ -21,6 +21,7 @@
/* Note mask bit is true for DISABLED irqs. */
static unsigned int cached_irq_mask = 0xffff;
spinlock_t i8259_irq_lock = SPIN_LOCK_UNLOCKED;
static inline void
i8259_update_irq_hw(unsigned int irq, unsigned long mask)
......@@ -34,19 +35,30 @@ i8259_update_irq_hw(unsigned int irq, unsigned long mask)
inline void
i8259a_enable_irq(unsigned int irq)
{
spin_lock(&i8259_irq_lock);
i8259_update_irq_hw(irq, cached_irq_mask &= ~(1 << irq));
spin_unlock(&i8259_irq_lock);
}
inline void
i8259a_disable_irq(unsigned int irq)
static inline void
__i8259a_disable_irq(unsigned int irq)
{
i8259_update_irq_hw(irq, cached_irq_mask |= 1 << irq);
}
void
i8259a_disable_irq(unsigned int irq)
{
spin_lock(&i8259_irq_lock);
__i8259a_disable_irq(irq);
spin_unlock(&i8259_irq_lock);
}
void
i8259a_mask_and_ack_irq(unsigned int irq)
{
i8259a_disable_irq(irq);
spin_lock(&i8259_irq_lock);
__i8259a_disable_irq(irq);
/* Ack the interrupt making it the lowest priority. */
if (irq >= 8) {
......@@ -54,6 +66,7 @@ i8259a_mask_and_ack_irq(unsigned int irq)
irq = 2;
}
outb(0xE0 | irq, 0x20); /* ack the master */
spin_unlock(&i8259_irq_lock);
}
unsigned int
......@@ -63,6 +76,13 @@ i8259a_startup_irq(unsigned int irq)
return 0; /* never anything pending */
}
void
i8259a_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
i8259a_enable_irq(irq);
}
struct hw_interrupt_type i8259a_irq_type = {
typename: "XT-PIC",
startup: i8259a_startup_irq,
......@@ -70,7 +90,7 @@ struct hw_interrupt_type i8259a_irq_type = {
enable: i8259a_enable_irq,
disable: i8259a_disable_irq,
ack: i8259a_mask_and_ack_irq,
end: i8259a_enable_irq,
end: i8259a_end_irq,
};
void __init
......
This diff is collapsed.
......@@ -19,6 +19,7 @@ extern void isa_no_iack_sc_device_interrupt(unsigned long, struct pt_regs *);
extern void srm_device_interrupt(unsigned long, struct pt_regs *);
extern void pyxis_device_interrupt(unsigned long, struct pt_regs *);
extern struct irqaction timer_irqaction;
extern struct irqaction isa_cascade_irqaction;
extern struct irqaction timer_cascade_irqaction;
extern struct irqaction halt_switch_irqaction;
......@@ -33,27 +34,37 @@ extern void i8259a_enable_irq(unsigned int);
extern void i8259a_disable_irq(unsigned int);
extern void i8259a_mask_and_ack_irq(unsigned int);
extern unsigned int i8259a_startup_irq(unsigned int);
extern void i8259a_end_irq(unsigned int);
extern struct hw_interrupt_type i8259a_irq_type;
extern void init_i8259a_irqs(void);
extern void no_action(int cpl, void *dev_id, struct pt_regs *regs);
extern void handle_irq(int irq, struct pt_regs * regs);
extern unsigned long prof_cpu_mask;
static inline void
alpha_do_profile(unsigned long pc)
{
if (prof_buffer && current->pid) {
extern char _stext;
pc -= (unsigned long) &_stext;
pc >>= prof_shift;
/*
* Don't ignore out-of-bounds PC values silently,
* put them into the last histogram slot, so if
* present, they will show up as a sharp peak.
*/
if (pc > prof_len - 1)
pc = prof_len - 1;
atomic_inc((atomic_t *)&prof_buffer[pc]);
}
extern char _stext;
if (!prof_buffer)
return;
/*
* Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
* (default is all CPUs.)
*/
if (!((1<<smp_processor_id()) & prof_cpu_mask))
return;
pc -= (unsigned long) &_stext;
pc >>= prof_shift;
/*
* Don't ignore out-of-bounds PC values silently,
* put them into the last histogram slot, so if
* present, they will show up as a sharp peak.
*/
if (pc > prof_len - 1)
pc = prof_len - 1;
atomic_inc((atomic_t *)&prof_buffer[pc]);
}
......@@ -10,7 +10,6 @@ struct pt_regs;
struct task_struct;
struct pci_dev;
struct pci_controler;
struct irqaction;
/* core_apecs.c */
extern struct pci_ops apecs_pci_ops;
......@@ -81,14 +80,13 @@ extern void setup_smp(void);
extern int smp_info(char *buffer);
extern void handle_ipi(struct pt_regs *);
extern void smp_percpu_timer_interrupt(struct pt_regs *);
extern unsigned long cpu_present_mask;
/* bios32.c */
/* extern void reset_for_srm(void); */
/* time.c */
extern void timer_interrupt(int irq, void *dev, struct pt_regs * regs);
extern void common_init_rtc(struct irqaction *);
extern void common_init_rtc(void);
extern unsigned long est_cycle_freq;
/* smc37c93x.c */
......
......@@ -487,6 +487,7 @@ setup_arch(char **cmdline_p)
#ifdef __SMP__
setup_smp();
#endif
paging_init();
}
static char sys_unknown[] = "Unknown";
......
/*
* Handle interrupts from the SRM, assuming no additional weirdness.
*/
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/irq.h>
#include <asm/machvec.h>
#include <asm/dma.h>
#include "proto.h"
#include "irq_impl.h"
/*
* Is the palcode SMP safe? In other words: can we call cserve_ena/dis
* at the same time in multiple CPUs? To be safe I added a spinlock
* but it can be removed trivially if the palcode is robust against smp.
*/
spinlock_t srm_irq_lock = SPIN_LOCK_UNLOCKED;
static inline void
srm_enable_irq(unsigned int irq)
{
spin_lock(&srm_irq_lock);
cserve_ena(irq - 16);
spin_unlock(&srm_irq_lock);
}
static void
srm_disable_irq(unsigned int irq)
{
spin_lock(&srm_irq_lock);
cserve_dis(irq - 16);
spin_unlock(&srm_irq_lock);
}
static unsigned int
srm_startup_irq(unsigned int irq)
{
srm_enable_irq(irq);
return 0;
}
static void
srm_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
srm_enable_irq(irq);
}
/* Handle interrupts from the SRM, assuming no additional weirdness. */
static struct hw_interrupt_type srm_irq_type = {
typename: "SRM",
startup: srm_startup_irq,
shutdown: srm_disable_irq,
enable: srm_enable_irq,
disable: srm_disable_irq,
ack: srm_disable_irq,
end: srm_end_irq,
};
void __init
init_srm_irqs(long max, unsigned long ignore_mask)
{
long i;
for (i = 16; i < max; ++i) {
if (i < 64 && ((ignore_mask >> i) & 1))
continue;
irq_desc[i].status = IRQ_DISABLED;
irq_desc[i].handler = &srm_irq_type;
}
}
void
srm_device_interrupt(unsigned long vector, struct pt_regs * regs)
{
int irq = (vector - 0x800) >> 4;
handle_irq(irq, regs);
}
......@@ -48,7 +48,7 @@ alcor_enable_irq(unsigned int irq)
alcor_update_irq_hw(cached_irq_mask |= 1UL << (irq - 16));
}
static inline void
static void
alcor_disable_irq(unsigned int irq)
{
alcor_update_irq_hw(cached_irq_mask &= ~(1UL << (irq - 16)));
......@@ -81,6 +81,13 @@ alcor_isa_mask_and_ack_irq(unsigned int irq)
*(vuip)GRU_INT_CLEAR = 0; mb();
}
static void
alcor_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
alcor_enable_irq(irq);
}
static struct hw_interrupt_type alcor_irq_type = {
typename: "ALCOR",
startup: alcor_startup_irq,
......@@ -88,7 +95,7 @@ static struct hw_interrupt_type alcor_irq_type = {
enable: alcor_enable_irq,
disable: alcor_disable_irq,
ack: alcor_mask_and_ack_irq,
end: alcor_enable_irq,
end: alcor_end_irq,
};
static void
......@@ -140,7 +147,6 @@ alcor_init_irq(void)
i8259a_irq_type.ack = alcor_isa_mask_and_ack_irq;
init_i8259a_irqs();
init_rtc_irq();
common_init_isa_dma();
setup_irq(16+31, &isa_cascade_irqaction);
......
......@@ -65,6 +65,13 @@ cabriolet_startup_irq(unsigned int irq)
return 0; /* never anything pending */
}
static void
cabriolet_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
cabriolet_enable_irq(irq);
}
static struct hw_interrupt_type cabriolet_irq_type = {
typename: "CABRIOLET",
startup: cabriolet_startup_irq,
......@@ -72,7 +79,7 @@ static struct hw_interrupt_type cabriolet_irq_type = {
enable: cabriolet_enable_irq,
disable: cabriolet_disable_irq,
ack: cabriolet_disable_irq,
end: cabriolet_enable_irq,
end: cabriolet_end_irq,
};
static void
......@@ -103,7 +110,6 @@ static void __init
cabriolet_init_irq(void)
{
init_i8259a_irqs();
init_rtc_irq();
if (alpha_using_srm) {
alpha_mv.device_interrupt = srm_device_interrupt;
......
......@@ -35,6 +35,10 @@
/* Note mask bit is true for ENABLED irqs. */
static unsigned long cached_irq_mask;
/* dp264 boards handle at max four CPUs */
static unsigned long cpu_irq_affinity[4];
spinlock_t dp264_irq_lock = SPIN_LOCK_UNLOCKED;
static void
tsunami_update_irq_hw(unsigned long mask, unsigned long isa_enable)
......@@ -47,12 +51,16 @@ tsunami_update_irq_hw(unsigned long mask, unsigned long isa_enable)
volatile unsigned long *dim0, *dim1, *dim2, *dim3;
unsigned long mask0, mask1, mask2, mask3, maskB, dummy;
mask0 = mask1 = mask2 = mask3 = mask;
mask0 = mask & cpu_irq_affinity[0];
mask1 = mask & cpu_irq_affinity[1];
mask2 = mask & cpu_irq_affinity[2];
mask3 = mask & cpu_irq_affinity[3];
maskB = mask | isa_enable;
if (bcpu == 0) mask0 = maskB;
if (bcpu == 1) mask1 = maskB;
if (bcpu == 2) mask2 = maskB;
if (bcpu == 3) mask3 = maskB;
if (bcpu == 0) mask0 = maskB & cpu_irq_affinity[0];
else if (bcpu == 1) mask1 = maskB & cpu_irq_affinity[1];
else if (bcpu == 2) mask2 = maskB & cpu_irq_affinity[2];
else if (bcpu == 3) mask3 = maskB & cpu_irq_affinity[3];
dim0 = &cchip->dim0.csr;
dim1 = &cchip->dim1.csr;
......@@ -73,10 +81,12 @@ tsunami_update_irq_hw(unsigned long mask, unsigned long isa_enable)
*dim2;
*dim3;
#else
volatile unsigned long *dimB = &cchip->dim1.csr;
volatile unsigned long *dimB;
if (bcpu == 0) dimB = &cchip->dim0.csr;
if (bcpu == 2) dimB = &cchip->dim2.csr;
if (bcpu == 3) dimB = &cchip->dim3.csr;
else if (bcpu == 1) dimB = &cchip->dim1.csr;
else if (bcpu == 2) dimB = &cchip->dim2.csr;
else if (bcpu == 3) dimB = &cchip->dim3.csr;
*dimB = mask | isa_enable;
mb();
*dimB;
......@@ -98,15 +108,19 @@ clipper_update_irq_hw(unsigned long mask)
static inline void
dp264_enable_irq(unsigned int irq)
{
spin_lock(&dp264_irq_lock);
cached_irq_mask |= 1UL << irq;
dp264_update_irq_hw(cached_irq_mask);
spin_unlock(&dp264_irq_lock);
}
static void
dp264_disable_irq(unsigned int irq)
{
spin_lock(&dp264_irq_lock);
cached_irq_mask &= ~(1UL << irq);
dp264_update_irq_hw(cached_irq_mask);
spin_unlock(&dp264_irq_lock);
}
static unsigned int
......@@ -116,18 +130,29 @@ dp264_startup_irq(unsigned int irq)
return 0; /* never anything pending */
}
static void
dp264_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
dp264_enable_irq(irq);
}
static inline void
clipper_enable_irq(unsigned int irq)
{
spin_lock(&dp264_irq_lock);
cached_irq_mask |= 1UL << irq;
clipper_update_irq_hw(cached_irq_mask);
spin_unlock(&dp264_irq_lock);
}
static void
clipper_disable_irq(unsigned int irq)
{
spin_lock(&dp264_irq_lock);
cached_irq_mask &= ~(1UL << irq);
clipper_update_irq_hw(cached_irq_mask);
spin_unlock(&dp264_irq_lock);
}
static unsigned int
......@@ -137,6 +162,45 @@ clipper_startup_irq(unsigned int irq)
return 0; /* never anything pending */
}
static void
clipper_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
clipper_enable_irq(irq);
}
static void
cpu_set_irq_affinity(unsigned int irq, unsigned long affinity)
{
int cpu;
for (cpu = 0; cpu < 4; cpu++) {
if (affinity & (1UL << cpu))
cpu_irq_affinity[cpu] |= 1UL << irq;
else
cpu_irq_affinity[cpu] &= ~(1UL << irq);
}
}
static void
dp264_set_affinity(unsigned int irq, unsigned long affinity)
{
spin_lock(&dp264_irq_lock);
cpu_set_irq_affinity(irq, affinity);
dp264_update_irq_hw(cached_irq_mask);
spin_unlock(&dp264_irq_lock);
}
static void
clipper_set_affinity(unsigned int irq, unsigned long affinity)
{
spin_lock(&dp264_irq_lock);
cpu_set_irq_affinity(irq, affinity);
clipper_update_irq_hw(cached_irq_mask);
spin_unlock(&dp264_irq_lock);
}
static struct hw_interrupt_type dp264_irq_type = {
typename: "DP264",
startup: dp264_startup_irq,
......@@ -144,7 +208,8 @@ static struct hw_interrupt_type dp264_irq_type = {
enable: dp264_enable_irq,
disable: dp264_disable_irq,
ack: dp264_disable_irq,
end: dp264_enable_irq,
end: dp264_end_irq,
set_affinity: dp264_set_affinity,
};
static struct hw_interrupt_type clipper_irq_type = {
......@@ -154,7 +219,8 @@ static struct hw_interrupt_type clipper_irq_type = {
enable: clipper_enable_irq,
disable: clipper_disable_irq,
ack: clipper_disable_irq,
end: clipper_enable_irq,
end: clipper_end_irq,
set_affinity: clipper_set_affinity,
};
static void
......@@ -249,6 +315,8 @@ init_tsunami_irqs(struct hw_interrupt_type * ops)
static void __init
dp264_init_irq(void)
{
int cpu;
outb(0, DMA1_RESET_REG);
outb(0, DMA2_RESET_REG);
outb(DMA_MODE_CASCADE, DMA2_MODE_REG);
......@@ -257,10 +325,12 @@ dp264_init_irq(void)
if (alpha_using_srm)
alpha_mv.device_interrupt = dp264_srm_device_interrupt;
/* this is single threaded by design so no need of any smp lock */
for (cpu = 0; cpu < 4; cpu++)
cpu_irq_affinity[cpu] = ~0UL;
dp264_update_irq_hw(0UL);
init_i8259a_irqs();
init_rtc_irq();
init_tsunami_irqs(&dp264_irq_type);
}
......@@ -278,7 +348,6 @@ clipper_init_irq(void)
clipper_update_irq_hw(0UL);
init_i8259a_irqs();
init_rtc_irq();
init_tsunami_irqs(&clipper_irq_type);
}
......
......@@ -48,7 +48,7 @@ eb64p_enable_irq(unsigned int irq)
eb64p_update_irq_hw(irq, cached_irq_mask &= ~(1 << irq));
}
static inline void
static void
eb64p_disable_irq(unsigned int irq)
{
eb64p_update_irq_hw(irq, cached_irq_mask |= 1 << irq);
......@@ -61,6 +61,13 @@ eb64p_startup_irq(unsigned int irq)
return 0; /* never anything pending */
}
static void
eb64p_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
eb64p_enable_irq(irq);
}
static struct hw_interrupt_type eb64p_irq_type = {
typename: "EB64P",
startup: eb64p_startup_irq,
......@@ -68,7 +75,7 @@ static struct hw_interrupt_type eb64p_irq_type = {
enable: eb64p_enable_irq,
disable: eb64p_disable_irq,
ack: eb64p_disable_irq,
end: eb64p_enable_irq,
end: eb64p_end_irq,
};
static void
......@@ -119,7 +126,6 @@ eb64p_init_irq(void)
outb(0xff, 0x27);
init_i8259a_irqs();
init_rtc_irq();
for (i = 16; i < 32; ++i) {
irq_desc[i].status = IRQ_DISABLED;
......
......@@ -76,6 +76,13 @@ eiger_startup_irq(unsigned int irq)
return 0; /* never anything pending */
}
static void
eiger_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
eiger_enable_irq(irq);
}
static struct hw_interrupt_type eiger_irq_type = {
typename: "EIGER",
startup: eiger_startup_irq,
......@@ -83,7 +90,7 @@ static struct hw_interrupt_type eiger_irq_type = {
enable: eiger_enable_irq,
disable: eiger_disable_irq,
ack: eiger_disable_irq,
end: eiger_enable_irq,
end: eiger_end_irq,
};
static void
......@@ -147,7 +154,6 @@ eiger_init_irq(void)
eiger_update_irq_hw(i, -1);
init_i8259a_irqs();
init_rtc_irq();
for (i = 16; i < 128; ++i) {
irq_desc[i].status = IRQ_DISABLED;
......
......@@ -71,7 +71,7 @@ static struct hw_interrupt_type jensen_local_irq_type = {
enable: i8259a_enable_irq,
disable: i8259a_disable_irq,
ack: jensen_local_ack,
end: i8259a_enable_irq,
end: i8259a_end_irq,
};
static void
......@@ -110,7 +110,6 @@ static void __init
jensen_init_irq(void)
{
init_i8259a_irqs();
init_rtc_irq();
irq_desc[1].handler = &jensen_local_irq_type;
irq_desc[4].handler = &jensen_local_irq_type;
......
......@@ -70,7 +70,6 @@ miata_init_irq(void)
#endif
init_i8259a_irqs();
init_rtc_irq();
/* Not interested in the bogus interrupts (3,10), Fan Fault (0),
NMI (1), or EIDE (9).
......
......@@ -48,7 +48,7 @@ mikasa_enable_irq(unsigned int irq)
mikasa_update_irq_hw(cached_irq_mask |= 1 << (irq - 16));
}
static inline void
static void
mikasa_disable_irq(unsigned int irq)
{
mikasa_update_irq_hw(cached_irq_mask &= ~(1 << (irq - 16)));
......@@ -61,6 +61,13 @@ mikasa_startup_irq(unsigned int irq)
return 0;
}
static void
mikasa_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
mikasa_enable_irq(irq);
}
static struct hw_interrupt_type mikasa_irq_type = {
typename: "MIKASA",
startup: mikasa_startup_irq,
......@@ -68,7 +75,7 @@ static struct hw_interrupt_type mikasa_irq_type = {
enable: mikasa_enable_irq,
disable: mikasa_disable_irq,
ack: mikasa_disable_irq,
end: mikasa_enable_irq,
end: mikasa_end_irq,
};
static void
......@@ -113,7 +120,6 @@ mikasa_init_irq(void)
}
init_i8259a_irqs();
init_rtc_irq();
common_init_isa_dma();
}
......
......@@ -54,7 +54,6 @@ static void __init
nautilus_init_irq(void)
{
init_i8259a_irqs();
init_rtc_irq();
common_init_isa_dma();
}
......
......@@ -45,13 +45,13 @@ noritake_update_irq_hw(int irq, int mask)
outw(mask, port);
}
static inline void
static void
noritake_enable_irq(unsigned int irq)
{
noritake_update_irq_hw(irq, cached_irq_mask |= 1 << (irq - 16));
}
static inline void
static void
noritake_disable_irq(unsigned int irq)
{
noritake_update_irq_hw(irq, cached_irq_mask &= ~(1 << (irq - 16)));
......@@ -140,7 +140,6 @@ noritake_init_irq(void)
}
init_i8259a_irqs();
init_rtc_irq();
common_init_isa_dma();
}
......
......@@ -41,6 +41,7 @@ static unsigned int hose_irq_masks[4] = {
0xff0000, 0xfe0000, 0xff0000, 0xff0000
};
static unsigned int cached_irq_masks[4];
spinlock_t rawhide_irq_lock = SPIN_LOCK_UNLOCKED;
static inline void
rawhide_update_irq_hw(int hose, int mask)
......@@ -50,7 +51,7 @@ rawhide_update_irq_hw(int hose, int mask)
*(vuip)MCPCIA_INT_MASK0(MCPCIA_HOSE2MID(hose));
}
static void
static inline void
rawhide_enable_irq(unsigned int irq)
{
unsigned int mask, hose;
......@@ -59,9 +60,11 @@ rawhide_enable_irq(unsigned int irq)
hose = irq / 24;
irq -= hose * 24;
spin_lock(&rawhide_irq_lock);
mask = cached_irq_masks[hose] |= 1 << irq;
mask |= hose_irq_masks[hose];
rawhide_update_irq_hw(hose, mask);
spin_unlock(&rawhide_irq_lock);
}
static void
......@@ -73,9 +76,11 @@ rawhide_disable_irq(unsigned int irq)
hose = irq / 24;
irq -= hose * 24;
spin_lock(&rawhide_irq_lock);
mask = cached_irq_masks[hose] &= ~(1 << irq);
mask |= hose_irq_masks[hose];
rawhide_update_irq_hw(hose, mask);
spin_unlock(&rawhide_irq_lock);
}
......@@ -86,6 +91,13 @@ rawhide_startup_irq(unsigned int irq)
return 0;
}
static void
rawhide_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
rawhide_enable_irq(irq);
}
static struct hw_interrupt_type rawhide_irq_type = {
typename: "RAWHIDE",
startup: rawhide_startup_irq,
......@@ -93,7 +105,7 @@ static struct hw_interrupt_type rawhide_irq_type = {
enable: rawhide_enable_irq,
disable: rawhide_disable_irq,
ack: rawhide_disable_irq,
end: rawhide_enable_irq,
end: rawhide_end_irq,
};
static void
......@@ -143,7 +155,6 @@ rawhide_init_irq(void)
}
init_i8259a_irqs();
init_rtc_irq();
common_init_isa_dma();
}
......
......@@ -64,7 +64,7 @@ ruffian_init_irq(void)
}
static void __init
ruffian_init_rtc(struct irqaction *action)
ruffian_init_rtc(void)
{
/* Ruffian does not have the RTC connected to the CPU timer
interrupt. Instead, it uses the PIT connected to IRQ 0. */
......@@ -78,7 +78,7 @@ ruffian_init_rtc(struct irqaction *action)
outb(0x31, 0x42);
outb(0x13, 0x42);
setup_irq(0, action);
setup_irq(0, &timer_irqaction);
}
static void
......
......@@ -65,6 +65,13 @@ rx164_startup_irq(unsigned int irq)
return 0;
}
static void
rx164_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
rx164_enable_irq(irq);
}
static struct hw_interrupt_type rx164_irq_type = {
typename: "RX164",
startup: rx164_startup_irq,
......@@ -72,7 +79,7 @@ static struct hw_interrupt_type rx164_irq_type = {
enable: rx164_enable_irq,
disable: rx164_disable_irq,
ack: rx164_disable_irq,
end: rx164_enable_irq,
end: rx164_end_irq,
};
static void
......@@ -114,7 +121,6 @@ rx164_init_irq(void)
}
init_i8259a_irqs();
init_rtc_irq();
common_init_isa_dma();
setup_irq(16+20, &isa_cascade_irqaction);
......
......@@ -30,6 +30,7 @@
#include "pci_impl.h"
#include "machvec_impl.h"
spinlock_t sable_irq_lock = SPIN_LOCK_UNLOCKED:
/*
* For SABLE, which is really baroque, we manage 40 IRQ's, but the
......@@ -137,8 +138,10 @@ sable_enable_irq(unsigned int irq)
unsigned long bit, mask;
bit = sable_irq_swizzle.irq_to_mask[irq];
spin_lock(&sable_irq_lock);
mask = sable_irq_swizzle.shadow_mask &= ~(1UL << bit);
sable_update_irq_hw(bit, mask);
spin_unlock(&sable_irq_lock);
}
static void
......@@ -147,8 +150,10 @@ sable_disable_irq(unsigned int irq)
unsigned long bit, mask;
bit = sable_irq_swizzle.irq_to_mask[irq];
spin_lock(&sable_irq_lock);
mask = sable_irq_swizzle.shadow_mask |= 1UL << bit;
sable_update_irq_hw(bit, mask);
spin_unlock(&sable_irq_lock);
}
static unsigned int
......@@ -158,15 +163,24 @@ sable_startup_irq(unsigned int irq)
return 0;
}
static void
sable_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
sable_enable_irq(irq);
}
static void
sable_mask_and_ack_irq(unsigned int irq)
{
unsigned long bit, mask;
bit = sable_irq_swizzle.irq_to_mask[irq];
spin_lock(&sable_irq_lock);
mask = sable_irq_swizzle.shadow_mask |= 1UL << bit;
sable_update_irq_hw(bit, mask);
sable_ack_irq_hw(bit);
spin_unlock(&sable_irq_lock);
}
static struct hw_interrupt_type sable_irq_type = {
......@@ -176,7 +190,7 @@ static struct hw_interrupt_type sable_irq_type = {
enable: sable_enable_irq,
disable: sable_disable_irq,
ack: sable_mask_and_ack_irq,
end: sable_enable_irq,
end: sable_end_irq,
};
static void
......@@ -208,7 +222,6 @@ sable_init_irq(void)
irq_desc[i].handler = &sable_irq_type;
}
init_rtc_irq();
common_init_isa_dma();
}
......
......@@ -42,7 +42,6 @@ sio_init_irq(void)
alpha_mv.device_interrupt = srm_device_interrupt;
init_i8259a_irqs();
init_rtc_irq();
common_init_isa_dma();
}
......
......@@ -43,7 +43,6 @@ sx164_init_irq(void)
alpha_mv.device_interrupt = srm_device_interrupt;
init_i8259a_irqs();
init_rtc_irq();
/* Not interested in the bogus interrupts (0,3,4,5,40-47),
NMI (1), or HALT (2). */
......
......@@ -66,6 +66,13 @@ takara_startup_irq(unsigned int irq)
return 0; /* never anything pending */
}
static void
takara_end_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
takara_enable_irq(irq);
}
static struct hw_interrupt_type takara_irq_type = {
typename: "TAKARA",
startup: takara_startup_irq,
......@@ -73,7 +80,7 @@ static struct hw_interrupt_type takara_irq_type = {
enable: takara_enable_irq,
disable: takara_disable_irq,
ack: takara_disable_irq,
end: takara_enable_irq,
end: takara_end_irq,
};
static void
......@@ -126,7 +133,6 @@ takara_init_irq(void)
long i;
init_i8259a_irqs();
init_rtc_irq();
if (alpha_using_srm) {
alpha_mv.device_interrupt = takara_srm_device_interrupt;
......
......@@ -163,7 +163,7 @@ static inline unsigned long mktime(unsigned int year, unsigned int mon,
}
void
common_init_rtc(struct irqaction *action)
common_init_rtc()
{
unsigned char x;
......@@ -192,18 +192,12 @@ common_init_rtc(struct irqaction *action)
outb(0x31, 0x42);
outb(0x13, 0x42);
setup_irq(RTC_IRQ, action);
init_rtc_irq();
}
void
time_init(void)
{
static struct irqaction timer_irqaction = {
handler: timer_interrupt,
flags: SA_INTERRUPT,
name: "timer",
};
unsigned int year, mon, day, hour, min, sec, cc1, cc2;
unsigned long cycle_freq, one_percent;
long diff;
......@@ -292,7 +286,9 @@ time_init(void)
state.partial_tick = 0L;
/* Startup the timer source. */
alpha_mv.init_rtc(&timer_irqaction);
alpha_mv.init_rtc();
do_get_fast_time = do_gettimeofday;
}
/*
......
......@@ -68,13 +68,13 @@ static inline void wb977_ww(int reg, int val)
/*
* This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE
*/
spinlock_t __netwinder_data gpio_lock = SPIN_LOCK_UNLOCKED;
spinlock_t gpio_lock = SPIN_LOCK_UNLOCKED;
static unsigned int __netwinder_data current_gpio_op = 0;
static unsigned int __netwinder_data current_gpio_io = 0;
static unsigned int __netwinder_data current_cpld = 0;
static unsigned int current_gpio_op = 0;
static unsigned int current_gpio_io = 0;
static unsigned int current_cpld = 0;
void __netwinder_text gpio_modify_op(int mask, int set)
void gpio_modify_op(int mask, int set)
{
unsigned int new_gpio, changed;
......@@ -119,7 +119,7 @@ static inline void __gpio_modify_io(int mask, int in)
}
}
void __netwinder_text gpio_modify_io(int mask, int in)
void gpio_modify_io(int mask, int in)
{
/* Open up the SuperIO chip */
wb977_open();
......@@ -130,7 +130,7 @@ void __netwinder_text gpio_modify_io(int mask, int in)
wb977_close();
}
int __netwinder_text gpio_read(void)
int gpio_read(void)
{
return inb(GP1_IO_BASE) | inb(GP2_IO_BASE) << 8;
}
......@@ -360,7 +360,7 @@ static void __init wb977_init(void)
wb977_close();
}
void __netwinder_text cpld_modify(int mask, int set)
void cpld_modify(int mask, int set)
{
int msk;
......
......@@ -471,6 +471,10 @@ int probe_irq_off(unsigned long irqs)
return irq_found;
}
void __init init_irq_proc(void)
{
}
void __init init_IRQ(void)
{
extern void init_dma(void);
......
......@@ -37,7 +37,7 @@ extern spinlock_t gpio_lock;
#ifdef CONFIG_FOOTBRIDGE
static void __ebsa285_text ebsa285_leds_event(led_event_t evt)
static void ebsa285_leds_event(led_event_t evt)
{
unsigned long flags;
......@@ -129,7 +129,7 @@ static void __ebsa285_text ebsa285_leds_event(led_event_t evt)
#ifdef CONFIG_ARCH_NETWINDER
static void __netwinder_text netwinder_leds_event(led_event_t evt)
static void netwinder_leds_event(led_event_t evt)
{
unsigned long flags;
......
......@@ -767,6 +767,8 @@ void __init setup_arch(char **cmdline_p)
setup_bootmem();
request_standard_resources(mdesc);
paging_init();
#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
conswitchp = &vga_con;
......
......@@ -60,6 +60,8 @@ __setup("noalign", noalign_setup);
__setup("nocache", nocache_setup);
__setup("nowb", nowrite_setup);
#define FIRST_KERNEL_PGD_NR (FIRST_USER_PGD_NR + USER_PTRS_PER_PGD)
/*
* need to get a 16k page for level 1
*/
......@@ -71,9 +73,9 @@ pgd_t *get_pgd_slow(void)
if (pgd) {
pgd_t *init = pgd_offset_k(0);
memzero(pgd, USER_PTRS_PER_PGD * sizeof(pgd_t));
memcpy(pgd + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
memzero(pgd, FIRST_KERNEL_PGD_NR * sizeof(pgd_t));
memcpy(pgd + FIRST_KERNEL_PGD_NR, init + FIRST_KERNEL_PGD_NR,
(PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
clean_cache_area(pgd, PTRS_PER_PGD * sizeof(pgd_t));
/*
......
......@@ -25,22 +25,6 @@ SECTIONS
__init_end = .;
}
.ebsa285 : {
__ebsa285_begin = .;
*(.text.ebsa285)
*(.data.ebsa285)
. = ALIGN(4096);
__ebsa285_end = .;
}
.netwinder : {
__netwinder_begin = .;
*(.text.netwinder)
*(.data.netwinder)
. = ALIGN(4096);
__netwinder_end = .;
}
.text : { /* Real text segment */
_text = .; /* Text and read-only data */
*(.text)
......@@ -65,11 +49,26 @@ SECTIONS
. = ALIGN(8192);
.data : { /* Data */
.data : {
/*
* first, the init task union, aligned
* to an 8192 byte boundary.
*/
*(.init.task)
/*
* then the cacheline aligned data
*/
. = ALIGN(32);
*(.data.cacheline_aligned)
/*
* and the usual data section
*/
*(.data)
CONSTRUCTORS
_edata = .; /* End of data section */
_edata = .;
}
.bss : {
......
......@@ -131,7 +131,7 @@ static spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED;
static void end_8259A_irq (unsigned int irq)
{
if (!(irq_desc[irq].status & IRQ_DISABLED))
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
enable_8259A_irq(irq);
}
......
......@@ -1160,7 +1160,7 @@ static void end_level_ioapic_irq (unsigned int i)
static void mask_and_ack_level_ioapic_irq (unsigned int i) { /* nothing */ }
static void set_ioapic_affinity (unsigned int irq, unsigned int mask)
static void set_ioapic_affinity (unsigned int irq, unsigned long mask)
{
unsigned long flags;
/*
......
......@@ -874,7 +874,7 @@ static struct proc_dir_entry * root_irq_dir;
static struct proc_dir_entry * irq_dir [NR_IRQS];
static struct proc_dir_entry * smp_affinity_entry [NR_IRQS];
unsigned int irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = 0xffffffff};
static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };
#define HEX_DIGITS 8
......@@ -883,7 +883,7 @@ static int irq_affinity_read_proc (char *page, char **start, off_t off,
{
if (count < HEX_DIGITS+1)
return -EINVAL;
return sprintf (page, "%08x\n", irq_affinity[(int)data]);
return sprintf (page, "%08lx\n", irq_affinity[(long)data]);
}
static unsigned int parse_hex_value (const char *buffer,
......@@ -926,7 +926,7 @@ static unsigned int parse_hex_value (const char *buffer,
static int irq_affinity_write_proc (struct file *file, const char *buffer,
unsigned long count, void *data)
{
int irq = (int) data, full_count = count, err;
int irq = (long) data, full_count = count, err;
unsigned long new_value;
if (!irq_desc[irq].handler->set_affinity)
......@@ -993,7 +993,7 @@ static void register_irq_proc (unsigned int irq)
entry = create_proc_entry("smp_affinity", 0700, irq_dir[irq]);
entry->nlink = 1;
entry->data = (void *)irq;
entry->data = (void *)(long)irq;
entry->read_proc = irq_affinity_read_proc;
entry->write_proc = irq_affinity_write_proc;
......
......@@ -631,13 +631,14 @@ void free_initmem(void)
#ifdef CONFIG_BLK_DEV_INITRD
void free_initrd_mem(unsigned long start, unsigned long end)
{
if (start < end)
printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
for (; start < end; start += PAGE_SIZE) {
ClearPageReserved(mem_map + MAP_NR(start));
set_page_count(mem_map+MAP_NR(start), 1);
free_page(start);
totalram_pages++;
}
printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
}
#endif
......
# $Id: config.in,v 1.86 2000/02/10 02:51:10 davem Exp $
# $Id: config.in,v 1.87 2000/02/27 19:34:12 davem Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
......@@ -163,6 +163,7 @@ if [ "$CONFIG_NET" = "y" ]; then
bool 'Network device support' CONFIG_NETDEVICES
if [ "$CONFIG_NETDEVICES" = "y" ]; then
tristate ' Dummy net driver support' CONFIG_DUMMY
tristate ' Bonding driver support' CONFIG_BONDING
tristate ' PPP (point-to-point) support' CONFIG_PPP
if [ ! "$CONFIG_PPP" = "n" ]; then
dep_tristate ' PPP support for async serial ports' CONFIG_PPP_ASYNC $CONFIG_PPP
......
......@@ -218,6 +218,7 @@ CONFIG_SCSI_FCAL=m
#
CONFIG_NETDEVICES=y
CONFIG_DUMMY=m
CONFIG_BONDING=m
CONFIG_PPP=m
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
......@@ -240,7 +241,7 @@ CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
#
# Filesystems
# File systems
#
# CONFIG_QUOTA is not set
CONFIG_AUTOFS_FS=m
......
/* $Id: ioport.c,v 1.34 2000/02/18 13:48:48 davem Exp $
/* $Id: ioport.c,v 1.35 2000/02/27 08:16:25 davem Exp $
* ioport.c: Simple io mapping allocator.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......
# $Id: config.in,v 1.95 2000/02/10 02:51:12 davem Exp $
# $Id: config.in,v 1.99 2000/02/27 19:34:17 davem Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
......@@ -112,6 +112,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
define_bool CONFIG_IDEDMA_NEW_DRIVE_LISTINGS y
define_bool CONFIG_BLK_DEV_NS87415 y
define_bool CONFIG_BLK_DEV_CMD64X y
define_bool CONFIG_BLK_DEV_IDE_MODES y
fi
fi
......@@ -200,6 +201,7 @@ if [ "$CONFIG_NET" = "y" ]; then
bool 'Network device support' CONFIG_NETDEVICES
if [ "$CONFIG_NETDEVICES" = "y" ]; then
tristate ' Dummy net driver support' CONFIG_DUMMY
tristate ' Bonding driver support' CONFIG_BONDING
tristate ' PPP (point-to-point) support' CONFIG_PPP
if [ ! "$CONFIG_PPP" = "n" ]; then
dep_tristate ' PPP support for async serial ports' CONFIG_PPP_ASYNC $CONFIG_PPP
......
......@@ -136,6 +136,7 @@ CONFIG_IDEDMA_AUTO=y
CONFIG_IDEDMA_NEW_DRIVE_LISTINGS=y
CONFIG_BLK_DEV_NS87415=y
CONFIG_BLK_DEV_CMD64X=y
CONFIG_BLK_DEV_IDE_MODES=y
#
# Networking options
......@@ -254,6 +255,7 @@ CONFIG_SCSI_FCAL=m
#
CONFIG_NETDEVICES=y
CONFIG_DUMMY=m
CONFIG_BONDING=m
CONFIG_PPP=m
# CONFIG_PPP_ASYNC is not set
# CONFIG_PPP_SYNC_TTY is not set
......
......@@ -293,11 +293,15 @@ static int rd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
switch (cmd) {
case BLKFLSBUF:
if (!capable(CAP_SYS_ADMIN)) return -EACCES;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
/* special: we want to release the ramdisk memory,
it's not like with the other blockdevices where
this ioctl only flushes away the buffer cache. */
if ((atomic_read(&inode->i_bdev->bd_openers) > 1))
return -EBUSY;
destroy_buffers(inode->i_rdev);
rd_blocksizes[minor] = 0;
break;
case BLKGETSIZE: /* Return device size */
......@@ -338,6 +342,8 @@ static int initrd_release(struct inode *inode,struct file *file)
extern void free_initrd_mem(unsigned long, unsigned long);
if (--initrd_users) return 0;
blkdev_put(inode->i_bdev, BDEV_FILE);
iput(inode);
free_initrd_mem(initrd_start, initrd_end);
initrd_start = 0;
return 0;
......@@ -358,7 +364,6 @@ static int rd_open(struct inode * inode, struct file * filp)
if (DEVICE_NR(inode->i_rdev) == INITRD_MINOR) {
if (!initrd_start) return -ENODEV;
initrd_users++;
filp->f_op = &initrd_fops;
return 0;
}
#endif
......@@ -366,7 +371,6 @@ static int rd_open(struct inode * inode, struct file * filp)
if (DEVICE_NR(inode->i_rdev) >= NUM_RAMDISKS)
return -ENXIO;
filp->f_op = &def_blk_fops;
MOD_INC_USE_COUNT;
return 0;
......@@ -395,6 +399,8 @@ static void __exit rd_cleanup (void)
devfs_unregister (devfs_handle);
unregister_blkdev( MAJOR_NR, "ramdisk" );
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
blksize_size[MAJOR_NR] = NULL;
blk_size[MAJOR_NR] = NULL;
}
/* This is the registration and initialization section of the RAM disk driver */
......@@ -432,7 +438,6 @@ int __init rd_init (void)
hardsect_size[MAJOR_NR] = rd_hardsec; /* Size of the RAM disk blocks */
blksize_size[MAJOR_NR] = rd_blocksizes; /* Avoid set_blocksize() check */
blk_size[MAJOR_NR] = rd_kbsize; /* Size of the RAM disk in kB */
for (i = 0; i < NUM_RAMDISKS; i++)
register_disk(NULL, MKDEV(MAJOR_NR,i), 1, &fd_fops, rd_size<<1);
......@@ -442,6 +447,8 @@ int __init rd_init (void)
register_disk(NULL, MKDEV(MAJOR_NR,INITRD_MINOR), 1, &fd_fops, rd_size<<1);
#endif
blk_size[MAJOR_NR] = rd_kbsize; /* Size of the RAM disk in kB */
/* rd_size is given in kB */
printk("RAMDISK driver initialized: "
"%d RAM disks of %dK size %d blocksize\n",
......@@ -584,26 +591,28 @@ static void __init rd_load_image(kdev_t device, int offset, int unit)
ram_device = MKDEV(MAJOR_NR, unit);
if ((inode = get_empty_inode()) == NULL)
return;
memset(&infile, 0, sizeof(infile));
memset(&in_dentry, 0, sizeof(in_dentry));
inode = get_empty_inode();
inode->i_rdev = device;
inode->i_bdev = bdget(kdev_t_to_nr(device));
infile.f_mode = 1; /* read only */
infile.f_dentry = &in_dentry;
in_dentry.d_inode = inode;
infile.f_op = &initrd_fops;
init_special_inode(inode, S_IFBLK | S_IRUSR, kdev_t_to_nr(device));
if ((out_inode = get_empty_inode()) == NULL)
goto free_inode;
memset(&outfile, 0, sizeof(outfile));
memset(&out_dentry, 0, sizeof(out_dentry));
out_inode = get_empty_inode();
out_inode->i_rdev = ram_device;
out_inode->i_bdev = bdget(kdev_t_to_nr(ram_device));
outfile.f_mode = 3; /* read/write */
outfile.f_dentry = &out_dentry;
out_dentry.d_inode = out_inode;
outfile.f_op = &def_blk_fops;
init_special_inode(out_inode, S_IFBLK | S_IRUSR | S_IWUSR, kdev_t_to_nr(ram_device));
if (blkdev_open(inode, &infile) != 0)
goto free_inodes;
goto free_inode;
if (blkdev_open(out_inode, &outfile) != 0)
goto free_inodes;
......@@ -697,9 +706,12 @@ static void __init rd_load_image(kdev_t device, int offset, int unit)
if (infile.f_op->release)
infile.f_op->release(inode, &infile);
set_fs(fs);
free_inodes:
iput(inode);
return;
free_inodes: /* free inodes on error */
iput(out_inode);
blkdev_put(inode->i_bdev, BDEV_FILE);
free_inode:
iput(inode);
}
......
......@@ -11,6 +11,10 @@ fi
tristate 'Standard/generic (dumb) serial support' CONFIG_SERIAL
if [ "$CONFIG_SERIAL" = "y" ]; then
bool ' Support for console on serial port' CONFIG_SERIAL_CONSOLE
if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
tristate ' Atomwide serial port support' CONFIG_ATOMWIDE_SERIAL
tristate ' Dual serial port support' CONFIG_DUALSP_SERIAL
fi
fi
bool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED
if [ "$CONFIG_SERIAL_EXTENDED" = "y" ]; then
......@@ -116,9 +120,23 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then
tristate ' Berkshire Products PC Watchdog' CONFIG_PCWATCHDOG
tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT
tristate ' Mixcom Watchdog' CONFIG_MIXCOMWD
if [ "$CONFIG_FOOTBRIDGE" = "y" ]; then
tristate ' DC21285 watchdog' CONFIG_21285_WATCHDOG
if [ "$CONFIG_ARCH_NETWINDER" = "y" ]; then
tristate ' NetWinder WB83C977 watchdog' CONFIG_977_WATCHDOG
fi
fi
fi
endmenu
if [ "$CONFIG_ARCH_NETWINDER" = "y" ]; then
tristate 'NetWinder thermometer support' CONFIG_DS1620
tristate 'NetWinder Button' CONFIG_NWBUTTON
if [ "$CONFIG_NWBUTTON" != "n" ]; then
bool ' Reboot Using Button' CONFIG_NWBUTTON_REBOOT
fi
tristate 'NetWinder flash support' CONFIG_NWFLASH
fi
tristate '/dev/nvram support' CONFIG_NVRAM
tristate 'Enhanced Real Time Clock Support' CONFIG_RTC
......
/*
* Video4Linux Colour QuickCam driver
* Copyright 1997-1999 Philip Blundell <philb@gnu.org>
* Copyright 1997-2000 Philip Blundell <philb@gnu.org>
*
* Module parameters:
*
* parport=auto -- probe all parports (default)
* parport=0 -- parport0 becomes qcam1
* parport=2,0,1 -- parports 2,0,1 are tried in that order
*
* probe=0 -- do no probing, assume camera is present
* probe=1 -- use IEEE-1284 autoprobe data only (default)
* probe=2 -- probe aggressively for cameras
*
* The parport parameter controls which parports will be scanned.
* Scanning all parports causes some printers to print a garbage page.
* -- March 14, 1999 Billy Donahue <billy@escape.com>
*/
#include <linux/module.h>
......@@ -32,6 +45,9 @@ struct qcam_device {
struct semaphore lock;
};
/* cameras maximum */
#define MAX_CAMS 4
/* The three possible QuickCam modes */
#define QC_MILLIONS 0x18
#define QC_BILLIONS 0x10
......@@ -42,6 +58,11 @@ struct qcam_device {
#define QC_DECIMATION_2 2
#define QC_DECIMATION_4 4
#define BANNER "Colour QuickCam for Video4Linux v0.05"
static int parport[MAX_CAMS] = { [1 ... MAX_CAMS-1] = -1 };
static int probe = 2;
static inline void qcam_set_ack(struct qcam_device *qcam, unsigned int i)
{
/* note: the QC specs refer to the PCAck pin by voltage, not
......@@ -159,6 +180,22 @@ static int qc_detect(struct qcam_device *qcam)
{
unsigned int stat, ostat, i, count = 0;
/* The probe routine below is not very reliable. The IEEE-1284
probe takes precedence. */
/* XXX Currently parport provides no way to distinguish between
"the IEEE probe was not done" and "the probe was done, but
no device was found". Fix this one day. */
if (qcam->pport->probe_info[0].class == PARPORT_CLASS_MEDIA
&& qcam->pport->probe_info[0].model
&& !strcmp(qcam->pdev->port->probe_info[0].model,
"Color QuickCam 2.0")) {
printk(KERN_DEBUG "QuickCam: Found by IEEE1284 probe.\n");
return 1;
}
if (probe < 2)
return 0;
parport_write_control(qcam->pport, 0xc);
/* look for a heartbeat */
......@@ -174,6 +211,26 @@ static int qc_detect(struct qcam_device *qcam)
}
}
/* Reset the camera and try again */
parport_write_control(qcam->pport, 0xc);
parport_write_control(qcam->pport, 0x8);
mdelay(1);
parport_write_control(qcam->pport, 0xc);
mdelay(1);
count = 0;
ostat = stat = parport_read_status(qcam->pport);
for (i=0; i<250; i++)
{
mdelay(1);
stat = parport_read_status(qcam->pport);
if (ostat != stat)
{
if (++count >= 3) return 1;
ostat = stat;
}
}
/* no (or flatline) camera, give up */
return 0;
}
......@@ -627,7 +684,7 @@ static long qcam_read(struct video_device *v, char *buf, unsigned long count, i
/* video device template */
static struct video_device qcam_template=
{
"Colour Quickcam",
"Colour QuickCam",
VID_TYPE_CAPTURE,
VID_HARDWARE_QCAM_C,
qcam_open,
......@@ -681,7 +738,6 @@ static struct qcam_device *qcam_init(struct parport *port)
return q;
}
#define MAX_CAMS 4
static struct qcam_device *qcams[MAX_CAMS];
static unsigned int num_cams = 0;
......@@ -689,6 +745,19 @@ int init_cqcam(struct parport *port)
{
struct qcam_device *qcam;
if (parport[0] != -1)
{
/* The user gave specific instructions */
int i, found = 0;
for (i = 0; i < MAX_CAMS && parport[i] != -1; i++)
{
if (parport[0] == port->number)
found = 1;
}
if (!found)
return -ENODEV;
}
if (num_cams == MAX_CAMS)
return -ENOSPC;
......@@ -700,7 +769,7 @@ int init_cqcam(struct parport *port)
qc_reset(qcam);
if (qc_detect(qcam)==0)
if (probe && qc_detect(qcam)==0)
{
parport_release(qcam->pdev);
parport_unregister_device(qcam->pdev);
......@@ -712,16 +781,18 @@ int init_cqcam(struct parport *port)
parport_release(qcam->pdev);
printk(KERN_INFO "Colour Quickcam found on %s\n",
qcam->pport->name);
if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER)==-1)
{
printk(KERN_ERR "Unable to register Colour QuickCam on %s\n",
qcam->pport->name);
parport_unregister_device(qcam->pdev);
kfree(qcam);
return -ENODEV;
}
printk(KERN_INFO "video%d: Colour QuickCam found on %s\n",
qcam->vdev.minor, qcam->pport->name);
qcams[num_cams++] = qcam;
return 0;
......@@ -734,8 +805,6 @@ void close_cqcam(struct qcam_device *qcam)
kfree(qcam);
}
#define BANNER "Connectix Colour Quickcam driver v0.03"
static void cq_attach(struct parport *port)
{
init_cqcam(port);
......@@ -756,11 +825,16 @@ static struct parport_driver cqcam_driver = {
static int __init cqcam_init (void)
{
printk(BANNER "\n");
return parport_register_driver(&cqcam_driver);
}
MODULE_AUTHOR("Philip Blundell <philb@gnu.org>");
MODULE_DESCRIPTION(BANNER);
MODULE_PARM_DESC(parport ,"parport=<auto|n[,n]...> for port detection method \n\
probe=<0|1|2> # for camera detection method");
MODULE_PARM(parport, "1-" __MODULE_STRING(MAX_CAMS) "i");
MODULE_PARM(probe, "i");
static void __exit cqcam_cleanup (void)
{
......
......@@ -84,7 +84,7 @@ static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp,
written+=sz;
}
#endif
if (copy_from_user(p, buf, count))
if (copy_from_user(p, buf, count))
return -EFAULT;
written += count;
*ppos += written;
......@@ -634,12 +634,12 @@ int __init chr_dev_init(void)
misc_init();
#ifdef CONFIG_SOUND
soundcore_init();
#ifdef CONFIG_SOUND_OSS
#ifdef CONFIG_SOUND_OSS
soundcard_init();
#endif
#endif
#ifdef CONFIG_DMASOUND
dmasound_init();
#endif
#endif
#endif
#ifdef CONFIG_SPARCAUDIO
sparcaudio_init();
......
......@@ -49,7 +49,7 @@ static int
vcs_size(struct inode *inode)
{
int size;
int currcons = MINOR(inode->i_rdev) & 127;
int currcons = MINOR(inode->i_rdev) & 127;
if (currcons == 0)
currcons = fg_console;
else
......
......@@ -203,7 +203,7 @@ do_kdsk_ioctl(int cmd, struct kbentry *user_kbe, int perm, struct kbd_struct *kb
if (!(key_map = key_maps[s])) {
int j;
if (keymap_count >= MAX_NR_OF_USER_KEYMAPS &&
if (keymap_count >= MAX_NR_OF_USER_KEYMAPS &&
!capable(CAP_SYS_RESOURCE))
return -EPERM;
......
......@@ -5,6 +5,7 @@
source drivers/net/arcnet/Config.in
tristate 'Dummy net driver support' CONFIG_DUMMY
tristate 'Bonding driver support' CONFIG_BONDING
tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
if [ "$CONFIG_NETLINK" = "y" ]; then
......
......@@ -228,6 +228,7 @@ obj-$(CONFIG_STRIP) += strip.o
obj-$(CONFIG_DE650) += de650.o 8390.o
obj-$(CONFIG_3C589) += 3c589.o
obj-$(CONFIG_DUMMY) += dummy.o
obj-$(CONFIG_BONDING) += bonding.o
obj-$(CONFIG_DE600) += de600.o
obj-$(CONFIG_DE620) += de620.o
obj-$(CONFIG_AT1500) += lance.o
......
......@@ -685,6 +685,15 @@ static struct net_device tr0_dev = {
struct net_device *dev_base = NEXT_DEV;
/*
* The loopback device is global so it can be directly referenced
* by the network code. Also, it must be first on device list.
*/
extern int loopback_init(struct net_device *dev);
struct net_device loopback_dev =
{"lo", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, loopback_init};
struct net_device *dev_base = &loopback_dev;
rwlock_t dev_base_lock = RW_LOCK_UNLOCKED;
/*
* originally based on the dummy device.
*
* Copyright 1999, Thomas Davis, tadavis@lbl.gov.
* Licensed under the GPL. Based on dummy.c, and eql.c devices.
*
* bond.c: a bonding/etherchannel/sun trunking net driver
*
* This is useful to talk to a Cisco 5500, running Etherchannel, aka:
* Linux Channel Bonding
* Sun Trunking (Solaris)
*
* How it works:
* ifconfig bond0 ipaddress netmask up
* will setup a network device, with an ip address. No mac address
* will be assigned at this time. The hw mac address will come from
* the first slave bonded to the channel. All slaves will then use
* this hw mac address.
*
* ifconfig bond0 down
* will release all slaves, marking them as down.
*
* ifenslave bond0 eth0
* will attache eth0 to bond0 as a slave. eth0 hw mac address will either
* a: be used as initial mac address
* b: if a hw mac address already is there, eth0's hw mac address
* will then be set from bond0.
*
* v0.1 - first working version.
* v0.2 - changed stats to be calculated by summing slaves stats.
*
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/malloc.h>
#include <linux/string.h>
#include <linux/init.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/uaccess.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_bonding.h>
typedef struct slave
{
struct slave *next;
struct slave *prev;
struct net_device *dev;
} slave_t;
typedef struct bonding
{
slave_t *next;
slave_t *prev;
struct net_device *master;
slave_t *current_slave;
struct net_device_stats stats;
} bonding_t;
static int bond_xmit(struct sk_buff *skb, struct net_device *dev);
static struct net_device_stats *bond_get_stats(struct net_device *dev);
static struct net_device *this_bond;
static int bond_open(struct net_device *dev)
{
MOD_INC_USE_COUNT;
return 0;
}
static int bond_close(struct net_device *master)
{
bonding_t *bond = master->priv;
slave_t *slave;
while ((slave = bond->next) != (slave_t*)bond) {
spin_lock_bh(&master->xmit_lock);
slave->next->prev = slave->prev;
slave->prev->next = slave->next;
bond->current_slave = (slave_t*)bond;
spin_unlock_bh(&master->xmit_lock);
netdev_set_master(slave->dev, NULL);
kfree(slave);
}
MOD_DEC_USE_COUNT;
return 0;
}
/* Fake multicast ability.
NB. It is possible and necessary to make it true one, otherwise
the device is not functional.
*/
static void bond_set_multicast_list(struct net_device *dev)
{
}
static int bond_enslave(struct net_device *master, struct net_device *dev)
{
int err;
bonding_t *bond = master->priv;
slave_t *slave;
if (dev->type != master->type)
return -ENODEV;
if ((slave = kmalloc(sizeof(slave_t), GFP_KERNEL)) == NULL)
return -ENOMEM;
memset(slave, 0, sizeof(slave_t));
err = netdev_set_master(dev, master);
if (err) {
kfree(slave);
return err;
}
slave->dev = dev;
spin_lock_bh(&master->xmit_lock);
dev_hold(dev);
slave->prev = bond->prev;
slave->next = (slave_t*)bond;
slave->prev->next = slave;
slave->next->prev = slave;
spin_unlock_bh(&master->xmit_lock);
MOD_INC_USE_COUNT;
return 0;
}
static int bond_release(struct net_device *master, struct net_device *dev)
{
bonding_t *bond = master->priv;
slave_t *slave;
if (dev->master != master)
return -EINVAL;
netdev_set_master(dev, NULL);
for (slave = bond->next; slave != (slave_t*)bond; slave = slave->next) {
if (slave->dev == dev) {
spin_lock_bh(&master->xmit_lock);
if (bond->current_slave == slave)
bond->current_slave = slave->next;
slave->next->prev = slave->prev;
slave->prev->next = slave->next;
spin_unlock_bh(&master->xmit_lock);
kfree(slave);
dev_put(dev);
MOD_DEC_USE_COUNT;
break;
}
}
return 0;
}
/* It is pretty silly, SIOCSIFHWADDR exists to make this. */
static int bond_sethwaddr(struct net_device *master, struct net_device *slave)
{
memcpy(master->dev_addr, slave->dev_addr, slave->addr_len);
return 0;
}
static int bond_ioctl(struct net_device *master, struct ifreq *ifr, int cmd)
{
struct net_device *slave = __dev_get_by_name(ifr->ifr_slave);
if (slave == NULL)
return -ENODEV;
switch (cmd) {
case BOND_ENSLAVE:
return bond_enslave(master, slave);
case BOND_RELEASE:
return bond_release(master, slave);
case BOND_SETHWADDR:
return bond_sethwaddr(master, slave);
default:
return -EOPNOTSUPP;
}
}
static int bond_event(struct notifier_block *this, unsigned long event, void *ptr)
{
struct net_device *slave = ptr;
if (this_bond == NULL ||
this_bond == slave ||
this_bond != slave->master)
return NOTIFY_DONE;
switch (event) {
case NETDEV_UNREGISTER:
bond_release(this_bond, slave);
break;
}
return NOTIFY_DONE;
}
struct notifier_block bond_netdev_notifier={
bond_event,
NULL,
0
};
int __init bond_init(struct net_device *dev)
{
bonding_t *bond;
bond = kmalloc(sizeof(struct bonding), GFP_KERNEL);
if (bond == NULL)
return -ENOMEM;
memset(bond, 0, sizeof(struct bonding));
bond->next = (slave_t*)bond;
bond->prev = (slave_t*)bond;
bond->master = dev;
bond->current_slave = (slave_t*)bond;
dev->priv = bond;
/* Initialize the device structure. */
dev->hard_start_xmit = bond_xmit;
dev->get_stats = bond_get_stats;
dev->open = bond_open;
dev->stop = bond_close;
dev->set_multicast_list = bond_set_multicast_list;
dev->do_ioctl = bond_ioctl;
/* Fill in the fields of the device structure with ethernet-generic
values. */
ether_setup(dev);
dev->tx_queue_len = 0;
dev->flags |= IFF_MASTER;
this_bond = dev;
register_netdevice_notifier(&bond_netdev_notifier);
return 0;
}
static int bond_xmit(struct sk_buff *skb, struct net_device *dev)
{
bonding_t *bond = dev->priv;
slave_t *slave, *start_at;
int pkt_len = skb->len;
slave = start_at = bond->current_slave;
do {
if (slave == (slave_t*)bond)
continue;
if (netif_running(slave->dev) && netif_carrier_ok(dev)) {
bond->current_slave = slave->next;
skb->dev = slave->dev;
if (dev_queue_xmit(skb)) {
bond->stats.tx_dropped++;
} else {
bond->stats.tx_packets++;
bond->stats.tx_bytes += pkt_len;
}
return 0;
}
} while ((slave = slave->next) != start_at);
bond->stats.tx_dropped++;
kfree_skb(skb);
return 0;
}
static struct net_device_stats *bond_get_stats(struct net_device *dev)
{
bonding_t *bond = dev->priv;
return &bond->stats;
}
#ifdef MODULE
static char bond_name[16];
static struct net_device dev_bond = {
bond_name, /* Needs to be writeable */
0, 0, 0, 0,
0x0, 0,
0, 0, 0, NULL, bond_init };
int init_module(void)
{
/* Find a name for this unit */
int err=dev_alloc_name(&dev_bond,"bond%d");
if (err<0)
return err;
if (register_netdev(&dev_bond) != 0)
return -EIO;
return 0;
}
void cleanup_module(void)
{
unregister_netdevice_notifier(&bond_netdev_notifier);
unregister_netdev(&dev_bond);
kfree(dev_bond.priv);
}
#endif /* MODULE */
/*
* Local variables:
* c-indent-level: 8
* c-basic-offset: 8
* tab-width: 8
* End:
*/
......@@ -185,27 +185,6 @@ static void __init appletalk_device_init(void)
#endif /* CONFIG_IPDDP */
}
/*
* The loopback device is global so it can be directly referenced
* by the network code.
*/
extern int loopback_init(struct net_device *dev);
struct net_device loopback_dev =
{
"lo" __PAD2, /* Software Loopback interface */
0x0, /* recv memory end */
0x0, /* recv memory start */
0x0, /* memory end */
0x0, /* memory start */
0, /* base I/O address */
0, /* IRQ */
0, 0, 0, /* flags */
NULL, /* next device */
loopback_init /* loopback_init should set up the rest */
};
static void special_device_init(void)
{
#ifdef CONFIG_DUMMY
......@@ -248,12 +227,20 @@ static void special_device_init(void)
extern int sb1000_probe(struct net_device *dev);
static struct net_device sb1000_dev =
{
"cm0", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL, sb1000_probe
"cm0 __PAD3", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL, sb1000_probe
};
register_netdev(&sb1000_dev);
}
#endif
register_netdev(&loopback_dev);
#ifdef CONFIG_BONDING
{
extern int bond_init(struct net_device *dev);
static struct net_device bond_dev = {
"bond" __PAD4, 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL, bond_init,
};
register_netdev(&bond_dev);
}
#endif
}
/*
......
/* $Id: sunlance.c,v 1.99 2000/02/16 10:36:14 davem Exp $
/* $Id: sunlance.c,v 1.100 2000/02/27 09:38:12 anton Exp $
* lance.c: Linux/Sparc/Lance driver
*
* Written 1995, 1996 by Miguel de Icaza
......@@ -1287,8 +1287,10 @@ static void lance_set_multicast(struct net_device *dev)
static void lance_set_multicast_retry(unsigned long _opaque)
{
struct net_device *dev = (struct net_device *) _opaque;
struct lance_private *lp = (struct lance_private *) dev->priv;
lance_set_multicast(dev);
timer_exit(&lp->multicast_timer);
}
static void lance_free_hwresources(struct lance_private *lp)
......
......@@ -1991,6 +1991,7 @@ static int __init parport_pc_init_pci (int irq, int dma)
}
}
#ifdef CONFIG_PCI
/* Look for parallel controllers that we don't know about. */
pci_for_each_dev(pcidev) {
const int class_noprogif = pcidev->class & ~0xff;
......@@ -2011,6 +2012,7 @@ static int __init parport_pc_init_pci (int irq, int dma)
"tim@cyberelk.demon.co.uk\n",
pcidev->vendor, pcidev->device);
}
#endif
return count;
}
......
......@@ -108,6 +108,7 @@ static struct dev_info device_list[] =
{"YAMAHA", "CDR100", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */
{"YAMAHA", "CDR102", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0
* extra reset */
{"MITSUMI", "CD-R CR-2201CS", "6119", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */
{"RELISYS", "Scorpio", "*", BLIST_NOLUN}, /* responds to all LUN */
{"MICROTEK", "ScanMaker II", "5.61", BLIST_NOLUN}, /* responds to all LUN */
......
......@@ -105,10 +105,12 @@ if [ "$CONFIG_FB" = "y" ]; then
bool ' Millennium I/II support' CONFIG_FB_MATROX_MILLENIUM
bool ' Mystique support' CONFIG_FB_MATROX_MYSTIQUE
bool ' G100/G200/G400 support' CONFIG_FB_MATROX_G100
dep_tristate ' Matrox I2C support' CONFIG_FB_MATROX_I2C $CONFIG_FB_MATROX $CONFIG_I2C_ALGOBIT
if [ "$CONFIG_FB_MATROX_G100" = "y" ]; then
dep_tristate ' G400 second head support' CONFIG_FB_MATROX_MAVEN $CONFIG_FB_MATROX_I2C
fi
if [ "$CONFIG_I2C" != "n" ]; then
dep_tristate ' Matrox I2C support' CONFIG_FB_MATROX_I2C $CONFIG_FB_MATROX $CONFIG_I2C_ALGOBIT
if [ "$CONFIG_FB_MATROX_G100" = "y" ]; then
dep_tristate ' G400 second head support' CONFIG_FB_MATROX_MAVEN $CONFIG_FB_MATROX_I2C
fi
fi
bool ' Multihead support' CONFIG_FB_MATROX_MULTIHEAD
fi
tristate ' ATI Mach64 display support (EXPERIMENTAL)' CONFIG_FB_ATY
......
......@@ -16,11 +16,12 @@ M_OBJS :=
# All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := fbmem.o fbcmap.o fbcon.o fbcon-afb.o fbcon-ilbm.o fbcon-vga.o \
fbcon-iplan2p2.o fbcon-iplan2p4.o fbcon-iplan2p8.o fbcon-vga-planes.o \
fbcon-cfb16.o fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o fbcon-cfb8.o \
fbcon-mac.o fbcon-mfb.o fbcon-vga8-planes.o \
matrox/matroxfb.o
export-objs := fbmem.o fbcmap.o fbcon.o fbcon-afb.o fbcon-ilbm.o \
fbcon-vga.o fbcon-iplan2p2.o fbcon-iplan2p4.o \
fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
fbcon-cfb8.o fbcon-mac.o fbcon-mfb.o fbcon-vga8-planes.o \
matrox/matroxfb.o cyber2000fb.o
# Object file lists.
obj-y :=
......
/*
* linux/drivers/video/cyber2000fb.c
*
* Copyright (C) 1998-2000 Russell King
*
* Integraphics Cyber2000 frame buffer device
*
* Based on cyberfb.c
......
......@@ -273,10 +273,10 @@ affs_create(struct inode *dir, struct dentry *dentry, int mode)
goto out;
pr_debug("AFFS: ino=%lu\n",inode->i_ino);
if (dir->i_sb->u.affs_sb.s_flags & SF_OFS)
if (dir->i_sb->u.affs_sb.s_flags & SF_OFS) {
inode->i_op = &affs_file_inode_operations;
inode->i_fop = &affs_file_operations_ofs;
else {
} else {
inode->i_op = &affs_file_inode_operations;
inode->i_fop = &affs_file_operations;
inode->i_mapping->a_ops = &affs_aops;
......
......@@ -630,7 +630,7 @@ int blkdev_put(struct block_device *bdev, int kind)
/* syncing will go here */
if (kind == BDEV_FILE || kind == BDEV_FS)
fsync_dev(rdev);
if (atomic_dec_and_test(&bdev->bd_openers)) {
if (atomic_dec_and_test(&bdev->bd_openers) && MAJOR(rdev) != RAMDISK_MAJOR) {
/* invalidating buffers will go here */
invalidate_buffers(rdev);
}
......
......@@ -692,7 +692,7 @@ static void ntfs_read_inode(struct inode* inode)
inode->u.ntfs_i.mmu_private = inode->i_size;
} else {
inode->i_op=&ntfs_inode_operations_nobmap;
inode->i_fop=&ntfs_file_operations_nommap,
inode->i_fop=&ntfs_file_operations_nommap;
}
inode->i_mode=S_IFREG|S_IRUGO;
}
......
/* $Id: inode.c,v 1.5 2000/02/10 21:16:06 davem Exp $
/* $Id: inode.c,v 1.6 2000/02/27 08:19:47 davem Exp $
* openpromfs.c: /proc/openprom handling routines
*
* Copyright (C) 1996-1999 Jakub Jelinek (jakub@redhat.com)
......
......@@ -46,7 +46,16 @@ extern unsigned long __irq_attempt[];
extern int global_irq_holder;
extern spinlock_t global_irq_lock;
extern atomic_t global_irq_count;
static inline int irqs_running (void)
{
int i;
for (i = 0; i < smp_num_cpus; i++)
if (local_irq_count(i))
return 1;
return 0;
}
static inline void release_irqlock(int cpu)
{
......@@ -60,7 +69,6 @@ static inline void release_irqlock(int cpu)
static inline void irq_enter(int cpu, int irq)
{
++local_irq_count(cpu);
atomic_inc(&global_irq_count);
while (spin_is_locked(&global_irq_lock))
barrier();
......@@ -68,7 +76,6 @@ static inline void irq_enter(int cpu, int irq)
static inline void irq_exit(int cpu, int irq)
{
atomic_dec(&global_irq_count);
--local_irq_count(cpu);
}
......
/* This exists merely to satisfy <linux/irq.h>. There is
nothing that would go here of general interest.
#ifndef _ALPHA_HW_IRQ_H
#define _ALPHA_HW_IRQ_H
Everything of consequence is in arch/alpha/kernel/irq_impl.h,
to be used only in arch/alpha/kernel/. */
static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
#ifdef CONFIG_ALPHA_GENERIC
#define ACTUAL_NR_IRQS alpha_mv.nr_irqs
#else
#define ACTUAL_NR_IRQS NR_IRQS
#endif
#endif
......@@ -22,7 +22,6 @@ struct linux_hose_info;
struct pci_dev;
struct pci_ops;
struct pci_controler;
struct irqaction;
struct alpha_machine_vector
{
......@@ -82,7 +81,7 @@ struct alpha_machine_vector
void (*init_arch)(void);
void (*init_irq)(void);
void (*init_rtc)(struct irqaction *);
void (*init_rtc)(void);
void (*init_pci)(void);
void (*kill_arch)(int);
......
......@@ -306,4 +306,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
#define pgd_ERROR(e) \
printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
extern void paging_init(void);
#endif /* _ALPHA_PGTABLE_H */
......@@ -55,6 +55,8 @@ extern int __cpu_logical_map[NR_CPUS];
#define hard_smp_processor_id() __hard_smp_processor_id()
#define smp_processor_id() (current->processor)
extern unsigned long cpu_present_mask;
#endif /* __SMP__ */
#define NO_PROC_ID (-1)
......
......@@ -43,6 +43,8 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 19
#define SO_SECURITY_ENCRYPTION_TRANSPORT 20
......
......@@ -39,4 +39,6 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
#endif /* _ASM_SOCKET_H */
......@@ -7,17 +7,6 @@
#include <linux/config.h>
#define __ebsa285_data __attribute__((__section__(".data.ebsa285")))
#define __netwinder_data __attribute__((__section__(".data.netwinder")))
#ifdef CONFIG_TEXT_SECTIONS
#define __ebsa285_text __attribute__((__section__(".text.ebsa285")))
#define __netwinder_text __attribute__((__section__(".text.netwinder")))
#else
#define __ebsa285_text
#define __netwinder_text
#endif
/* information about the system we're running on */
extern unsigned int system_rev;
extern unsigned int system_serial_low;
......
......@@ -4,6 +4,22 @@
#include <linux/threads.h>
#include <linux/irq.h>
typedef struct {
unsigned int __local_irq_count;
unsigned int __local_bh_count;
atomic_t __nmi_counter;
unsigned int __pad[5];
} ____cacheline_aligned irq_cpustat_t;
extern irq_cpustat_t irq_stat [NR_CPUS];
/*
* Simple wrappers reducing source bloat
*/
#define local_irq_count(cpu) (irq_stat[(cpu)].__local_irq_count)
#define local_bh_count(cpu) (irq_stat[(cpu)].__local_bh_count)
#define nmi_counter(cpu) (irq_stat[(cpu)].__nmi_counter)
/*
* Are we in an interrupt context? Either doing bottom half
* or hardware interrupt processing?
......
......@@ -68,7 +68,6 @@ extern int irq_vector[NR_IRQS];
* Interrupt entry/exit code at both C and assembly level
*/
extern void no_action(int cpl, void *dev_id, struct pt_regs *regs);
extern void mask_irq(unsigned int irq);
extern void unmask_irq(unsigned int irq);
extern void disable_8259A_irq(unsigned int irq);
......
......@@ -39,4 +39,6 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
#endif /* _ASM_SOCKET_H */
......@@ -46,4 +46,6 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
#endif /* _ASM_IA64_SOCKET_H */
......@@ -39,4 +39,6 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
#endif /* _ASM_SOCKET_H */
......@@ -56,6 +56,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
/* Types of sockets. */
#define SOCK_DGRAM 1 /* Connectionless, unreliable datagrams
of fixed maximum length. */
......
......@@ -61,6 +61,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
/* Types of sockets. */
#define SOCK_DGRAM 1 /* Connectionless, unreliable datagrams
of fixed maximum length. */
......
......@@ -45,4 +45,6 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
#endif /* _ASM_SOCKET_H */
......@@ -39,4 +39,6 @@
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_PEERNAME 28
#endif /* __ASM_SH_SOCKET_H */
/* $Id: socket.h,v 1.12 1998/07/22 22:06:48 davem Exp $ */
/* $Id: socket.h,v 1.13 2000/02/27 19:47:43 davem Exp $ */
#ifndef _ASM_SOCKET_H
#define _ASM_SOCKET_H
......@@ -40,6 +40,8 @@
#define SO_ATTACH_FILTER 0x001a
#define SO_DETACH_FILTER 0x001b
#define SO_PEERNAME 0x001c
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 0x5001
#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
......
......@@ -12,7 +12,12 @@
#include <asm/psr.h>
/* Define this to use the verbose/debugging versions in arch/sparc/lib/debuglocks.c */
/*
* Define this to use the verbose/debugging versions in
* arch/sparc/lib/debuglocks.c
*
* Be sure to make check_asm whenever changing this option.
*/
#define SPIN_LOCK_DEBUG
#ifdef SPIN_LOCK_DEBUG
......@@ -82,9 +87,13 @@ do { unsigned long flags; \
typedef unsigned char spinlock_t;
#define SPIN_LOCK_UNLOCKED 0
#define spin_lock_init(lock) (*(lock) = 0)
#define spin_lock_init(lock) (*((unsigned char *)(lock)) = 0)
#define spin_is_locked(lock) (*((volatile unsigned char *)(lock)) != 0)
#define spin_unlock_wait(lock) do { barrier(); } while(*(volatile unsigned char *)lock)
#define spin_unlock_wait(lock) \
do { \
barrier(); \
} while(*((volatile unsigned char *)lock))
extern __inline__ void spin_lock(spinlock_t *lock)
{
......@@ -93,7 +102,7 @@ extern __inline__ void spin_lock(spinlock_t *lock)
orcc %%g2, 0x0, %%g0
bne,a 2f
ldub [%0], %%g2
.text 2
.subsection 2
2: orcc %%g2, 0x0, %%g0
bne,a 2b
ldub [%0], %%g2
......@@ -159,7 +168,7 @@ extern __inline__ void _read_lock(rwlock_t *rw)
ldstub [%%g1 + 3], %%g2
" : /* no outputs */
: "r" (lp)
: "g2", "g4", "g7", "memory", "cc");
: "g2", "g4", "memory", "cc");
}
#define read_lock(lock) \
......@@ -179,7 +188,7 @@ extern __inline__ void _read_unlock(rwlock_t *rw)
ldstub [%%g1 + 3], %%g2
" : /* no outputs */
: "r" (lp)
: "g2", "g4", "g7", "memory", "cc");
: "g2", "g4", "memory", "cc");
}
#define read_unlock(lock) \
......@@ -199,7 +208,7 @@ extern __inline__ void write_lock(rwlock_t *rw)
ldstub [%%g1 + 3], %%g2
" : /* no outputs */
: "r" (lp)
: "g2", "g4", "g7", "memory", "cc");
: "g2", "g4", "memory", "cc");
}
#define write_unlock(rw) do { (rw)->lock = 0; } while(0)
......
/* $Id: socket.h,v 1.5 1998/07/22 22:06:49 davem Exp $ */
/* $Id: socket.h,v 1.6 2000/02/27 19:47:58 davem Exp $ */
#ifndef _ASM_SOCKET_H
#define _ASM_SOCKET_H
......@@ -40,6 +40,8 @@
#define SO_ATTACH_FILTER 0x001a
#define SO_DETACH_FILTER 0x001b
#define SO_PEERNAME 0x001c
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 0x5001
#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
......
......@@ -104,6 +104,7 @@ extern void affs_dir_truncate(struct inode *);
extern struct inode_operations affs_file_inode_operations;
extern struct inode_operations affs_dir_inode_operations;
extern struct inode_operations affs_symlink_inode_operations;
extern struct file_operations affs_file_operations;
extern struct file_operations affs_file_operations_ofs;
extern struct file_operations affs_dir_operations;
......
#ifndef __LINUX_BRLOCK_H
#define __LINUX_BRLOCK_H
/*
* 'Big Reader' read-write spinlocks.
*
* super-fast read/write locks, with write-side penalty. The point
* is to have a per-CPU read/write lock. Readers lock their CPU-local
* readlock, writers must lock all locks to get write access. These
* CPU-read-write locks are semantically identical to normal rwlocks.
* Memory usage is higher as well. (NR_CPUS*L1_CACHE_BYTES bytes)
*
* The most important feature is that these spinlocks do not cause
* cacheline ping-pong in the 'most readonly data' case.
*
* Copyright 2000, Ingo Molnar <mingo@redhat.com>
*
* Registry idea and naming [ crutial! :-) ] by:
*
* David S. Miller <davem@redhat.com>
*
* David has an implementation that doesnt use atomic operations in
* the read branch via memory ordering tricks - i guess we need to
* split this up into a per-arch thing? The atomicity issue is a
* secondary item in profiles, at least on x86 platforms.
*
* The atomic op version overhead is indeed a big deal on
* load-locked/store-conditional cpus (ALPHA/MIPS/PPC) and
* compare-and-swap cpus (Sparc64). So we control which
* implementation to use with a __BRLOCK_USE_ATOMICS define. -DaveM
*/
/* Register bigreader lock indices here. */
enum brlock_indices {
BR_GLOBALIRQ_LOCK,
BR_NETPROTO_LOCK,
__BR_END
};
#include <linux/config.h>
#ifdef CONFIG_SMP
#include <linux/cache.h>
#include <linux/spinlock.h>
#if defined(__i386__)
#define __BRLOCK_USE_ATOMICS
#else
#undef __BRLOCK_USE_ATOMICS
#endif
#ifdef __BRLOCK_USE_ATOMICS
typedef rwlock_t brlock_read_lock_t;
#else
typedef unsigned int brlock_read_lock_t;
#endif
/*
* align last allocated index to the next cacheline:
*/
#define __BR_IDX_MAX \
(((sizeof(brlock_read_lock_t)*__BR_END + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) / sizeof(brlock_read_lock_t))
extern brlock_read_lock_t __brlock_array[NR_CPUS][__BR_IDX_MAX];
#ifndef __BRLOCK_USE_ATOMICS
struct br_wrlock {
spinlock_t lock;
} __attribute__ ((__aligned__(SMP_CACHE_BYTES)));
extern struct br_wrlock __br_write_locks[__BR_IDX_MAX];
#endif
extern void __br_lock_usage_bug (void);
#ifdef __BRLOCK_USE_ATOMICS
extern inline void br_read_lock (enum brlock_indices idx)
{
/*
* This causes a link-time bug message if an
* invalid index is used:
*/
if (idx >= __BR_END)
__br_lock_usage_bug();
read_lock(&__brlock_array[smp_processor_id()][idx]);
}
extern inline void br_read_unlock (enum brlock_indices idx)
{
if (idx >= __BR_END)
__br_lock_usage_bug();
read_unlock(&__brlock_array[smp_processor_id()][idx]);
}
#else /* ! __BRLOCK_USE_ATOMICS */
extern inline void br_read_lock (enum brlock_indices idx)
{
unsigned int *ctr;
spinlock_t *lock;
/*
* This causes a link-time bug message if an
* invalid index is used:
*/
if (idx >= __BR_END)
__br_lock_usage_bug();
ctr = &__brlock_array[smp_processor_id()][idx];
lock = &__br_write_locks[idx].lock;
again:
(*ctr)++;
rmb();
if (spin_is_locked(lock)) {
(*ctr)--;
rmb();
while (spin_is_locked(lock))
barrier();
goto again;
}
}
extern inline void br_read_unlock (enum brlock_indices idx)
{
unsigned int *ctr;
if (idx >= __BR_END)
__br_lock_usage_bug();
ctr = &__brlock_array[smp_processor_id()][idx];
wmb();
(*ctr)--;
}
#endif /* __BRLOCK_USE_ATOMICS */
/* write path not inlined - it's rare and larger */
extern void FASTCALL(__br_write_lock (enum brlock_indices idx));
extern void FASTCALL(__br_write_unlock (enum brlock_indices idx));
extern inline void br_write_lock (enum brlock_indices idx)
{
if (idx >= __BR_END)
__br_lock_usage_bug();
__br_write_lock(idx);
}
extern inline void br_write_unlock (enum brlock_indices idx)
{
if (idx >= __BR_END)
__br_lock_usage_bug();
__br_write_unlock(idx);
}
#else
# define br_read_lock(idx) ((void)(idx))
# define br_read_unlock(idx) ((void)(idx))
# define br_write_lock(idx) ((void)(idx))
# define br_write_unlock(idx) ((void)(idx))
#endif
/*
* Now enumerate all of the possible sw/hw IRQ protected
* versions of the interfaces.
*/
#define br_read_lock_irqsave(idx, flags) \
do { local_irq_save(flags); br_read_lock(idx); } while (0)
#define br_read_lock_irq(idx) \
do { local_irq_disable(); br_read_lock(idx); } while (0)
#define br_read_lock_bh(idx) \
do { local_bh_disable(); br_read_lock(idx); } while (0)
#define br_write_lock_irqsave(idx, flags) \
do { local_irq_save(flags); br_write_lock(idx); } while (0)
#define br_write_lock_irq(idx) \
do { local_irq_disable(); br_write_lock(idx); } while (0)
#define br_write_lock_bh(idx) \
do { local_bh_disable(); br_write_lock(idx); } while (0)
#define br_read_unlock_irqrestore(idx, flags) \
do { br_read_unlock(irx); local_irq_restore(flags); } while (0)
#define br_read_unlock_irq(idx) \
do { br_read_unlock(idx); local_irq_enable(); } while (0)
#define br_read_unlock_bh(idx) \
do { br_read_unlock(idx); local_bh_enable(); } while (0)
#define br_write_unlock_irqrestore(idx, flags) \
do { br_write_unlock(irx); local_irq_restore(flags); } while (0)
#define br_write_unlock_irq(idx) \
do { br_write_unlock(idx); local_irq_enable(); } while (0)
#define br_write_unlock_bh(idx) \
do { br_write_unlock(idx); local_bh_enable(); } while (0)
#endif /* __LINUX_BRLOCK_H */
/*
* Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
*
*
* Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
* NCM: Network and Communications Management, Inc.
*
* BUT, I'm the one who modified it for ethernet, so:
* (c) Copyright 1999, Thomas Davis, tadavis@lbl.gov
*
* This software may be used and distributed according to the terms
* of the GNU Public License, incorporated herein by reference.
*
*/
#ifndef _LINUX_IF_BONDING_H
#define _LINUX_IF_BONDING_H
#define BOND_ENSLAVE (SIOCDEVPRIVATE)
#define BOND_RELEASE (SIOCDEVPRIVATE + 1)
#define BOND_SETHWADDR (SIOCDEVPRIVATE + 2)
#endif /* _LINUX_BOND_H */
/*
* Local variables:
* version-control: t
* kept-new-versions: 5
* c-indent-level: 8
* c-basic-offset: 8
* tab-width: 8
* End:
*/
......@@ -56,9 +56,9 @@ struct sockaddr_in6 {
__u16 sin6_port; /* Transport layer port # */
__u32 sin6_flowinfo; /* IPv6 flow information */
struct in6_addr sin6_addr; /* IPv6 address */
__u32 sin6_scope_id; /* scope id (new in RFC2553) */
};
struct ipv6_mreq {
/* IPv6 multicast address of group */
struct in6_addr ipv6mr_multiaddr;
......@@ -157,18 +157,6 @@ struct in6_flowlabel_req
#define IPV6_AUTHHDR 10
#define IPV6_FLOWINFO 11
#if 0
/* Aliases for obsolete names */
#define IPV6_RXHOPOPTS IPV6_HOPOPTS
#define IPV6_RXDSTOPTS IPV6_DSTOPTS
#define IPV6_RXSRCRT IPV6_RTHDR
#endif
/*
* Alternative names
*/
#define SCM_SRCRT IPV6_RXSRCRT
#define IPV6_UNICAST_HOPS 16
#define IPV6_MULTICAST_IF 17
#define IPV6_MULTICAST_HOPS 18
......
......@@ -26,7 +26,7 @@ struct hw_interrupt_type {
void (*disable)(unsigned int irq);
void (*ack)(unsigned int irq);
void (*end)(unsigned int irq);
void (*set_affinity)(unsigned int irq, unsigned int mask);
void (*set_affinity)(unsigned int irq, unsigned long mask);
};
typedef struct hw_interrupt_type hw_irq_controller;
......@@ -44,34 +44,19 @@ typedef struct {
struct irqaction *action; /* IRQ action list */
unsigned int depth; /* nested irq disables */
spinlock_t lock;
unsigned int __pad[3];
} ____cacheline_aligned irq_desc_t;
extern irq_desc_t irq_desc [NR_IRQS];
typedef struct {
unsigned int __local_irq_count;
unsigned int __local_bh_count;
atomic_t __nmi_counter;
unsigned int __pad[5];
} ____cacheline_aligned irq_cpustat_t;
extern irq_cpustat_t irq_stat [NR_CPUS];
/*
* Simple wrappers reducing source bloat
*/
#define local_irq_count(cpu) (irq_stat[(cpu)].__local_irq_count)
#define local_bh_count(cpu) (irq_stat[(cpu)].__local_bh_count)
#define nmi_counter(cpu) (irq_stat[(cpu)].__nmi_counter)
#include <asm/hw_irq.h> /* the arch dependent stuff */
extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
extern spinlock_t irq_controller_lock;
extern int setup_irq(unsigned int , struct irqaction * );
extern hw_irq_controller no_irq_type; /* needed in every arch ? */
extern void no_action(int cpl, void *dev_id, struct pt_regs *regs);
extern volatile unsigned long irq_err_count;
#endif /* __asm_h */
......@@ -184,7 +184,8 @@ enum netdev_state_t
__LINK_STATE_XOFF=0,
__LINK_STATE_START,
__LINK_STATE_PRESENT,
__LINK_STATE_SCHED
__LINK_STATE_SCHED,
__LINK_STATE_NOCARRIER
};
......@@ -287,6 +288,7 @@ struct net_device
void *ip_ptr; /* IPv4 specific data */
void *dn_ptr; /* DECnet specific data */
void *ip6_ptr; /* IPv6 specific data */
void *ec_ptr; /* Econet specific data */
struct Qdisc *qdisc;
struct Qdisc *qdisc_sleeping;
......@@ -533,6 +535,30 @@ extern __inline__ void dev_put(struct net_device *dev)
#define __dev_put(dev) atomic_dec(&(dev)->refcnt)
#define dev_hold(dev) atomic_inc(&(dev)->refcnt)
/* Carrier loss detection, dial on demand. The functions netif_carrier_on
* and _off may be called from IRQ context, but it is caller
* who is responsible for serialization of these calls.
*/
extern __inline__ int netif_carrier_ok(struct net_device *dev)
{
return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
}
extern void __netdev_watchdog_up(struct net_device *dev);
extern __inline__ void netif_carrier_on(struct net_device *dev)
{
clear_bit(__LINK_STATE_NOCARRIER, &dev->state);
if (netif_running(dev))
__netdev_watchdog_up(dev);
}
extern __inline__ void netif_carrier_off(struct net_device *dev)
{
set_bit(__LINK_STATE_NOCARRIER, &dev->state);
}
/* Hot-plugging. */
extern __inline__ int netif_device_present(struct net_device *dev)
{
......@@ -544,22 +570,15 @@ extern __inline__ void netif_device_detach(struct net_device *dev)
if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) &&
netif_running(dev)) {
netif_stop_queue(dev);
if (dev->tx_timeout &&
del_timer(&dev->watchdog_timer))
__dev_put(dev);
}
}
extern __inline__ void netif_device_attach(struct net_device *dev)
{
if (test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
netif_running(dev)) {
netif_wake_queue(dev);
if (dev->tx_timeout) {
dev->watchdog_timer.expires = jiffies + dev->watchdog_timeo;
add_timer(&dev->watchdog_timer);
dev_hold(dev);
}
__netdev_watchdog_up(dev);
}
}
......
#ifndef __LINUX_IP6_NETFILTER_H
#define __LINUX_IP6_NETFILTER_H
/* IPv6-specific defines for netfilter.
* (C)1998 Rusty Russell -- This code is GPL.
* (C)1999 David Jeffery
* this header was blatantly ripped from netfilter_ipv4.h
* it's amazing what adding a bunch of 6s can do =8^)
*/
#include <linux/config.h>
#include <linux/netfilter.h>
/* IP Cache bits. */
/* Src IP address. */
#define NFC_IP6_SRC 0x0001
/* Dest IP address. */
#define NFC_IP6_DST 0x0002
/* Input device. */
#define NFC_IP6_IF_IN 0x0004
/* Output device. */
#define NFC_IP6_IF_OUT 0x0008
/* TOS. */
#define NFC_IP6_TOS 0x0010
/* Protocol. */
#define NFC_IP6_PROTO 0x0020
/* IP options. */
#define NFC_IP6_OPTIONS 0x0040
/* Frag & flags. */
#define NFC_IP6_FRAG 0x0080
/* Per-protocol information: only matters if proto match. */
/* TCP flags. */
#define NFC_IP6_TCPFLAGS 0x0100
/* Source port. */
#define NFC_IP6_SRC_PT 0x0200
/* Dest port. */
#define NFC_IP6_DST_PT 0x0400
/* Something else about the proto */
#define NFC_IP6_PROTO_UNKNOWN 0x2000
/* IP6 Hooks */
/* After promisc drops, checksum checks. */
#define NF_IP6_PRE_ROUTING 0
/* If the packet is destined for this box. */
#define NF_IP6_LOCAL_IN 1
/* If the packet is destined for another interface. */
#define NF_IP6_FORWARD 2
/* Packets coming from a local process. */
#define NF_IP6_LOCAL_OUT 3
/* Packets about to hit the wire. */
#define NF_IP6_POST_ROUTING 4
#define NF_IP6_NUMHOOKS 5
#endif /*__LINUX_IP6_NETFILTER_H*/
......@@ -192,6 +192,16 @@ struct tc_red_qopt
unsigned char Wlog; /* log(W) */
unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
unsigned char Scell_log; /* cell size for idle damping */
unsigned char flags;
#define TC_RED_ECN 1
};
struct tc_red_xstats
{
__u32 early; /* Early drops */
__u32 pdrop; /* Drops due to queue limits */
__u32 other; /* Drops due to drop() calls */
__u32 marked; /* Marked packets */
};
/* GRED section */
......
......@@ -170,11 +170,9 @@ extern __inline__ int ip_send(struct sk_buff *skb)
extern __inline__
int ip_decrease_ttl(struct iphdr *iph)
{
u16 check = iph->check;
check = ntohs(check) + 0x0100;
if ((check & 0xFF00) == 0)
check++; /* carry overflow */
iph->check = htons(check);
u32 check = iph->check;
check += __constant_htons(0x0100);
iph->check = check + (check>>16);
return --iph->ttl;
}
......
......@@ -4,7 +4,7 @@
* Authors:
* Pedro Roque <roque@di.fc.ul.pt>
*
* $Id: ipv6.h,v 1.19 2000/01/09 02:19:26 davem Exp $
* $Id: ipv6.h,v 1.20 2000/02/27 19:51:38 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -20,6 +20,8 @@
#include <net/ndisc.h>
#include <net/flow.h>
#define SIN6_LEN_RFC2133 24
/*
* NextHeader field of IPv6 header
*/
......
......@@ -45,9 +45,6 @@ struct inet_protocol
const char *name;
};
extern rwlock_t inet_protocol_lock;
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
struct inet6_protocol
{
......@@ -65,7 +62,6 @@ struct inet6_protocol
const char *name;
};
extern rwlock_t inet6_protocol_lock;
#endif
extern struct inet_protocol *inet_protocol_base;
......
......@@ -894,7 +894,7 @@ extern __inline__ void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
* socket is looked up by one cpu and unhasing is made by another CPU.
* It is true for udp/raw, netlink (leak to receive and error queues), tcp
* (leak to backlog). Packet socket does all the processing inside
* ptype_lock, so that it has not this race condition. UNIX sockets
* BR_NETPROTO_LOCK, so that it has not this race condition. UNIX sockets
* use separate SMP lock, so that they are prone too.
*/
......
......@@ -43,6 +43,7 @@
#include <linux/mm.h>
#include <linux/capability.h>
#include <linux/highuid.h>
#include <linux/brlock.h>
#if defined(CONFIG_PROC_FS)
#include <linux/proc_fs.h>
......@@ -340,6 +341,14 @@ EXPORT_SYMBOL(timer_table);
#ifdef __SMP__
/* Various random spinlocks we want to export */
EXPORT_SYMBOL(tqueue_lock);
/* Big-Reader lock implementation */
EXPORT_SYMBOL(__brlock_array);
#ifndef __BRLOCK_USE_ATOMICS
EXPORT_SYMBOL(__br_write_locks);
#endif
EXPORT_SYMBOL(__br_write_lock);
EXPORT_SYMBOL(__br_write_unlock);
#endif
/* autoirq from drivers/net/auto_irq.c */
......
......@@ -7,6 +7,6 @@
#
L_TARGET := lib.a
L_OBJS := errno.o ctype.o string.o vsprintf.o
L_OBJS := errno.o ctype.o string.o vsprintf.o brlock.o
include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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