Commit 94261f38 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-acpi.bkbits.net/linux-acpi-release-2.6.2

into home.osdl.org:/home/torvalds/v2.5/linux
parents 86872310 ee66a461
......@@ -17,6 +17,14 @@ bz64wrap: helper script. Uncompressed input is piped to this script,
which compresses its input, and then outputs the uu-/base64-encoded
version of the compressed input.
cpcset: Copy changeset between unrelated repositories.
Attempts to preserve changeset user, user address, description, in
addition to the changeset (the patch) itself.
Typical usage:
cd my-updated-repo
bk changes # looking for a changeset...
cpcset 1.1511 . ../another-repo
csets-to-patches: Produces a delta of two BK repositories, in the form
of individual files, each containing a single cset as a GNU patch.
Output is several files, each with the filename "/tmp/rev-$REV.patch"
......@@ -33,6 +41,11 @@ Typical usage:
bk changes -L ~/repo/original-repo 2>&1 | \
perl cset-to-linus > summary.txt
gcapatch: Generates patch containing changes in local repository.
Typical usage:
cd my-updated-repo
gcapatch > foo.patch
unbz64wrap: Reverse an encoded, compressed data stream created by
bz64wrap into an uncompressed, typically text/plain output.
#!/bin/sh
#
# Purpose: Copy changeset patch and description from one
# repository to another, unrelated one.
#
# usage: cpcset [revision] [from-repository] [to-repository]
#
REV=$1
FROM=$2
TO=$3
TMPF=/tmp/cpcset.$$
rm -f $TMPF*
CWD_SAVE=`pwd`
cd $FROM
bk changes -r$REV | \
grep -v '^ChangeSet' | \
sed -e 's/^ //g' > $TMPF.log
USERHOST=`bk changes -r$REV | grep '^ChangeSet' | awk '{print $4}'`
export BK_USER=`echo $USERHOST | awk '-F@' '{print $1}'`
export BK_HOST=`echo $USERHOST | awk '-F@' '{print $2}'`
bk export -tpatch -hdu -r$REV > $TMPF.patch && \
cd $CWD_SAVE && \
cd $TO && \
bk import -tpatch -CFR -y"`cat $TMPF.log`" $TMPF.patch . && \
bk commit -y"`cat $TMPF.log`"
rm -f $TMPF*
echo changeset $REV copied.
echo ""
#!/bin/sh
#
# Purpose: Generate GNU diff of local changes versus canonical top-of-tree
#
# Usage: gcapatch > foo.patch
#
bk export -tpatch -hdu -r`bk repogca bk://linux.bkbits.net/linux-2.5`,+
......@@ -51,10 +51,10 @@ There may be more modes.
Drivers that support modedb boot options
Boot Name Cards Supported
ami - Amiga chipset frame buffer
amifb - Amiga chipset frame buffer
aty128fb - ATI Rage128 / Pro frame buffer
atyfb - ATI Mach64 frame buffer
tdfx - 3D Fx frame buffer
tdfxfb - 3D Fx frame buffer
tridentfb - Trident (Cyber)blade chipset frame buffer
BTW, only a few drivers use this at the moment. Others are to follow
......
......@@ -709,7 +709,8 @@ S: Maintained
DVB SUBSYSTEM AND DRIVERS
P: LinuxTV.org Project
L: linux-dvb@linuxtv.org
M: linux-dvb-maintainer@linuxtv.org
L: linux-dvb@linuxtv.org (subscription required)
W: http://linuxtv.org/developer/dvb.xml
S: Supported
......
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 2
EXTRAVERSION =-rc1
EXTRAVERSION =-rc2
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
......@@ -690,7 +690,7 @@ modules_install: _modinst_ _modinst_post
_modinst_:
@if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \
echo "Warning: you may need to install module-init-tools"; \
echo "See http://www.codemonkey.org.uk/post-halloween-2.5.txt";\
echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
sleep 1; \
fi
@rm -rf $(MODLIB)/kernel
......@@ -825,8 +825,15 @@ define all-sources
-name '*.[chS]' -print )
endef
quiet_cmd_cscope = MAKE $@
cmd_cscope = $(all-sources) | cscope -k -b -i -
quiet_cmd_cscope-file = FILELST cscope.files
cmd_cscope-file = $(all-sources) > cscope.files
quiet_cmd_cscope = MAKE cscope.out
cmd_cscope = cscope -k -b
cscope: FORCE
$(call cmd,cscope-file)
$(call cmd,cscope)
quiet_cmd_TAGS = MAKE $@
cmd_TAGS = $(all-sources) | etags -
......@@ -840,9 +847,6 @@ define cmd_tags
$(all-sources) | xargs ctags $$CTAGSF -a
endef
cscope: FORCE
$(call cmd,cscope)
TAGS: FORCE
$(call cmd,TAGS)
......
......@@ -399,7 +399,7 @@ config X86_USE_3DNOW
config X86_OOSTORE
bool
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6
depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
default y
config HPET_TIMER
......@@ -1261,11 +1261,6 @@ config FRAME_POINTER
If you don't debug the kernel, you can say N, but we may not be able
to solve problems without frame pointers.
config X86_EXTRA_IRQS
bool
depends on X86_LOCAL_APIC || X86_VOYAGER
default y
config X86_FIND_SMP_CONFIG
bool
depends on X86_LOCAL_APIC || X86_VOYAGER
......
......@@ -1101,7 +1101,6 @@ CONFIG_USB_HIDINPUT=y
# CONFIG_DEBUG_KERNEL is not set
CONFIG_DEBUG_SPINLOCK_SLEEP=y
CONFIG_FRAME_POINTER=y
CONFIG_X86_EXTRA_IRQS=y
CONFIG_X86_FIND_SMP_CONFIG=y
CONFIG_X86_MPPARSE=y
......
......@@ -844,6 +844,8 @@ static void apm_cpu_idle(void)
idle_percentage *= 100;
idle_percentage /= jiffies_since_last_check;
use_apm_idle = (idle_percentage > idle_threshold);
if (apm_info.forbid_idle)
use_apm_idle = 0;
last_jiffies = jiffies;
last_stime = current->stime;
}
......
......@@ -352,6 +352,14 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset)
static int __init mtrr_if_init(void)
{
struct cpuinfo_x86 *c = &boot_cpu_data;
if ((!cpu_has(c, X86_FEATURE_MTRR)) &&
(!cpu_has(c, X86_FEATURE_K6_MTRR)) &&
(!cpu_has(c, X86_FEATURE_CYRIX_ARR)) &&
(!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))
return -ENODEV;
proc_root_mtrr =
create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root);
if (proc_root_mtrr) {
......
......@@ -285,6 +285,30 @@ static __init int apm_is_horked(struct dmi_blacklist *d)
return 0;
}
static __init int apm_is_horked_d850md(struct dmi_blacklist *d)
{
if (apm_info.disabled == 0) {
apm_info.disabled = 1;
printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
printk(KERN_INFO "This bug is fixed in bios P15 which is available for \n");
printk(KERN_INFO "download from support.intel.com \n");
}
return 0;
}
/*
* Some APM bioses hang on APM idle calls
*/
static __init int apm_likes_to_melt(struct dmi_blacklist *d)
{
if (apm_info.forbid_idle == 0) {
apm_info.forbid_idle = 1;
printk(KERN_INFO "%s machine detected. Disabling APM idle calls.\n", d->ident);
}
return 0;
}
/*
* Some machines, usually laptops, can't handle an enabled local APIC.
* The symptoms include hangs or reboots when suspending or resuming,
......@@ -557,6 +581,22 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_PRODUCT_NAME, "Latitude C600"),
NO_MATCH, NO_MATCH
} },
{ set_apm_ints, "Dell Latitude", { /* Allow interrupts during suspend on Dell Latitude laptops*/
MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
MATCH(DMI_PRODUCT_NAME, "Latitude C510"),
NO_MATCH, NO_MATCH
} },
{ apm_is_horked, "Dell Inspiron 2500", { /* APM crashes */
MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
MATCH(DMI_BIOS_VERSION,"A11")
} },
{ set_apm_ints, "Dell Inspiron", { /* Allow interrupts during suspend on Dell Inspiron laptops*/
MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"),
NO_MATCH, NO_MATCH
} },
{ broken_apm_power, "Dell Inspiron 5000e", { /* Handle problems with APM on Inspiron 5000e */
MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
MATCH(DMI_BIOS_VERSION, "A04"),
......@@ -567,6 +607,12 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_BIOS_VERSION, "A12"),
MATCH(DMI_BIOS_DATE, "02/04/2002"), NO_MATCH
} },
{ apm_is_horked, "Dell Dimension 4100", { /* APM crashes */
MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
MATCH(DMI_PRODUCT_NAME, "XPS-Z"),
MATCH(DMI_BIOS_VENDOR,"Intel Corp."),
MATCH(DMI_BIOS_VERSION,"A11")
} },
{ set_realmode_power_off, "Award Software v4.60 PGMA", { /* broken PM poweroff bios */
MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
MATCH(DMI_BIOS_VERSION, "4.60 PGMA"),
......@@ -577,21 +623,16 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
NO_MATCH, NO_MATCH
} },
{ set_bios_reboot, "Dell PowerEdge 300", { /* Handle problems with rebooting on Dell 1300's */
{ set_bios_reboot, "Dell PowerEdge 300", { /* Handle problems with rebooting on Dell 300's */
MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
NO_MATCH, NO_MATCH
} },
{ set_bios_reboot, "Dell PowerEdge 2400", { /* Handle problems with rebooting on Dell 300/800's */
{ set_bios_reboot, "Dell PowerEdge 2400", { /* Handle problems with rebooting on Dell 2400's */
MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
NO_MATCH, NO_MATCH
} },
{ set_apm_ints, "Dell Inspiron", { /* Allow interrupts during suspend on Dell Inspiron laptops*/
MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"),
NO_MATCH, NO_MATCH
} },
{ set_apm_ints, "Compaq 12XL125", { /* Allow interrupts during suspend on Compaq Laptops*/
MATCH(DMI_SYS_VENDOR, "Compaq"),
MATCH(DMI_PRODUCT_NAME, "Compaq PC"),
......@@ -618,7 +659,7 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_BIOS_VERSION, "Version1.01"),
NO_MATCH, NO_MATCH,
} },
{ apm_is_horked, "Intel D850MD", { /* APM crashes */
{ apm_is_horked_d850md, "Intel D850MD", { /* APM crashes */
MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
MATCH(DMI_BIOS_VERSION, "MV85010A.86A.0016.P07.0201251536"),
NO_MATCH, NO_MATCH,
......@@ -646,6 +687,16 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
MATCH(DMI_BIOS_VERSION,"A11")
} },
{ apm_likes_to_melt, "Jabil AMD", { /* APM idle hangs */
MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
MATCH(DMI_BIOS_VERSION, "0AASNP06"),
NO_MATCH, NO_MATCH,
} },
{ apm_likes_to_melt, "AMI Bios", { /* APM idle hangs */
MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
MATCH(DMI_BIOS_VERSION, "0AASNP05"),
NO_MATCH, NO_MATCH,
} },
{ sony_vaio_laptop, "Sony Vaio", { /* This is a Sony Vaio laptop */
MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
MATCH(DMI_PRODUCT_NAME, "PCG-"),
......@@ -774,6 +825,11 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0094.P10"),
NO_MATCH, NO_MATCH
} },
{ broken_pirq, "l44GX Bios", { /* Bad $PIR */
MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0115.P12"),
NO_MATCH, NO_MATCH
} },
{ broken_pirq, "l44GX Bios", { /* Bad $PIR */
MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0120.P12"),
......@@ -789,6 +845,12 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0066.P07.9906041405"),
NO_MATCH, NO_MATCH
} },
{ broken_pirq, "IBM xseries 370", { /* Bad $PIR */
MATCH(DMI_BIOS_VENDOR, "IBM"),
MATCH(DMI_BIOS_VERSION,"MMKT33AUS"),
NO_MATCH, NO_MATCH
} },
/* Intel in disguise - In this case they can't hide and they don't run
too well either... */
......
......@@ -259,7 +259,7 @@ static int __init pci_direct_init(void)
release_resource(region);
type2:
if ((!pci_probe & PCI_PROBE_CONF2) == 0)
if ((pci_probe & PCI_PROBE_CONF2) == 0)
goto out;
region = request_region(0xCF8, 4, "PCI conf2");
if (!region)
......
This diff is collapsed.
......@@ -158,6 +158,10 @@
#define IOC_TCNFG 0x318
#define IOC_PDIR_BASE 0x320
#define IOC_ROPE0_CFG 0x500
#define IOC_ROPE_AO 0x10 /* Allow "Relaxed Ordering" */
/* AGP GART driver looks for this */
#define ZX1_SBA_IOMMU_COOKIE 0x0000badbadc0ffeeUL
......@@ -1361,6 +1365,7 @@ ioc_iova_init(struct ioc *ioc)
#ifdef FULL_VALID_PDIR
unsigned long index;
#endif
unsigned int i;
/*
** Firmware programs the base and size of a "safe IOVA space"
......@@ -1455,6 +1460,18 @@ ioc_iova_init(struct ioc *ioc)
/* Enable IOVA translation */
WRITE_REG(ioc->ibase | 1, ioc->ioc_hpa + IOC_IBASE);
READ_REG(ioc->ioc_hpa + IOC_IBASE);
/* Clear ROPE(N)_CONFIG AO bit.
** Disables "NT Ordering" (~= !"Relaxed Ordering")
** Overrides bit 1 in DMA Hint Sets.
** Improves netperf UDP_STREAM by ~10% for tg3 on bcm5701.
*/
for (i=0; i<(8*8); i+=8) {
unsigned long rope_config;
rope_config = READ_REG(ioc->ioc_hpa + IOC_ROPE0_CFG + i);
rope_config &= ~IOC_ROPE_AO;
WRITE_REG(rope_config, ioc->ioc_hpa + IOC_ROPE0_CFG + i);
}
}
static void __init
......
......@@ -489,18 +489,35 @@ END(clone)
* because some system calls (such as ia64_execve) directly
* manipulate ar.pfs.
*/
.global ia64_strace_leave_kernel
GLOBAL_ENTRY(ia64_trace_syscall)
PT_REGS_UNWIND_INFO(0)
{ /*
* Some versions of gas generate bad unwind info if the first instruction of a
* procedure doesn't go into the first slot of a bundle. This is a workaround.
/*
* We need to preserve the scratch registers f6-f11 in case the system
* call is sigreturn.
*/
nop.m 0
nop.i 0
adds r16=PT(F6)+16,sp
adds r17=PT(F7)+16,sp
;;
stf.spill [r16]=f6,32
stf.spill [r17]=f7,32
;;
stf.spill [r16]=f8,32
stf.spill [r17]=f9,32
;;
stf.spill [r16]=f10
stf.spill [r17]=f11
br.call.sptk.many rp=syscall_trace // give parent a chance to catch syscall args
}
adds r16=PT(F6)+16,sp
adds r17=PT(F7)+16,sp
;;
ldf.fill f6=[r16],32
ldf.fill f7=[r17],32
;;
ldf.fill f8=[r16],32
ldf.fill f9=[r17],32
;;
ldf.fill f10=[r16]
ldf.fill f11=[r17]
// the syscall number may have changed, so re-load it and re-calculate the
// syscall entry-point:
adds r15=PT(R15)+16,sp // r15 = &pt_regs.r15 (syscall #)
......@@ -529,9 +546,8 @@ GLOBAL_ENTRY(ia64_trace_syscall)
.strace_save_retval:
.mem.offset 0,0; st8.spill [r2]=r8 // store return value in slot for r8
.mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10
ia64_strace_leave_kernel:
br.call.sptk.many rp=syscall_trace // give parent a chance to catch return value
.rety: br.cond.sptk ia64_leave_syscall
.ret3: br.cond.sptk ia64_leave_syscall
strace_error:
ld8 r3=[r2] // load pt_regs.r8
......@@ -545,6 +561,23 @@ strace_error:
br.cond.sptk .strace_save_retval
END(ia64_trace_syscall)
/*
* When traced and returning from sigreturn, we invoke syscall_trace but then
* go straight to ia64_leave_kernel rather than ia64_leave_syscall.
*/
GLOBAL_ENTRY(ia64_strace_leave_kernel)
PT_REGS_UNWIND_INFO(0)
{ /*
* Some versions of gas generate bad unwind info if the first instruction of a
* procedure doesn't go into the first slot of a bundle. This is a workaround.
*/
nop.m 0
nop.i 0
br.call.sptk.many rp=syscall_trace // give parent a chance to catch return value
}
.ret4: br.cond.sptk ia64_leave_kernel
END(ia64_strace_leave_kernel)
GLOBAL_ENTRY(ia64_ret_from_clone)
PT_REGS_UNWIND_INFO(0)
{ /*
......
......@@ -103,20 +103,22 @@ EXPORT_SYMBOL(ia64_save_scratch_fpregs);
#include <asm/unwind.h>
EXPORT_SYMBOL(unw_init_running);
#ifdef CONFIG_SMP
# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
#ifdef ASM_SUPPORTED
# ifdef CONFIG_SMP
# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
/*
* This is not a normal routine and we don't want a function descriptor for it, so we use
* a fake declaration here.
*/
extern char ia64_spinlock_contention_pre3_4;
EXPORT_SYMBOL(ia64_spinlock_contention_pre3_4);
# else
# else
/*
* This is not a normal routine and we don't want a function descriptor for it, so we use
* a fake declaration here.
*/
extern char ia64_spinlock_contention;
EXPORT_SYMBOL(ia64_spinlock_contention);
# endif
# endif
#endif
......@@ -33,6 +33,5 @@ struct hw_interrupt_type irq_type_ia64_lsapic = {
.enable = lsapic_noop,
.disable = lsapic_noop,
.ack = lsapic_noop,
.end = lsapic_noop,
.set_affinity = (void (*)(unsigned int, unsigned long)) lsapic_noop
.end = lsapic_noop
};
......@@ -467,10 +467,10 @@ smp_build_cpu_map (void)
#ifdef CONFIG_NUMA
/* on which node is each logical CPU (one cacheline even for 64 CPUs) */
volatile u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
EXPORT_SYMBOL(cpu_to_node_map);
/* which logical CPUs are on which nodes */
volatile cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
/*
* Build cpu to node mapping and initialize the per node cpu masks.
......@@ -566,8 +566,8 @@ smp_cpus_done (unsigned int dummy)
if (cpu_online(cpu))
bogosum += cpu_data(cpu)->loops_per_jiffy;
printk(KERN_INFO "Total of %lu processors activated (%lu.%02lu BogoMIPS).\n",
num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);
printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
(int)num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);
}
int __devinit
......
......@@ -21,6 +21,7 @@
#include <linux/profile.h>
#include <linux/timex.h>
#include <asm/machvec.h>
#include <asm/delay.h>
#include <asm/hw_irq.h>
#include <asm/ptrace.h>
......@@ -243,6 +244,8 @@ timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long new_itm;
platform_timer_interrupt(irq, dev_id, regs);
new_itm = local_cpu_data->itm_next;
if (!time_after(ia64_get_itc(), new_itm))
......
......@@ -153,7 +153,7 @@ xbow_attach(vertex_hdl_t conn)
#if DEBUG && ATTACH_DEBUG
char name[MAXDEVNAME];
#endif
static void xbow_errintr_handler(int, void *, struct pt_regs *);
static irqreturn_t xbow_errintr_handler(int, void *, struct pt_regs *);
#if DEBUG && ATTACH_DEBUG
......
......@@ -10,4 +10,4 @@
#
obj-y += cache.o io.o ptc_deadlock.o sn2_smp.o sn_proc_fs.o \
prominfo_proc.o timer.o
prominfo_proc.o timer.o timer_interrupt.o
......@@ -50,7 +50,7 @@ wait_piowc(void)
piows = pda->pio_write_status_addr;
do {
__asm__ __volatile__ ("mf.a" ::: "memory");
ia64_mfa();
} while (((ws = *piows) & SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK) !=
SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK);
return ws;
......@@ -93,7 +93,8 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit
if (is_headless_node(cnode))
continue;
if (cnode == mycnode) {
asm volatile ("ptc.ga %0,%1;;srlz.i;;" :: "r"(start), "r"(nbits<<2) : "memory");
ia64_ptcga(start, nbits<<2);
ia64_srlz_i();
} else {
nasid = cnodeid_to_nasid(cnode);
ptc0 = CHANGE_NASID(nasid, ptc0);
......
/*
* Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved.
*
*
* Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License
......@@ -30,56 +32,33 @@
* http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#ifndef _ASM_IA64_MACHVEC_SN1_h
#define _ASM_IA64_MACHVEC_SN1_h
#include <linux/interrupt.h>
#include <asm/sn/pda.h>
#include <asm/sn/leds.h>
extern ia64_mv_setup_t sn1_setup;
extern ia64_mv_cpu_init_t sn_cpu_init;
extern ia64_mv_irq_init_t sn1_irq_init;
extern ia64_mv_send_ipi_t sn1_send_IPI;
extern ia64_mv_global_tlb_purge_t sn1_global_tlb_purge;
extern ia64_mv_inb_t sn1_inb;
extern ia64_mv_inw_t sn1_inw;
extern ia64_mv_inl_t sn1_inl;
extern ia64_mv_outb_t sn1_outb;
extern ia64_mv_outw_t sn1_outw;
extern ia64_mv_outl_t sn1_outl;
extern ia64_mv_dma_alloc_coherent sn1_dma_alloc_coherent;
extern ia64_mv_dma_free_coherent sn1_dma_free_coherent;
extern ia64_mv_dma_map_single sn1_dma_map_single;
extern ia64_mv_dma_unmap_single sn1_dma_unmap_single;
extern ia64_mv_dma_map_sg sn1_dma_map_sg;
extern ia64_mv_dma_unmap_sg sn1_dma_unmap_sg;
extern ia64_mv_dma_sync_single sn1_dma_sync_single;
extern ia64_mv_dma_sync_sg sn1_dma_sync_sg;
extern void sn_lb_int_war_check(void);
extern irqreturn_t timer_interrupt (int irq, void *dev_id, struct pt_regs *regs);
/*
* This stuff has dual use!
*
* For a generic kernel, the macros are used to initialize the
* platform's machvec structure. When compiling a non-generic kernel,
* the macros are used directly.
*/
#define platform_name "sn1"
#define platform_setup sn1_setup
#define platform_cpu_init sn_cpu_init
#define platform_irq_init sn1_irq_init
#define platform_send_ipi sn1_send_IPI
#define platform_global_tlb_purge sn1_global_tlb_purge
#define platform_inb sn1_inb
#define platform_inw sn1_inw
#define platform_inl sn1_inl
#define platform_outb sn1_outb
#define platform_outw sn1_outw
#define platform_outl sn1_outl
#define platform_dma_init machvec_noop
#define platform_dma_alloc_coherent sn1_dma_alloc_coherent
#define platform_dma_free_coherent sn1_dma_free_coherent
#define platform_dma_map_single sn1_dma_map_single
#define platform_dma_unmap_single sn1_dma_unmap_single
#define platform_dma_map_sg sn1_dma_map_sg
#define platform_dma_unmap_sg sn1_dma_unmap_sg
#define platform_dma_sync_single sn1_dma_sync_single
#define platform_dma_sync_sg sn1_dma_sync_sg
#define SN_LB_INT_WAR_INTERVAL 100
void
sn_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
/* LED blinking */
if (!pda->hb_count--) {
pda->hb_count = HZ/2;
set_led_bits(pda->hb_state ^= LED_CPU_HEARTBEAT, LED_CPU_HEARTBEAT);
printk("Blink\n");
}
#endif /* _ASM_IA64_MACHVEC_SN1_h */
if (enable_shub_wars_1_1()) {
/* Bugfix code for SHUB 1.1 */
if (pda->pio_shub_war_cam_addr)
*pda->pio_shub_war_cam_addr = 0x8000000000000010UL;
}
if (pda->sn_lb_int_war_ticks == 0)
sn_lb_int_war_check();
pda->sn_lb_int_war_ticks++;
if (pda->sn_lb_int_war_ticks >= SN_LB_INT_WAR_INTERVAL)
pda->sn_lb_int_war_ticks = 0;
}
......@@ -241,12 +241,16 @@ save_user_regs(struct pt_regs *regs, struct mcontext *frame, int sigret)
* (except for MSR).
*/
static int
restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr)
restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig)
{
unsigned long save_r2;
#ifdef CONFIG_ALTIVEC
unsigned long msr;
#endif
/* backup/restore the TLS as we don't want it to be modified */
if (!sig)
save_r2 = regs->gpr[2];
/* copy up to but not including MSR */
if (__copy_from_user(regs, &sr->mc_gregs, PT_MSR * sizeof(elf_greg_t)))
return 1;
......@@ -254,6 +258,8 @@ restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr)
if (__copy_from_user(&regs->orig_gpr3, &sr->mc_gregs[PT_ORIG_R3],
GP_REGS_SIZE - PT_ORIG_R3 * sizeof(elf_greg_t)))
return 1;
if (!sig)
regs->gpr[2] = save_r2;
/* force the process to reload the FP registers from
current->thread when it next does FP instructions */
......@@ -359,7 +365,7 @@ handle_rt_signal(unsigned long sig, struct k_sigaction *ka,
force_sig(SIGSEGV, current);
}
static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs)
static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int sig)
{
sigset_t set;
struct mcontext *mcp;
......@@ -368,7 +374,7 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs)
|| __get_user(mcp, &ucp->uc_regs))
return -EFAULT;
restore_sigmask(&set);
if (restore_user_regs(regs, mcp))
if (restore_user_regs(regs, mcp, sig))
return -EFAULT;
return 0;
......@@ -376,10 +382,16 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs)
int sys_swapcontext(struct ucontext __user *old_ctx,
struct ucontext __user *new_ctx,
int r5, int r6, int r7, int r8, struct pt_regs *regs)
int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
{
unsigned char tmp;
/* Context size is for future use. Right now, we only make sure
* we are passed something we understand
*/
if (ctx_size < sizeof(struct ucontext))
return -EINVAL;
if (old_ctx != NULL) {
if (verify_area(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
|| save_user_regs(regs, &old_ctx->uc_mcontext, 0)
......@@ -406,7 +418,7 @@ int sys_swapcontext(struct ucontext __user *old_ctx,
* or if another thread unmaps the region containing the context.
* We kill the task with a SIGSEGV in this situation.
*/
if (do_setcontext(new_ctx, regs))
if (do_setcontext(new_ctx, regs, 0))
do_exit(SIGSEGV);
sigreturn_exit(regs);
/* doesn't actually return back to here */
......@@ -425,7 +437,7 @@ int sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
(regs->gpr[1] + __SIGNAL_FRAMESIZE + 16);
if (verify_area(VERIFY_READ, rt_sf, sizeof(struct rt_sigframe)))
goto bad;
if (do_setcontext(&rt_sf->uc, regs))
if (do_setcontext(&rt_sf->uc, regs, 1))
goto bad;
/*
......@@ -484,7 +496,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
if (save_user_regs(regs, &frame->mctx, __NR_sigreturn))
goto badframe;
if (put_user(regs->gpr[1], (unsigned long *)newsp))
if (put_user(regs->gpr[1], (unsigned long __user *)newsp))
goto badframe;
regs->gpr[1] = newsp;
regs->gpr[3] = sig;
......@@ -529,7 +541,7 @@ int sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
sr = (struct mcontext *) sigctx.regs;
if (verify_area(VERIFY_READ, sr, sizeof(*sr))
|| restore_user_regs(regs, sr))
|| restore_user_regs(regs, sr, 1))
goto badframe;
sigreturn_exit(regs); /* doesn't return */
......
......@@ -727,6 +727,10 @@ config STACK_DEBUG
depends on DEBUG_KERNEL
bool "Stack Overflow Detection Support"
config DEBUG_BOOTMEM
depends on DEBUG_KERNEL
bool "Debug BOOTMEM initialization"
# We have a custom atomic_dec_and_lock() implementation but it's not
# compatible with spinlock debugging so we need to fall back on
# the generic version in that case.
......
......@@ -54,7 +54,14 @@ bootup_user_stack:
.ascii "HdrS"
.word LINUX_VERSION_CODE
.half 0x0203 /* HdrS version */
/* History:
*
* 0x0202 : Supports kernel params string
* 0x0300 : Supports being located at other than 0x4000
*/
.half 0x0300 /* HdrS version */
root_flags:
.half 1
root_dev:
......@@ -345,7 +352,8 @@ spitfire_got_tlbentry:
nop
nop
and %g1, %g3, %g1 /* Mask to just get paddr bits. */
sub %g1, %g2, %g1 /* Get rid of %pc offset to get base. */
set 0x5fff, %l3 /* Mask offset to get phys base. */
andn %g1, %l3, %g1
/* NOTE: We hold on to %g1 paddr base as we need it below to lock
* NOTE: the PROM cif code into the TLB.
......
......@@ -1261,6 +1261,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
void __devinit smp_prepare_boot_cpu(void)
{
current_thread_info()->cpu = hard_smp_processor_id();
cpu_set(smp_processor_id(), cpu_online_map);
cpu_set(smp_processor_id(), phys_cpu_present_map);
}
......
......@@ -2043,8 +2043,4 @@ void __init trap_init(void)
*/
atomic_inc(&init_mm.mm_count);
current->active_mm = &init_mm;
#ifdef CONFIG_SMP
current_thread_info()->cpu = hard_smp_processor_id();
#endif
}
......@@ -1293,6 +1293,10 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
unsigned long bootmap_pfn, bytes_avail, size;
int i;
#ifdef CONFIG_DEBUG_BOOTMEM
prom_printf("bootmem_init: Scan sp_banks, ");
#endif
bytes_avail = 0UL;
for (i = 0; sp_banks[i].num_bytes != 0; i++) {
end_of_phys_memory = sp_banks[i].base_addr +
......@@ -1359,14 +1363,24 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
/* Initialize the boot-time allocator. */
max_pfn = max_low_pfn = end_pfn;
min_low_pfn = pfn_base;
#ifdef CONFIG_DEBUG_BOOTMEM
prom_printf("init_bootmem(spfn[%lx], bpfn[%lx], mlpfn[%lx])\n",
start_pfn, bootmap_pfn, max_low_pfn);
#endif
bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn, pfn_base, end_pfn);
/* Now register the available physical memory with the
* allocator.
*/
for (i = 0; sp_banks[i].num_bytes != 0; i++)
for (i = 0; sp_banks[i].num_bytes != 0; i++) {
#ifdef CONFIG_DEBUG_BOOTMEM
prom_printf("free_bootmem(sp_banks:%d): base[%lx] size[%lx]\n",
i, sp_banks[i].base_addr, sp_banks[i].num_bytes);
#endif
free_bootmem(sp_banks[i].base_addr,
sp_banks[i].num_bytes);
}
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) {
......@@ -1382,6 +1396,9 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
#endif
/* Reserve the kernel text/data/bss. */
size = (start_pfn << PAGE_SHIFT) - phys_base;
#ifdef CONFIG_DEBUG_BOOTMEM
prom_printf("reserve_bootmem(kernel): base[%lx] size[%lx]\n", phys_base, size);
#endif
reserve_bootmem(phys_base, size);
*pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT;
......@@ -1390,6 +1407,10 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
* in free_all_bootmem.
*/
size = bootmap_size;
#ifdef CONFIG_DEBUG_BOOTMEM
prom_printf("reserve_bootmem(bootmap): base[%lx] size[%lx]\n",
(bootmap_pfn << PAGE_SHIFT), size);
#endif
reserve_bootmem((bootmap_pfn << PAGE_SHIFT), size);
*pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT;
......@@ -1714,6 +1735,9 @@ void __init mem_init(void)
max_mapnr = last_valid_pfn - pfn_base;
high_memory = __va(last_valid_pfn << PAGE_SHIFT);
#ifdef CONFIG_DEBUG_BOOTMEM
prom_printf("mem_init: Calling free_all_bootmem().\n");
#endif
totalram_pages = num_physpages = free_all_bootmem() - 1;
/*
......
......@@ -68,6 +68,9 @@ config HPET_TIMER
If unsure, say Y.
config HPET_EMULATE_RTC
def_bool HPET_TIMER && RTC=y
config GENERIC_ISA_DMA
bool
default y
......@@ -271,51 +274,7 @@ endmenu
menu "Power management options"
config PM
bool "Power Management support"
---help---
"Power Management" means that parts of your computer are shut
off or put into a power conserving "sleep" mode if they are not
being used. There are two competing standards for doing this: APM
and ACPI. If you want to use either one, say Y here and then also
to the requisite support below.
Power Management is most important for battery powered laptop
computers.
Note that, even if you say N here, Linux on the x86 architecture
will issue the hlt instruction if nothing is to be done, thereby
sending the processor to limited sleep and saving power. However
using ACPI will likely save more power.
config SOFTWARE_SUSPEND
bool "Software Suspend (EXPERIMENTAL)"
depends on EXPERIMENTAL && PM && SWAP
---help---
Enable the possibilty of suspending the machine. It doesn't need APM.
You may suspend your machine by 'swsusp' or 'shutdown -z <time>'
(patch for sysvinit needed).
It creates an image which is saved in your active swaps. On the next
boot, pass the 'resume=/path/to/your/swap/file' option and the kernel
will detect the saved image, restore the memory from
it, and then continue to run as before you suspended.
If you don't want the previous state to continue, use the 'noresume'
kernel option. However, note that your partitions will be fsck'd and
you must re-mkswap your swap partitions/files.
Right now you may boot without resuming and then later resume but
in the meantime you cannot use those swap partitions/files which were
involved in suspending. Also in this case there is a risk that buffers
on disk won't match with saved ones.
SMP is supported ``as-is''. There's code for it but doesn't work.
There have been problems reported relating to SCSI.
This option is close to getting stable. However there is still some
absence of features.
For more information take a look at Documentation/power/swsusp.txt.
source kernel/power/Kconfig
source "drivers/acpi/Kconfig"
......@@ -336,8 +295,23 @@ config PCI_DIRECT
# the drivers/pci/msi.c code needs to be fixed first before enabling
config PCI_USE_VECTOR
bool
bool "Vector-based interrupt indexing"
depends on X86_LOCAL_APIC && NOTWORKING
default n
help
This replaces the current existing IRQ-based index interrupt scheme
with the vector-base index scheme. The advantages of vector base
over IRQ base are listed below:
1) Support MSI implementation.
2) Support future IOxAPIC hotplug
Note that this enables MSI, Message Signaled Interrupt, on all
MSI capable device functions detected if users also install the
MSI patch. Message Signal Interrupt enables an MSI-capable
hardware device to send an inbound Memory Write on its PCI bus
instead of asserting IRQ signal on device IRQ pin.
If you don't know what to do here, say N.
source "drivers/pci/Kconfig"
......@@ -396,51 +370,9 @@ config UID16
endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig"
source "drivers/block/Kconfig"
source "drivers/ide/Kconfig"
source "drivers/scsi/Kconfig"
source "drivers/md/Kconfig"
source "drivers/telephony/Kconfig"
source "drivers/message/fusion/Kconfig"
source "drivers/ieee1394/Kconfig"
#Currently not 64-bit safe
#source drivers/message/i2o/Config.in
source "net/Kconfig"
source "drivers/isdn/Kconfig"
# no support for non IDE/SCSI cdroms as they were all ISA only
#
# input before char - char/joystick depends on it. As does USB.
#
source "drivers/input/Kconfig"
source "drivers/char/Kconfig"
source "drivers/misc/Kconfig"
source "drivers/media/Kconfig"
source "fs/Kconfig"
source "drivers/video/Kconfig"
source "sound/Kconfig"
source drivers/Kconfig
source "drivers/usb/Kconfig"
source fs/Kconfig
source "arch/x86_64/oprofile/Kconfig"
......@@ -505,6 +437,7 @@ config DEBUG_INFO
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
Please note that this option requires new binutils.
If you don't debug the kernel, you can say N.
config FRAME_POINTER
......
......@@ -49,7 +49,7 @@ CFLAGS += -fno-reorder-blocks
# CFLAGS += -finline-limit=2000
CFLAGS += -Wno-sign-compare
# don't enable this when you use kgdb:
ifneq ($(CONFIG_X86_REMOTE_DEBUG),y)
ifneq ($(CONFIG_DEBUG_INFO),y)
CFLAGS += -fno-asynchronous-unwind-tables
endif
#CFLAGS += $(call check_gcc,-funit-at-a-time,)
......
......@@ -9,6 +9,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_X86_CMPXCHG=y
CONFIG_EARLY_PRINTK=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_GENERIC_ISA_DMA=y
#
......@@ -26,7 +27,8 @@ CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=18
# CONFIG_IKCONFIG is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
CONFIG_FUTEX=y
......@@ -34,6 +36,7 @@ CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
#
# Loadable module support
......@@ -59,7 +62,6 @@ CONFIG_X86_CPUID=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_MTRR=y
# CONFIG_HUGETLB_PAGE is not set
CONFIG_SMP=y
# CONFIG_PREEMPT is not set
CONFIG_K8_NUMA=y
......@@ -79,9 +81,9 @@ CONFIG_SOFTWARE_SUSPEND=y
#
# ACPI (Advanced Configuration and Power Interface) Support
#
# CONFIG_ACPI_HT is not set
CONFIG_ACPI=y
CONFIG_ACPI_BOOT=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_SLEEP_PROC_FS=y
CONFIG_ACPI_AC=y
......@@ -94,17 +96,23 @@ CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_TOSHIBA=y
CONFIG_ACPI_DEBUG=y
CONFIG_ACPI_BUS=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_PCI=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_ACPI_RELAXED_AML is not set
#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set
#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
# CONFIG_PCI_USE_VECTOR is not set
# CONFIG_PCI_LEGACY_PROC is not set
# CONFIG_PCI_NAMES is not set
# CONFIG_HOTPLUG is not set
......@@ -115,6 +123,7 @@ CONFIG_PCI_DIRECT=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_AOUT is not set
CONFIG_COMPAT=y
CONFIG_UID16=y
......@@ -179,7 +188,6 @@ CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_OPTI621 is not set
# CONFIG_BLK_DEV_RZ1000 is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDE_TCQ is not set
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
......@@ -246,6 +254,7 @@ CONFIG_BLK_DEV_SD=y
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_SATA is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_CPQFCTS is not set
# CONFIG_SCSI_DMX3191D is not set
......@@ -260,7 +269,7 @@ CONFIG_SCSI_IPS=m
# CONFIG_SCSI_QLOGIC_FC is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_DEBUG is not set
#
......@@ -313,7 +322,12 @@ CONFIG_IP_MULTICAST=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_IPV6 is not set
CONFIG_IPV6=y
# CONFIG_IPV6_PRIVACY is not set
# CONFIG_INET6_AH is not set
# CONFIG_INET6_ESP is not set
# CONFIG_INET6_IPCOMP is not set
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_NETFILTER is not set
......@@ -325,7 +339,9 @@ CONFIG_IPV6_SCTP__=y
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
......@@ -358,7 +374,7 @@ CONFIG_NETDEVICES=y
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
CONFIG_MII=y
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_NET_VENDOR_3COM is not set
......@@ -388,7 +404,6 @@ CONFIG_8139TOO=m
# CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
#
......@@ -421,10 +436,10 @@ CONFIG_TIGON3=y
# CONFIG_NET_RADIO is not set
#
# Token Ring devices (depends on LLC=y)
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_RCPCI is not set
# CONFIG_SHAPER is not set
#
......@@ -442,6 +457,11 @@ CONFIG_TIGON3=y
#
# CONFIG_IRDA is not set
#
# Bluetooth support
#
# CONFIG_BT is not set
#
# ISDN subsystem
#
......@@ -504,6 +524,7 @@ CONFIG_HW_CONSOLE=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
# CONFIG_SERIAL_8250_ACPI is not set
CONFIG_SERIAL_8250_NR_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set
#
......@@ -520,7 +541,11 @@ CONFIG_UNIX98_PTY_COUNT=256
# CONFIG_I2C is not set
#
# I2C Hardware Sensors Mainboard support
# I2C Algorithms
#
#
# I2C Hardware Bus support
#
#
......@@ -549,7 +574,6 @@ CONFIG_RTC=y
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_SONYPI is not set
#
# Ftape, the floppy tape device driver
......@@ -559,6 +583,7 @@ CONFIG_AGP_AMD64=y
# CONFIG_DRM is not set
# CONFIG_MWAVE is not set
CONFIG_RAW_DRIVER=y
CONFIG_MAX_RAW_DEVS=256
CONFIG_HANGCHECK_TIMER=y
#
......@@ -619,10 +644,13 @@ CONFIG_ISO9660_FS=y
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
# CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y
#
......@@ -647,6 +675,7 @@ CONFIG_RAMFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V4 is not set
......@@ -669,6 +698,11 @@ CONFIG_SUNRPC=y
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
#
# Native Language Support
#
# CONFIG_NLS is not set
#
# Graphics support
#
......@@ -707,13 +741,15 @@ CONFIG_SOUND_PRIME=y
# CONFIG_SOUND_MAESTRO is not set
# CONFIG_SOUND_MAESTRO3 is not set
CONFIG_SOUND_ICH=y
# CONFIG_SOUND_RME96XX is not set
# CONFIG_SOUND_SONICVIBES is not set
# CONFIG_SOUND_TRIDENT is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
# CONFIG_SOUND_VIA82CXXX is not set
# CONFIG_SOUND_OSS is not set
# CONFIG_SOUND_ALI5455 is not set
# CONFIG_SOUND_FORTE is not set
# CONFIG_SOUND_RME96XX is not set
# CONFIG_SOUND_AD1980 is not set
#
......@@ -722,11 +758,6 @@ CONFIG_SOUND_ICH=y
# CONFIG_USB is not set
# CONFIG_USB_GADGET is not set
#
# Bluetooth support
#
# CONFIG_BT is not set
#
# Profiling support
#
......@@ -744,8 +775,6 @@ CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_FRAME_POINTER is not set
# CONFIG_IOMMU_DEBUG is not set
CONFIG_IOMMU_LEAK=y
CONFIG_MCE_DEBUG=y
#
# Security options
......@@ -760,4 +789,4 @@ CONFIG_MCE_DEBUG=y
#
# Library routines
#
# CONFIG_CRC32 is not set
CONFIG_CRC32=y
......@@ -33,11 +33,14 @@
#include <asm/user32.h>
#undef WARN_OLD
#undef CORE_DUMP /* probably broken */
extern int ia32_setup_arg_pages(struct linux_binprm *bprm);
static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
static int load_aout_library(struct file*);
#if CORE_DUMP
static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file);
/*
......@@ -92,11 +95,15 @@ static void dump_thread32(struct pt_regs * regs, struct user32 * dump)
#endif
}
#endif
static struct linux_binfmt aout_format = {
.module = THIS_MODULE,
.load_binary = load_aout_binary,
.load_shlib = load_aout_library,
#if CORE_DUMP
.core_dump = aout_core_dump,
#endif
.min_coredump = PAGE_SIZE
};
......@@ -109,6 +116,7 @@ static void set_brk(unsigned long start, unsigned long end)
do_brk(start, end - start);
}
#if CORE_DUMP
/*
* These are the only things you should do on a core-file: use only these
* macros to write out all the necessary info.
......@@ -201,6 +209,7 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file)
set_fs(fs);
return has_dumped;
}
#endif
/*
* create_aout_tables() parses the env- and arg-strings in new user
......@@ -285,10 +294,11 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
regs->cs = __USER32_CS;
regs->r8 = regs->r9 = regs->r10 = regs->r11 = regs->r12 =
regs->r13 = regs->r14 = regs->r15 = 0;
set_thread_flag(TIF_IA32);
/* OK, This is the point of no return */
set_personality(PER_LINUX);
set_thread_flag(TIF_IA32);
clear_thread_flag(TIF_ABI_PENDING);
current->mm->end_code = ex.a_text +
(current->mm->start_code = N_TXTADDR(ex));
......
......@@ -197,6 +197,7 @@ static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *re
static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
{
struct pt_regs *pp = (struct pt_regs *)(t->thread.rsp0);
--pp;
ELF_CORE_COPY_REGS((*elfregs), pp);
/* fix wrong segments */
(*elfregs)[7] = t->thread.ds;
......@@ -214,6 +215,8 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr
if (!tsk->used_math)
return 0;
if (!regs)
regs = (struct pt_regs *)tsk->thread.rsp0;
--regs;
if (tsk == current)
unlazy_fpu(tsk);
......@@ -250,6 +253,14 @@ elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
#define ELF_PLATFORM ("i686")
#define SET_PERSONALITY(ex, ibcs2) \
do { \
unsigned long new_flags = 0; \
if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
new_flags = _TIF_IA32; \
if ((current_thread_info()->flags & _TIF_IA32) \
!= new_flags) \
set_thread_flag(TIF_ABI_PENDING); \
else \
clear_thread_flag(TIF_ABI_PENDING); \
set_personality((ibcs2)?PER_SVR4:current->personality); \
} while (0)
......@@ -323,7 +334,6 @@ static void elf32_init(struct pt_regs *regs)
me->thread.gsindex = 0;
me->thread.ds = __USER_DS;
me->thread.es = __USER_DS;
set_thread_flag(TIF_IA32);
}
int setup_arg_pages(struct linux_binprm *bprm)
......@@ -392,7 +402,7 @@ elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int p
down_write(&me->mm->mmap_sem);
map_addr = do_mmap(filep, ELF_PAGESTART(addr),
eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr), prot,
type|MAP_32BIT,
type,
eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr));
up_write(&me->mm->mmap_sem);
return(map_addr);
......
......@@ -44,10 +44,10 @@
asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
void signal_fault(struct pt_regs *regs, void *frame, char *where);
static int ia32_copy_siginfo_to_user(siginfo_t32 *to, siginfo_t *from)
int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from)
{
int err;
if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t32)))
return -EFAULT;
/* If you change siginfo_t structure, please make sure that
......@@ -55,21 +55,18 @@ static int ia32_copy_siginfo_to_user(siginfo_t32 *to, siginfo_t *from)
It should never copy any pad contained in the structure
to avoid security leaks, but must copy the generic
3 ints plus the relevant union member. */
if (from->si_code < 0) {
err = __put_user(from->si_signo, &to->si_signo);
err |= __put_user(from->si_errno, &to->si_errno);
err |= __put_user(from->si_code, &to->si_code);
err |= __put_user(from->_sifields._rt._pid, &to->_sifields._rt._pid);
err |= __put_user(from->_sifields._rt._uid, &to->_sifields._rt._uid);
err |= __put_user((u32)(u64)from->_sifields._rt._sigval.sival_ptr,
&to->_sifields._rt._sigval.sival_ptr);
} else {
err = __put_user(from->si_signo, &to->si_signo);
err |= __put_user(from->si_errno, &to->si_errno);
err |= __put_user(from->si_code, &to->si_code);
/* First 32bits of unions are always present. */
err |= __put_user((short)from->si_code, &to->si_code);
if (from->si_code < 0) {
err |= __put_user(from->si_pid, &to->si_pid);
err |= __put_user(from->si_uid, &to->si_uid);
err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr);
} else {
/* First 32bits of unions are always present:
* si_pid === si_band === si_tid === si_addr(LS half) */
err |= __put_user(from->_sifields._pad[0], &to->_sifields._pad[0]);
switch (from->si_code >> 16) {
case __SI_FAULT >> 16:
break;
......@@ -78,18 +75,39 @@ static int ia32_copy_siginfo_to_user(siginfo_t32 *to, siginfo_t *from)
err |= __put_user(from->si_stime, &to->si_stime);
err |= __put_user(from->si_status, &to->si_status);
default:
case __SI_KILL >> 16:
err |= __put_user(from->si_uid, &to->si_uid);
break;
case __SI_POLL >> 16:
err |= __put_user(from->si_band, &to->si_band);
err |= __put_user(from->si_fd, &to->si_fd);
break;
case __SI_TIMER >> 16:
err |= __put_user(from->si_overrun, &to->si_overrun);
err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr);
break;
/* case __SI_RT: This is not generated by the kernel as of now. */
}
}
return err;
}
int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from)
{
int err;
if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32)))
return -EFAULT;
err = __get_user(to->si_signo, &from->si_signo);
err |= __get_user(to->si_errno, &from->si_errno);
err |= __get_user(to->si_code, &from->si_code);
err |= __get_user(to->si_pid, &from->si_pid);
err |= __get_user(to->si_uid, &from->si_uid);
err |= __get_user((u32)(u64)to->si_ptr, &from->si_ptr);
return err;
}
asmlinkage long
sys32_sigsuspend(int history0, int history1, old_sigset_t mask, struct pt_regs regs)
{
......@@ -134,9 +152,9 @@ sys32_sigaltstack(const stack_ia32_t *uss_ptr, stack_ia32_t *uoss_ptr,
set_fs(seg);
if (ret >= 0 && uoss_ptr) {
if (!access_ok(VERIFY_WRITE,uoss_ptr,sizeof(stack_ia32_t)) ||
__put_user((u32)(u64)uss.ss_sp, &uoss_ptr->ss_sp) ||
__put_user(uss.ss_flags, &uoss_ptr->ss_flags) ||
__put_user(uss.ss_size, &uoss_ptr->ss_size))
__put_user((u32)(u64)uoss.ss_sp, &uoss_ptr->ss_sp) ||
__put_user(uoss.ss_flags, &uoss_ptr->ss_flags) ||
__put_user(uoss.ss_size, &uoss_ptr->ss_size))
ret = -EFAULT;
}
return ret;
......@@ -376,7 +394,7 @@ ia32_setup_sigcontext(struct sigcontext_ia32 *sc, struct _fpstate_ia32 *fpstate,
/*
* Determine which stack to use..
*/
static inline void *
static void *
get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
{
unsigned long rsp;
......@@ -386,7 +404,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
/* This is the X/Open sanctioned signal stack switching. */
if (ka->sa.sa_flags & SA_ONSTACK) {
if (! on_sig_stack(rsp))
if (sas_ss_flags(rsp) == 0)
rsp = current->sas_ss_sp + current->sas_ss_size;
}
......
......@@ -4,6 +4,7 @@
* Copyright 2000-2002 Andi Kleen, SuSE Labs.
*/
#include <asm/dwarf2.h>
#include <asm/calling.h>
#include <asm/offset.h>
#include <asm/current.h>
......@@ -45,6 +46,7 @@
* with the int 0x80 path.
*/
ENTRY(ia32_cstar_target)
CFI_STARTPROC
swapgs
movl %esp,%r8d
movq %gs:pda_kernelstack,%rsp
......@@ -105,6 +107,7 @@ cstar_tracesys:
cstar_badarg:
movq $-EFAULT,%rax
jmp cstar_sysret
CFI_ENDPROC
/*
* Emulated IA32 system calls via int 0x80.
......@@ -128,6 +131,7 @@ cstar_badarg:
*/
ENTRY(ia32_syscall)
CFI_STARTPROC
swapgs
sti
movl %eax,%eax
......@@ -168,6 +172,7 @@ ni_syscall:
quiet_ni_syscall:
movq $-ENOSYS,%rax
ret
CFI_ENDPROC
.macro PTREGSCALL label, func
.globl \label
......@@ -188,6 +193,7 @@ quiet_ni_syscall:
PTREGSCALL stub32_rt_sigsuspend, sys_rt_sigsuspend
ENTRY(ia32_ptregs_common)
CFI_STARTPROC
popq %r11
SAVE_REST
movq %r11, %r15
......@@ -198,6 +204,7 @@ ENTRY(ia32_ptregs_common)
je int_ret_from_sys_call /* misbalances the call/ret stack. sorry */
pushq %r11
ret
CFI_ENDPROC
.data
.align 8
......@@ -326,7 +333,7 @@ ia32_sys_call_table:
.quad stub32_clone /* 120 */
.quad sys_setdomainname
.quad sys_uname
.quad sys32_modify_ldt
.quad sys_modify_ldt
.quad sys32_adjtimex
.quad sys32_mprotect /* 125 */
.quad compat_sys_sigprocmask
......@@ -334,10 +341,10 @@ ia32_sys_call_table:
.quad sys_init_module
.quad sys_delete_module
.quad quiet_ni_syscall /* 130 get_kernel_syms */
.quad ni_syscall /* quotactl */
.quad sys32_quotactl /* quotactl */
.quad sys_getpgid
.quad sys_fchdir
.quad ni_syscall /* bdflush */
.quad quiet_ni_syscall /* bdflush */
.quad sys_sysfs /* 135 */
.quad sys_personality
.quad ni_syscall /* for afs_syscall */
......@@ -425,8 +432,8 @@ ia32_sys_call_table:
.quad sys_madvise
.quad sys_getdents64 /* 220 getdents64 */
.quad compat_sys_fcntl64
.quad sys_ni_syscall /* tux */
.quad sys_ni_syscall /* security */
.quad quiet_ni_syscall /* tux */
.quad quiet_ni_syscall /* security */
.quad sys_gettid
.quad sys_readahead /* 225 */
.quad sys_setxattr
......@@ -454,7 +461,7 @@ ia32_sys_call_table:
.quad sys32_io_submit
.quad sys_io_cancel
.quad sys_fadvise64
.quad sys_ni_syscall /* free_huge_pages */
.quad quiet_ni_syscall /* free_huge_pages */
.quad sys_exit_group /* exit_group */
.quad sys_lookup_dcookie
.quad sys_epoll_create
......
......@@ -858,8 +858,13 @@ sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
int sys32_ni_syscall(int call)
{
struct task_struct *me = current;
static char lastcomm[8];
if (strcmp(lastcomm, me->comm)) {
printk(KERN_INFO "IA32 syscall %d from %s not implemented\n", call,
current->comm);
strcpy(lastcomm, me->comm);
}
return -ENOSYS;
}
......@@ -1022,84 +1027,6 @@ sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
return ret;
}
siginfo_t32 *
siginfo64to32(siginfo_t32 *d, siginfo_t *s)
{
memset (d, 0, sizeof(siginfo_t32));
d->si_signo = s->si_signo;
d->si_errno = s->si_errno;
d->si_code = s->si_code;
if (s->si_signo >= SIGRTMIN) {
d->si_pid = s->si_pid;
d->si_uid = s->si_uid;
memcpy(&d->si_int, &s->si_int,
sizeof(siginfo_t) - offsetof(siginfo_t,si_int));
} else switch (s->si_signo) {
/* XXX: What about POSIX1.b timers */
case SIGCHLD:
d->si_pid = s->si_pid;
d->si_status = s->si_status;
d->si_utime = s->si_utime;
d->si_stime = s->si_stime;
break;
case SIGSEGV:
case SIGBUS:
case SIGFPE:
case SIGILL:
d->si_addr = (long)(s->si_addr);
// d->si_trapno = s->si_trapno;
break;
case SIGPOLL:
d->si_band = s->si_band;
d->si_fd = s->si_fd;
break;
default:
d->si_pid = s->si_pid;
d->si_uid = s->si_uid;
break;
}
return d;
}
siginfo_t *
siginfo32to64(siginfo_t *d, siginfo_t32 *s)
{
d->si_signo = s->si_signo;
d->si_errno = s->si_errno;
d->si_code = s->si_code;
if (s->si_signo >= SIGRTMIN) {
d->si_pid = s->si_pid;
d->si_uid = s->si_uid;
memcpy(&d->si_int,
&s->si_int,
sizeof(siginfo_t) - offsetof(siginfo_t, si_int));
} else switch (s->si_signo) {
/* XXX: What about POSIX1.b timers */
case SIGCHLD:
d->si_pid = s->si_pid;
d->si_status = s->si_status;
d->si_utime = s->si_utime;
d->si_stime = s->si_stime;
break;
case SIGSEGV:
case SIGBUS:
case SIGFPE:
case SIGILL:
d->si_addr = (void *)A(s->si_addr);
// d->si_trapno = s->si_trapno;
break;
case SIGPOLL:
d->si_band = s->si_band;
d->si_fd = s->si_fd;
break;
default:
d->si_pid = s->si_pid;
d->si_uid = s->si_uid;
break;
}
return d;
}
extern asmlinkage long
sys_rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo,
const struct timespec *uts, size_t sigsetsize);
......@@ -1114,7 +1041,6 @@ sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
int ret;
mm_segment_t old_fs = get_fs();
siginfo_t info;
siginfo_t32 info32;
if (copy_from_user (&s32, uthese, sizeof(compat_sigset_t)))
return -EFAULT;
......@@ -1126,13 +1052,18 @@ sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
}
if (uts && get_compat_timespec(&t, uts))
return -EFAULT;
if (uinfo) {
/* stop data leak to user space in case of structure fill mismatch
* between sys_rt_sigtimedwait & ia32_copy_siginfo_to_user.
*/
memset(&info, 0, sizeof(info));
}
set_fs (KERNEL_DS);
ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
sigsetsize);
set_fs (old_fs);
if (ret >= 0 && uinfo) {
if (copy_to_user (uinfo, siginfo64to32(&info32, &info),
sizeof(siginfo_t32)))
if (ia32_copy_siginfo_to_user(uinfo, &info))
return -EFAULT;
}
return ret;
......@@ -1145,14 +1076,11 @@ asmlinkage long
sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
{
siginfo_t info;
siginfo_t32 info32;
int ret;
mm_segment_t old_fs = get_fs();
if (copy_from_user (&info32, uinfo, sizeof(siginfo_t32)))
if (ia32_copy_siginfo_from_user(&info, uinfo))
return -EFAULT;
/* XXX: Is this correct? */
siginfo32to64(&info, &info32);
set_fs (KERNEL_DS);
ret = sys_rt_sigqueueinfo(pid, sig, &info);
set_fs (old_fs);
......@@ -1289,31 +1217,6 @@ sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
return ret;
}
extern asmlinkage long sys_modify_ldt(int func, void *ptr,
unsigned long bytecount);
asmlinkage long sys32_modify_ldt(int func, void *ptr, unsigned long bytecount)
{
long ret;
if (func == 0x1 || func == 0x11) {
struct user_desc info;
mm_segment_t old_fs = get_fs();
if (bytecount != sizeof(struct user_desc))
return -EINVAL;
if (copy_from_user(&info, ptr, sizeof(struct user_desc)))
return -EFAULT;
/* lm bit was undefined in the 32bit ABI and programs
give it random values. Force it to zero here. */
info.lm = 0;
set_fs(KERNEL_DS);
ret = sys_modify_ldt(func, &info, bytecount);
set_fs(old_fs);
} else {
ret = sys_modify_ldt(func, ptr, bytecount);
}
return ret;
}
/* Handle adjtimex compatibility. */
struct timex32 {
......@@ -2007,6 +1910,18 @@ long sys32_vm86_warning(void)
return -ENOSYS;
}
long sys32_quotactl(void)
{
struct task_struct *me = current;
static char lastcomm[8];
if (strcmp(lastcomm, me->comm)) {
printk(KERN_INFO "%s: 32bit quotactl not supported on 64 bit kernel\n",
me->comm);
strcpy(lastcomm, me->comm);
}
return -ENOSYS;
}
struct exec_domain ia32_exec_domain = {
.name = "linux/x86",
.pers_low = PER_LINUX32,
......
......@@ -56,6 +56,7 @@
/* address in low memory of the wakeup routine. */
unsigned long acpi_wakeup_address = 0;
unsigned long acpi_video_flags;
extern char wakeup_start, wakeup_end;
extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
......@@ -116,6 +117,22 @@ void __init acpi_reserve_bootmem(void)
printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
}
static int __init acpi_sleep_setup(char *str)
{
while ((str != NULL) && (*str != '\0')) {
if (strncmp(str, "s3_bios", 7) == 0)
acpi_video_flags = 1;
if (strncmp(str, "s3_mode", 7) == 0)
acpi_video_flags |= 2;
str = strchr(str, ',');
if (str != NULL)
str += strspn(str, ", \t");
}
return 1;
}
__setup("acpi_sleep=", acpi_sleep_setup);
#endif /*CONFIG_ACPI_SLEEP*/
void acpi_pci_link_exit(void) {}
......@@ -41,7 +41,19 @@ wakeup_code:
cmpl $0x12345678, %eax
jne bogus_real_magic
testl $1, video_flags - wakeup_code
jz 1f
lcall $0xc000,$3
movw %cs, %ax
movw %ax, %ds # Bios might have played with that
movw %ax, %ss
1:
testl $2, video_flags - wakeup_code
jz 1f
mov video_mode - wakeup_code, %ax
call mode_seta
1:
movw $0xb800, %ax
movw %ax,%fs
......@@ -250,6 +262,7 @@ real_save_gdt: .word 0
.quad 0
real_magic: .quad 0
video_mode: .quad 0
video_flags: .quad 0
bogus_real_magic:
movb $0xba,%al ; outb %al,$0x80
......@@ -382,8 +395,10 @@ ENTRY(acpi_copy_wakeup_routine)
movl %eax, saved_efer
movl %edx, saved_efer2
# movq saved_videomode, %rdx # FIXME: videomode
movq %rdx, video_mode - wakeup_start (,%rdi)
movl saved_video_mode, %edx
movl %edx, video_mode - wakeup_start (,%rdi)
movl acpi_video_flags, %edx
movl %edx, video_flags - wakeup_start (,%rdi)
movq $0x12345678, real_magic - wakeup_start (,%rdi)
movq $0x123456789abcdef0, %rdx
movq %rdx, saved_magic
......
......@@ -34,6 +34,7 @@
#include <asm/smp.h>
#include <asm/cache.h>
#include <asm/errno.h>
#include <asm/dwarf2.h>
#include <asm/calling.h>
#include <asm/offset.h>
#include <asm/msr.h>
......@@ -41,7 +42,6 @@
#include <asm/thread_info.h>
#include <asm/hw_irq.h>
#include <asm/errno.h>
#include <asm/dwarf2.h>
.code64
......@@ -82,22 +82,53 @@
/* push in order ss, rsp, eflags, cs, rip */
xorq %rax, %rax
pushq %rax /* ss */
CFI_ADJUST_CFA_OFFSET 8
pushq %rax /* rsp */
CFI_ADJUST_CFA_OFFSET 8
CFI_OFFSET rip,0
pushq $(1<<9) /* eflags - interrupts on */
CFI_ADJUST_CFA_OFFSET 8
pushq $__KERNEL_CS /* cs */
CFI_ADJUST_CFA_OFFSET 8
pushq \child_rip /* rip */
CFI_ADJUST_CFA_OFFSET 8
CFI_OFFSET rip,0
pushq %rax /* orig rax */
CFI_ADJUST_CFA_OFFSET 8
.endm
.macro UNFAKE_STACK_FRAME
addq $8*6, %rsp
CFI_ADJUST_CFA_OFFSET -(6*8)
.endm
.macro CFI_DEFAULT_STACK
CFI_ADJUST_CFA_OFFSET (SS)
CFI_OFFSET r15,R15-SS
CFI_OFFSET r14,R14-SS
CFI_OFFSET r13,R13-SS
CFI_OFFSET r12,R12-SS
CFI_OFFSET rbp,RBP-SS
CFI_OFFSET rbx,RBX-SS
CFI_OFFSET r11,R11-SS
CFI_OFFSET r10,R10-SS
CFI_OFFSET r9,R9-SS
CFI_OFFSET r8,R8-SS
CFI_OFFSET rax,RAX-SS
CFI_OFFSET rcx,RCX-SS
CFI_OFFSET rdx,RDX-SS
CFI_OFFSET rsi,RSI-SS
CFI_OFFSET rdi,RDI-SS
CFI_OFFSET rsp,RSP-SS
CFI_OFFSET rip,RIP-SS
.endm
/*
* A newly forked process directly context switches into this.
*/
/* rdi: prev */
ENTRY(ret_from_fork)
CFI_STARTPROC
CFI_DEFAULT_STACK
call schedule_tail
GET_THREAD_INFO(%rcx)
bt $TIF_SYSCALL_TRACE,threadinfo_flags(%rcx)
......@@ -115,6 +146,7 @@ rff_trace:
call syscall_trace
GET_THREAD_INFO(%rcx)
jmp rff_action
CFI_ENDPROC
/*
* System call entry. Upto 6 arguments in registers are supported.
......@@ -144,6 +176,7 @@ rff_trace:
*/
ENTRY(system_call)
CFI_STARTPROC
swapgs
movq %rsp,%gs:pda_oldrsp
movq %gs:pda_kernelstack,%rsp
......@@ -283,6 +316,7 @@ int_signal:
int_restore_rest:
RESTORE_REST
jmp int_with_check
CFI_ENDPROC
/*
* Certain special system calls that need to save a complete full stack frame.
......@@ -303,7 +337,9 @@ int_restore_rest:
PTREGSCALL stub_iopl, sys_iopl
ENTRY(ptregscall_common)
CFI_STARTPROC
popq %r11
CFI_ADJUST_CFA_OFFSET -8
SAVE_REST
movq %r11, %r15
FIXUP_TOP_OF_STACK %r11
......@@ -312,10 +348,14 @@ ENTRY(ptregscall_common)
movq %r15, %r11
RESTORE_REST
pushq %r11
CFI_ADJUST_CFA_OFFSET 8
ret
CFI_ENDPROC
ENTRY(stub_execve)
CFI_STARTPROC
popq %r11
CFI_ADJUST_CFA_OFFSET -8
SAVE_REST
movq %r11, %r15
FIXUP_TOP_OF_STACK %r11
......@@ -330,15 +370,18 @@ ENTRY(stub_execve)
ret
exec_32bit:
CFI_ADJUST_CFA_OFFSET REST_SKIP
movq %rax,RAX(%rsp)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
/*
* sigreturn is special because it needs to restore all registers on return.
* This cannot be done with SYSRET, so use the IRET return path instead.
*/
ENTRY(stub_rt_sigreturn)
CFI_STARTPROC
addq $8, %rsp
SAVE_REST
FIXUP_TOP_OF_STACK %r11
......@@ -346,6 +389,7 @@ ENTRY(stub_rt_sigreturn)
movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
/*
* Interrupt entry/exit.
......@@ -357,10 +401,20 @@ ENTRY(stub_rt_sigreturn)
/* 0(%rsp): interrupt number */
.macro interrupt func
CFI_STARTPROC simple
CFI_DEF_CFA rsp,(SS-ORIG_RAX)
CFI_OFFSET rsp,(RSP-SS)
CFI_OFFSET rip,(RIP-SS)
cld
#ifdef CONFIG_X86_REMOTE_DEBUG
#ifdef CONFIG_DEBUG_INFO
SAVE_ALL
movq %rsp,%rdi
/*
* Setup a stack frame pointer. This allows gdb to trace
* back to the original stack.
*/
movq %rsp,%rbp
CFI_DEF_CFA_REGISTER rbp
#else
SAVE_ARGS
leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler
......@@ -382,6 +436,9 @@ ret_from_intr:
popq %rdi
cli
subl $1,%gs:pda_irqcount
#ifdef CONFIG_KGDB
movq RBP(%rdi),%rbp
#endif
leaq ARGOFFSET(%rdi),%rsp
exit_intr:
GET_THREAD_INFO(%rcx)
......@@ -465,6 +522,7 @@ retint_kernel:
movl $0,threadinfo_preempt_count(%rcx)
jmp exit_intr
#endif
CFI_ENDPROC
/*
* APIC interrupts.
......@@ -473,6 +531,7 @@ retint_kernel:
pushq $\num-256
interrupt \func
jmp ret_from_intr
CFI_ENDPROC
.endm
#ifdef CONFIG_SMP
......@@ -518,24 +577,43 @@ ENTRY(spurious_interrupt)
* and the exception handler in %rax.
*/
ENTRY(error_entry)
CFI_STARTPROC simple
CFI_DEF_CFA rsp,(SS-RDI)
CFI_REL_OFFSET rsp,(RSP-RDI)
CFI_REL_OFFSET rip,(RIP-RDI)
/* rdi slot contains rax, oldrax contains error code */
cld
subq $14*8,%rsp
CFI_ADJUST_CFA_OFFSET (14*8)
movq %rsi,13*8(%rsp)
CFI_REL_OFFSET rsi,RSI
movq 14*8(%rsp),%rsi /* load rax from rdi slot */
movq %rdx,12*8(%rsp)
CFI_REL_OFFSET rdx,RDX
movq %rcx,11*8(%rsp)
CFI_REL_OFFSET rcx,RCX
movq %rsi,10*8(%rsp) /* store rax */
CFI_REL_OFFSET rax,RAX
movq %r8, 9*8(%rsp)
CFI_REL_OFFSET r8,R8
movq %r9, 8*8(%rsp)
CFI_REL_OFFSET r9,R9
movq %r10,7*8(%rsp)
CFI_REL_OFFSET r10,R10
movq %r11,6*8(%rsp)
CFI_REL_OFFSET r11,R11
movq %rbx,5*8(%rsp)
CFI_REL_OFFSET rbx,RBX
movq %rbp,4*8(%rsp)
CFI_REL_OFFSET rbp,RBP
movq %r12,3*8(%rsp)
CFI_REL_OFFSET r12,R12
movq %r13,2*8(%rsp)
CFI_REL_OFFSET r13,R13
movq %r14,1*8(%rsp)
CFI_REL_OFFSET r14,R14
movq %r15,(%rsp)
CFI_REL_OFFSET r15,R15
xorl %ebx,%ebx
testl $3,CS(%rsp)
je error_kernelspace
......@@ -561,6 +639,7 @@ error_exit:
swapgs
RESTORE_ARGS 0,8,0
iretq
CFI_ENDPROC
error_kernelspace:
incl %ebx
......@@ -615,6 +694,7 @@ bad_gs:
* rdi: fn, rsi: arg, rdx: flags
*/
ENTRY(kernel_thread)
CFI_STARTPROC
FAKE_STACK_FRAME $child_rip
SAVE_ALL
......@@ -642,6 +722,8 @@ ENTRY(kernel_thread)
RESTORE_ALL
UNFAKE_STACK_FRAME
ret
CFI_ENDPROC
child_rip:
/*
......@@ -671,6 +753,7 @@ child_rip:
* rdi: name, rsi: argv, rdx: envp, fake frame on the stack
*/
ENTRY(execve)
CFI_STARTPROC
FAKE_STACK_FRAME $0
SAVE_ALL
call sys_execve
......@@ -681,6 +764,7 @@ ENTRY(execve)
RESTORE_ARGS
UNFAKE_STACK_FRAME
ret
CFI_ENDPROC
ENTRY(page_fault)
errorentry do_page_fault
......@@ -692,6 +776,7 @@ ENTRY(simd_coprocessor_error)
zeroentry do_simd_coprocessor_error
ENTRY(device_not_available)
CFI_STARTPROC
pushq $-1 #error code
SAVE_ALL
movl $1,%ebx
......@@ -706,11 +791,13 @@ ENTRY(device_not_available)
cmoveq %rcx,%rdx
call *%rdx
jmp error_exit
CFI_ENDPROC
ENTRY(debug)
zeroentry do_debug
ENTRY(nmi)
CFI_STARTPROC
pushq $-1
SAVE_ALL
/* NMI could happen inside the critical section of a swapgs,
......@@ -731,6 +818,7 @@ ENTRY(nmi)
swapgs
2: RESTORE_ALL 8
iretq
CFI_ENDPROC
ENTRY(int3)
zeroentry do_int3
......
......@@ -46,11 +46,6 @@ void __init fpu_init(void)
current->used_math = 0;
}
/*
* The _current_ task is using the FPU for the first time
* so initialize it and set the mxcsr to its default.
* remember the current task has used the FPU.
*/
void init_fpu(struct task_struct *child)
{
if (child->used_math) {
......
......@@ -107,7 +107,6 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
retval = copy_ldt(&mm->context, &old_mm->context);
up(&old_mm->context.sem);
}
rwlock_init(&mm->context.ldtlock);
return retval;
}
......@@ -216,10 +215,8 @@ static int write_ldt(void * ptr, unsigned long bytecount, int oldmode)
/* Install the new entry ... */
install:
write_lock(&mm->context.ldtlock);
*lp = entry_1;
*(lp+1) = entry_2;
write_unlock(&mm->context.ldtlock);
error = 0;
out_unlock:
......
......@@ -35,6 +35,7 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
BUG_ON(!s->page);
s->dma_address = pci_map_page(hwdev, s->page, s->offset,
s->length, direction);
s->dma_length = s->length;
}
return nents;
}
......@@ -53,7 +54,7 @@ void pci_unmap_sg(struct pci_dev *dev, struct scatterlist *sg,
struct scatterlist *s = &sg[i];
BUG_ON(s->page == NULL);
BUG_ON(s->dma_address == 0);
pci_unmap_single(dev, s->dma_address, s->length, dir);
pci_unmap_single(dev, s->dma_address, s->dma_length, dir);
}
}
......
......@@ -382,10 +382,12 @@ static int pci_map_sg_nonforce(struct pci_dev *dev, struct scatterlist *sg,
if (i > 0)
pci_unmap_sg(dev, sg, i, dir);
nents = 0;
sg[0].dma_length = 0;
break;
}
}
s->dma_address = addr;
s->dma_length = s->length;
}
flush_gart(dev);
return nents;
......@@ -412,8 +414,9 @@ static int __pci_map_cont(struct scatterlist *sg, int start, int stopat,
*sout = *s;
sout->dma_address = iommu_bus_base;
sout->dma_address += iommu_page*PAGE_SIZE + s->offset;
sout->dma_length = s->length;
} else {
sout->length += s->length;
sout->dma_length += s->length;
}
addr = phys_addr;
......@@ -436,6 +439,7 @@ static inline int pci_map_cont(struct scatterlist *sg, int start, int stopat,
if (!need) {
BUG_ON(stopat - start != 1);
*sout = sg[start];
sout->dma_length = sg[start].length;
return 0;
}
return __pci_map_cont(sg, start, stopat, sout, pages);
......@@ -453,8 +457,6 @@ int pci_map_sg(struct pci_dev *dev, struct scatterlist *sg, int nents, int dir)
unsigned long pages = 0;
int need = 0, nextneed;
unsigned long size = 0;
BUG_ON(dir == PCI_DMA_NONE);
if (nents == 0)
return 0;
......@@ -466,7 +468,6 @@ int pci_map_sg(struct pci_dev *dev, struct scatterlist *sg, int nents, int dir)
s->dma_address = addr;
BUG_ON(s->length == 0);
size += s->length;
nextneed = need_iommu(dev, addr, s->length);
/* Handle the previous not yet processed entries */
......@@ -493,7 +494,7 @@ int pci_map_sg(struct pci_dev *dev, struct scatterlist *sg, int nents, int dir)
out++;
flush_gart(dev);
if (out < nents)
sg[out].length = 0;
sg[out].dma_length = 0;
return out;
error:
......@@ -540,9 +541,9 @@ void pci_unmap_sg(struct pci_dev *dev, struct scatterlist *sg, int nents,
int i;
for (i = 0; i < nents; i++) {
struct scatterlist *s = &sg[i];
if (!s->length)
if (!s->dma_length || !s->length)
break;
pci_unmap_single(dev, s->dma_address, s->length, dir);
pci_unmap_single(dev, s->dma_address, s->dma_length, dir);
}
}
......@@ -800,7 +801,8 @@ fs_initcall(pci_iommu_init);
merge Do SG merging. Implies force (experimental)
nomerge Don't do SG merging.
forcesac For SAC mode for masks <40bits (experimental)
fullflush Flush IOMMU on each allocation (for testing)
fullflush Flush IOMMU on each allocation (default)
nofullflush Don't use IOMMU fullflush
*/
__init int iommu_setup(char *opt)
{
......@@ -838,6 +840,8 @@ __init int iommu_setup(char *opt)
iommu_sac_force = 1;
if (!memcmp(p, "fullflush", 9))
iommu_fullflush = 1;
if (!memcmp(p, "nofullflush", 11))
iommu_fullflush = 0;
#ifdef CONFIG_IOMMU_LEAK
if (!memcmp(p,"leak", 4)) {
leak_trace = 1;
......
......@@ -152,20 +152,6 @@ static int __init idle_setup (char *str)
__setup("idle=", idle_setup);
void idle_warning(void)
{
static int warned;
if (warned)
return;
warned = 1;
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
BUG();
printk(KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n");
printk(KERN_ERR "******* Working around it, but it will cost you a lot of power\n");
printk(KERN_ERR "******* Please consider a BIOS update.\n");
printk(KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n");
}
/* Prints also some state that isn't saved in the pt_regs */
void __show_regs(struct pt_regs * regs)
{
......@@ -234,6 +220,10 @@ void exit_thread(void)
void flush_thread(void)
{
struct task_struct *tsk = current;
struct thread_info *t = current_thread_info();
if (t->flags & _TIF_ABI_PENDING)
t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32);
tsk->thread.debugreg0 = 0;
tsk->thread.debugreg1 = 0;
......@@ -440,7 +430,6 @@ struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *
write_pda(pcurrent, next_p);
write_pda(kernelstack, (unsigned long)next_p->thread_info + THREAD_SIZE - PDA_STACKOFFSET);
/*
* Now maybe reload the debug registers
*/
......
......@@ -65,43 +65,78 @@ long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigne
return error;
}
unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)
static void find_start_end(unsigned long flags, unsigned long *begin,
unsigned long *end)
{
struct vm_area_struct *vma;
unsigned long end = TASK_SIZE;
#ifdef CONFIG_IA32_EMULATION
if (test_thread_flag(TIF_IA32)) {
if (!addr)
addr = TASK_UNMAPPED_32;
end = IA32_PAGE_OFFSET;
*begin = TASK_UNMAPPED_32;
*end = IA32_PAGE_OFFSET;
} else
#endif
if (flags & MAP_32BIT) {
/* This is usually used needed to map code in small model, so it needs to
be in the first 31bit. Limit it to that.
This means we need to move the unmapped base down for this case. This can
give conflicts with the heap, but we assume that glibc malloc knows how
to fall back to mmap. Give it 1GB of playground for now. -AK */
if (!addr)
addr = 0x40000000;
end = 0x80000000;
/* This is usually used needed to map code in small
model, so it needs to be in the first 31bit. Limit
it to that. This means we need to move the
unmapped base down for this case. This can give
conflicts with the heap, but we assume that glibc
malloc knows how to fall back to mmap. Give it 1GB
of playground for now. -AK */
*begin = 0x40000000;
*end = 0x80000000;
} else {
if (!addr)
addr = TASK_UNMAPPED_64;
end = TASK_SIZE;
*begin = TASK_UNMAPPED_64;
*end = TASK_SIZE;
}
}
unsigned long
arch_get_unmapped_area(struct file *filp, unsigned long addr,
unsigned long len, unsigned long pgoff, unsigned long flags)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
unsigned long start_addr;
unsigned long begin, end;
find_start_end(flags, &begin, &end);
if (len > end)
return -ENOMEM;
if (addr) {
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
if (end - len >= addr &&
(!vma || addr + len <= vma->vm_start))
return addr;
}
addr = mm->free_area_cache;
if (addr < begin)
addr = begin;
start_addr = addr;
for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
full_search:
for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
/* At this point: (!vma || addr < vma->vm_end). */
if (end - len < addr)
if (end - len < addr) {
/*
* Start a new search - just in case we missed
* some holes.
*/
if (start_addr != begin) {
start_addr = addr = begin;
goto full_search;
}
return -ENOMEM;
if (!vma || addr + len <= vma->vm_start)
}
if (!vma || addr + len <= vma->vm_start) {
/*
* Remember the place where we stopped the search:
*/
mm->free_area_cache = addr + len;
return addr;
}
addr = vma->vm_end;
}
}
......
......@@ -10,6 +10,7 @@
* Copyright (c) 1998 Andrea Arcangeli
* Copyright (c) 2002 Vojtech Pavlik
* Copyright (c) 2003 Andi Kleen
* RTC support code taken from arch/i386/kernel/timers/time_hpet.c
*
*/
......@@ -28,6 +29,7 @@
#include <asm/vsyscall.h>
#include <asm/timex.h>
#include <asm/proto.h>
#include <asm/hpet.h>
#include <linux/cpufreq.h>
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/apic.h>
......@@ -627,10 +629,10 @@ static int hpet_init(void)
* and period also hpet_tick.
*/
hpet_writel(HPET_T0_ENABLE | HPET_T0_PERIODIC | HPET_T0_SETVAL |
HPET_T0_32BIT, HPET_T0_CFG);
hpet_writel(hpet_tick, HPET_T0_CMP);
hpet_writel(HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
HPET_TN_32BIT, HPET_T0_CFG);
hpet_writel(hpet_tick, HPET_T0_CMP);
hpet_writel(hpet_tick, HPET_T0_CMP); /* AK: why twice? */
/*
* Go!
......@@ -733,3 +735,229 @@ void __init time_init_smp(void)
}
__setup("report_lost_ticks", time_setup);
#ifdef CONFIG_HPET_EMULATE_RTC
/* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
* is enabled, we support RTC interrupt functionality in software.
* RTC has 3 kinds of interrupts:
* 1) Update Interrupt - generate an interrupt, every sec, when RTC clock
* is updated
* 2) Alarm Interrupt - generate an interrupt at a specific time of day
* 3) Periodic Interrupt - generate periodic interrupt, with frequencies
* 2Hz-8192Hz (2Hz-64Hz for non-root user) (all freqs in powers of 2)
* (1) and (2) above are implemented using polling at a frequency of
* 64 Hz. The exact frequency is a tradeoff between accuracy and interrupt
* overhead. (DEFAULT_RTC_INT_FREQ)
* For (3), we use interrupts at 64Hz or user specified periodic
* frequency, whichever is higher.
*/
#include <linux/mc146818rtc.h>
#include <linux/rtc.h>
extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
#define DEFAULT_RTC_INT_FREQ 64
#define RTC_NUM_INTS 1
static unsigned long UIE_on;
static unsigned long prev_update_sec;
static unsigned long AIE_on;
static struct rtc_time alarm_time;
static unsigned long PIE_on;
static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ;
static unsigned long PIE_count;
static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */
int is_hpet_enabled(void)
{
return vxtime.hpet_address != 0;
}
/*
* Timer 1 for RTC, we do not use periodic interrupt feature,
* even if HPET supports periodic interrupts on Timer 1.
* The reason being, to set up a periodic interrupt in HPET, we need to
* stop the main counter. And if we do that everytime someone diables/enables
* RTC, we will have adverse effect on main kernel timer running on Timer 0.
* So, for the time being, simulate the periodic interrupt in software.
*
* hpet_rtc_timer_init() is called for the first time and during subsequent
* interuppts reinit happens through hpet_rtc_timer_reinit().
*/
int hpet_rtc_timer_init(void)
{
unsigned int cfg, cnt;
unsigned long flags;
if (!is_hpet_enabled())
return 0;
/*
* Set the counter 1 and enable the interrupts.
*/
if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
hpet_rtc_int_freq = PIE_freq;
else
hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
local_irq_save(flags);
cnt = hpet_readl(HPET_COUNTER);
cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq);
hpet_writel(cnt, HPET_T1_CMP);
local_irq_restore(flags);
cfg = hpet_readl(HPET_T1_CFG);
cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
hpet_writel(cfg, HPET_T1_CFG);
return 1;
}
static void hpet_rtc_timer_reinit(void)
{
unsigned int cfg, cnt;
if (!(PIE_on | AIE_on | UIE_on))
return;
if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
hpet_rtc_int_freq = PIE_freq;
else
hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
/* It is more accurate to use the comparator value than current count.*/
cnt = hpet_readl(HPET_T1_CMP);
cnt += hpet_tick*HZ/hpet_rtc_int_freq;
hpet_writel(cnt, HPET_T1_CMP);
cfg = hpet_readl(HPET_T1_CFG);
cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
hpet_writel(cfg, HPET_T1_CFG);
return;
}
/*
* The functions below are called from rtc driver.
* Return 0 if HPET is not being used.
* Otherwise do the necessary changes and return 1.
*/
int hpet_mask_rtc_irq_bit(unsigned long bit_mask)
{
if (!is_hpet_enabled())
return 0;
if (bit_mask & RTC_UIE)
UIE_on = 0;
if (bit_mask & RTC_PIE)
PIE_on = 0;
if (bit_mask & RTC_AIE)
AIE_on = 0;
return 1;
}
int hpet_set_rtc_irq_bit(unsigned long bit_mask)
{
int timer_init_reqd = 0;
if (!is_hpet_enabled())
return 0;
if (!(PIE_on | AIE_on | UIE_on))
timer_init_reqd = 1;
if (bit_mask & RTC_UIE) {
UIE_on = 1;
}
if (bit_mask & RTC_PIE) {
PIE_on = 1;
PIE_count = 0;
}
if (bit_mask & RTC_AIE) {
AIE_on = 1;
}
if (timer_init_reqd)
hpet_rtc_timer_init();
return 1;
}
int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec)
{
if (!is_hpet_enabled())
return 0;
alarm_time.tm_hour = hrs;
alarm_time.tm_min = min;
alarm_time.tm_sec = sec;
return 1;
}
int hpet_set_periodic_freq(unsigned long freq)
{
if (!is_hpet_enabled())
return 0;
PIE_freq = freq;
PIE_count = 0;
return 1;
}
int hpet_rtc_dropped_irq(void)
{
if (!is_hpet_enabled())
return 0;
return 1;
}
irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
struct rtc_time curr_time;
unsigned long rtc_int_flag = 0;
int call_rtc_interrupt = 0;
hpet_rtc_timer_reinit();
if (UIE_on | AIE_on) {
rtc_get_rtc_time(&curr_time);
}
if (UIE_on) {
if (curr_time.tm_sec != prev_update_sec) {
/* Set update int info, call real rtc int routine */
call_rtc_interrupt = 1;
rtc_int_flag = RTC_UF;
prev_update_sec = curr_time.tm_sec;
}
}
if (PIE_on) {
PIE_count++;
if (PIE_count >= hpet_rtc_int_freq/PIE_freq) {
/* Set periodic int info, call real rtc int routine */
call_rtc_interrupt = 1;
rtc_int_flag |= RTC_PF;
PIE_count = 0;
}
}
if (AIE_on) {
if ((curr_time.tm_sec == alarm_time.tm_sec) &&
(curr_time.tm_min == alarm_time.tm_min) &&
(curr_time.tm_hour == alarm_time.tm_hour)) {
/* Set alarm int info, call real rtc int routine */
call_rtc_interrupt = 1;
rtc_int_flag |= RTC_AF;
}
}
if (call_rtc_interrupt) {
rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8));
rtc_interrupt(rtc_int_flag, dev_id, regs);
}
return IRQ_HANDLED;
}
#endif
......@@ -405,9 +405,7 @@ static void do_trap(int trapnr, int signr, char *str,
if ((regs->cs & 3) != 0) {
struct task_struct *tsk = current;
if (exception_trace && !(tsk->ptrace & PT_PTRACED) &&
(tsk->sighand->action[signr-1].sa.sa_handler == SIG_IGN ||
(tsk->sighand->action[signr-1].sa.sa_handler == SIG_DFL)))
if (exception_trace && unhandled_signal(tsk, signr))
printk(KERN_INFO
"%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
tsk->comm, tsk->pid, str,
......@@ -491,9 +489,7 @@ asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
if ((regs->cs & 3)!=0) {
struct task_struct *tsk = current;
if (exception_trace && !(tsk->ptrace & PT_PTRACED) &&
(tsk->sighand->action[SIGSEGV-1].sa.sa_handler == SIG_IGN ||
(tsk->sighand->action[SIGSEGV-1].sa.sa_handler == SIG_DFL)))
if (exception_trace && unhandled_signal(tsk, SIGSEGV))
printk(KERN_INFO
"%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
tsk->comm, tsk->pid,
......@@ -553,6 +549,8 @@ asmlinkage void default_do_nmi(struct pt_regs * regs)
unsigned char reason = inb(0x61);
if (!(reason & 0xc0)) {
if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) == NOTIFY_BAD)
return;
#ifdef CONFIG_X86_LOCAL_APIC
/*
* Ok, so this is none of the documented NMI sources,
......
......@@ -3,6 +3,7 @@
*/
#include <asm-generic/vmlinux.lds.h>
#include <linux/config.h>
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
......@@ -137,7 +138,9 @@ SECTIONS
/* Sections to be discarded */
/DISCARD/ : {
*(.exitcall.exit)
#ifndef CONFIG_DEBUG_INFO
*(.eh_frame)
#endif
}
/* DWARF 2 */
......
......@@ -149,13 +149,11 @@ EXPORT_SYMBOL_GPL(unset_nmi_callback);
#undef strncpy
#undef strchr
#undef strcmp
#undef bcopy
#undef strcpy
#undef strcat
extern void * memset(void *,int,__kernel_size_t);
extern size_t strlen(const char *);
extern void bcopy(const char * src, char * dest, int count);
extern void * memmove(void * dest,const void *src,size_t count);
extern char * strcpy(char * dest,const char *src);
extern int strcmp(const char * cs,const char * ct);
......@@ -178,7 +176,6 @@ EXPORT_SYMBOL_NOVERS(memchr);
EXPORT_SYMBOL_NOVERS(strrchr);
EXPORT_SYMBOL_NOVERS(strnlen);
EXPORT_SYMBOL_NOVERS(memscan);
EXPORT_SYMBOL_NOVERS(bcopy);
EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL_NOVERS(__memcpy);
......
......@@ -8,6 +8,7 @@
#include <linux/config.h>
#include <linux/linkage.h>
#include <asm/dwarf2.h>
#include <asm/calling.h>
#include <asm/rwlock.h>
......@@ -15,18 +16,22 @@
.macro thunk name,func
.globl \name
\name:
CFI_STARTPROC
SAVE_ARGS
call \func
jmp restore
CFI_ENDPROC
.endm
/* rdi: arg1 ... normal C conventions. rax is passed from C. */
.macro thunk_retrax name,func
.globl \name
\name:
CFI_STARTPROC
SAVE_ARGS
call \func
jmp restore_norax
CFI_ENDPROC
.endm
......@@ -43,13 +48,20 @@
thunk_retrax __down_failed_trylock,__down_trylock
thunk __up_wakeup,__up
/* SAVE_ARGS below is used only for the .cfi directives it contains. */
CFI_STARTPROC
SAVE_ARGS
restore:
RESTORE_ARGS
ret
CFI_ENDPROC
CFI_STARTPROC
SAVE_ARGS
restore_norax:
RESTORE_ARGS 1
ret
CFI_ENDPROC
#ifdef CONFIG_SMP
/* Support for read/write spinlocks. */
......
......@@ -88,7 +88,7 @@ unsigned long __clear_user(void *addr, unsigned long size)
" .quad 1b,2b\n"
".previous"
: [size8] "=c"(size), [dst] "=&D" (__d0)
: [size1] "r"(size & 7), "[size8]" (size / 8), "[dst] "(addr),
: [size1] "r"(size & 7), "[size8]" (size / 8), "[dst]"(addr),
[zero] "r" (0UL), [eight] "r" (8UL));
return size;
}
......
......@@ -32,6 +32,7 @@
#include <asm/tlbflush.h>
#include <asm/proto.h>
#include <asm/kdebug.h>
#include <asm-generic/sections.h>
void bust_spinlocks(int yes)
{
......@@ -169,8 +170,45 @@ void dump_pagetable(unsigned long address)
printk("BAD\n");
}
static inline int unhandled_signal(struct task_struct *tsk, int sig)
static const char errata93_warning[] =
KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n"
KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n"
KERN_ERR "******* Please consider a BIOS update.\n"
KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n";
/* Workaround for K8 erratum #93 & buggy BIOS.
BIOS SMM functions are required to use a specific workaround
to avoid corruption of the 64bit RIP register on C stepping K8.
A lot of BIOS that didn't get tested properly miss this.
The OS sees this as a page fault with the upper 32bits of RIP cleared.
Try to work around it here.
Note we only handle faults in kernel here. */
static int is_errata93(struct pt_regs *regs, unsigned long address)
{
static int warned;
if (address != regs->rip)
return 0;
if ((address >> 32) != 0)
return 0;
address |= 0xffffffffUL << 32;
if ((address >= (u64)_stext && address <= (u64)_etext) ||
(address >= MODULES_VADDR && address <= MODULES_END)) {
if (!warned) {
printk(errata93_warning);
warned = 1;
}
regs->rip = address;
return 1;
}
return 0;
}
int unhandled_signal(struct task_struct *tsk, int sig)
{
/* Warn for strace, but not for gdb */
if ((tsk->ptrace & (PT_PTRACED|PT_TRACESYSGOOD)) == PT_PTRACED)
return 0;
return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
(tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
}
......@@ -331,8 +369,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (is_prefetch(regs, address))
return;
if (exception_trace && !(tsk->ptrace & PT_PTRACED) &&
!unhandled_signal(tsk, SIGSEGV)) {
if (exception_trace && !unhandled_signal(tsk, SIGSEGV)) {
printk(KERN_INFO
"%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
tsk->comm, tsk->pid, address, regs->rip,
......@@ -360,9 +397,16 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
return;
}
/*
* Hall of shame of CPU/BIOS bugs.
*/
if (is_prefetch(regs, address))
return;
if (is_errata93(regs, address))
return;
/*
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice.
......
......@@ -47,7 +47,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
struct node nodes[MAXNODE];
int nodeid, i, nb;
int found = 0;
int nmax;
u32 reg;
nb = find_northbridge();
if (nb < 0)
......@@ -55,8 +55,10 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb);
nmax = (1 << ((read_pci_config(0, nb, 0, 0x60 ) >> 4) & 3));
numnodes = nmax;
reg = read_pci_config(0, nb, 0, 0x60);
numnodes = ((reg >> 4) & 7) + 1;
printk(KERN_INFO "Number of nodes %d (%x)\n", numnodes, reg);
memset(&nodes,0,sizeof(nodes));
prevbase = 0;
......@@ -66,12 +68,17 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
base = read_pci_config(0, nb, 1, 0x40 + i*8);
limit = read_pci_config(0, nb, 1, 0x44 + i*8);
nodeid = limit & 3;
nodeid = limit & 7;
if ((base & 3) == 0) {
if (i < nmax)
if (i < numnodes)
printk("Skipping disabled node %d\n", i);
continue;
}
if (nodeid >= numnodes) {
printk("Ignoring excess node %d (%x:%x)\n", nodeid,
base, limit);
continue;
}
if (!limit) {
printk(KERN_INFO "Skipping node entry %d (base %lx)\n", i,
......
......@@ -109,10 +109,6 @@ typedef void irqreturn_t;
#define pci_get_drvdata(pci_dev) (pci_dev)->driver_data
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,44)
#define pci_pool_create(a, b, c, d, e) pci_pool_create(a, b, c, d, e, SLAB_KERNEL)
#endif
#include "he.h"
#include "suni.h"
......@@ -1986,8 +1982,7 @@ he_service_tbrq(struct he_dev *he_dev, int group)
TBRQ_MULTIPLE(he_dev->tbrq_head) ? " MULTIPLE" : "");
#ifdef USE_TPD_POOL
tpd = NULL;
p = &he_dev->outstanding_tpds;
while ((p = p->next) != &he_dev->outstanding_tpds) {
list_for_each(p, &he_dev->outstanding_tpds) {
struct he_tpd *__tpd = list_entry(p, struct he_tpd, entry);
if (TPD_ADDR(__tpd->status) == TBRQ_TPD(he_dev->tbrq_head)) {
tpd = __tpd;
......
......@@ -361,7 +361,7 @@ request_firmware(const struct firmware **firmware, const char *name,
wait_for_completion(&fw_priv->completion);
del_timer(&fw_priv->timeout);
del_timer_sync(&fw_priv->timeout);
fw_remove_class_device(class_dev);
if (fw_priv->fw->size && !fw_priv->abort) {
......
......@@ -130,7 +130,7 @@ config PARIDE_BPCK
config PARIDE_BPCK6
tristate "MicroSolutions backpack (Series 6) protocol"
depends on PARIDE
depends on PARIDE && !64BIT
---help---
This option enables support for the Micro Solutions BACKPACK
parallel port Series 6 IDE protocol. (Most BACKPACK drives made
......
......@@ -493,7 +493,6 @@ int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi)
return 0;
}
printk(KERN_ERR "cdrom: %s: unknown mrw mode page\n", cdi->name);
return 1;
}
......
......@@ -64,10 +64,9 @@ config DRM_I830
module will be called i830. AGP support is required for this driver
to work.
config DRM_MGA
tristate "Matrox g200/g400"
depends on DRM && AGP
depends on DRM && AGP && (!X86_64 || BROKEN)
help
Choose this option if you have a Matrox G200, G400 or G450 graphics
card. If M is selected, the module will be called mga. AGP
......
......@@ -8,6 +8,9 @@
# In the future, some of these should be built conditionally.
#
# First come modules that register themselves with the core
EXTRA_CFLAGS += -Idrivers/ide
obj-$(CONFIG_BLK_DEV_IDE) += pci/
# Core IDE code - must come before legacy
......
......@@ -1605,8 +1605,8 @@ static void idedisk_setup (ide_drive_t *drive)
if (drive->addressing == 0 && drive->capacity64 > 1ULL << 28) {
printk("%s: cannot use LBA48 - full capacity "
"%llu sectors (%llu MB)\n",
drive->name,
drive->capacity64, sectors_to_MB(drive->capacity64));
drive->name, (unsigned long long)drive->capacity64,
sectors_to_MB(drive->capacity64));
drive->capacity64 = 1ULL << 28;
}
......
......@@ -32,6 +32,11 @@
#include <asm/io.h>
#include <asm/irq.h>
#ifdef CONFIG_PPC_PMAC
#include <asm/prom.h>
#include <asm/pci-bridge.h>
#endif
#include "pdc202xx_new.h"
#define PDC202_DEBUG_CABLE 0
......@@ -513,6 +518,44 @@ void pdcnew_reset (ide_drive_t *drive)
#endif
}
#ifdef CONFIG_PPC_PMAC
static void __devinit apple_kiwi_init(struct pci_dev *pdev)
{
struct device_node *np = pci_device_to_OF_node(pdev);
unsigned int class_rev = 0;
unsigned long mmio;
u8 conf;
if (np == NULL || !device_is_compatible(np, "kiwi-root"))
return;
pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
class_rev &= 0xff;
if (class_rev >= 0x03) {
/* Setup chip magic config stuff (from darwin) */
pci_read_config_byte(pdev, 0x40, &conf);
pci_write_config_byte(pdev, 0x40, conf | 0x01);
}
mmio = (unsigned long)ioremap(pci_resource_start(pdev, 5),
pci_resource_len(pdev, 5));
/* Setup some PLL stuffs */
switch (pdev->device) {
case PCI_DEVICE_ID_PROMISE_20270:
writew(0x0d2b, mmio + 0x1202);
mdelay(30);
break;
case PCI_DEVICE_ID_PROMISE_20271:
writew(0x0826, mmio + 0x1202);
mdelay(30);
break;
}
iounmap((void *)mmio);
}
#endif /* CONFIG_PPC_PMAC */
static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char *name)
{
if (dev->resource[PCI_ROM_RESOURCE].start) {
......@@ -522,6 +565,10 @@ static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char
name, dev->resource[PCI_ROM_RESOURCE].start);
}
#ifdef CONFIG_PPC_PMAC
apple_kiwi_init(dev);
#endif
#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
pdc202_devs[n_pdc202_devs++] = dev;
......
......@@ -377,6 +377,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
unsigned long flags;
unsigned char str, data;
unsigned int dfl;
int ret;
spin_lock_irqsave(&i8042_lock, flags);
str = i8042_read_status();
......@@ -385,7 +386,8 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (~str & I8042_STR_OBF) {
if (irq) dbg("Interrupt %d, without any data", irq);
return IRQ_RETVAL(0);
ret = 0;
goto out;
}
dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
......@@ -428,9 +430,10 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
serio_interrupt(&i8042_kbd_port, data, dfl, regs);
irq_ret:
ret = 1;
out:
mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
return IRQ_RETVAL(1);
return IRQ_RETVAL(ret);
}
/*
......
......@@ -3106,7 +3106,8 @@ static inline void md_enter_safemode(mddev_t *mddev)
{
if (!mddev->safemode) return;
if (mddev->safemode == 2 &&
(atomic_read(&mddev->writes_pending) || mddev->in_sync))
(atomic_read(&mddev->writes_pending) || mddev->in_sync ||
mddev->recovery_cp != MaxSector))
return; /* avoid the lock */
mddev_lock_uninterruptible(mddev);
if (mddev->safemode && !atomic_read(&mddev->writes_pending) &&
......
......@@ -29,6 +29,7 @@ extern const struct raid6_calls raid6_intx2;
extern const struct raid6_calls raid6_intx4;
extern const struct raid6_calls raid6_intx8;
extern const struct raid6_calls raid6_intx16;
extern const struct raid6_calls raid6_intx32;
extern const struct raid6_calls raid6_mmxx1;
extern const struct raid6_calls raid6_mmxx2;
extern const struct raid6_calls raid6_sse1x1;
......
......@@ -15,7 +15,7 @@
*
* $#-way unrolled portable integer math RAID-6 instruction set
*
* This file is postprocessed using unroller.pl
* This file is postprocessed using unroll.pl
*/
#include "raid6.h"
......
......@@ -1146,7 +1146,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
0x00, 0x00, 0x00, 0x00,
0x61, 0x00 };
u8 b1[] = { 0x61 };
u8 b[ARM_PACKET_SIZE];
u8 *b;
char idstring[21];
u8 *firmware = NULL;
size_t firmware_size = 0;
......@@ -1203,6 +1203,10 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
trans_count = 0;
j = 0;
b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
if (b == NULL)
return -ENOMEM;
for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
size = firmware_size - i;
if (size > COMMAND_PACKET_SIZE)
......@@ -1230,6 +1234,8 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
kfree(b);
return result;
}
......
......@@ -875,6 +875,7 @@ static ssize_t w9966_v4l_read(struct file *file, char *buf,
unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000
unsigned char* dest = (unsigned char*)buf;
unsigned long dleft = count;
unsigned char *tbuf;
// Why would anyone want more than this??
if (count > cam->width * cam->height * 2)
......@@ -894,25 +895,33 @@ static ssize_t w9966_v4l_read(struct file *file, char *buf,
w9966_pdev_release(cam);
return -EFAULT;
}
tbuf = kmalloc(W9966_RBUFFER, GFP_KERNEL);
if (tbuf == NULL) {
count = -ENOMEM;
goto out;
}
while(dleft > 0)
{
unsigned long tsize = (dleft > W9966_RBUFFER) ? W9966_RBUFFER : dleft;
unsigned char tbuf[W9966_RBUFFER];
if (parport_read(cam->pport, tbuf, tsize) < tsize) {
w9966_pdev_release(cam);
return -EFAULT;
count = -EFAULT;
goto out;
}
if (copy_to_user(dest, tbuf, tsize) != 0) {
w9966_pdev_release(cam);
return -EFAULT;
count = -EFAULT;
goto out;
}
dest += tsize;
dleft -= tsize;
}
w9966_wReg(cam, 0x01, 0x18); // Disable capture
out:
kfree(tbuf);
w9966_pdev_release(cam);
return count;
......
......@@ -3,7 +3,7 @@ menu "I2O device support"
config I2O
tristate "I2O support"
depends on PCI
depends on PCI && !64BIT
---help---
The Intelligent Input/Output (I2O) architecture allows hardware
drivers to be split into two parts: an operating system specific
......
......@@ -615,8 +615,10 @@ static int cp_rx_poll (struct net_device *dev, int *budget)
if (cpr16(IntrStatus) & cp_rx_intr_mask)
goto rx_status_loop;
netif_rx_complete(dev);
local_irq_disable();
cpw16_f(IntrMask, cp_intr_mask);
__netif_rx_complete(dev);
local_irq_enable();
return 0; /* done */
}
......@@ -643,6 +645,12 @@ cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
spin_lock(&cp->lock);
/* close possible race's with dev_close */
if (unlikely(!netif_running(dev))) {
cpw16(IntrMask, 0);
goto out;
}
if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) {
if (netif_rx_schedule_prep(dev)) {
cpw16_f(IntrMask, cp_norx_intr_mask);
......@@ -664,7 +672,7 @@ cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
/* TODO: reset hardware */
}
out:
spin_unlock(&cp->lock);
return IRQ_HANDLED;
}
......
......@@ -65,6 +65,75 @@ config TEKRAM_DONGLE
dongles you will have to start irattach like this:
"irattach -d tekram".
config LITELINK_DONGLE
tristate "Parallax LiteLink dongle"
depends on DONGLE && IRDA
help
Say Y here if you want to build support for the Parallax Litelink
dongle. To compile it as a module, choose M here. The Parallax
dongle attaches to the normal 9-pin serial port connector, and can
currently only be used by IrTTY. To activate support for Parallax
dongles you will have to start irattach like this:
"irattach -d litelink".
config MA600_DONGLE
tristate "Mobile Action MA600 dongle"
depends on DONGLE && IRDA && EXPERIMENTAL
help
Say Y here if you want to build support for the Mobile Action MA600
dongle. To compile it as a module, choose M here. The MA600 dongle
attaches to the normal 9-pin serial port connector, and can
currently only be used by IrTTY. The driver should also support
the MA620 USB version of the dongle, if the integrated USB-to-RS232
converter is supported by usbserial. To activate support for
MA600 dongle you will have to start irattach like this:
"irattach -d ma600".
config GIRBIL_DONGLE
tristate "Greenwich GIrBIL dongle"
depends on DONGLE && IRDA && EXPERIMENTAL
help
Say Y here if you want to build support for the Greenwich GIrBIL
dongle. If you want to compile it as a module, choose M here.
The Greenwich dongle attaches to the normal 9-pin serial port
connector, and can currently only be used by IrTTY. To activate
support for Greenwich dongles you will have to start irattach
like this: "irattach -d girbil".
config MCP2120_DONGLE
tristate "Microchip MCP2120"
depends on DONGLE && IRDA && EXPERIMENTAL
help
Say Y here if you want to build support for the Microchip MCP2120
dongle. If you want to compile it as a module, choose M here.
The MCP2120 dongle attaches to the normal 9-pin serial port
connector, and can currently only be used by IrTTY. To activate
support for MCP2120 dongles you will have to start irattach
like this: "irattach -d mcp2120".
You must build this dongle yourself. For more information see:
<http://www.eyetap.org/~tangf/irda_sir_linux.html>
config OLD_BELKIN_DONGLE
tristate "Old Belkin dongle"
depends on DONGLE && IRDA && EXPERIMENTAL
help
Say Y here if you want to build support for the Adaptec Airport 1000
and 2000 dongles. If you want to compile it as a module, choose
M here. Some information is contained in the comments
at the top of <file:drivers/net/irda/old_belkin.c>.
config ACT200L_DONGLE
tristate "ACTiSYS IR-200L dongle"
depends on DONGLE && IRDA && EXPERIMENTAL
help
Say Y here if you want to build support for the ACTiSYS IR-200L
dongle. If you want to compile it as a module, choose M here.
The ACTiSYS IR-200L dongle attaches to the normal 9-pin serial
port connector, and can currently only be used by IrTTY.
To activate support for ACTiSYS IR-200L dongle you will have to
start irattach like this: "irattach -d act200l".
comment "Old SIR device drivers"
config IRPORT_SIR
......@@ -130,7 +199,7 @@ config TEKRAM_DONGLE_OLD
dongles you will have to start irattach like this:
"irattach -d tekram".
config GIRBIL_DONGLE
config GIRBIL_DONGLE_OLD
tristate "Greenwich GIrBIL dongle"
depends on DONGLE_OLD && IRDA
help
......@@ -141,7 +210,7 @@ config GIRBIL_DONGLE
dongles you will have to insert "irattach -d girbil" in the
/etc/irda/drivers script.
config LITELINK_DONGLE
config LITELINK_DONGLE_OLD
tristate "Parallax LiteLink dongle"
depends on DONGLE_OLD && IRDA
help
......@@ -152,7 +221,7 @@ config LITELINK_DONGLE
dongles you will have to start irattach like this:
"irattach -d litelink".
config MCP2120_DONGLE
config MCP2120_DONGLE_OLD
tristate "Microchip MCP2120"
depends on DONGLE_OLD && IRDA
help
......@@ -166,7 +235,7 @@ config MCP2120_DONGLE
You must build this dongle yourself. For more information see:
<http://www.eyetap.org/~tangf/irda_sir_linux.html>
config OLD_BELKIN_DONGLE
config OLD_BELKIN_DONGLE_OLD
tristate "Old Belkin dongle"
depends on DONGLE_OLD && IRDA
help
......@@ -175,11 +244,7 @@ config OLD_BELKIN_DONGLE
will be called old_belkin. Some information is contained in the
comments at the top of <file:drivers/net/irda/old_belkin.c>.
config EP7211_IR
tristate "EP7211 I/R support"
depends on DONGLE_OLD && ARCH_EP7211 && IRDA
config ACT200L_DONGLE
config ACT200L_DONGLE_OLD
tristate "ACTiSYS IR-200L dongle (EXPERIMENTAL)"
depends on DONGLE_OLD && EXPERIMENTAL && IRDA
help
......@@ -190,7 +255,7 @@ config ACT200L_DONGLE
ACTiSYS IR-200L dongles you will have to start irattach like this:
"irattach -d act200l".
config MA600_DONGLE
config MA600_DONGLE_OLD
tristate "Mobile Action MA600 dongle (EXPERIMENTAL)"
depends on DONGLE_OLD && EXPERIMENTAL && IRDA
---help---
......@@ -206,6 +271,10 @@ config MA600_DONGLE
There is a pre-compiled module on
<http://engsvr.ust.hk/~eetwl95/download/ma600-2.4.x.tar.gz>
config EP7211_IR
tristate "EP7211 I/R support"
depends on DONGLE_OLD && ARCH_EP7211 && IRDA
comment "FIR device drivers"
config USB_IRDA
......
......@@ -21,20 +21,26 @@ obj-$(CONFIG_VIA_FIR) += via-ircc.o
obj-$(CONFIG_ESI_DONGLE_OLD) += esi.o
obj-$(CONFIG_TEKRAM_DONGLE_OLD) += tekram.o
obj-$(CONFIG_ACTISYS_DONGLE_OLD) += actisys.o
obj-$(CONFIG_GIRBIL_DONGLE) += girbil.o
obj-$(CONFIG_LITELINK_DONGLE) += litelink.o
obj-$(CONFIG_OLD_BELKIN_DONGLE) += old_belkin.o
obj-$(CONFIG_GIRBIL_DONGLE_OLD) += girbil.o
obj-$(CONFIG_LITELINK_DONGLE_OLD) += litelink.o
obj-$(CONFIG_OLD_BELKIN_DONGLE_OLD) += old_belkin.o
obj-$(CONFIG_MCP2120_DONGLE_OLD) += mcp2120.o
obj-$(CONFIG_ACT200L_DONGLE_OLD) += act200l.o
obj-$(CONFIG_MA600_DONGLE_OLD) += ma600.o
obj-$(CONFIG_EP7211_IR) += ep7211_ir.o
obj-$(CONFIG_MCP2120_DONGLE) += mcp2120.o
obj-$(CONFIG_AU1000_FIR) += au1k_ir.o
obj-$(CONFIG_ACT200L_DONGLE) += act200l.o
obj-$(CONFIG_MA600_DONGLE) += ma600.o
# New SIR drivers
obj-$(CONFIG_IRTTY_SIR) += irtty-sir.o sir-dev.o
# New dongles drivers for new SIR drivers
obj-$(CONFIG_ESI_DONGLE) += esi-sir.o
obj-$(CONFIG_TEKRAM_DONGLE) += tekram-sir.o
obj-$(CONFIG_ACTISYS_DONGLE) += actisys-sir.o
obj-$(CONFIG_LITELINK_DONGLE) += litelink-sir.o
obj-$(CONFIG_GIRBIL_DONGLE) += girbil-sir.o
obj-$(CONFIG_OLD_BELKIN_DONGLE) += old_belkin-sir.o
obj-$(CONFIG_MCP2120_DONGLE) += mcp2120-sir.o
obj-$(CONFIG_ACT200L_DONGLE) += act200l-sir.o
obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o
# The SIR helper module
sir-dev-objs := sir_core.o sir_dev.o sir_dongle.o sir_kthread.o
/*********************************************************************
*
* Filename: act200l.c
* Version: 0.8
* Description: Implementation for the ACTiSYS ACT-IR200L dongle
* Status: Experimental.
* Author: SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>
* Created at: Fri Aug 3 17:35:42 2001
* Modified at: Fri Aug 17 10:22:40 2001
* Modified by: SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>
*
* Copyright (c) 2001 SHIMIZU Takuya, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
********************************************************************/
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <net/irda/irda.h>
#include "sir-dev.h"
static int act200l_reset(struct sir_dev *dev);
static int act200l_open(struct sir_dev *dev);
static int act200l_close(struct sir_dev *dev);
static int act200l_change_speed(struct sir_dev *dev, unsigned speed);
/* Regsiter 0: Control register #1 */
#define ACT200L_REG0 0x00
#define ACT200L_TXEN 0x01 /* Enable transmitter */
#define ACT200L_RXEN 0x02 /* Enable receiver */
/* Register 1: Control register #2 */
#define ACT200L_REG1 0x10
#define ACT200L_LODB 0x01 /* Load new baud rate count value */
#define ACT200L_WIDE 0x04 /* Expand the maximum allowable pulse */
/* Register 4: Output Power register */
#define ACT200L_REG4 0x40
#define ACT200L_OP0 0x01 /* Enable LED1C output */
#define ACT200L_OP1 0x02 /* Enable LED2C output */
#define ACT200L_BLKR 0x04
/* Register 5: Receive Mode register */
#define ACT200L_REG5 0x50
#define ACT200L_RWIDL 0x01 /* fixed 1.6us pulse mode */
/* Register 6: Receive Sensitivity register #1 */
#define ACT200L_REG6 0x60
#define ACT200L_RS0 0x01 /* receive threshold bit 0 */
#define ACT200L_RS1 0x02 /* receive threshold bit 1 */
/* Register 7: Receive Sensitivity register #2 */
#define ACT200L_REG7 0x70
#define ACT200L_ENPOS 0x04 /* Ignore the falling edge */
/* Register 8,9: Baud Rate Dvider register #1,#2 */
#define ACT200L_REG8 0x80
#define ACT200L_REG9 0x90
#define ACT200L_2400 0x5f
#define ACT200L_9600 0x17
#define ACT200L_19200 0x0b
#define ACT200L_38400 0x05
#define ACT200L_57600 0x03
#define ACT200L_115200 0x01
/* Register 13: Control register #3 */
#define ACT200L_REG13 0xd0
#define ACT200L_SHDW 0x01 /* Enable access to shadow registers */
/* Register 15: Status register */
#define ACT200L_REG15 0xf0
/* Register 21: Control register #4 */
#define ACT200L_REG21 0x50
#define ACT200L_EXCK 0x02 /* Disable clock output driver */
#define ACT200L_OSCL 0x04 /* oscillator in low power, medium accuracy mode */
static struct dongle_driver act200l = {
.owner = THIS_MODULE,
.driver_name = "ACTiSYS ACT-IR200L",
.type = IRDA_ACT200L_DONGLE,
.open = act200l_open,
.close = act200l_close,
.reset = act200l_reset,
.set_speed = act200l_change_speed,
};
static int __init act200l_init(void)
{
return irda_register_dongle(&act200l);
}
static void __exit act200l_cleanup(void)
{
irda_unregister_dongle(&act200l);
}
static int act200l_open(struct sir_dev *dev)
{
struct qos_info *qos = &dev->qos;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
/* Power on the dongle */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
/* Set the speeds we can accept */
qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
qos->min_turn_time.bits = 0x03;
irda_qos_bits_to_value(qos);
/* irda thread waits 50 msec for power settling */
return 0;
}
static int act200l_close(struct sir_dev *dev)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
/* Power off the dongle */
sirdev_set_dtr_rts(dev, FALSE, FALSE);
return 0;
}
/*
* Function act200l_change_speed (dev, speed)
*
* Set the speed for the ACTiSYS ACT-IR200L type dongle.
*
*/
static int act200l_change_speed(struct sir_dev *dev, unsigned speed)
{
u8 control[3];
int ret = 0;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
/* Clear DTR and set RTS to enter command mode */
sirdev_set_dtr_rts(dev, FALSE, TRUE);
switch (speed) {
default:
ret = -EINVAL;
/* fall through */
case 9600:
control[0] = ACT200L_REG8 | (ACT200L_9600 & 0x0f);
control[1] = ACT200L_REG9 | ((ACT200L_9600 >> 4) & 0x0f);
break;
case 19200:
control[0] = ACT200L_REG8 | (ACT200L_19200 & 0x0f);
control[1] = ACT200L_REG9 | ((ACT200L_19200 >> 4) & 0x0f);
break;
case 38400:
control[0] = ACT200L_REG8 | (ACT200L_38400 & 0x0f);
control[1] = ACT200L_REG9 | ((ACT200L_38400 >> 4) & 0x0f);
break;
case 57600:
control[0] = ACT200L_REG8 | (ACT200L_57600 & 0x0f);
control[1] = ACT200L_REG9 | ((ACT200L_57600 >> 4) & 0x0f);
break;
case 115200:
control[0] = ACT200L_REG8 | (ACT200L_115200 & 0x0f);
control[1] = ACT200L_REG9 | ((ACT200L_115200 >> 4) & 0x0f);
break;
}
control[2] = ACT200L_REG1 | ACT200L_LODB | ACT200L_WIDE;
/* Write control bytes */
sirdev_raw_write(dev, control, 3);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(MSECS_TO_JIFFIES(5));
/* Go back to normal mode */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
dev->speed = speed;
return ret;
}
/*
* Function act200l_reset (driver)
*
* Reset the ACTiSYS ACT-IR200L type dongle.
*/
#define ACT200L_STATE_WAIT1_RESET (SIRDEV_STATE_DONGLE_RESET+1)
#define ACT200L_STATE_WAIT2_RESET (SIRDEV_STATE_DONGLE_RESET+2)
static int act200l_reset(struct sir_dev *dev)
{
unsigned state = dev->fsm.substate;
unsigned delay = 0;
u8 control[9] = {
ACT200L_REG15,
ACT200L_REG13 | ACT200L_SHDW,
ACT200L_REG21 | ACT200L_EXCK | ACT200L_OSCL,
ACT200L_REG13,
ACT200L_REG7 | ACT200L_ENPOS,
ACT200L_REG6 | ACT200L_RS0 | ACT200L_RS1,
ACT200L_REG5 | ACT200L_RWIDL,
ACT200L_REG4 | ACT200L_OP0 | ACT200L_OP1 | ACT200L_BLKR,
ACT200L_REG0 | ACT200L_TXEN | ACT200L_RXEN
};
int ret = 0;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
switch (state) {
case SIRDEV_STATE_DONGLE_RESET:
/* Reset the dongle : set RTS low for 25 ms */
sirdev_set_dtr_rts(dev, TRUE, FALSE);
state = ACT200L_STATE_WAIT1_RESET;
delay = 50;
break;
case ACT200L_STATE_WAIT1_RESET:
/* Clear DTR and set RTS to enter command mode */
sirdev_set_dtr_rts(dev, FALSE, TRUE);
udelay(25); /* better wait for some short while */
/* Write control bytes */
sirdev_raw_write(dev, control, sizeof(control));
state = ACT200L_STATE_WAIT2_RESET;
delay = 15;
break;
case ACT200L_STATE_WAIT2_RESET:
/* Go back to normal mode */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
dev->speed = 9600;
break;
default:
ERROR("%s(), unknown state %d\n", __FUNCTION__, state);
ret = -1;
break;
}
dev->fsm.substate = state;
return (delay > 0) ? delay : ret;
}
MODULE_AUTHOR("SHIMIZU Takuya <tshimizu@ga2.so-net.ne.jp>");
MODULE_DESCRIPTION("ACTiSYS ACT-IR200L dongle driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("irda-dongle-10"); /* IRDA_ACT200L_DONGLE */
module_init(act200l_init);
module_exit(act200l_cleanup);
......@@ -92,12 +92,12 @@ static struct dongle_reg dongle = {
.owner = THIS_MODULE,
};
int __init act200l_init(void)
static int __init act200l_init(void)
{
return irda_device_register_dongle(&dongle);
}
void __exit act200l_cleanup(void)
static void __exit act200l_cleanup(void)
{
irda_device_unregister_dongle(&dongle);
}
......
......@@ -65,7 +65,7 @@ static int actisys_reset(struct sir_dev *);
/* These are the baudrates supported, in the order available */
/* Note : the 220L doesn't support 38400, but we will fix that below */
static __u32 baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
static unsigned baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
#define MAX_SPEEDS (sizeof(baud_rates)/sizeof(baud_rates[0]))
......@@ -89,7 +89,7 @@ static struct dongle_driver act220l_plus = {
.set_speed = actisys_change_speed,
};
int __init actisys_sir_init(void)
static int __init actisys_sir_init(void)
{
int ret;
......@@ -107,7 +107,7 @@ int __init actisys_sir_init(void)
return 0;
}
void __exit actisys_sir_cleanup(void)
static void __exit actisys_sir_cleanup(void)
{
/* We have to remove both dongles */
irda_unregister_dongle(&act220l_plus);
......@@ -118,7 +118,7 @@ static int actisys_open(struct sir_dev *dev)
{
struct qos_info *qos = &dev->qos;
dev->set_dtr_rts(dev, TRUE, TRUE);
sirdev_set_dtr_rts(dev, TRUE, TRUE);
/* Set the speeds we can accept */
qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
......@@ -130,13 +130,15 @@ static int actisys_open(struct sir_dev *dev)
qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */
irda_qos_bits_to_value(qos);
/* irda thread waits 50 msec for power settling */
return 0;
}
static int actisys_close(struct sir_dev *dev)
{
/* Power off the dongle */
dev->set_dtr_rts(dev, FALSE, FALSE);
sirdev_set_dtr_rts(dev, FALSE, FALSE);
return 0;
}
......@@ -174,23 +176,25 @@ static int actisys_change_speed(struct sir_dev *dev, unsigned speed)
* Now, we can set the speed requested. Send RTS pulses until we
* reach the target speed
*/
for (i=0; i<MAX_SPEEDS; i++) {
for (i = 0; i < MAX_SPEEDS; i++) {
if (speed == baud_rates[i]) {
dev->speed = baud_rates[i];
dev->speed = speed;
break;
}
/* Set RTS low for 10 us */
dev->set_dtr_rts(dev, TRUE, FALSE);
sirdev_set_dtr_rts(dev, TRUE, FALSE);
udelay(MIN_DELAY);
/* Set RTS high for 10 us */
dev->set_dtr_rts(dev, TRUE, TRUE);
sirdev_set_dtr_rts(dev, TRUE, TRUE);
udelay(MIN_DELAY);
}
/* Check if life is sweet... */
if (i >= MAX_SPEEDS)
ret = -1; /* This should not happen */
if (i >= MAX_SPEEDS) {
actisys_reset(dev);
ret = -EINVAL; /* This should not happen */
}
/* Basta lavoro, on se casse d'ici... */
return ret;
......@@ -221,11 +225,11 @@ static int actisys_change_speed(struct sir_dev *dev, unsigned speed)
static int actisys_reset(struct sir_dev *dev)
{
/* Reset the dongle : set DTR low for 10 us */
dev->set_dtr_rts(dev, FALSE, TRUE);
sirdev_set_dtr_rts(dev, FALSE, TRUE);
udelay(MIN_DELAY);
/* Go back to normal mode */
dev->set_dtr_rts(dev, TRUE, TRUE);
sirdev_set_dtr_rts(dev, TRUE, TRUE);
dev->speed = 9600; /* That's the default */
......
......@@ -91,7 +91,7 @@ static struct dongle_reg dongle_plus = {
* So, we register a dongle of each sort and let irattach
* pick the right one...
*/
int __init actisys_init(void)
static int __init actisys_init(void)
{
int ret;
......@@ -108,7 +108,7 @@ int __init actisys_init(void)
return 0;
}
void __exit actisys_cleanup(void)
static void __exit actisys_cleanup(void)
{
/* We have to remove both dongles */
irda_device_unregister_dongle(&dongle);
......
......@@ -133,7 +133,7 @@ static void SetCOMInterrupts(struct ali_ircc_cb *self , unsigned char enable);
* Initialize chip. Find out whay kinds of chips we are dealing with
* and their configuation registers address
*/
int __init ali_ircc_init(void)
static int __init ali_ircc_init(void)
{
ali_chip_t *chip;
chipio_t info;
......
......@@ -97,7 +97,7 @@ static int ep7211_ir_reset(struct irda_task *task)
* Initialize EP7211 I/R module
*
*/
int __init ep7211_ir_init(void)
static int __init ep7211_ir_init(void)
{
return irda_device_register_dongle(&dongle);
}
......
......@@ -68,11 +68,14 @@ static int esi_open(struct sir_dev *dev)
{
struct qos_info *qos = &dev->qos;
/* Power up and set dongle to 9600 baud */
sirdev_set_dtr_rts(dev, FALSE, TRUE);
qos->baud_rate.bits &= IR_9600|IR_19200|IR_115200;
qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */
irda_qos_bits_to_value(qos);
/* shouldn't we do set_dtr_rts(FALSE, TRUE) here (power up at 9600)? */
/* irda thread waits 50 msec for power settling */
return 0;
}
......@@ -80,7 +83,7 @@ static int esi_open(struct sir_dev *dev)
static int esi_close(struct sir_dev *dev)
{
/* Power off dongle */
dev->set_dtr_rts(dev, FALSE, FALSE);
sirdev_set_dtr_rts(dev, FALSE, FALSE);
return 0;
}
......@@ -88,11 +91,13 @@ static int esi_close(struct sir_dev *dev)
/*
* Function esi_change_speed (task)
*
* Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
* Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
* Apparently (see old esi-driver) no delays are needed here...
*
*/
static int esi_change_speed(struct sir_dev *dev, unsigned speed)
{
int ret = 0;
int dtr, rts;
switch (speed) {
......@@ -104,6 +109,7 @@ static int esi_change_speed(struct sir_dev *dev, unsigned speed)
dtr = rts = TRUE;
break;
default:
ret = -EINVAL;
speed = 9600;
/* fall through */
case 9600:
......@@ -113,12 +119,10 @@ static int esi_change_speed(struct sir_dev *dev, unsigned speed)
}
/* Change speed of dongle */
dev->set_dtr_rts(dev, dtr, rts);
sirdev_set_dtr_rts(dev, dtr, rts);
dev->speed = speed;
/* do we need some delay for power stabilization? */
return 0;
return ret;
}
/*
......@@ -129,9 +133,18 @@ static int esi_change_speed(struct sir_dev *dev, unsigned speed)
*/
static int esi_reset(struct sir_dev *dev)
{
dev->set_dtr_rts(dev, FALSE, FALSE);
/* Hm, probably repower to 9600 and some delays? */
sirdev_set_dtr_rts(dev, FALSE, FALSE);
/* Hm, the old esi-driver left the dongle unpowered relying on
* the following speed change to repower. This might work for
* the esi because we only need the modem lines. However, now the
* general rule is reset must bring the dongle to some working
* well-known state because speed change might write to registers.
* The old esi-driver didn't any delay here - let's hope it' fine.
*/
sirdev_set_dtr_rts(dev, FALSE, TRUE);
dev->speed = 9600;
return 0;
}
......
......@@ -52,12 +52,12 @@ static struct dongle_reg dongle = {
.owner = THIS_MODULE,
};
int __init esi_init(void)
static int __init esi_init(void)
{
return irda_device_register_dongle(&dongle);
}
void __exit esi_cleanup(void)
static void __exit esi_cleanup(void)
{
irda_device_unregister_dongle(&dongle);
}
......
/*********************************************************************
*
* Filename: girbil.c
* Version: 1.2
* Description: Implementation for the Greenwich GIrBIL dongle
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sat Feb 6 21:02:33 1999
* Modified at: Fri Dec 17 09:13:20 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Neither Dag Brattli nor University of Troms admit liability nor
* provide warranty for any of this software. This material is
* provided "AS-IS" and at no charge.
*
********************************************************************/
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <net/irda/irda.h>
#include "sir-dev.h"
static int girbil_reset(struct sir_dev *dev);
static int girbil_open(struct sir_dev *dev);
static int girbil_close(struct sir_dev *dev);
static int girbil_change_speed(struct sir_dev *dev, unsigned speed);
/* Control register 1 */
#define GIRBIL_TXEN 0x01 /* Enable transmitter */
#define GIRBIL_RXEN 0x02 /* Enable receiver */
#define GIRBIL_ECAN 0x04 /* Cancel self emmited data */
#define GIRBIL_ECHO 0x08 /* Echo control characters */
/* LED Current Register (0x2) */
#define GIRBIL_HIGH 0x20
#define GIRBIL_MEDIUM 0x21
#define GIRBIL_LOW 0x22
/* Baud register (0x3) */
#define GIRBIL_2400 0x30
#define GIRBIL_4800 0x31
#define GIRBIL_9600 0x32
#define GIRBIL_19200 0x33
#define GIRBIL_38400 0x34
#define GIRBIL_57600 0x35
#define GIRBIL_115200 0x36
/* Mode register (0x4) */
#define GIRBIL_IRDA 0x40
#define GIRBIL_ASK 0x41
/* Control register 2 (0x5) */
#define GIRBIL_LOAD 0x51 /* Load the new baud rate value */
static struct dongle_driver girbil = {
.owner = THIS_MODULE,
.driver_name = "Greenwich GIrBIL",
.type = IRDA_GIRBIL_DONGLE,
.open = girbil_open,
.close = girbil_close,
.reset = girbil_reset,
.set_speed = girbil_change_speed,
};
static int __init girbil_init(void)
{
return irda_register_dongle(&girbil);
}
static void __exit girbil_cleanup(void)
{
irda_unregister_dongle(&girbil);
}
static int girbil_open(struct sir_dev *dev)
{
struct qos_info *qos = &dev->qos;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* Power on dongle */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
qos->min_turn_time.bits = 0x03;
irda_qos_bits_to_value(qos);
/* irda thread waits 50 msec for power settling */
return 0;
}
static int girbil_close(struct sir_dev *dev)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* Power off dongle */
sirdev_set_dtr_rts(dev, FALSE, FALSE);
return 0;
}
/*
* Function girbil_change_speed (dev, speed)
*
* Set the speed for the Girbil type dongle.
*
*/
#define GIRBIL_STATE_WAIT_SPEED (SIRDEV_STATE_DONGLE_SPEED + 1)
static int girbil_change_speed(struct sir_dev *dev, unsigned speed)
{
unsigned state = dev->fsm.substate;
unsigned delay = 0;
u8 control[2];
static int ret = 0;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* dongle alread reset - port and dongle at default speed */
switch(state) {
case SIRDEV_STATE_DONGLE_SPEED:
/* Set DTR and Clear RTS to enter command mode */
sirdev_set_dtr_rts(dev, FALSE, TRUE);
udelay(25); /* better wait a little while */
ret = 0;
switch (speed) {
default:
ret = -EINVAL;
/* fall through */
case 9600:
control[0] = GIRBIL_9600;
break;
case 19200:
control[0] = GIRBIL_19200;
break;
case 34800:
control[0] = GIRBIL_38400;
break;
case 57600:
control[0] = GIRBIL_57600;
break;
case 115200:
control[0] = GIRBIL_115200;
break;
}
control[1] = GIRBIL_LOAD;
/* Write control bytes */
sirdev_raw_write(dev, control, 2);
dev->speed = speed;
state = GIRBIL_STATE_WAIT_SPEED;
delay = 100;
break;
case GIRBIL_STATE_WAIT_SPEED:
/* Go back to normal mode */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
udelay(25); /* better wait a little while */
break;
default:
ERROR("%s - undefined state %d\n", __FUNCTION__, state);
ret = -EINVAL;
break;
}
dev->fsm.substate = state;
return (delay > 0) ? delay : ret;
}
/*
* Function girbil_reset (driver)
*
* This function resets the girbil dongle.
*
* Algorithm:
* 0. set RTS, and wait at least 5 ms
* 1. clear RTS
*/
#define GIRBIL_STATE_WAIT1_RESET (SIRDEV_STATE_DONGLE_RESET + 1)
#define GIRBIL_STATE_WAIT2_RESET (SIRDEV_STATE_DONGLE_RESET + 2)
#define GIRBIL_STATE_WAIT3_RESET (SIRDEV_STATE_DONGLE_RESET + 3)
static int girbil_reset(struct sir_dev *dev)
{
unsigned state = dev->fsm.substate;
unsigned delay = 0;
u8 control = GIRBIL_TXEN | GIRBIL_RXEN;
int ret = 0;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
switch (state) {
case SIRDEV_STATE_DONGLE_RESET:
/* Reset dongle */
sirdev_set_dtr_rts(dev, TRUE, FALSE);
/* Sleep at least 5 ms */
delay = 20;
state = GIRBIL_STATE_WAIT1_RESET;
break;
case GIRBIL_STATE_WAIT1_RESET:
/* Set DTR and clear RTS to enter command mode */
sirdev_set_dtr_rts(dev, FALSE, TRUE);
delay = 20;
state = GIRBIL_STATE_WAIT2_RESET;
break;
case GIRBIL_STATE_WAIT2_RESET:
/* Write control byte */
sirdev_raw_write(dev, &control, 1);
delay = 20;
state = GIRBIL_STATE_WAIT3_RESET;
break;
case GIRBIL_STATE_WAIT3_RESET:
/* Go back to normal mode */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
dev->speed = 9600;
break;
default:
ERROR("%s(), undefined state %d\n", __FUNCTION__, state);
ret = -1;
break;
}
dev->fsm.substate = state;
return (delay > 0) ? delay : ret;
}
MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_DESCRIPTION("Greenwich GIrBIL dongle driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("irda-dongle-4"); /* IRDA_GIRBIL_DONGLE */
module_init(girbil_init);
module_exit(girbil_cleanup);
......@@ -71,12 +71,12 @@ static struct dongle_reg dongle = {
.owner = THIS_MODULE,
};
int __init girbil_init(void)
static int __init girbil_init(void)
{
return irda_device_register_dongle(&dongle);
}
void __exit girbil_cleanup(void)
static void __exit girbil_cleanup(void)
{
irda_device_unregister_dongle(&dongle);
}
......
......@@ -98,7 +98,7 @@ EXPORT_SYMBOL(irport_change_speed);
EXPORT_SYMBOL(irport_net_open);
EXPORT_SYMBOL(irport_net_close);
int __init irport_init(void)
static int __init irport_init(void)
{
int i;
......
/*********************************************************************
*
* Filename: litelink.c
* Version: 1.1
* Description: Driver for the Parallax LiteLink dongle
* Status: Stable
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Fri May 7 12:50:33 1999
* Modified at: Fri Dec 17 09:14:23 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
********************************************************************/
/*
* Modified at: Thu Jan 15 2003
* Modified by: Eugene Crosser <crosser@average.org>
*
* Convert to "new" IRDA infrastructure for kernel 2.6
*/
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <net/irda/irda.h>
#include "sir-dev.h"
#define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */
#define MAX_DELAY 10000 /* 1 ms */
static int litelink_open(struct sir_dev *dev);
static int litelink_close(struct sir_dev *dev);
static int litelink_change_speed(struct sir_dev *dev, unsigned speed);
static int litelink_reset(struct sir_dev *dev);
/* These are the baudrates supported - 9600 must be last one! */
static unsigned baud_rates[] = { 115200, 57600, 38400, 19200, 9600 };
static struct dongle_driver litelink = {
.owner = THIS_MODULE,
.driver_name = "Parallax LiteLink",
.type = IRDA_LITELINK_DONGLE,
.open = litelink_open,
.close = litelink_close,
.reset = litelink_reset,
.set_speed = litelink_change_speed,
};
static int __init litelink_sir_init(void)
{
return irda_register_dongle(&litelink);
}
static void __exit litelink_sir_cleanup(void)
{
irda_unregister_dongle(&litelink);
}
static int litelink_open(struct sir_dev *dev)
{
struct qos_info *qos = &dev->qos;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* Power up dongle */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
/* Set the speeds we can accept */
qos->baud_rate.bits &= IR_115200|IR_57600|IR_38400|IR_19200|IR_9600;
qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */
irda_qos_bits_to_value(qos);
/* irda thread waits 50 msec for power settling */
return 0;
}
static int litelink_close(struct sir_dev *dev)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* Power off dongle */
sirdev_set_dtr_rts(dev, FALSE, FALSE);
return 0;
}
/*
* Function litelink_change_speed (task)
*
* Change speed of the Litelink dongle. To cycle through the available
* baud rates, pulse RTS low for a few ms.
*/
static int litelink_change_speed(struct sir_dev *dev, unsigned speed)
{
int i;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* dongle already reset by irda-thread - current speed (dongle and
* port) is the default speed (115200 for litelink!)
*/
/* Cycle through avaiable baudrates until we reach the correct one */
for (i = 0; baud_rates[i] != speed; i++) {
/* end-of-list reached due to invalid speed request */
if (baud_rates[i] == 9600)
break;
/* Set DTR, clear RTS */
sirdev_set_dtr_rts(dev, FALSE, TRUE);
/* Sleep a minimum of 15 us */
udelay(MIN_DELAY);
/* Set DTR, Set RTS */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
/* Sleep a minimum of 15 us */
udelay(MIN_DELAY);
}
dev->speed = baud_rates[i];
/* invalid baudrate should not happen - but if, we return -EINVAL and
* the dongle configured for 9600 so the stack has a chance to recover
*/
return (dev->speed == speed) ? 0 : -EINVAL;
}
/*
* Function litelink_reset (task)
*
* Reset the Litelink type dongle.
*
*/
static int litelink_reset(struct sir_dev *dev)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* probably the power-up can be dropped here, but with only
* 15 usec delay it's not worth the risk unless somebody with
* the hardware confirms it doesn't break anything...
*/
/* Power on dongle */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
/* Sleep a minimum of 15 us */
udelay(MIN_DELAY);
/* Clear RTS to reset dongle */
sirdev_set_dtr_rts(dev, TRUE, FALSE);
/* Sleep a minimum of 15 us */
udelay(MIN_DELAY);
/* Go back to normal mode */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
/* Sleep a minimum of 15 us */
udelay(MIN_DELAY);
/* This dongles speed defaults to 115200 bps */
dev->speed = 115200;
return 0;
}
MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_DESCRIPTION("Parallax Litelink dongle driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("irda-dongle-5"); /* IRDA_LITELINK_DONGLE */
/*
* Function init_module (void)
*
* Initialize Litelink module
*
*/
module_init(litelink_sir_init);
/*
* Function cleanup_module (void)
*
* Cleanup Litelink module
*
*/
module_exit(litelink_sir_cleanup);
......@@ -56,12 +56,12 @@ static struct dongle_reg dongle = {
.owner = THIS_MODULE,
};
int __init litelink_init(void)
static int __init litelink_init(void)
{
return irda_device_register_dongle(&dongle);
}
void __exit litelink_cleanup(void)
static void __exit litelink_cleanup(void)
{
irda_device_unregister_dongle(&dongle);
}
......
/*********************************************************************
*
* Filename: ma600.c
* Version: 0.1
* Description: Implementation of the MA600 dongle
* Status: Experimental.
* Author: Leung <95Etwl@alumni.ee.ust.hk> http://www.engsvr.ust/~eetwl95
* Created at: Sat Jun 10 20:02:35 2000
* Modified at: Sat Aug 16 09:34:13 2003
* Modified by: Martin Diehl <mad@mdiehl.de> (modified for new sir_dev)
*
* Note: very thanks to Mr. Maru Wang <maru@mobileaction.com.tw> for providing
* information on the MA600 dongle
*
* Copyright (c) 2000 Leung, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
********************************************************************/
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <net/irda/irda.h>
#include "sir-dev.h"
static int ma600_open(struct sir_dev *);
static int ma600_close(struct sir_dev *);
static int ma600_change_speed(struct sir_dev *, unsigned);
static int ma600_reset(struct sir_dev *);
/* control byte for MA600 */
#define MA600_9600 0x00
#define MA600_19200 0x01
#define MA600_38400 0x02
#define MA600_57600 0x03
#define MA600_115200 0x04
#define MA600_DEV_ID1 0x05
#define MA600_DEV_ID2 0x06
#define MA600_2400 0x08
static struct dongle_driver ma600 = {
.owner = THIS_MODULE,
.driver_name = "MA600",
.type = IRDA_MA600_DONGLE,
.open = ma600_open,
.close = ma600_close,
.reset = ma600_reset,
.set_speed = ma600_change_speed,
};
static int __init ma600_sir_init(void)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
return irda_register_dongle(&ma600);
}
static void __exit ma600_sir_cleanup(void)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
irda_unregister_dongle(&ma600);
}
/*
Power on:
(0) Clear RTS and DTR for 1 second
(1) Set RTS and DTR for 1 second
(2) 9600 bps now
Note: assume RTS, DTR are clear before
*/
static int ma600_open(struct sir_dev *dev)
{
struct qos_info *qos = &dev->qos;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
sirdev_set_dtr_rts(dev, TRUE, TRUE);
/* Explicitly set the speeds we can accept */
qos->baud_rate.bits &= IR_2400|IR_9600|IR_19200|IR_38400
|IR_57600|IR_115200;
/* Hm, 0x01 means 10ms - for >= 1ms we would need 0x07 */
qos->min_turn_time.bits = 0x01; /* Needs at least 1 ms */
irda_qos_bits_to_value(qos);
/* irda thread waits 50 msec for power settling */
return 0;
}
static int ma600_close(struct sir_dev *dev)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* Power off dongle */
sirdev_set_dtr_rts(dev, FALSE, FALSE);
return 0;
}
static __u8 get_control_byte(__u32 speed)
{
__u8 byte;
switch (speed) {
default:
case 115200:
byte = MA600_115200;
break;
case 57600:
byte = MA600_57600;
break;
case 38400:
byte = MA600_38400;
break;
case 19200:
byte = MA600_19200;
break;
case 9600:
byte = MA600_9600;
break;
case 2400:
byte = MA600_2400;
break;
}
return byte;
}
/*
* Function ma600_change_speed (dev, speed)
*
* Set the speed for the MA600 type dongle.
*
* The dongle has already been reset to a known state (dongle default)
* We cycle through speeds by pulsing RTS low and then high.
*/
/*
* Function ma600_change_speed (dev, speed)
*
* Set the speed for the MA600 type dongle.
*
* Algorithm
* 1. Reset (already done by irda thread state machine)
* 2. clear RTS, set DTR and wait for 1ms
* 3. send Control Byte to the MA600 through TXD to set new baud rate
* wait until the stop bit of Control Byte is sent (for 9600 baud rate,
* it takes about 10 msec)
* 4. set RTS, set DTR (return to NORMAL Operation)
* 5. wait at least 10 ms, new setting (baud rate, etc) takes effect here
* after
*/
/* total delays are only about 20ms - let's just sleep for now to
* avoid the state machine complexity before we get things working
*/
static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
{
u8 byte;
IRDA_DEBUG(2, "%s(), speed=%d (was %d)\n", __FUNCTION__,
speed, dev->speed);
/* dongle already reset, dongle and port at default speed (9600) */
/* Set RTS low for 1 ms */
sirdev_set_dtr_rts(dev, TRUE, FALSE);
mdelay(1);
/* Write control byte */
byte = get_control_byte(speed);
sirdev_raw_write(dev, &byte, sizeof(byte));
/* Wait at least 10ms: fake wait_until_sent - 10 bits at 9600 baud*/
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(MSECS_TO_JIFFIES(15)); /* old ma600 uses 15ms */
#if 1
/* read-back of the control byte. ma600 is the first dongle driver
* which uses this so there might be some unidentified issues.
* Disable this in case of problems with readback.
*/
sirdev_raw_read(dev, &byte, sizeof(byte));
if (byte != get_control_byte(speed)) {
WARNING("%s(): bad control byte read-back %02x != %02x\n",
__FUNCTION__, (unsigned) byte,
(unsigned) get_control_byte(speed));
return -1;
}
else
IRDA_DEBUG(2, "%s() control byte write read OK\n", __FUNCTION__);
#endif
/* Set DTR, Set RTS */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
/* Wait at least 10ms */
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(MSECS_TO_JIFFIES(10));
/* dongle is now switched to the new speed */
dev->speed = speed;
return 0;
}
/*
* Function ma600_reset (dev)
*
* This function resets the ma600 dongle.
*
* Algorithm:
* 0. DTR=0, RTS=1 and wait 10 ms
* 1. DTR=1, RTS=1 and wait 10 ms
* 2. 9600 bps now
*/
/* total delays are only about 20ms - let's just sleep for now to
* avoid the state machine complexity before we get things working
*/
int ma600_reset(struct sir_dev *dev)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
/* Reset the dongle : set DTR low for 10 ms */
sirdev_set_dtr_rts(dev, FALSE, TRUE);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(MSECS_TO_JIFFIES(10));
/* Go back to normal mode */
sirdev_set_dtr_rts(dev, TRUE, TRUE);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(MSECS_TO_JIFFIES(10));
dev->speed = 9600; /* That's the dongle-default */
return 0;
}
MODULE_AUTHOR("Leung <95Etwl@alumni.ee.ust.hk> http://www.engsvr.ust/~eetwl95");
MODULE_DESCRIPTION("MA600 dongle driver version 0.1");
MODULE_LICENSE("GPL");
MODULE_ALIAS("irda-dongle-11"); /* IRDA_MA600_DONGLE */
module_init(ma600_sir_init);
module_exit(ma600_sir_cleanup);
......@@ -82,13 +82,13 @@ static struct dongle_reg dongle = {
.owner = THIS_MODULE,
};
int __init ma600_init(void)
static int __init ma600_init(void)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
return irda_device_register_dongle(&dongle);
}
void __exit ma600_cleanup(void)
static void __exit ma600_cleanup(void)
{
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
irda_device_unregister_dongle(&dongle);
......
This diff is collapsed.
......@@ -48,12 +48,12 @@ static struct dongle_reg dongle = {
.owner = THIS_MODULE,
};
int __init mcp2120_init(void)
static int __init mcp2120_init(void)
{
return irda_device_register_dongle(&dongle);
}
void __exit mcp2120_cleanup(void)
static void __exit mcp2120_cleanup(void)
{
irda_device_unregister_dongle(&dongle);
}
......
......@@ -155,7 +155,7 @@ static int nsc_ircc_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data);
* Initialize chip. Just try to find out how many chips we are dealing with
* and where they are
*/
int __init nsc_ircc_init(void)
static int __init nsc_ircc_init(void)
{
chipio_t info;
nsc_chip_t *chip;
......
This diff is collapsed.
......@@ -82,12 +82,12 @@ static struct dongle_reg dongle = {
.owner = THIS_MODULE,
};
int __init old_belkin_init(void)
static int __init old_belkin_init(void)
{
return irda_device_register_dongle(&dongle);
}
void __exit old_belkin_cleanup(void)
static void __exit old_belkin_cleanup(void)
{
irda_device_unregister_dongle(&dongle);
}
......
......@@ -121,15 +121,17 @@ extern int sirdev_set_dongle(struct sir_dev *dev, IRDA_DONGLE type);
extern void sirdev_write_complete(struct sir_dev *dev);
extern int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count);
/* low level helpers for SIR device/dongle setup */
extern int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len);
extern int sirdev_raw_read(struct sir_dev *dev, char *buf, int len);
extern int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts);
/* not exported */
extern int sirdev_get_dongle(struct sir_dev *self, IRDA_DONGLE type);
extern int sirdev_put_dongle(struct sir_dev *self);
extern int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len);
extern int sirdev_raw_read(struct sir_dev *dev, char *buf, int len);
extern void sirdev_enable_rx(struct sir_dev *dev);
extern int sirdev_schedule_request(struct sir_dev *dev, int state, unsigned param);
extern int __init irda_thread_create(void);
extern void __exit irda_thread_join(void);
......@@ -195,10 +197,6 @@ struct sir_dev {
const struct sir_driver * drv;
void *priv;
/* dongle callbacks to the SIR device */
int (*read)(struct sir_dev *, char *buf, int len);
int (*write)(struct sir_dev *, const char *buf, int len);
int (*set_dtr_rts)(struct sir_dev *, int dtr, int rts);
};
#endif /* IRDA_SIR_H */
......@@ -37,6 +37,10 @@ EXPORT_SYMBOL(sirdev_set_dongle);
EXPORT_SYMBOL(sirdev_write_complete);
EXPORT_SYMBOL(sirdev_receive);
EXPORT_SYMBOL(sirdev_raw_write);
EXPORT_SYMBOL(sirdev_raw_read);
EXPORT_SYMBOL(sirdev_set_dtr_rts);
static int __init sir_core_init(void)
{
return irda_thread_create();
......
......@@ -117,6 +117,14 @@ int sirdev_raw_read(struct sir_dev *dev, char *buf, int len)
return count;
}
int sirdev_set_dtr_rts(struct sir_dev *dev, int dtr, int rts)
{
int ret = -ENXIO;
if (dev->drv->set_dtr_rts != 0)
ret = dev->drv->set_dtr_rts(dev, dtr, rts);
return ret;
}
/**********************************************************************/
/* called from client driver - likely with bh-context - to indicate
......
......@@ -102,12 +102,6 @@ int sirdev_get_dongle(struct sir_dev *dev, IRDA_DONGLE type)
err = -ESTALE;
goto out_unlock; /* rmmod already pending */
}
/* Initialize dongle driver callbacks */
dev->read = sirdev_raw_read;
dev->write = sirdev_raw_write;
dev->set_dtr_rts = dev->drv->set_dtr_rts;
dev->dongle_drv = drv;
if (!drv->open || (err=drv->open(dev))!=0)
......
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.
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.
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.
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.
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