Commit ad8590e5 authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/sfr
parents 13c25cd1 93e50e5e
No related merge requests found
This diff is collapsed.
......@@ -1507,6 +1507,11 @@ M: emoenke@gwdg.de
L: linux-kernel@vger.kernel.org
S: Maintained
SC1200 WDT DRIVER
P: Zwane Mwaikambo
M: zwane@commfireservices.com
S: Maintained
SCHEDULER
P: Ingo Molnar
M: mingo@elte.hu
......
......@@ -522,7 +522,7 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
struct k_sigaction *ka;
spin_lock_irq(&current->sighand->siglock);
signr = dequeue_signal(&current->blocked, &info);
signr = dequeue_signal(current, &current->blocked, &info);
spin_unlock_irq(&current->sighand->siglock);
if (!signr)
......
......@@ -136,6 +136,7 @@ config M386
- "Winchip-2" for IDT Winchip 2.
- "Winchip-2A" for IDT Winchips with 3dNow! capabilities.
- "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3.
- "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above).
If you don't know what to do, choose "386".
......@@ -174,7 +175,7 @@ config M686
against the f00f bug found in earlier Pentiums.
config MPENTIUMII
bool "Pentium-II/Celeron(pre-Coppermine)"
bool "Pentium-II/Celeron(pre-Coppermine)"
help
Select this for Intel chips based on the Pentium-II and
pre-Coppermine Celeron core. This option enables an unaligned
......@@ -260,6 +261,16 @@ config MCYRIXIII
treat this chip as a generic 586. Whilst the CPU is 686 class,
it lacks the cmov extension which gcc assumes is present when
generating 686 code.
Note, that Nehemiah (Model 9) and above will not boot with this
kernel due to them lacking the 3dnow instructions used in earlier
incarnations of the CPU.
config MVIAC3_2
bool "VIA C3-2 (Nehemiah)"
help
Select this for a VIA C3 "Nehemiah". Selecting this enables usage of SSE
and tells gcc to treat the CPU as a 686.
Note, this kernel will not boot on older (pre model 9) C3s.
endchoice
......@@ -278,8 +289,8 @@ config X86_XADD
config X86_L1_CACHE_SHIFT
int
default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586
default "4" if MELAN || M486 || M386
default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2
default "6" if MK7 || MK8
default "7" if MPENTIUM4
......@@ -325,12 +336,12 @@ config X86_POPAD_OK
config X86_ALIGNMENT_16
bool
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2
default y
config X86_TSC
bool
depends on MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8
depends on MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2
default y
config X86_GOOD_APIC
......@@ -345,7 +356,7 @@ config X86_INTEL_USERCOPY
config X86_USE_PPRO_CHECKSUM
bool
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || MK8
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2
default y
config X86_USE_3DNOW
......@@ -360,7 +371,7 @@ config X86_OOSTORE
config X86_PREFETCH
bool
depends on MPENTIUMIII || MPENTIUM4
depends on MPENTIUMIII || MPENTIUM4 || MVIAC3_2
default y
config X86_SSE2
......@@ -1005,6 +1016,16 @@ config X86_POWERNOW_K6
If in doubt, say N.
config X86_POWERNOW_K7
tristate "AMD Mobile Athlon/Duron PowerNow!"
depends on CPU_FREQ
help
This adds the CPUFreq driver for mobile AMD K7 mobile processors.
For details, take a look at linux/Documentation/cpufreq.
If in doubt, say N.
config ELAN_CPUFREQ
tristate "AMD Elan"
depends on CPU_FREQ && MELAN
......
......@@ -46,6 +46,7 @@ cflags-$(CONFIG_MWINCHIP3D) += -march=i586
cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-march=c3,-march=i486)
# The alignment flags change with gcc 3.2
cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0)
cflags-$(CONFIG_MVIAC3_2) += $(call check_gcc,-march=c3-2,-march=i686)
CFLAGS += $(cflags-y)
......
......@@ -395,6 +395,8 @@ static void __init init_centaur(struct cpuinfo_x86 *c)
set_bit(X86_FEATURE_CX8, c->x86_capability);
set_bit(X86_FEATURE_3DNOW, c->x86_capability);
case 9: /* Nehemiah */
default:
get_model_name(c);
display_cacheinfo(c);
break;
......@@ -408,6 +410,12 @@ static unsigned int centaur_size_cache(struct cpuinfo_x86 * c, unsigned int size
/* VIA C3 CPUs (670-68F) need further shifting. */
if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8)))
size >>= 8;
/* VIA also screwed up Nehemiah stepping 1, and made
it return '65KB' instead of '64KB' */
if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1))
size -=1;
return size;
}
......
obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o
obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o
obj-$(CONFIG_X86_LONGHAUL) += longhaul.o
obj-$(CONFIG_X86_SPEEDSTEP) += speedstep.o
obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o
......
/*
* $Id: powernow-k7.c,v 1.31 2003/02/12 21:16:35 davej Exp $
*
* (C) 2003 Dave Jones <davej@suse.de>
*
* Licensed under the terms of the GNU GPL License version 2.
* Based upon datasheets & sample CPUs kindly provided by AMD.
*
* BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous*
*
* Errata 5: Processor may fail to execute a FID/VID change in presence of interrupt.
* - We cli/sti on stepping A0 CPUs around the FID/VID transition.
* Errata 15: Processors with half frequency multipliers may hang upon wakeup from disconnect.
* - We disable half multipliers if ACPI is used on A0 stepping CPUs.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/cpufreq.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <asm/msr.h>
#include <asm/timex.h>
#include <asm/io.h>
#include "powernow-k7.h"
#define DEBUG
#ifdef DEBUG
#define dprintk(msg...) printk(msg)
#else
#define dprintk(msg...) do { } while(0);
#endif
#define PFX "powernow: "
struct psb_s {
u8 signature[10];
u8 tableversion;
u8 flags;
u16 settlingtime;
u8 reserved1;
u8 numpst;
};
struct pst_s {
u32 cpuid;
u8 fsbspeed;
u8 maxfid;
u8 startvid;
u8 numpstates;
};
/* divide by 1000 to get VID. */
static int mobile_vid_table[32] = {
2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650,
1600, 1550, 1500, 1450, 1400, 1350, 1300, 0,
1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100,
1075, 1050, 1024, 1000, 975, 950, 925, 0,
};
/* divide by 10 to get FID. */
static int fid_codes[32] = {
110, 115, 120, 125, 50, 55, 60, 65,
70, 75, 80, 85, 90, 95, 10, 105,
30, 190, 40, 200, 130, 135, 140, 210,
150, 225, 160, 165, 170, 180, -1, -1,
};
static struct cpufreq_driver powernow_driver;
static struct cpufreq_frequency_table *powernow_table;
static unsigned int can_scale_bus;
static unsigned int can_scale_vid;
static unsigned int minimum_speed=-1;
static unsigned int maximum_speed;
static unsigned int number_scales;
static unsigned int fsb;
static unsigned int latency;
static char have_a0;
#ifndef rdmsrl
#define rdmsrl(msr,val) do {unsigned long l__,h__; \
rdmsr (msr, l__, h__); \
val = l__; \
val |= ((u64)h__<<32); \
} while(0);
#endif
#ifndef wrmsrl
static void wrmsrl (u32 msr, u64 val)
{
u32 lo, hi;
lo = (u32) val;
hi = val >> 32;
wrmsr (msr, lo, hi);
}
#endif
static int check_powernow(void)
{
struct cpuinfo_x86 *c = cpu_data;
unsigned int maxei, eax, ebx, ecx, edx;
if (c->x86_vendor != X86_VENDOR_AMD) {
printk (KERN_INFO PFX "AMD processor not detected.\n");
return 0;
}
if (c->x86 !=6) {
printk (KERN_INFO PFX "This module only works with AMD K7 CPUs\n");
return 0;
}
printk (KERN_INFO PFX "AMD K7 CPU detected.\n");
if ((c->x86_model == 6) && (c->x86_mask == 0)) {
printk (KERN_INFO PFX "K7 660[A0] core detected, enabling errata workarounds\n");
have_a0 = 1;
}
/* Get maximum capabilities */
maxei = cpuid_eax (0x80000000);
if (maxei < 0x80000007) { /* Any powernow info ? */
printk (KERN_INFO PFX "No powernow capabilities detected\n");
return 0;
}
cpuid(0x80000007, &eax, &ebx, &ecx, &edx);
printk (KERN_INFO PFX "PowerNOW! Technology present. Can scale: ");
if (edx & 1 << 1) {
printk ("frequency");
can_scale_bus=1;
}
if ((edx & (1 << 1 | 1 << 2)) == 0x6)
printk (" and ");
if (edx & 1 << 2) {
printk ("voltage");
can_scale_vid=1;
}
if (!(edx & (1 << 1 | 1 << 2))) {
printk (" nothing.\n");
return 0;
}
printk (".\n");
return 1;
}
static int get_ranges (unsigned char *pst)
{
int j;
u8 fid, vid;
unsigned int speed;
powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL);
if (!powernow_table)
return -ENOMEM;
memset(powernow_table, 0, (sizeof(struct cpufreq_frequency_table) * (number_scales + 1)));
for (j=0 ; j < number_scales; j++) {
fid = *pst++;
powernow_table[j].frequency = fsb * fid_codes[fid] * 100;
powernow_table[j].index = fid; /* lower 8 bits */
speed = fsb * (fid_codes[fid]/10);
if ((fid_codes[fid] % 10)==5) {
speed += fsb/2;
#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
if (have_a0 == 1)
powernow_table[j].frequency = CPUFREQ_ENTRY_INVALID;
#endif
}
dprintk (KERN_INFO PFX " FID: 0x%x (%d.%dx [%dMHz])\t", fid,
fid_codes[fid] / 10, fid_codes[fid] % 10, speed);
if (speed < minimum_speed)
minimum_speed = speed;
if (speed > maximum_speed)
maximum_speed = speed;
vid = *pst++;
powernow_table[j].index |= (vid << 8); /* upper 8 bits */
dprintk ("VID: 0x%x (%d.%03dV)\n", vid, mobile_vid_table[vid]/1000,
mobile_vid_table[vid]%1000);
}
dprintk ("\n");
powernow_table[number_scales].frequency = CPUFREQ_TABLE_END;
powernow_table[number_scales].index = 0;
return 0;
}
static void change_speed (unsigned int index)
{
u8 fid, vid;
struct cpufreq_freqs freqs;
union msr_fidvidstatus fidvidstatus;
union msr_fidvidctl fidvidctl;
/* fid are the lower 8 bits of the index we stored into
* the cpufreq frequency table in powernow_decode_bios,
* vid are the upper 8 bits.
*/
fid = powernow_table[index].index & 0xFF;
vid = (powernow_table[index].index & 0xFF00) >> 8;
freqs.cpu = 0;
rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
freqs.old = fsb * fid_codes[fidvidstatus.bits.CFID] * 100;
freqs.new = powernow_table[index].frequency;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
/* Now do the magic poking into the MSRs. */
if (have_a0 == 1) /* A0 errata 5 */
__asm__("\tcli\n");
rdmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
fidvidctl.bits.SGTC = latency; /* Stop grant timeout counter */
fidvidctl.bits.FID = fid;
fidvidctl.bits.VID = vid;
/* Note, we could set these lazily. Ie, only do voltage transition
if its changed since last time (Some speeds have the same voltage) */
fidvidctl.bits.FIDC = 1;
fidvidctl.bits.VIDC = 1;
wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
if (have_a0 == 1)
__asm__("\tsti\n");
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
}
int powernow_decode_bios (int maxfid, int startvid)
{
struct psb_s *psb;
struct pst_s *pst;
struct cpuinfo_x86 *c = cpu_data;
unsigned int i, j;
unsigned char *p;
unsigned int etuple;
unsigned int ret;
etuple = cpuid_eax(0x80000001);
etuple &= 0xf00;
etuple |= (c->x86_model<<4)|(c->x86_mask);
for (i=0xC0000; i < 0xffff0 ; i+=16) {
p = phys_to_virt(i);
if (memcmp(p, "AMDK7PNOW!", 10) == 0){
dprintk (KERN_INFO PFX "Found PSB header at %p\n", p);
psb = (struct psb_s *) p;
dprintk (KERN_INFO PFX "Table version: 0x%x\n", psb->tableversion);
if (psb->tableversion != 0x12) {
printk (KERN_INFO PFX "Sorry, only v1.2 tables supported right now\n");
return -ENODEV;
}
dprintk (KERN_INFO PFX "Flags: 0x%x (", psb->flags);
if ((psb->flags & 1)==0) {
dprintk ("Mobile");
} else {
dprintk ("Desktop");
}
dprintk (" voltage regulator)\n");
latency = psb->settlingtime;
dprintk (KERN_INFO PFX "Settling Time: %d microseconds.\n", psb->settlingtime);
dprintk (KERN_INFO PFX "Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst);
p += sizeof (struct psb_s);
pst = (struct pst_s *) p;
for (i = 0 ; i <psb->numpst; i++) {
pst = (struct pst_s *) p;
number_scales = pst->numpstates;
if ((etuple == pst->cpuid) && (maxfid==pst->maxfid) && (startvid==pst->startvid))
{
dprintk (KERN_INFO PFX "PST:%d (@%p)\n", i, pst);
dprintk (KERN_INFO PFX " cpuid: 0x%x\t", pst->cpuid);
dprintk ("fsb: %d\t", pst->fsbspeed);
dprintk ("maxFID: 0x%x\t", pst->maxfid);
dprintk ("startvid: 0x%x\n", pst->startvid);
fsb = pst->fsbspeed;
ret = get_ranges ((char *) pst + sizeof (struct pst_s));
return ret;
} else {
p = (char *) pst + sizeof (struct pst_s);
for (j=0 ; j < number_scales; j++)
p+=2;
}
}
return -EINVAL;
}
p++;
}
return -ENODEV;
}
static int powernow_target (struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
unsigned int newstate;
if (cpufreq_frequency_table_target(policy, powernow_table, target_freq, relation, &newstate))
return -EINVAL;
change_speed(newstate);
return 0;
}
static int powernow_verify (struct cpufreq_policy *policy)
{
return cpufreq_frequency_table_verify(policy, powernow_table);
}
static int __init powernow_cpu_init (struct cpufreq_policy *policy)
{
union msr_fidvidstatus fidvidstatus;
int result;
if (policy->cpu != 0)
return -ENODEV;
rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
result = powernow_decode_bios(fidvidstatus.bits.MFID, fidvidstatus.bits.SVID);
if (result)
return result;
printk (KERN_INFO PFX "Minimum speed %d MHz. Maximum speed %d MHz.\n",
minimum_speed, maximum_speed);
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
policy->cpuinfo.transition_latency = latency;
#ifdef CONFIG_CPU_FREQ_24_API
powernow_driver.cpu_cur_freq[policy->cpu] = maximum_speed;
#endif
return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
}
static int __init powernow_init (void)
{
if (check_powernow()==0)
return -ENODEV;
return cpufreq_register_driver(&powernow_driver);
}
static void __exit powernow_exit (void)
{
cpufreq_unregister_driver(&powernow_driver);
if (powernow_table)
kfree(powernow_table);
}
static struct cpufreq_driver powernow_driver = {
.verify = powernow_verify,
.target = powernow_target,
.init = powernow_cpu_init,
.name = "powernow-k7",
};
MODULE_AUTHOR ("Dave Jones <davej@suse.de>");
MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors.");
MODULE_LICENSE ("GPL");
module_init(powernow_init);
module_exit(powernow_exit);
/*
* $Id: powernow-k7.h,v 1.2 2003/02/10 18:26:01 davej Exp $
* (C) 2003 Dave Jones.
*
* Licensed under the terms of the GNU GPL License version 2.
*
* AMD-specific information
*
*/
#ifndef MSR_K7_FID_VID_CTL
#define MSR_K7_FID_VID_CTL 0xc0010041
#endif
#ifndef MSR_K7_FID_VID_STATUS
#define MSR_K7_FID_VID_STATUS 0xc0010042
#endif
union msr_fidvidctl {
struct {
unsigned FID:5, // 4:0
reserved1:3, // 7:5
VID:5, // 12:8
reserved2:3, // 15:13
FIDC:1, // 16
VIDC:1, // 17
reserved3:2, // 19:18
FIDCHGRATIO:1, // 20
reserved4:11, // 31-21
SGTC:20, // 32:51
reserved5:12; // 63:52
} bits;
unsigned long long val;
};
union msr_fidvidstatus {
struct {
unsigned CFID:5, // 4:0
reserved1:3, // 7:5
SFID:5, // 12:8
reserved2:3, // 15:13
MFID:5, // 20:16
reserved3:11, // 31:21
CVID:5, // 36:32
reserved4:3, // 39:37
SVID:5, // 44:40
reserved5:3, // 47:45
MVID:5, // 52:48
reserved6:11; // 63:53
} bits;
unsigned long long val;
};
......@@ -160,7 +160,6 @@ static void __init smp_store_cpu_info(int id)
goto valid_k7;
/* If we get here, it's not a certified SMP capable AMD system. */
printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n");
tainted |= TAINT_UNSAFE_SMP;
}
......@@ -182,8 +181,6 @@ static unsigned long long tsc_values[NR_CPUS];
#define NR_LOOPS 5
extern unsigned long fast_gettimeoffset_quotient;
/*
* accurate 64-bit/32-bit division, expanded to 32-bit divisions and 64-bit
* multiplication. Not terribly optimized but we need it at boot time only
......@@ -223,7 +220,8 @@ static void __init synchronize_tsc_bp (void)
printk("checking TSC synchronization across %u CPUs: ", num_booting_cpus());
one_usec = ((1<<30)/fast_gettimeoffset_quotient)*(1<<2);
/* convert from kcyc/sec to cyc/usec */
one_usec = cpu_khz / 1000;
atomic_set(&tsc_start_flag, 1);
wmb();
......@@ -1069,6 +1067,15 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
if (smp_b_stepping)
printk(KERN_WARNING "WARNING: SMP operation may be unreliable with B stepping processors.\n");
/* Don't taint if we are running SMP kernel on a single non-MP approved Athlon */
if (tainted & TAINT_UNSAFE_SMP) {
if (cpucount)
printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n");
else
tainted &= ~TAINT_UNSAFE_SMP;
}
Dprintk("Boot done.\n");
/*
......
......@@ -4,4 +4,4 @@
obj-y := timer.o timer_none.o timer_tsc.o timer_pit.o
obj-$(CONFIG_X86_CYCLONE) += timer_cyclone.o
obj-$(CONFIG_X86_SUMMIT) += timer_cyclone.o
......@@ -4,9 +4,14 @@
/* list of externed timers */
extern struct timer_opts timer_pit;
extern struct timer_opts timer_tsc;
#ifdef CONFIG_X86_SUMMIT
extern struct timer_opts timer_cyclone;
#endif
/* list of timers, ordered by preference, NULL terminated */
static struct timer_opts* timers[] = {
#ifdef CONFIG_X86_SUMMIT
&timer_cyclone,
#endif
&timer_tsc,
&timer_pit,
NULL,
......
......@@ -17,6 +17,7 @@
#include <asm/fixmap.h>
extern spinlock_t i8253_lock;
extern unsigned long calibrate_tsc(void);
/* Number of usecs that the last interrupt was delayed */
static int delay_at_last_interrupt;
......@@ -145,6 +146,27 @@ static int init_cyclone(void)
}
}
/* init cpu_khz.
* XXX - This should really be done elsewhere,
* and in a more generic fashion. -johnstul@us.ibm.com
*/
if (cpu_has_tsc) {
unsigned long tsc_quotient = calibrate_tsc();
if (tsc_quotient) {
/* report CPU clock rate in Hz.
* The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) =
* clock/second. Our precision is about 100 ppm.
*/
{ unsigned long eax=0, edx=1000;
__asm__("divl %2"
:"=a" (cpu_khz), "=d" (edx)
:"r" (tsc_quotient),
"0" (eax), "1" (edx));
printk("Detected %lu.%03lu MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000);
}
}
}
/* Everything looks good! */
return 0;
}
......
......@@ -29,7 +29,7 @@ static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */
* Equal to 2^32 * (1 / (clocks per usec) ).
* Initialized in time_init.
*/
unsigned long fast_gettimeoffset_quotient;
static unsigned long fast_gettimeoffset_quotient;
static unsigned long get_offset_tsc(void)
{
......@@ -130,7 +130,7 @@ static void delay_tsc(unsigned long loops)
#define CALIBRATE_LATCH (5 * LATCH)
#define CALIBRATE_TIME (5 * 1000020/HZ)
static unsigned long __init calibrate_tsc(void)
unsigned long __init calibrate_tsc(void)
{
/* Set the Gate high, disable speaker */
outb((inb(0x61) & ~0x02) | 0x01, 0x61);
......
......@@ -296,7 +296,6 @@ zap_hugepage_range(struct vm_area_struct *vma,
int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
{
struct mm_struct *mm = current->mm;
struct inode *inode = mapping->host;
unsigned long addr;
int ret = 0;
......@@ -320,7 +319,6 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
+ (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
page = find_get_page(mapping, idx);
if (!page) {
loff_t i_size;
page = alloc_hugetlb_page();
if (!page) {
ret = -ENOMEM;
......@@ -332,9 +330,6 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
free_huge_page(page);
goto out;
}
i_size = (loff_t)(idx + 1) * HPAGE_SIZE;
if (i_size > inode->i_size)
inode->i_size = i_size;
}
set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE);
}
......
......@@ -1004,7 +1004,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
for (;;) {
int signr;
signr = dequeue_signal(&current->blocked, &info);
signr = dequeue_signal(current, &current->blocked, &info);
if (!signr)
break;
......
......@@ -183,7 +183,7 @@ asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
unsigned long signr;
spin_lock_irq(&current->sigmask_lock);
signr = dequeue_signal(&current->blocked, &info);
signr = dequeue_signal(current, &current->blocked, &info);
spin_unlock_irq(&current->sigmask_lock);
if (!signr)
......
......@@ -1726,7 +1726,7 @@ sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
}
spin_lock_irq(&current->sighand->siglock);
sig = dequeue_signal(&these, &info);
sig = dequeue_signal(current, &these, &info);
if (!sig) {
/* None ready -- temporarily unblock those we're interested
in so that we'll be awakened when they arrive. */
......@@ -1744,7 +1744,7 @@ sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
timeout = schedule_timeout(timeout);
spin_lock_irq(&current->sighand->siglock);
sig = dequeue_signal(&these, &info);
sig = dequeue_signal(current, &these, &info);
current->blocked = current->real_blocked;
siginitset(&current->real_blocked, 0);
recalc_sigpending();
......
......@@ -740,9 +740,6 @@ void handler_irq(int irq, struct pt_regs *regs)
irq_enter();
kstat_cpu(cpu).irqs[irq]++;
if (irq == 9)
kbd_pt_regs = regs;
/* Sliiiick... */
#ifndef CONFIG_SMP
bp = ((irq != 0) ?
......
......@@ -1679,23 +1679,6 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_times
return ret;
}
extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set, old_sigset_t *oset);
asmlinkage int sys32_sigprocmask(int how, compat_old_sigset_t *set, compat_old_sigset_t *oset)
{
old_sigset_t s;
int ret;
mm_segment_t old_fs = get_fs();
if (set && get_user (s, set)) return -EFAULT;
set_fs (KERNEL_DS);
ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL);
set_fs (old_fs);
if (ret) return ret;
if (oset && put_user (s, oset)) return -EFAULT;
return 0;
}
extern asmlinkage int sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize);
asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, compat_size_t sigsetsize)
......@@ -1732,21 +1715,6 @@ asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset
return 0;
}
extern asmlinkage int sys_sigpending(old_sigset_t *set);
asmlinkage int sys32_sigpending(compat_old_sigset_t *set)
{
old_sigset_t s;
int ret;
mm_segment_t old_fs = get_fs();
set_fs (KERNEL_DS);
ret = sys_sigpending(&s);
set_fs (old_fs);
if (put_user (s, set)) return -EFAULT;
return ret;
}
extern asmlinkage int sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
......@@ -1813,7 +1781,7 @@ sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
}
spin_lock_irq(&current->sighand->siglock);
sig = dequeue_signal(&these, &info);
sig = dequeue_signal(current, &these, &info);
if (!sig) {
timeout = MAX_SCHEDULE_TIMEOUT;
if (uts)
......@@ -1833,7 +1801,7 @@ sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
timeout = schedule_timeout(timeout);
spin_lock_irq(&current->sighand->siglock);
sig = dequeue_signal(&these, &info);
sig = dequeue_signal(current, &these, &info);
current->blocked = current->real_blocked;
siginitset(&current->real_blocked, 0);
recalc_sigpending();
......
......@@ -55,7 +55,7 @@ sys_call_table32:
.word sys_quotactl, sys_set_tid_address, sys32_mount, sys_ustat, sys_setxattr
/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys32_getdents
.word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys32_sigpending, sys_ni_syscall
/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
.word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sparc64_newuname
/*190*/ .word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
.word sys_epoll_wait, sys_nis_syscall, sys_getppid, sys32_sigaction, sys_sgetmask
......@@ -63,7 +63,7 @@ sys_call_table32:
.word sys32_readahead, sys32_socketcall, sys_syslog, sys32_lookup_dcookie, sys_nis_syscall
/*210*/ .word sys_nis_syscall, sys_nis_syscall, sys_waitpid, sys_swapoff, sys32_sysinfo
.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex
/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys_getpgid
/*220*/ .word compat_sys_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys_getpgid
.word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
/*230*/ .word sys32_select, sys_time, sys_nis_syscall, sys_stime, sys_ni_syscall
.word sys_ni_syscall, sys_llseek, sys_mlock, sys_munlock, sys_mlockall
......@@ -203,7 +203,7 @@ sunos_sys_table:
.word sunos_nosys, sunos_getdents, sys_setsid
.word sys_fchdir, sunos_nosys, sunos_nosys
.word sunos_nosys, sunos_nosys, sunos_nosys
.word sunos_nosys, sys32_sigpending, sunos_nosys
.word sunos_nosys, compat_sys_sigpending, sunos_nosys
.word sys_setpgid, sunos_pathconf, sunos_fpathconf
.word sunos_sysconf, sunos_uname, sunos_nosys
.word sunos_nosys, sunos_nosys, sunos_nosys
......
......@@ -245,7 +245,6 @@ void zap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigne
int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
{
struct mm_struct *mm = current->mm;
struct inode *inode = mapping->host;
unsigned long addr;
int ret = 0;
......@@ -269,7 +268,6 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
+ (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
page = find_get_page(mapping, idx);
if (!page) {
loff_t i_size;
page = alloc_hugetlb_page();
if (!page) {
......@@ -282,9 +280,6 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
free_huge_page(page);
goto out;
}
i_size = (loff_t)(idx + 1) * HPAGE_SIZE;
if (i_size > inode->i_size)
inode->i_size = i_size;
}
set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE);
}
......
......@@ -406,7 +406,6 @@ static int handle_rawcode(unsigned int keyval)
static void a5kkbd_rx(int irq, void *dev_id, struct pt_regs *regs)
{
kbd_pt_regs = regs;
if (handle_rawcode(ioc_readb(IOC_KARTRX)))
tasklet_schedule(&keyboard_tasklet);
}
......
......@@ -28,6 +28,7 @@
#include <linux/slab.h>
static void blk_unplug_work(void *data);
static void blk_unplug_timeout(unsigned long data);
/*
* For the allocated request tables
......@@ -247,6 +248,9 @@ void blk_queue_make_request(request_queue_t * q, make_request_fn * mfn)
init_timer(&q->unplug_timer);
INIT_WORK(&q->unplug_work, blk_unplug_work, q);
q->unplug_timer.function = blk_unplug_timeout;
q->unplug_timer.data = (unsigned long)q;
/*
* by default assume old behaviour and bounce for any highmem page
*/
......@@ -1298,9 +1302,6 @@ int blk_init_queue(request_queue_t *q, request_fn_proc *rfn, spinlock_t *lock)
blk_queue_make_request(q, __make_request);
blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE);
q->unplug_timer.function = blk_unplug_timeout;
q->unplug_timer.data = (unsigned long)q;
blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS);
blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
......
......@@ -149,7 +149,7 @@ static int nbd_xmit(int send, struct socket *sock, char *buf, int size, int msg_
spin_lock_irqsave(&current->sighand->siglock, flags);
printk(KERN_WARNING "NBD (pid %d: %s) got signal %d\n",
current->pid, current->comm,
dequeue_signal(&current->blocked, &info));
dequeue_signal(current, &current->blocked, &info));
spin_unlock_irqrestore(&current->sighand->siglock, flags);
result = -EINTR;
break;
......
......@@ -376,8 +376,6 @@ static void ec3104_keyb_interrupt(int irq, void *data, struct pt_regs *regs)
struct e5_struct *k = &ec3104_keyb;
u8 msr, lsr;
kbd_pt_regs = regs;
msr = ctrl_inb(EC3104_SER4_MSR);
if ((msr & MSR_CTS) && !(k->last_msr & MSR_CTS)) {
......
This diff is collapsed.
......@@ -50,8 +50,6 @@
#include <linux/tty.h>
#include <linux/kmod.h>
#include "busmouse.h"
/*
* Head entry for the doubly linked miscdevice list
*/
......@@ -64,7 +62,6 @@ static DECLARE_MUTEX(misc_sem);
#define DYNAMIC_MINORS 64 /* like dynamic majors */
static unsigned char misc_minors[DYNAMIC_MINORS / 8];
extern int psaux_init(void);
#ifdef CONFIG_SGI_NEWPORT_GFX
extern void gfx_register(void);
#endif
......
......@@ -23,6 +23,11 @@
* 2000/01/20 Fixed SMP locking on put_tty_queue using bits of
* the patch by Andrew J. Kroll <ag784@freenet.buffalo.edu>
* who actually finally proved there really was a race.
*
* 2002/03/18 Implemented n_tty_wakeup to send SIGIO POLL_OUTs to
* waiting writing processes-Sapan Bhatia <sapan@corewars.org>.
* Also fixed a bug in BLOCKING mode where write_chan returns
* EAGAIN
*/
#include <linux/types.h>
......@@ -707,6 +712,22 @@ static int n_tty_receive_room(struct tty_struct *tty)
return 0;
}
/*
* Required for the ptys, serial driver etc. since processes
* that attach themselves to the master and rely on ASYNC
* IO must be woken up
*/
static void n_tty_write_wakeup(struct tty_struct *tty)
{
if (tty->fasync)
{
set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
kill_fasync(&tty->fasync, SIGIO, POLL_OUT);
}
return;
}
static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
char *fp, int count)
{
......@@ -1156,6 +1177,8 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file,
while (nr > 0) {
ssize_t num = opost_block(tty, b, nr);
if (num < 0) {
if (num == -EAGAIN)
break;
retval = num;
goto break_out;
}
......@@ -1235,6 +1258,6 @@ struct tty_ldisc tty_ldisc_N_TTY = {
normal_poll, /* poll */
n_tty_receive_buf, /* receive_buf */
n_tty_receive_room, /* receive_room */
0 /* write_wakeup */
n_tty_write_wakeup /* write_wakeup */
};
......@@ -231,8 +231,7 @@ nvram_set_checksum(void)
* The are the file operation function for user access to /dev/nvram
*/
static long long
nvram_llseek(struct file *file, loff_t offset, int origin)
static loff_t nvram_llseek(struct file *file,loff_t offset, int origin )
{
lock_kernel();
switch (origin) {
......
......@@ -47,7 +47,7 @@ static int write_block(unsigned long p, const char *buf, int count);
static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cmd, unsigned long arg);
static ssize_t flash_read(struct file *file, char *buf, size_t count, loff_t * ppos);
static ssize_t flash_write(struct file *file, const char *buf, size_t count, loff_t * ppos);
static long long flash_llseek(struct file *file, long long offset, int orig);
static loff_t flash_llseek(struct file *file, loff_t offset, int orig);
#define KFLASH_SIZE 1024*1024 //1 Meg
#define KFLASH_SIZE4 4*1024*1024 //4 Meg
......@@ -301,9 +301,9 @@ static ssize_t flash_write(struct file *file, const char *buf, size_t size, loff
* also note that seeking relative to the "end of file" isn't supported:
* it has no meaning, so it returns -EINVAL.
*/
static long long flash_llseek(struct file *file, long long offset, int orig)
static loff_t flash_llseek(struct file *file, loff_t offset, int orig)
{
long long ret;
loff_t ret;
lock_kernel();
if (flashdebug)
......
......@@ -354,4 +354,14 @@ config WAFER_WDT
Documentation/modules.txt. The module will be called
wafer5823wdt.o
config CPU5_WDT
tristate "SMA CPU5 Watchdog"
depends on WATCHDOG
---help---
TBD.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module is called cpu5wdt.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
endmenu
......@@ -29,3 +29,4 @@ obj-$(CONFIG_SC520_WDT) += sc520_wdt.o
obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o
obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o
......@@ -220,7 +220,7 @@ static struct notifier_block acq_notifier =
static int __init acq_init(void)
{
printk("WDT driver for Acquire single board computer initialising.\n");
printk(KERN_INFO "WDT driver for Acquire single board computer initialising.\n");
spin_lock_init(&acq_lock);
if (misc_register(&acq_miscdev))
......
......@@ -100,7 +100,7 @@ static void wdt_timer_ping(unsigned long data)
pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp & ~ALI_WDT_ARM));
pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp | ALI_WDT_ARM));
} else {
printk(OUR_NAME ": Heartbeat lost! Will not ping the watchdog\n");
printk(KERN_INFO OUR_NAME ": Heartbeat lost! Will not ping the watchdog\n");
}
/* Re-set the timer interval */
timer.expires = jiffies + WDT_INTERVAL;
......@@ -136,7 +136,7 @@ static void wdt_startup(void)
add_timer(&timer);
printk(OUR_NAME ": Watchdog timer is now enabled.\n");
printk(KERN_INFO OUR_NAME ": Watchdog timer is now enabled.\n");
}
static void wdt_turnoff(void)
......@@ -144,7 +144,7 @@ static void wdt_turnoff(void)
/* Stop the timer */
del_timer_sync(&timer);
wdt_change(WDT_DISABLE);
printk(OUR_NAME ": Watchdog timer is now disabled...\n");
printk(KERN_INFO OUR_NAME ": Watchdog timer is now disabled...\n");
}
/*
......@@ -203,7 +203,7 @@ static int fop_close(struct inode * inode, struct file * file)
if(wdt_expect_close)
wdt_turnoff();
else
printk(OUR_NAME ": device file closed unexpectedly. Will not stop the WDT!\n");
printk(KERN_INFO OUR_NAME ": device file closed unexpectedly. Will not stop the WDT!\n");
clear_bit(0, &wdt_is_open);
return 0;
......@@ -262,7 +262,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void
* reboot with no heartbeat
*/
wdt_change(WDT_ENABLE);
printk(OUR_NAME ": Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second.\n");
printk(KERN_INFO OUR_NAME ": Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second.\n");
}
return NOTIFY_DONE;
}
......
/*
* sma cpu5 watchdog driver
*
* Copyright (C) 2003 Heiko Ronsdorf <hero@ihg.uni-duisburg.de>
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/timer.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/watchdog.h>
/* adjustable parameters */
static int verbose = 0;
static int port = 0x91;
static volatile int ticks = 10000;
#define PFX "cpu5wdt: "
#define CPU5WDT_EXTENT 0x0A
#define CPU5WDT_STATUS_REG 0x00
#define CPU5WDT_TIME_A_REG 0x02
#define CPU5WDT_TIME_B_REG 0x03
#define CPU5WDT_MODE_REG 0x04
#define CPU5WDT_TRIGGER_REG 0x07
#define CPU5WDT_ENABLE_REG 0x08
#define CPU5WDT_RESET_REG 0x09
#define CPU5WDT_INTERVAL (HZ/10+1)
/* some device data */
static struct {
struct semaphore stop;
volatile int running;
struct timer_list timer;
volatile int queue;
int default_ticks;
int min_ticks;
unsigned long inuse;
} cpu5wdt_device;
/* generic helper functions */
static void cpu5wdt_trigger(unsigned long unused)
{
if ( verbose > 2 )
printk(KERN_DEBUG PFX "trigger at %i ticks\n", ticks);
if( cpu5wdt_device.running )
ticks--;
/* keep watchdog alive */
outb(1, port + CPU5WDT_TRIGGER_REG);
/* requeue?? */
if( cpu5wdt_device.queue && ticks ) {
cpu5wdt_device.timer.expires = jiffies + CPU5WDT_INTERVAL;
add_timer(&cpu5wdt_device.timer);
}
else {
/* ticks doesn't matter anyway */
up(&cpu5wdt_device.stop);
}
}
static void cpu5wdt_reset(void)
{
if ( ticks < cpu5wdt_device.min_ticks )
cpu5wdt_device.min_ticks = ticks;
ticks = cpu5wdt_device.default_ticks;
if ( verbose )
printk(KERN_DEBUG PFX "reset (%i ticks)\n", (int) ticks);
}
static void cpu5wdt_start(void)
{
if ( !cpu5wdt_device.queue ) {
cpu5wdt_device.queue = 1;
outb(0, port + CPU5WDT_TIME_A_REG);
outb(0, port + CPU5WDT_TIME_B_REG);
outb(1, port + CPU5WDT_MODE_REG);
outb(0, port + CPU5WDT_RESET_REG);
outb(0, port + CPU5WDT_ENABLE_REG);
cpu5wdt_device.timer.expires = jiffies + CPU5WDT_INTERVAL;
add_timer(&cpu5wdt_device.timer);
}
/* if process dies, counter is not decremented */
cpu5wdt_device.running++;
}
static int cpu5wdt_stop(void)
{
if ( cpu5wdt_device.running )
cpu5wdt_device.running = 0;
ticks = cpu5wdt_device.default_ticks;
if ( verbose )
printk(KERN_CRIT PFX "stop not possible\n");
return -EIO;
}
/* filesystem operations */
static int cpu5wdt_open(struct inode *inode, struct file *file)
{
switch(minor(inode->i_rdev)) {
case WATCHDOG_MINOR:
if ( test_and_set_bit(0, &cpu5wdt_device.inuse) )
return -EBUSY;
break;
default:
return -ENODEV;
}
return 0;
}
static int cpu5wdt_release(struct inode *inode, struct file *file)
{
if(minor(inode->i_rdev)==WATCHDOG_MINOR) {
clear_bit(0, &cpu5wdt_device.inuse);
}
return 0;
}
static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
unsigned int value;
static struct watchdog_info ident =
{
.options = WDIOF_CARDRESET,
.identity = "CPU5 WDT"
};
switch(cmd) {
case WDIOC_KEEPALIVE:
cpu5wdt_reset();
break;
case WDIOC_GETSTATUS:
value = inb(port + CPU5WDT_STATUS_REG);
value = (value >> 2) & 1;
if ( copy_to_user((int *)arg, (int *)&value, sizeof(int)) )
return -EFAULT;
break;
case WDIOC_GETSUPPORT:
if ( copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)) )
return -EFAULT;
break;
case WDIOC_SETOPTIONS:
if ( copy_from_user(&value, (int *)arg, sizeof(int)) )
return -EFAULT;
switch(value) {
case WDIOS_ENABLECARD:
cpu5wdt_start();
break;
case WDIOS_DISABLECARD:
return cpu5wdt_stop();
default:
return -EINVAL;
}
break;
default:
return -EINVAL;
}
return 0;
}
static ssize_t cpu5wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
if ( !count )
return -EIO;
cpu5wdt_reset();
return count;
}
static struct file_operations cpu5wdt_fops = {
.owner = THIS_MODULE,
.ioctl = cpu5wdt_ioctl,
.open = cpu5wdt_open,
.write = cpu5wdt_write,
.release = cpu5wdt_release,
};
static struct miscdevice cpu5wdt_misc = {
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &cpu5wdt_fops
};
/* init/exit function */
static int __devinit cpu5wdt_init(void)
{
unsigned int val;
int err;
if ( verbose )
printk(KERN_DEBUG PFX "port=0x%x, verbose=%i\n", port, verbose);
if ( (err = misc_register(&cpu5wdt_misc)) < 0 ) {
printk(KERN_ERR PFX "misc_register failed\n");
goto no_misc;
}
if ( !request_region(port, CPU5WDT_EXTENT, PFX) ) {
printk(KERN_ERR PFX "request_region failed\n");
err = -EBUSY;
goto no_port;
}
/* watchdog reboot? */
val = inb(port + CPU5WDT_STATUS_REG);
val = (val >> 2) & 1;
if ( !val )
printk(KERN_INFO PFX "sorry, was my fault\n");
init_MUTEX_LOCKED(&cpu5wdt_device.stop);
cpu5wdt_device.queue = 0;
cpu5wdt_device.min_ticks = ticks;
clear_bit(0, &cpu5wdt_device.inuse);
init_timer(&cpu5wdt_device.timer);
cpu5wdt_device.timer.function = cpu5wdt_trigger;
cpu5wdt_device.timer.data = 0;
cpu5wdt_device.default_ticks = ticks;
printk(KERN_INFO PFX "init success\n");
return 0;
no_port:
misc_deregister(&cpu5wdt_misc);
no_misc:
return err;
}
static int __devinit cpu5wdt_init_module(void)
{
return cpu5wdt_init();
}
static void __devexit cpu5wdt_exit(void)
{
if ( cpu5wdt_device.queue ) {
cpu5wdt_device.queue = 0;
down(&cpu5wdt_device.stop);
}
misc_deregister(&cpu5wdt_misc);
release_region(port, CPU5WDT_EXTENT);
}
static void __devexit cpu5wdt_exit_module(void)
{
cpu5wdt_exit();
}
/* module entry points */
module_init(cpu5wdt_init_module);
module_exit(cpu5wdt_exit_module);
MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>");
MODULE_DESCRIPTION("sma cpu5 watchdog driver");
MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog");
MODULE_LICENSE("GPL");
MODULE_PARM(port, "i");
MODULE_PARM_DESC(port, "base address of watchdog card, default is 0x91");
MODULE_PARM(verbose, "i");
MODULE_PARM_DESC(verbose, "be verbose, default is 0 (no)");
MODULE_PARM(ticks, "i");
MODULE_PARM_DESC(ticks, "count down ticks, default is 10000");
......@@ -453,9 +453,9 @@ static struct file_operations zf_fops = {
};
static struct miscdevice zf_miscdev = {
WATCHDOG_MINOR,
"watchdog",
&zf_fops
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &zf_fops
};
......@@ -464,9 +464,9 @@ static struct miscdevice zf_miscdev = {
* turn the timebomb registers off.
*/
static struct notifier_block zf_notifier = {
zf_notify_sys,
NULL,
0
.notifier_call = zf_notify_sys,
.next = NULL,
.priority = 0
};
static void __init zf_show_action(int act)
......
......@@ -56,6 +56,7 @@
#include <linux/watchdog.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/reboot.h>
#include <asm/uaccess.h>
#include <asm/io.h>
......@@ -197,28 +198,30 @@ void pcwd_showprevstate(void)
if (revision == PCWD_REVISION_A) {
if (card_status & WD_WDRST)
printk("pcwd: Previous reboot was caused by the card.\n");
printk(KERN_INFO "pcwd: Previous reboot was caused by the card.\n");
if (card_status & WD_T110) {
printk("pcwd: Card senses a CPU Overheat. Panicking!\n");
panic("pcwd: CPU Overheat.\n");
printk(KERN_EMERG "pcwd: Card senses a CPU Overheat. Panicking!\n");
printk(KERN_EMERG "pcwd: CPU Overheat.\n");
machine_power_off();
}
if ((!(card_status & WD_WDRST)) &&
(!(card_status & WD_T110)))
printk("pcwd: Cold boot sense.\n");
printk(KERN_INFO "pcwd: Cold boot sense.\n");
} else {
if (card_status & 0x01)
printk("pcwd: Previous reboot was caused by the card.\n");
printk(KERN_INFO "pcwd: Previous reboot was caused by the card.\n");
if (card_status & 0x04) {
printk("pcwd: Card senses a CPU Overheat. Panicking!\n");
panic("pcwd: CPU Overheat.\n");
printk(KERN_EMERG "pcwd: Card senses a CPU Overheat. Panicking!\n");
printk(KERN_EMERG "pcwd: CPU Overheat.\n");
machine_power_off();
}
if ((!(card_status & 0x01)) &&
(!(card_status & 0x04)))
printk("pcwd: Cold boot sense.\n");
printk(KERN_INFO "pcwd: Cold boot sense.\n");
}
}
......@@ -275,8 +278,10 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
{
rv |= WDIOF_OVERHEAT;
if (temp_panic)
panic("pcwd: Temperature overheat trip!\n");
if (temp_panic) {
printk (KERN_INFO "pcwd: Temperature overheat trip!\n");
machine_power_off();
}
}
}
else
......@@ -288,8 +293,10 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
{
rv |= WDIOF_OVERHEAT;
if (temp_panic)
panic("pcwd: Temperature overheat trip!\n");
if (temp_panic) {
printk (KERN_INFO "pcwd: Temperature overheat trip!\n");
machine_power_off();
}
}
}
......@@ -350,7 +357,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
spin_unlock(&io_lock);
if ((cdat & 0x10) == 0)
{
printk("pcwd: Could not disable card.\n");
printk(KERN_INFO "pcwd: Could not disable card.\n");
return -EIO;
}
......@@ -365,7 +372,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
spin_unlock(&io_lock);
if (cdat & 0x10)
{
printk("pcwd: Could not enable card.\n");
printk(KERN_INFO "pcwd: Could not enable card.\n");
return -EIO;
}
return 0;
......@@ -592,7 +599,7 @@ static int __init pcwatchdog_init(void)
revision = PCWD_REVISION_A;
printk("pcwd: v%s Ken Hollis (kenji@bitgate.com)\n", WD_VER);
printk(KERN_INFO "pcwd: v%s Ken Hollis (kenji@bitgate.com)\n", WD_VER);
/* Initial variables */
supports_temp = 0;
......@@ -611,7 +618,7 @@ static int __init pcwatchdog_init(void)
}
if (!found) {
printk("pcwd: No card detected, or port not available.\n");
printk(KERN_INFO "pcwd: No card detected, or port not available.\n");
return(-EIO);
}
#endif
......@@ -624,9 +631,9 @@ static int __init pcwatchdog_init(void)
revision = get_revision();
if (revision == PCWD_REVISION_A)
printk("pcwd: PC Watchdog (REV.A) detected at port 0x%03x\n", current_readport);
printk(KERN_INFO "pcwd: PC Watchdog (REV.A) detected at port 0x%03x\n", current_readport);
else if (revision == PCWD_REVISION_C)
printk("pcwd: PC Watchdog (REV.C) detected at port 0x%03x (Firmware version: %s)\n",
printk(KERN_INFO "pcwd: PC Watchdog (REV.C) detected at port 0x%03x (Firmware version: %s)\n",
current_readport, get_firmware());
else {
/* Should NEVER happen, unless get_revision() fails. */
......@@ -635,7 +642,7 @@ static int __init pcwatchdog_init(void)
}
if (supports_temp)
printk("pcwd: Temperature Option Detected.\n");
printk(KERN_INFO "pcwd: Temperature Option Detected.\n");
debug_off();
......
......@@ -267,9 +267,9 @@ static struct file_operations wdt_fops = {
};
static struct miscdevice wdt_miscdev = {
WATCHDOG_MINOR,
"watchdog",
&wdt_fops
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &wdt_fops
};
/*
......@@ -291,9 +291,9 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
static struct notifier_block wdt_notifier=
{
wdt_notify_sys,
0,
0
.notifier_call = wdt_notify_sys,
.next = NULL,
.priority = 0
};
static void __exit sbc60xxwdt_unload(void)
......
......@@ -297,18 +297,18 @@ static struct notifier_block sc1200wdt_notifier =
static struct file_operations sc1200wdt_fops =
{
owner: THIS_MODULE,
write: sc1200wdt_write,
ioctl: sc1200wdt_ioctl,
open: sc1200wdt_open,
release: sc1200wdt_release
.owner = THIS_MODULE,
.write = sc1200wdt_write,
.ioctl = sc1200wdt_ioctl,
.open = sc1200wdt_open,
.release = sc1200wdt_release
};
static struct miscdevice sc1200wdt_miscdev =
{
minor: WATCHDOG_MINOR,
name: "watchdog",
fops: &sc1200wdt_fops,
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &sc1200wdt_fops,
};
......@@ -397,10 +397,12 @@ static int __init sc1200wdt_init(void)
goto out_clean;
}
#if defined CONFIG_PNP
/* now that the user has specified an IO port and we haven't detected
* any devices, disable pnp support */
isapnp = 0;
pnp_unregister_driver(&scl200wdt_pnp_driver);
#endif
if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
printk(KERN_ERR PFX "Unable to register IO port %#x\n", io);
......@@ -484,5 +486,3 @@ module_exit(sc1200wdt_exit);
MODULE_AUTHOR("Zwane Mwaikambo <zwane@commfireservices.com>");
MODULE_DESCRIPTION("Driver for National Semiconductor PC87307/PC97307 watchdog component");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -281,18 +281,18 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}
static struct file_operations wdt_fops = {
owner: THIS_MODULE,
llseek: fop_llseek,
write: fop_write,
open: fop_open,
release: fop_close,
ioctl: fop_ioctl
.owner = THIS_MODULE,
.llseek = fop_llseek,
.write = fop_write,
.open = fop_open,
.release = fop_close,
.ioctl = fop_ioctl
};
static struct miscdevice wdt_miscdev = {
WATCHDOG_MINOR,
"watchdog",
&wdt_fops
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &wdt_fops
};
/*
......@@ -314,9 +314,9 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
static struct notifier_block wdt_notifier=
{
wdt_notify_sys,
0,
0
.notifier_call = wdt_notify_sys,
.next = NULL,
.priority = 0
};
static void __exit sc520_wdt_unload(void)
......
......@@ -275,9 +275,9 @@ static struct file_operations wdt_fops = {
};
static struct miscdevice wdt_miscdev = {
WATCHDOG_MINOR,
"watchdog",
&wdt_fops
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &wdt_fops
};
/*
......@@ -299,9 +299,9 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
static struct notifier_block wdt_notifier=
{
wdt_notify_sys,
0,
0
.notifier_call = wdt_notify_sys,
.next = NULL,
.priority = 0
};
static void __exit w83877f_wdt_unload(void)
......
......@@ -198,17 +198,17 @@ static int wafwdt_notify_sys(struct notifier_block *this, unsigned long code, vo
*/
static struct file_operations wafwdt_fops = {
owner:THIS_MODULE,
write:wafwdt_write,
ioctl:wafwdt_ioctl,
open:wafwdt_open,
release:wafwdt_close,
.owner = THIS_MODULE,
.write = wafwdt_write,
.ioctl = wafwdt_ioctl,
.open = wafwdt_open,
.release = wafwdt_close,
};
static struct miscdevice wafwdt_miscdev = {
WATCHDOG_MINOR,
"watchdog",
&wafwdt_fops
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &wafwdt_fops
};
/*
......@@ -217,9 +217,9 @@ static struct miscdevice wafwdt_miscdev = {
*/
static struct notifier_block wafwdt_notifier = {
wafwdt_notify_sys,
NULL,
0
.notifier_call = wafwdt_notify_sys,
.next = NULL,
.priority = 0
};
static int __init wafwdt_init(void)
......
......@@ -465,17 +465,17 @@ static struct file_operations wdt_fops = {
static struct miscdevice wdt_miscdev=
{
WATCHDOG_MINOR,
"watchdog",
&wdt_fops
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &wdt_fops
};
#ifdef CONFIG_WDT_501
static struct miscdevice temp_miscdev=
{
TEMP_MINOR,
"temperature",
&wdt_fops
.minor = TEMP_MINOR,
.name = "temperature",
.fops = &wdt_fops
};
#endif
......@@ -486,9 +486,9 @@ static struct miscdevice temp_miscdev=
static struct notifier_block wdt_notifier=
{
wdt_notify_sys,
NULL,
0
.notifier_call = wdt_notify_sys,
.next = NULL,
.priority = 0
};
/**
......
......@@ -258,7 +258,7 @@ static int wdt977_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
static struct watchdog_info ident = {
identity : "Winbond 83977"
.identity = "Winbond 83977"
};
int temp;
......
......@@ -56,7 +56,7 @@
/* ----- global variables -------------------------------------------------- */
/**** lock for writing to global variables: the adapter & driver list */
DECLARE_MUTEX(adap_lock);
static DECLARE_MUTEX(adap_lock);
static DECLARE_MUTEX(driver_lock);
/**** adapter list */
......
......@@ -46,7 +46,7 @@ MODULE_LICENSE("GPL");
#define NS558_ISA 1
#define NS558_PNP 2
static int ns558_isa_portlist[] = { 0x200, 0x201, 0x202, 0x203, 0x204, 0x205, 0x207, 0x209,
static int ns558_isa_portlist[] = { 0x201, 0x200, 0x202, 0x203, 0x204, 0x205, 0x207, 0x209,
0x20b, 0x20c, 0x20e, 0x20f, 0x211, 0x219, 0x101, 0 };
struct ns558 {
......@@ -140,7 +140,7 @@ static void ns558_isa_probe(int io)
port->type = NS558_ISA;
port->size = (1 << i);
port->gameport.io = io & (-1 << i);
port->gameport.io = io;
port->gameport.phys = port->phys;
port->gameport.name = port->name;
port->gameport.id.bustype = BUS_ISA;
......@@ -148,7 +148,7 @@ static void ns558_isa_probe(int io)
sprintf(port->phys, "isa%04x/gameport0", io & (-1 << i));
sprintf(port->name, "NS558 ISA");
request_region(port->gameport.io, (1 << i), "ns558-isa");
request_region(io & (-1 << i), (1 << i), "ns558-isa");
gameport_register_port(&port->gameport);
......@@ -275,7 +275,7 @@ void __exit ns558_exit(void)
/* fall through */
#endif
case NS558_ISA:
release_region(port->gameport.io, port->size);
release_region(port->gameport.io & ~(port->size - 1), port->size);
break;
default:
......
......@@ -340,7 +340,7 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
case JSIOCSBTNMAP:
if (copy_from_user(joydev->keypam, (__u16 *) arg, sizeof(__u16) * (KEY_MAX - BTN_MISC)))
return -EFAULT;
for (i = 0; i < joydev->nkey; i++); {
for (i = 0; i < joydev->nkey; i++) {
if (joydev->keypam[i] > KEY_MAX || joydev->keypam[i] < BTN_MISC) return -EINVAL;
joydev->keymap[joydev->keypam[i] - BTN_MISC] = i;
}
......@@ -377,7 +377,8 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
struct joydev *joydev;
int i, j, t, minor;
if (test_bit(BTN_TOUCH, dev->keybit))
/* Avoid tablets */
if (test_bit(EV_KEY, dev->evbit) && test_bit(BTN_TOUCH, dev->keybit))
return NULL;
for (minor = 0; minor < JOYDEV_MINORS && joydev_table[minor]; minor++);
......@@ -463,18 +464,18 @@ static void joydev_disconnect(struct input_handle *handle)
static struct input_device_id joydev_ids[] = {
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_X) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_WHEEL) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_ABS) },
.absbit = { BIT(ABS_THROTTLE) },
},
{ }, /* Terminating entry */
......
......@@ -64,6 +64,8 @@ static void amijoy_interrupt(int irq, void *dummy, struct pt_regs *fp)
case 1: data = ~custom.joy1dat; button = (~ciaa.pra >> 7) & 1; break;
}
input_regs(amijoy_dev + i, fp);
input_report_key(amijoy_dev + i, BTN_TRIGGER, button);
input_report_abs(amijoy_dev + i, ABS_X, ((data >> 1) & 1) - ((data >> 9) & 1));
......
......@@ -151,7 +151,7 @@ static int mark_core_as_ready(struct iforce *iforce, unsigned short addr)
return -1;
}
void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data, struct pt_regs *regs)
{
struct input_dev *dev = &iforce->dev;
int i;
......@@ -181,6 +181,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
case 0x01: /* joystick position data */
case 0x03: /* wheel position data */
input_regs(dev, regs);
if (HI(cmd) == 1) {
input_report_abs(dev, ABS_X, (__s16) (((__s16)data[1] << 8) | data[0]));
input_report_abs(dev, ABS_Y, (__s16) (((__s16)data[3] << 8) | data[2]));
......@@ -219,6 +221,7 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
break;
case 0x02: /* status report */
input_regs(dev, regs);
input_report_key(dev, BTN_DEAD, data[0] & 0x02);
input_sync(dev);
......
......@@ -78,7 +78,7 @@ static void iforce_serio_write_wakeup(struct serio *serio)
iforce_serial_xmit((struct iforce *)serio->private);
}
static void iforce_serio_irq(struct serio *serio, unsigned char data, unsigned int flags)
static void iforce_serio_irq(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct iforce* iforce = serio->private;
......@@ -115,7 +115,7 @@ static void iforce_serio_irq(struct serio *serio, unsigned char data, unsigned i
}
if (iforce->idx == iforce->len) {
iforce_process_packet(iforce, (iforce->id << 8) | iforce->idx, iforce->data);
iforce_process_packet(iforce, (iforce->id << 8) | iforce->idx, iforce->data, regs);
iforce->pkt = 0;
iforce->id = 0;
iforce->len = 0;
......
......@@ -74,7 +74,7 @@ void iforce_usb_xmit(struct iforce *iforce)
spin_unlock_irqrestore(&iforce->xmit_lock, flags);
}
static void iforce_usb_irq(struct urb *urb)
static void iforce_usb_irq(struct urb *urb, struct pt_regs *regs)
{
struct iforce *iforce = urb->context;
int status;
......@@ -96,7 +96,7 @@ static void iforce_usb_irq(struct urb *urb)
}
iforce_process_packet(iforce,
(iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1);
(iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1, regs);
exit:
status = usb_submit_urb (urb, GFP_ATOMIC);
......@@ -105,7 +105,7 @@ static void iforce_usb_irq(struct urb *urb)
__FUNCTION__, status);
}
static void iforce_usb_out(struct urb *urb)
static void iforce_usb_out(struct urb *urb, struct pt_regs *regs)
{
struct iforce *iforce = urb->context;
......@@ -120,7 +120,7 @@ static void iforce_usb_out(struct urb *urb)
wake_up(&iforce->wait);
}
static void iforce_usb_ctrl(struct urb *urb)
static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs)
{
struct iforce *iforce = urb->context;
if (urb->status) return;
......@@ -133,11 +133,14 @@ static int iforce_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct usb_device *dev = interface_to_usbdev(intf);
struct usb_host_interface *interface;
struct usb_endpoint_descriptor *epirq, *epout;
struct iforce *iforce;
epirq = intf->altsetting[0].endpoint + 0;
epout = intf->altsetting[0].endpoint + 1;
interface = &intf->altsetting[intf->act_altsetting];
epirq = &interface->endpoint[0].desc;
epout = &interface->endpoint[1].desc;
if (!(iforce = kmalloc(sizeof(struct iforce) + 32, GFP_KERNEL)))
goto fail;
......
......@@ -176,7 +176,7 @@ void iforce_delete_device(struct iforce *iforce);
/* iforce-packets.c */
int iforce_control_playback(struct iforce*, u16 id, unsigned int);
void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data);
void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data, struct pt_regs *regs);
int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data);
void iforce_dump_packet(char *msg, u16 cmd, unsigned char *data) ;
int iforce_get_id_packet(struct iforce *iforce, char *packet);
......
......@@ -81,7 +81,7 @@ static int magellan_crunch_nibbles(unsigned char *data, int count)
return 0;
}
static void magellan_process_packet(struct magellan* magellan)
static void magellan_process_packet(struct magellan* magellan, struct pt_regs *regs)
{
struct input_dev *dev = &magellan->dev;
unsigned char *data = magellan->data;
......@@ -89,6 +89,8 @@ static void magellan_process_packet(struct magellan* magellan)
if (!magellan->idx) return;
input_regs(dev, regs);
switch (magellan->data[0]) {
case 'd': /* Axis data */
......@@ -111,12 +113,12 @@ static void magellan_process_packet(struct magellan* magellan)
input_sync(dev);
}
static void magellan_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void magellan_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct magellan* magellan = serio->private;
if (data == '\r') {
magellan_process_packet(magellan);
magellan_process_packet(magellan, regs);
magellan->idx = 0;
} else {
if (magellan->idx < MAGELLAN_MAX_LENGTH)
......
......@@ -81,7 +81,7 @@ struct spaceball {
* SpaceBall.
*/
static void spaceball_process_packet(struct spaceball* spaceball)
static void spaceball_process_packet(struct spaceball* spaceball, struct pt_regs *regs)
{
struct input_dev *dev = &spaceball->dev;
unsigned char *data = spaceball->data;
......@@ -89,6 +89,8 @@ static void spaceball_process_packet(struct spaceball* spaceball)
if (spaceball->idx < 2) return;
input_regs(dev, regs);
switch (spaceball->data[0]) {
case 'D': /* Ball data */
......@@ -147,13 +149,13 @@ static void spaceball_process_packet(struct spaceball* spaceball)
* can occur in the axis values.
*/
static void spaceball_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void spaceball_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct spaceball *spaceball = serio->private;
switch (data) {
case 0xd:
spaceball_process_packet(spaceball);
spaceball_process_packet(spaceball, regs);
spaceball->idx = 0;
spaceball->escape = 0;
return;
......
......@@ -74,7 +74,7 @@ static unsigned char *spaceorb_errors[] = { "EEPROM storing 0 failed", "Receive
* SpaceOrb.
*/
static void spaceorb_process_packet(struct spaceorb *spaceorb)
static void spaceorb_process_packet(struct spaceorb *spaceorb, struct pt_regs *regs)
{
struct input_dev *dev = &spaceorb->dev;
unsigned char *data = spaceorb->data;
......@@ -86,6 +86,8 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb)
for (i = 0; i < spaceorb->idx; i++) c ^= data[i];
if (c) return;
input_regs(dev, regs);
switch (data[0]) {
case 'R': /* Reset packet */
......@@ -128,12 +130,12 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb)
input_sync(dev);
}
static void spaceorb_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void spaceorb_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct spaceorb* spaceorb = serio->private;
if (~data & 0x80) {
if (spaceorb->idx) spaceorb_process_packet(spaceorb);
if (spaceorb->idx) spaceorb_process_packet(spaceorb, regs);
spaceorb->idx = 0;
}
if (spaceorb->idx < SPACEORB_MAX_LENGTH)
......
......@@ -64,13 +64,15 @@ struct stinger {
* Stinger. It updates the data accordingly.
*/
static void stinger_process_packet(struct stinger *stinger)
static void stinger_process_packet(struct stinger *stinger, struct pt_regs *regs)
{
struct input_dev *dev = &stinger->dev;
unsigned char *data = stinger->data;
if (!stinger->idx) return;
input_regs(dev, regs);
input_report_key(dev, BTN_A, ((data[0] & 0x20) >> 5));
input_report_key(dev, BTN_B, ((data[0] & 0x10) >> 4));
input_report_key(dev, BTN_C, ((data[0] & 0x08) >> 3));
......@@ -96,7 +98,7 @@ static void stinger_process_packet(struct stinger *stinger)
* packet processing routine.
*/
static void stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct stinger* stinger = serio->private;
......@@ -106,7 +108,7 @@ static void stinger_interrupt(struct serio *serio, unsigned char data, unsigned
stinger->data[stinger->idx++] = data;
if (stinger->idx == 4) {
stinger_process_packet(stinger);
stinger_process_packet(stinger, regs);
stinger->idx = 0;
}
......
......@@ -101,7 +101,7 @@ struct twidjoy {
* Twiddler. It updates the data accordingly.
*/
static void twidjoy_process_packet(struct twidjoy *twidjoy)
static void twidjoy_process_packet(struct twidjoy *twidjoy, struct pt_regs *regs)
{
if (twidjoy->idx == TWIDJOY_MAX_LENGTH) {
struct input_dev *dev = &twidjoy->dev;
......@@ -111,6 +111,8 @@ static void twidjoy_process_packet(struct twidjoy *twidjoy)
button_bits = ((data[1] & 0x7f) << 7) | (data[0] & 0x7f);
input_regs(dev, regs);
for (bp = twidjoy_buttons; bp->bitmask; bp++) {
int value = (button_bits & (bp->bitmask << bp->bitshift)) >> bp->bitshift;
int i;
......@@ -140,7 +142,7 @@ static void twidjoy_process_packet(struct twidjoy *twidjoy)
* packet processing routine.
*/
static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struc pt_regs *regs)
{
struct twidjoy *twidjoy = serio->private;
......@@ -157,7 +159,7 @@ static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned
twidjoy->data[twidjoy->idx++] = data;
if (twidjoy->idx == TWIDJOY_MAX_LENGTH) {
twidjoy_process_packet(twidjoy);
twidjoy_process_packet(twidjoy, regs);
twidjoy->idx = 0;
}
......
......@@ -63,13 +63,15 @@ struct warrior {
* Warrior. It updates the data accordingly.
*/
static void warrior_process_packet(struct warrior *warrior)
static void warrior_process_packet(struct warrior *warrior, struct pt_regs *regs)
{
struct input_dev *dev = &warrior->dev;
unsigned char *data = warrior->data;
if (!warrior->idx) return;
input_regs(dev, regs);
switch ((data[0] >> 4) & 7) {
case 1: /* Button data */
input_report_key(dev, BTN_TRIGGER, data[3] & 1);
......@@ -97,12 +99,12 @@ static void warrior_process_packet(struct warrior *warrior)
* packet processing routine.
*/
static void warrior_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void warrior_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct warrior* warrior = serio->private;
if (data & 0x80) {
if (warrior->idx) warrior_process_packet(warrior);
if (warrior->idx) warrior_process_packet(warrior, regs);
warrior->idx = 0;
warrior->len = warrior_lengths[(data >> 4) & 7];
}
......@@ -111,7 +113,7 @@ static void warrior_interrupt(struct serio *serio, unsigned char data, unsigned
warrior->data[warrior->idx++] = data;
if (warrior->idx == warrior->len) {
if (warrior->idx) warrior_process_packet(warrior);
if (warrior->idx) warrior_process_packet(warrior, regs);
warrior->idx = 0;
warrior->len = 0;
}
......
......@@ -87,6 +87,8 @@ static void amikbd_interrupt(int irq, void *dummy, struct pt_regs *fp)
scancode = amikbd_keycode[scancode];
input_regs(&amikbd_dev, fp);
if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */
input_report_key(&amikbd_dev, scancode, 1);
input_report_key(&amikbd_dev, scancode, 0);
......
......@@ -86,8 +86,7 @@ static unsigned char atkbd_set3_keycode[512] = {
#define ATKBD_CMD_SETLEDS 0x10ed
#define ATKBD_CMD_GSCANSET 0x11f0
#define ATKBD_CMD_SSCANSET 0x10f0
#define ATKBD_CMD_GETID 0x01f2
#define ATKBD_CMD_GETID2 0x0100
#define ATKBD_CMD_GETID 0x02f2
#define ATKBD_CMD_ENABLE 0x00f4
#define ATKBD_CMD_RESET_DIS 0x00f5
#define ATKBD_CMD_RESET_BAT 0x01ff
......@@ -120,12 +119,12 @@ struct atkbd {
unsigned char cmdbuf[4];
unsigned char cmdcnt;
unsigned char set;
unsigned char oldset;
unsigned char release;
signed char ack;
volatile signed char ack;
unsigned char emul;
unsigned short id;
unsigned char write;
unsigned char resend;
};
/*
......@@ -133,7 +132,7 @@ struct atkbd {
* the keyboard into events.
*/
static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct atkbd *atkbd = serio->private;
int code = data;
......@@ -142,11 +141,15 @@ static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned in
printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags);
#endif
if ((flags & (SERIO_FRAME | SERIO_PARITY)) && (~flags & SERIO_TIMEOUT) && atkbd->write) {
if ((flags & (SERIO_FRAME | SERIO_PARITY)) && (~flags & SERIO_TIMEOUT) && !atkbd->resend && atkbd->write) {
printk("atkbd.c: frame/parity error: %02x\n", flags);
serio_write(serio, ATKBD_CMD_RESEND);
atkbd->resend = 1;
return;
}
if (!flags)
atkbd->resend = 0;
switch (code) {
case ATKBD_RET_ACK:
......@@ -190,6 +193,7 @@ static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned in
atkbd->set, code, serio->phys, atkbd->release ? "released" : "pressed");
break;
default:
input_regs(&atkbd->dev, regs);
input_report_key(&atkbd->dev, atkbd->keycode[code], !atkbd->release);
input_sync(&atkbd->dev);
}
......@@ -227,12 +231,15 @@ static int atkbd_sendbyte(struct atkbd *atkbd, unsigned char byte)
static int atkbd_command(struct atkbd *atkbd, unsigned char *param, int command)
{
int timeout = 50000; /* 500 msec */
int timeout = 500000; /* 500 msec */
int send = (command >> 12) & 0xf;
int receive = (command >> 8) & 0xf;
int i;
atkbd->cmdcnt = receive;
if (command == ATKBD_CMD_RESET_BAT)
timeout = 2000000; /* 2 sec */
if (command & 0xff)
if (atkbd_sendbyte(atkbd, command & 0xff))
......@@ -242,14 +249,28 @@ static int atkbd_command(struct atkbd *atkbd, unsigned char *param, int command)
if (atkbd_sendbyte(atkbd, param[i]))
return (atkbd->cmdcnt = 0) - 1;
while (atkbd->cmdcnt && timeout--) udelay(10);
while (atkbd->cmdcnt && timeout--) {
if (atkbd->cmdcnt == 1 && command == ATKBD_CMD_RESET_BAT)
timeout = 100000;
if (atkbd->cmdcnt == 1 && command == ATKBD_CMD_GETID &&
atkbd->cmdbuf[1] != 0xab && atkbd->cmdbuf[1] != 0xac) {
atkbd->cmdcnt = 0;
break;
}
udelay(1);
}
if (param)
for (i = 0; i < receive; i++)
param[i] = atkbd->cmdbuf[(receive - 1) - i];
if (atkbd->cmdcnt)
return (atkbd->cmdcnt = 0) - 1;
if (atkbd->cmdcnt) {
atkbd->cmdcnt = 0;
return -1;
}
return 0;
}
......@@ -302,13 +323,6 @@ static int atkbd_set_3(struct atkbd *atkbd)
{
unsigned char param[2];
/*
* Remember original scancode set value, so that we can restore it on exit.
*/
if (atkbd_command(atkbd, &atkbd->oldset, ATKBD_CMD_GSCANSET))
atkbd->oldset = 2;
/*
* For known special keyboards we can go ahead and set the correct set.
* We check for NCD PS/2 Sun, NorthGate OmniKey 101 and
......@@ -376,8 +390,8 @@ static int atkbd_probe(struct atkbd *atkbd)
*/
if (atkbd_reset)
if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT))
printk(KERN_WARNING "atkbd.c: keyboard reset failed\n");
if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT))
printk(KERN_WARNING "atkbd.c: keyboard reset failed on %s\n", atkbd->serio->phys);
/*
* Then we check the keyboard ID. We should get 0xab83 under normal conditions.
......@@ -401,10 +415,7 @@ static int atkbd_probe(struct atkbd *atkbd)
if (param[0] != 0xab && param[0] != 0xac)
return -1;
atkbd->id = param[0] << 8;
if (atkbd_command(atkbd, param, ATKBD_CMD_GETID2))
return -1;
atkbd->id |= param[0];
atkbd->id = (param[0] << 8) | param[1];
/*
* Set the LEDs to a defined state.
......@@ -442,7 +453,7 @@ static int atkbd_probe(struct atkbd *atkbd)
static void atkbd_cleanup(struct serio *serio)
{
struct atkbd *atkbd = serio->private;
atkbd_command(atkbd, &atkbd->oldset, ATKBD_CMD_SSCANSET);
atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT);
}
/*
......
......@@ -62,18 +62,20 @@ struct nkbd {
char phys[32];
};
void nkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
void nkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct nkbd *nkbd = serio->private;
/* invalid scan codes are probably the init sequence, so we ignore them */
if (nkbd->keycode[data & NKBD_KEY])
if (nkbd->keycode[data & NKBD_KEY]) {
input_regs(&nkbd->dev, regs);
input_report_key(&nkbd->dev, nkbd->keycode[data & NKBD_KEY], data & NKBD_PRESS);
input_sync(&nkbd->dev);
}
else if (data == 0xe7) /* end of init sequence */
printk(KERN_INFO "input: %s on %s\n", nkbd_name, serio->phys);
input_sync(&nkbd->dev);
}
void nkbd_connect(struct serio *serio, struct serio_dev *dev)
......
......@@ -89,7 +89,7 @@ struct sunkbd {
* is received.
*/
static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct sunkbd* sunkbd = serio->private;
......@@ -119,6 +119,7 @@ static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned i
default:
if (sunkbd->keycode[data & SUNKBD_KEY]) {
input_regs(&sunkbd->dev, regs);
input_report_key(&sunkbd->dev, sunkbd->keycode[data & SUNKBD_KEY], !(data & SUNKBD_RELEASE));
input_sync(&sunkbd->dev);
} else {
......@@ -267,7 +268,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev)
sprintf(sunkbd->name, "Sun Type %d keyboard", sunkbd->type);
memcpy(sunkbd->keycode, sunkbd_keycode, sizeof(sunkbd->keycode));
for (i = 0; i < 255; i++)
for (i = 0; i < 127; i++)
set_bit(sunkbd->keycode[i], sunkbd->dev.keybit);
clear_bit(0, sunkbd->dev.keybit);
......
......@@ -63,7 +63,7 @@ struct xtkbd {
char phys[32];
};
void xtkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
void xtkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct xtkbd *xtkbd = serio->private;
......@@ -74,6 +74,7 @@ void xtkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags
default:
if (xtkbd->keycode[data & XTKBD_KEY]) {
input_regs(&xtkbd->dev, regs);
input_report_key(&xtkbd->dev, xtkbd->keycode[data & XTKBD_KEY], !(data & XTKBD_RELEASE));
input_sync(&xtkbd->dev);
} else {
......
/*
* PC-9800 Speaker beeper driver for Linux
*
* Copyright (c) 2002 Osamu Tomita
* Copyright (c) 2002 Vojtech Pavlik
* Copyright (c) 1992 Orest Zborowski
*
*/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
#include <asm/io.h>
MODULE_AUTHOR("Osamu Tomita <tomita@cinet.co.jp>");
MODULE_DESCRIPTION("PC-9800 Speaker beeper driver");
MODULE_LICENSE("GPL");
static char spkr98_name[] = "PC-9801 Speaker";
static char spkr98_phys[] = "isa3fdb/input0";
static struct input_dev spkr98_dev;
spinlock_t i8253_beep_lock = SPIN_LOCK_UNLOCKED;
static int spkr98_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
unsigned int count = 0;
unsigned long flags;
if (type != EV_SND)
return -1;
switch (code) {
case SND_BELL: if (value) value = 1000;
case SND_TONE: break;
default: return -1;
}
if (value > 20 && value < 32767)
count = CLOCK_TICK_RATE / value;
spin_lock_irqsave(&i8253_beep_lock, flags);
if (count) {
outb(0x76, 0x3fdf);
outb(0, 0x5f);
outb(count & 0xff, 0x3fdb);
outb(0, 0x5f);
outb((count >> 8) & 0xff, 0x3fdb);
/* beep on */
outb(6, 0x37);
} else {
/* beep off */
outb(7, 0x37);
}
spin_unlock_irqrestore(&i8253_beep_lock, flags);
return 0;
}
static int __init spkr98_init(void)
{
spkr98_dev.evbit[0] = BIT(EV_SND);
spkr98_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
spkr98_dev.event = spkr98_event;
spkr98_dev.name = spkr98_name;
spkr98_dev.phys = spkr98_phys;
spkr98_dev.id.bustype = BUS_ISA;
spkr98_dev.id.vendor = 0x001f;
spkr98_dev.id.product = 0x0001;
spkr98_dev.id.version = 0x0100;
input_register_device(&spkr98_dev);
printk(KERN_INFO "input: %s\n", spkr98_name);
return 0;
}
static void __exit spkr98_exit(void)
{
input_unregister_device(&spkr98_dev);
}
module_init(spkr98_init);
module_exit(spkr98_exit);
......@@ -44,6 +44,10 @@ config INPUT_M68K_BEEP
tristate "M68k Beeper support"
depends on M68K && INPUT && INPUT_MISC
config INPUT_98SPKR
tristate "PC-9800 Speaker support"
depends on X86_PC9800 && INPUT && INPUT_MISC
config INPUT_UINPUT
tristate "User level driver support"
depends on INPUT && INPUT_MISC
......
......@@ -7,5 +7,6 @@
obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
obj-$(CONFIG_INPUT_98SPKR) += 98spkr.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
obj-$(CONFIG_INPUT_GSC) += gsc_ps2.o
......@@ -305,7 +305,7 @@ static void __init gscps2_reset(char * addr)
* Receives a keyboard scancode, analyses it and sends it to the input layer.
*/
static void gscps2_kbd_docode(void)
static void gscps2_kbd_docode(struct pt_regs *regs)
{
int scancode = gscps2_readb_input(hpkeyb.addr);
DPRINTK("rel=%d scancode=%d, esc=%d ", hpkeyb.released, scancode, hpkeyb.escaped);
......@@ -341,6 +341,7 @@ static void gscps2_kbd_docode(void)
default:
hpkeyb.scancode = scancode;
DPRINTK("sent=%d, rel=%d\n",hpkeyb.scancode, hpkeyb.released);
input_regs(regs);
input_report_key(&hpkeyb.dev, hpkeyb_keycode[hpkeyb.scancode], !hpkeyb.released);
input_sync(&hpkeyb.dev);
if (hpkeyb.escaped)
......@@ -359,7 +360,7 @@ static void gscps2_kbd_docode(void)
* correct events to the input layer.
*/
static void gscps2_mouse_docode(void)
static void gscps2_mouse_docode(struct pt_regs *regs)
{
int xrel, yrel;
......@@ -368,7 +369,7 @@ static void gscps2_mouse_docode(void)
hpmouse.nbread--;
/* stolen from psmouse.c */
if (hpmouse.nbread && time_after(jiffies, hpmouse.last + HZ/20)) {
if (hpmouse.nbread && time_after(jiffies, hpmouse.last + HZ/2)) {
printk(KERN_DEBUG "%s:%d : Lost mouse synchronization, throwing %d bytes away.\n", __FILE__, __LINE__,
hpmouse.nbread);
hpmouse.nbread = 0;
......@@ -387,6 +388,8 @@ static void gscps2_mouse_docode(void)
if ((hpmouse.bytes[PACKET_CTRL] & (MOUSE_XOVFLOW | MOUSE_YOVFLOW)))
DPRINTK("Mouse: position overflow\n");
input_regs(regs);
input_report_key(&hpmouse.dev, BTN_LEFT, hpmouse.bytes[PACKET_CTRL] & MOUSE_LEFTBTN);
input_report_key(&hpmouse.dev, BTN_MIDDLE, hpmouse.bytes[PACKET_CTRL] & MOUSE_MIDBTN);
input_report_key(&hpmouse.dev, BTN_RIGHT, hpmouse.bytes[PACKET_CTRL] & MOUSE_RIGHTBTN);
......@@ -421,11 +424,11 @@ static void gscps2_interrupt(int irq, void *dev, struct pt_regs *reg)
{
/* process mouse actions */
while (gscps2_readb_status(hpmouse.addr) & GSC_STAT_RBNE)
gscps2_mouse_docode();
gscps2_mouse_docode(reg);
/* process keyboard scancode */
while (gscps2_readb_status(hpkeyb.addr) & GSC_STAT_RBNE)
gscps2_kbd_docode();
gscps2_kbd_docode(reg);
}
......
......@@ -63,6 +63,8 @@ static void amimouse_interrupt(int irq, void *dummy, struct pt_regs *fp)
potgor = custom.potgor;
input_regs(&amimouse_dev, fp);
input_report_rel(&amimouse_dev, REL_X, dx);
input_report_rel(&amimouse_dev, REL_Y, dy);
......
......@@ -131,6 +131,8 @@ static void inport_interrupt(int irq, void *dev_id, struct pt_regs *regs)
outb(INPORT_REG_MODE, INPORT_CONTROL_PORT);
outb(INPORT_MODE_HOLD | INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT);
input_regs(&inport_dev, regs);
outb(INPORT_REG_X, INPORT_CONTROL_PORT);
input_report_rel(&inport_dev, REL_X, inb(INPORT_DATA_PORT));
......
......@@ -130,6 +130,7 @@ static void logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
dy |= (buttons & 0xf) << 4;
buttons = ~buttons >> 5;
input_regs(&logibm_dev, regs);
input_report_rel(&logibm_dev, REL_X, dx);
input_report_rel(&logibm_dev, REL_Y, dy);
input_report_key(&logibm_dev, BTN_RIGHT, buttons & 1);
......
......@@ -73,6 +73,7 @@ static void pc110pad_interrupt(int irq, void *ptr, struct pt_regs *regs)
if (pc110pad_count < 3) return;
input_regs(&pc110pad_dev, regs);
input_report_key(&pc110pad_dev, BTN_TOUCH,
pc110pad_data[0] & 0x01);
input_report_abs(&pc110pad_dev, ABS_X,
......
......@@ -30,8 +30,7 @@ static int psmouse_noext;
#define PSMOUSE_CMD_GETINFO 0x03e9
#define PSMOUSE_CMD_SETSTREAM 0x00ea
#define PSMOUSE_CMD_POLL 0x03eb
#define PSMOUSE_CMD_GETID 0x01f2
#define PSMOUSE_CMD_GETID2 0x0100
#define PSMOUSE_CMD_GETID 0x02f2
#define PSMOUSE_CMD_SETRATE 0x10f3
#define PSMOUSE_CMD_ENABLE 0x00f4
#define PSMOUSE_CMD_RESET_DIS 0x00f6
......@@ -54,7 +53,7 @@ struct psmouse {
unsigned char model;
unsigned long last;
char acking;
char ack;
volatile char ack;
char error;
char devname[64];
char phys[32];
......@@ -74,20 +73,22 @@ static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2
* reports relevant events to the input module.
*/
static void psmouse_process_packet(struct psmouse *psmouse)
static void psmouse_process_packet(struct psmouse *psmouse, struct pt_regs *regs)
{
struct input_dev *dev = &psmouse->dev;
unsigned char *packet = psmouse->packet;
input_regs(dev, regs);
/*
* The PS2++ protocol is a little bit complex
*/
if (psmouse->type == PSMOUSE_PS2PP || psmouse->type == PSMOUSE_PS2TPP) {
if ((packet[0] & 0x40) == 0x40 && (int) packet[1] - (int) ((packet[0] & 0x10) << 4) > 191 ) {
if ((packet[0] & 0x40) == 0x40 && abs((int)packet[1] - (((int)packet[0] & 0x10) << 4)) > 191 ) {
switch (((packet[1] >> 4) & 0x03) | ((packet[0] >> 2) & 0xc0)) {
switch (((packet[1] >> 4) & 0x03) | ((packet[0] >> 2) & 0x0c)) {
case 1: /* Mouse extra info */
......@@ -106,10 +107,11 @@ static void psmouse_process_packet(struct psmouse *psmouse)
break;
#ifdef DEBUG
default:
printk(KERN_WARNING "psmouse.c: Received PS2++ packet #%x, but don't know how to handle.\n",
((packet[1] >> 4) & 0x03) | ((packet[0] >> 2) & 0xc0));
((packet[1] >> 4) & 0x03) | ((packet[0] >> 2) & 0x0c));
#endif
}
......@@ -165,7 +167,7 @@ static void psmouse_process_packet(struct psmouse *psmouse)
* packets or passing them to the command routine as command output.
*/
static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct psmouse *psmouse = serio->private;
......@@ -201,7 +203,7 @@ static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned
psmouse->packet[psmouse->pktcnt++] = data;
if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) {
psmouse_process_packet(psmouse);
psmouse_process_packet(psmouse, regs);
psmouse->pktcnt = 0;
return;
}
......@@ -248,6 +250,9 @@ static int psmouse_command(struct psmouse *psmouse, unsigned char *param, int co
psmouse->cmdcnt = receive;
if (command == PSMOUSE_CMD_RESET_BAT)
timeout = 2000000; /* 2 sec */
if (command & 0xff)
if (psmouse_sendbyte(psmouse, command & 0xff))
return (psmouse->cmdcnt = 0) - 1;
......@@ -256,7 +261,19 @@ static int psmouse_command(struct psmouse *psmouse, unsigned char *param, int co
if (psmouse_sendbyte(psmouse, param[i]))
return (psmouse->cmdcnt = 0) - 1;
while (psmouse->cmdcnt && timeout--) udelay(1);
while (psmouse->cmdcnt && timeout--) {
if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_RESET_BAT)
timeout = 100000;
if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_GETID &&
psmouse->cmdbuf[1] != 0xab && psmouse->cmdbuf[1] != 0xac) {
psmouse->cmdcnt = 0;
break;
}
udelay(1);
}
for (i = 0; i < receive; i++)
param[i] = psmouse->cmdbuf[(receive - 1) - i];
......@@ -498,11 +515,6 @@ static int psmouse_probe(struct psmouse *psmouse)
if (psmouse_command(psmouse, param, PSMOUSE_CMD_GETID))
return -1;
if (param[0] == 0xab || param[0] == 0xac) {
psmouse_command(psmouse, param, PSMOUSE_CMD_GETID2);
return -1;
}
if (param[0] != 0x00 && param[0] != 0x03 && param[0] != 0x04)
return -1;
......
......@@ -64,6 +64,8 @@ static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
rpcmouse_lastx = x;
rpcmouse_lasty = y;
input_regs(dev, regs);
input_report_rel(dev, REL_X, dx);
input_report_rel(dev, REL_Y, -dy);
......
......@@ -60,11 +60,13 @@ struct sermouse {
* second, which is as good as a PS/2 or USB mouse.
*/
static void sermouse_process_msc(struct sermouse *sermouse, signed char data)
static void sermouse_process_msc(struct sermouse *sermouse, signed char data, struct pt_regs *regs)
{
struct input_dev *dev = &sermouse->dev;
signed char *buf = sermouse->buf;
input_regs(dev, regs);
switch (sermouse->count) {
case 0:
......@@ -101,13 +103,15 @@ static void sermouse_process_msc(struct sermouse *sermouse, signed char data)
* standard 3-byte packets and 1200 bps.
*/
static void sermouse_process_ms(struct sermouse *sermouse, signed char data)
static void sermouse_process_ms(struct sermouse *sermouse, signed char data, struct pt_regs *regs)
{
struct input_dev *dev = &sermouse->dev;
signed char *buf = sermouse->buf;
if (data & 0x40) sermouse->count = 0;
input_regs(dev, regs);
switch (sermouse->count) {
case 0:
......@@ -200,7 +204,7 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)
* packets or passing them to the command routine as command output.
*/
static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct sermouse *sermouse = serio->private;
......@@ -208,9 +212,9 @@ static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned
sermouse->last = jiffies;
if (sermouse->type > SERIO_SUN)
sermouse_process_ms(sermouse, data);
sermouse_process_ms(sermouse, data, regs);
else
sermouse_process_msc(sermouse, data);
sermouse_process_msc(sermouse, data, regs);
}
/*
......
......@@ -454,7 +454,11 @@ static struct input_device_id mousedev_ids[] = {
.keybit = { [LONG(BTN_LEFT)] = BIT(BTN_LEFT) },
.relbit = { BIT(REL_X) | BIT(REL_Y) },
}, /* A mouse like device, at least one button, two relative axes */
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_RELBIT,
.evbit = { BIT(EV_KEY) | BIT(EV_REL) },
.relbit = { BIT(REL_WHEEL) },
}, /* A separate scrollwheel */
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
......
......@@ -23,8 +23,6 @@
#include <asm/irq.h>
#include <asm/hardware/amba_kmi.h>
extern struct pt_regs *kbd_pt_regs;
#define KMI_BASE (kmi->base)
struct amba_kmi_port {
......@@ -42,10 +40,8 @@ static void amba_kmi_int(int irq, void *dev_id, struct pt_regs *regs)
struct amba_kmi_port *kmi = dev_id;
unsigned int status = __raw_readb(KMIIR);
kbd_pt_regs = regs;
while (status & KMIIR_RXINTR) {
serio_interrupt(&kmi->io, __raw_readb(KMIDATA), 0);
serio_interrupt(&kmi->io, __raw_readb(KMIDATA), 0, regs);
status = __raw_readb(KMIIR);
}
}
......
......@@ -156,7 +156,7 @@ static struct serio ct82c710_port =
static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs)
{
serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0);
serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0, regs);
}
/*
......
......@@ -62,8 +62,6 @@ static unsigned char i8042_last_e0;
static unsigned char i8042_mux_open;
struct timer_list i8042_timer;
extern struct pt_regs *kbd_pt_regs;
static unsigned long i8042_unxlate_seen[256 / BITS_PER_LONG];
static unsigned char i8042_unxlate_table[128] = {
0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13,
......@@ -345,10 +343,6 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} buffer[I8042_BUFFER_SIZE];
int i, j = 0;
#ifdef CONFIG_VT
kbd_pt_regs = regs;
#endif
spin_lock_irqsave(&i8042_lock, flags);
while (j < I8042_BUFFER_SIZE &&
......@@ -381,7 +375,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
dfl & SERIO_PARITY ? ", bad parity" : "",
dfl & SERIO_TIMEOUT ? ", timeout" : "");
serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl);
serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs);
continue;
}
......@@ -391,7 +385,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
dfl & SERIO_TIMEOUT ? ", timeout" : "");
if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) {
serio_interrupt(&i8042_aux_port, data, dfl);
serio_interrupt(&i8042_aux_port, data, dfl, regs);
continue;
}
......@@ -399,7 +393,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
continue;
if (i8042_direct) {
serio_interrupt(&i8042_kbd_port, data, dfl);
serio_interrupt(&i8042_kbd_port, data, dfl, regs);
continue;
}
......@@ -408,7 +402,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (index == 0xaa || index == 0xb6)
set_bit(index, i8042_unxlate_seen);
if (test_and_clear_bit(index, i8042_unxlate_seen)) {
serio_interrupt(&i8042_kbd_port, 0xf0, dfl);
serio_interrupt(&i8042_kbd_port, 0xf0, dfl, regs);
data = i8042_unxlate_table[data & 0x7f];
}
} else {
......@@ -418,7 +412,7 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
i8042_last_e0 = (data == 0xe0);
serio_interrupt(&i8042_kbd_port, data, dfl);
serio_interrupt(&i8042_kbd_port, data, dfl, regs);
}
}
......
......@@ -136,7 +136,7 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++;
if (parkbd_counter == parkbd_mode + 10)
serio_interrupt(&parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0);
serio_interrupt(&parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0, regs);
}
parkbd_last = jiffies;
......
......@@ -69,8 +69,7 @@ static struct serio q40kbd_port =
static void q40kbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
if (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG))
if (q40kbd_port.dev)
q40kbd_port.dev->interrupt(&q40kbd_port, master_inb(KEYCODE_REG), 0);
serio_interrupt(&q40kbd_port, master_inb(KEYCODE_REG), 0, regs);
master_outb(-1, KEYBOARD_UNLOCK_REG);
}
......
......@@ -44,8 +44,6 @@ MODULE_AUTHOR("Vojtech Pavlik, Russell King");
MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
MODULE_LICENSE("GPL");
extern struct pt_regs *kbd_pt_regs;
static int rpckbd_write(struct serio *port, unsigned char val)
{
while (!(iomd_readb(IOMD_KCTRL) & (1 << 7)))
......@@ -60,12 +58,11 @@ static void rpckbd_rx(int irq, void *dev_id, struct pt_regs *regs)
{
struct serio *port = dev_id;
unsigned int byte;
kbd_pt_regs = regs;
while (iomd_readb(IOMD_KCTRL) & (1 << 5)) {
byte = iomd_readb(IOMD_KARTRX);
serio_interrupt(port, byte, 0);
serio_interrupt(port, byte, 0, regs);
}
}
......
......@@ -24,8 +24,6 @@
#include <asm/hardware/sa1111.h>
extern struct pt_regs *kbd_pt_regs;
struct ps2if {
struct serio io;
struct sa1111_dev *dev;
......@@ -47,8 +45,6 @@ static void ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
struct ps2if *ps2if = dev_id;
unsigned int scancode, flag, status;
kbd_pt_regs = regs;
status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
while (status & PS2STAT_RXF) {
if (status & PS2STAT_STP)
......@@ -62,7 +58,7 @@ static void ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
if (hweight8(scancode) & 1)
flag ^= SERIO_PARITY;
serio_interrupt(&ps2if->io, scancode, flag);
serio_interrupt(&ps2if->io, scancode, flag, regs);
status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
}
......
......@@ -135,10 +135,10 @@ void serio_rescan(struct serio *serio)
wake_up(&serio_wait);
}
void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
if (serio->dev && serio->dev->interrupt)
serio->dev->interrupt(serio, data, flags);
serio->dev->interrupt(serio, data, flags, regs);
else
if (!flags)
serio_rescan(serio);
......
......@@ -114,6 +114,9 @@ static void serport_ldisc_close(struct tty_struct *tty)
* serport_ldisc_receive() is called by the low level tty driver when characters
* are ready for us. We forward the characters, one by one to the 'interrupt'
* routine.
*
* FIXME: We should get pt_regs from the tty layer and forward them to
* serio_interrupt here.
*/
static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count)
......@@ -121,7 +124,7 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
struct serport *serport = (struct serport*) tty->disc_data;
int i;
for (i = 0; i < count; i++)
serio_interrupt(&serport->serio, cp[i], 0);
serio_interrupt(&serport->serio, cp[i], 0, NULL);
}
/*
......
......@@ -60,7 +60,7 @@ struct gunze {
char phys[32];
};
static void gunze_process_packet(struct gunze* gunze)
static void gunze_process_packet(struct gunze* gunze, struct pt_regs *regs)
{
struct input_dev *dev = &gunze->dev;
......@@ -71,18 +71,19 @@ static void gunze_process_packet(struct gunze* gunze)
return;
}
input_regs(dev, regs);
input_report_abs(dev, ABS_X, simple_strtoul(gunze->data + 1, NULL, 10) * 4);
input_report_abs(dev, ABS_Y, 3072 - simple_strtoul(gunze->data + 6, NULL, 10) * 3);
input_report_key(dev, BTN_TOUCH, gunze->data[0] == 'T');
input_sync(dev);
}
static void gunze_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
static void gunze_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
{
struct gunze* gunze = serio->private;
if (data == '\r') {
gunze_process_packet(gunze);
gunze_process_packet(gunze, regs);
gunze->idx = 0;
} else {
if (gunze->idx < GUNZE_MAX_LENGTH)
......
......@@ -108,6 +108,7 @@ static void action_button_handler(int irq, void *dev_id, struct pt_regs *regs)
int down = (GPLR & GPIO_BITSY_ACTION_BUTTON) ? 0 : 1;
struct input_dev *dev = (struct input_dev *) dev_id;
input_regs(dev, regs);
input_report_key(dev, KEY_ENTER, down);
input_sync(dev);
}
......@@ -121,6 +122,7 @@ static void npower_button_handler(int irq, void *dev_id, struct pt_regs *regs)
* This interrupt is only called when we release the key. So we have
* to fake a key press.
*/
input_regs(dev, regs);
input_report_key(dev, KEY_SUSPEND, 1);
input_report_key(dev, KEY_SUSPEND, down);
input_sync(dev);
......@@ -183,12 +185,14 @@ static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
* packets. Some packets coming from serial are not touchscreen related. In
* this case we send them off to be processed elsewhere.
*/
static void h3600ts_process_packet(struct h3600_dev *ts)
static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
{
struct input_dev *dev = &ts->dev;
static int touched = 0;
int key, down = 0;
input_regs(dev, regs);
switch (ts->event) {
/*
Buttons - returned as a single byte
......
......@@ -52,8 +52,6 @@ MODULE_AUTHOR("Franz Sirl <Franz.Sirl-kernel@lauterbach.com>");
#define KEYB_LEDREG 2 /* register # for leds on ADB keyboard */
#define MOUSE_DATAREG 0 /* reg# for movement/button codes from mouse */
extern struct pt_regs *kbd_pt_regs;
static int adb_message_handler(struct notifier_block *, unsigned long, void *);
static struct notifier_block adbhid_adb_notifier = {
.notifier_call = adb_message_handler,
......@@ -136,14 +134,13 @@ adbhid_keyboard_input(unsigned char *data, int nb, struct pt_regs *regs, int apo
/* first check this is from register 0 */
if (nb != 3 || (data[0] & 3) != KEYB_KEYREG)
return; /* ignore it */
kbd_pt_regs = regs;
adbhid_input_keycode(id, data[1], 0);
adbhid_input_keycode(id, data[1], 0, regs);
if (!(data[2] == 0xff || (data[2] == 0x7f && data[1] == 0x7f)))
adbhid_input_keycode(id, data[2], 0);
adbhid_input_keycode(id, data[2], 0, regs);
}
static void
adbhid_input_keycode(int id, int keycode, int repeat)
adbhid_input_keycode(int id, int keycode, int repeat, pt_regs *regs)
{
int up_flag;
......@@ -152,21 +149,24 @@ adbhid_input_keycode(int id, int keycode, int repeat)
switch (keycode) {
case 0x39: /* Generate down/up events for CapsLock everytime. */
input_regs(&adbhid[id]->input, regs);
input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 1);
input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 0);
input_sync(&adbhid[id]->input);
return;
case 0x3f: /* ignore Powerbook Fn key */
return;
}
if (adbhid[id]->keycode[keycode])
if (adbhid[id]->keycode[keycode]) {
input_regs(&adbhid[id]->input, regs);
input_report_key(&adbhid[id]->input,
adbhid[id]->keycode[keycode], !up_flag);
else
input_sync(&adbhid[id]->input);
} else
printk(KERN_INFO "Unhandled ADB key (scancode %#02x) %s.\n", keycode,
up_flag ? "released" : "pressed");
input_sync(&adbhid[id]->input);
}
static void
......@@ -253,6 +253,8 @@ adbhid_mouse_input(unsigned char *data, int nb, struct pt_regs *regs, int autopo
break;
}
input_regs(&adbhid[id]->input, regs);
input_report_key(&adbhid[id]->input, BTN_LEFT, !((data[1] >> 7) & 1));
input_report_key(&adbhid[id]->input, BTN_MIDDLE, !((data[2] >> 7) & 1));
......@@ -277,6 +279,8 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto
return;
}
input_regs(&adbhid[id]->input, regs);
switch (adbhid[id]->original_handler_id) {
default:
case 0x02: /* Adjustable keyboard button device */
......
......@@ -953,7 +953,7 @@ static char* amd8111e_read_regs(struct amd8111e_priv* lp)
reg_buff = kmalloc( AMD8111E_REG_DUMP_LEN,GFP_KERNEL);
if(NULL == reg_buff)
return NULL;
for( i=0; i< AMD8111E_REG_DUMP_LEN;i+=4);
for (i=0; i < AMD8111E_REG_DUMP_LEN; i+=4)
reg_buff[i]= readl(mmio + i);
return reg_buff;
}
......
......@@ -2045,7 +2045,7 @@ int init_module(void)
void cleanup_module(void)
{
int i = 0;
struct arlan_private ap;
struct arlan_private *ap;
ARLAN_DEBUG_ENTRY("cleanup_module");
......
......@@ -3769,7 +3769,7 @@ struct pci_dev *pdev = NULL;
for (i = 0; i <= MAX_FC_CARDS; i++)
fc[i] = NULL;
for (i = 0; i < clone_list[i].vendor_id != 0; i++)
for (i = 0; clone_list[i].vendor_id != 0; i++)
while ((pdev = pci_find_device(clone_list[i].vendor_id, clone_list[i].device_id, pdev))) {
unsigned short pci_command;
if (pci_enable_device(pdev))
......
......@@ -6479,8 +6479,11 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
}
#endif
/* Remove this if it causes problems for some boards. */
tp->dma_rwctrl |= DMA_RWCTRL_USE_MEM_READ_MULT;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) {
/* Remove this if it causes problems for some boards. */
tp->dma_rwctrl |= DMA_RWCTRL_USE_MEM_READ_MULT;
}
tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
......
......@@ -3064,7 +3064,7 @@ static int smctr_load_node_addr(struct net_device *dev)
__u8 r;
/* Check if node address has been specified by user. (non-0) */
for(i = 0; ((i < 6) && (dev->dev_addr[i] == 0)); i++);
for(i = 0; ((i < 6) && (dev->dev_addr[i] == 0)); i++)
{
if(i != 6)
{
......
......@@ -733,7 +733,7 @@ static int imm_init(int host_no)
static inline int imm_send_command(Scsi_Cmnd * cmd)
{
int host_no = cmd->host->unique_id;
int host_no = cmd->device->host->unique_id;
int k;
/* NOTE: IMM uses byte pairs */
......@@ -758,7 +758,7 @@ static int imm_completion(Scsi_Cmnd * cmd)
* 0 Told to schedule
* 1 Finished data transfer
*/
int host_no = cmd->host->unique_id;
int host_no = cmd->device->host->unique_id;
unsigned short ppb = IMM_BASE(host_no);
unsigned long start_jiffies = jiffies;
......@@ -845,7 +845,7 @@ static int imm_completion(Scsi_Cmnd * cmd)
int imm_command(Scsi_Cmnd * cmd)
{
static int first_pass = 1;
int host_no = cmd->host->unique_id;
int host_no = cmd->device->host->unique_id;
if (first_pass) {
printk("imm: using non-queuing interface\n");
......@@ -867,7 +867,7 @@ int imm_command(Scsi_Cmnd * cmd)
schedule();
if (cmd->SCp.phase) /* Only disconnect if we have connected */
imm_disconnect(cmd->host->unique_id);
imm_disconnect(cmd->device->host->unique_id);
imm_pb_release(host_no);
imm_hosts[host_no].cur_cmd = 0;
......@@ -883,7 +883,7 @@ static void imm_interrupt(void *data)
{
imm_struct *tmp = (imm_struct *) data;
Scsi_Cmnd *cmd = tmp->cur_cmd;
struct Scsi_Host *host = cmd->host;
struct Scsi_Host *host = cmd->device->host;
unsigned long flags;
if (!cmd) {
......@@ -930,9 +930,9 @@ static void imm_interrupt(void *data)
#endif
if (cmd->SCp.phase > 1)
imm_disconnect(cmd->host->unique_id);
imm_disconnect(cmd->device->host->unique_id);
if (cmd->SCp.phase > 0)
imm_pb_release(cmd->host->unique_id);
imm_pb_release(cmd->device->host->unique_id);
spin_lock_irqsave(host->host_lock, flags);
tmp->cur_cmd = 0;
......@@ -943,7 +943,7 @@ static void imm_interrupt(void *data)
static int imm_engine(imm_struct * tmp, Scsi_Cmnd * cmd)
{
int host_no = cmd->host->unique_id;
int host_no = cmd->device->host->unique_id;
unsigned short ppb = IMM_BASE(host_no);
unsigned char l = 0, h = 0;
int retv, x;
......@@ -972,7 +972,7 @@ static int imm_engine(imm_struct * tmp, Scsi_Cmnd * cmd)
/* Phase 2 - We are now talking to the scsi bus */
case 2:
if (!imm_select(host_no, cmd->target)) {
if (!imm_select(host_no, cmd->device->id)) {
imm_fail(host_no, DID_NO_CONNECT);
return 0;
}
......@@ -1082,7 +1082,7 @@ static int imm_engine(imm_struct * tmp, Scsi_Cmnd * cmd)
int imm_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
{
int host_no = cmd->host->unique_id;
int host_no = cmd->device->host->unique_id;
if (imm_hosts[host_no].cur_cmd) {
printk("IMM: bug in imm_queuecommand\n");
......@@ -1125,7 +1125,7 @@ int imm_biosparam(struct scsi_device *sdev, struct block_device *dev,
int imm_abort(Scsi_Cmnd * cmd)
{
int host_no = cmd->host->unique_id;
int host_no = cmd->device->host->unique_id;
/*
* There is no method for aborting commands since Iomega
* have tied the SCSI_MESSAGE line high in the interface
......@@ -1157,7 +1157,7 @@ void imm_reset_pulse(unsigned int base)
int imm_reset(Scsi_Cmnd * cmd)
{
int host_no = cmd->host->unique_id;
int host_no = cmd->device->host->unique_id;
if (cmd->SCp.phase)
imm_disconnect(host_no);
......
......@@ -195,14 +195,14 @@
* DRIVER_VER
*/
#define IPS_VERSION_HIGH "5.99"
#define IPS_VERSION_LOW ".00-BETA"
#define IPS_VERSION_LOW ".01-BETA"
#if !defined(__i386__) && !defined(__ia64__)
#error "This driver has only been tested on the x86/ia64 platforms"
#endif
#if LINUX_VERSION_CODE <= LinuxVersionCode(2,5,0)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
#include "sd.h"
#define IPS_SG_ADDRESS(sg) ((sg)->address)
#define IPS_LOCK_SAVE(lock,flags) spin_lock_irqsave(&io_request_lock,flags)
......@@ -241,6 +241,7 @@ static ips_ha_t *ips_ha[IPS_MAX_ADAPTERS]; /* Array of HA structures *
static unsigned int ips_next_controller = 0;
static unsigned int ips_num_controllers = 0;
static unsigned int ips_released_controllers = 0;
static int ips_hotplug;
static int ips_cmd_timeout = 60;
static int ips_reset_timeout = 60 * 5;
static int ips_force_memio = 1; /* Always use Memory Mapped I/O */
......@@ -572,7 +573,7 @@ ips_detect(Scsi_Host_Template *SHT) {
ips_free(ips_ha[i]);
ips_released_controllers++;
}
ips_hotplug = 1;
return (ips_num_controllers);
}
......@@ -702,6 +703,7 @@ ips_release(struct Scsi_Host *sh) {
/* free IRQ */
free_irq(ha->irq, ha);
IPS_REMOVE_HOST(sh);
scsi_unregister(sh);
ips_released_controllers++;
......@@ -1136,17 +1138,21 @@ ips_queue(Scsi_Cmnd *SC, void (*done) (Scsi_Cmnd *)) {
/* */
/****************************************************************************/
static int
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
ips_biosparam(Disk *disk, kdev_t dev, int geom[]) {
ips_ha_t *ha = (ips_ha_t *) disk->device->host->hostdata;
unsigned long capacity = disk->capacity;
#else
ips_biosparam(struct scsi_device *sdev, struct block_device *bdev,
sector_t capacity, int geom[]) {
ips_ha_t *ha;
ips_ha_t *ha = (ips_ha_t *) sdev->host->hostdata;
#endif
int heads;
int sectors;
int cylinders;
METHOD_TRACE("ips_biosparam", 1);
ha = (ips_ha_t *) sdev->host->hostdata;
if (!ha)
/* ?!?! host adater info invalid */
return (0);
......@@ -1178,7 +1184,7 @@ ips_biosparam(struct scsi_device *sdev, struct block_device *bdev,
return (0);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/****************************************************************************/
/* */
/* Routine Name: ips_select_queue_depth */
......@@ -1188,7 +1194,7 @@ ips_biosparam(struct scsi_device *sdev, struct block_device *bdev,
/* Select queue depths for the devices on the contoller */
/* */
/****************************************************************************/
/*static void
static void
ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device *scsi_devs) {
Scsi_Device *device;
ips_ha_t *ha;
......@@ -1221,8 +1227,8 @@ ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device *scsi_devs) {
}
}
}
*/
#else
/****************************************************************************/
/* */
/* Routine Name: ips_slave_configure */
......@@ -1247,6 +1253,7 @@ ips_slave_configure(Scsi_Device *SDptr)
}
return 0;
}
#endif
/****************************************************************************/
/* */
......@@ -3375,8 +3382,8 @@ ips_map_status(ips_ha_t *ha, ips_scb_t *scb, ips_stat_t *sp) {
ips_name,
ha->host_num,
scb->scsi_cmd->device->channel,
scb->scsi_cmd->channel->id,
scb->scsi_cmd->channel->lun,
scb->scsi_cmd->device->id,
scb->scsi_cmd->device->lun,
scb->basic_status,
scb->extended_status,
scb->extended_status == IPS_ERR_CKCOND ? scb->dcdb.sense_info[2] & 0xf : 0,
......@@ -4223,6 +4230,12 @@ ips_msense(ips_ha_t *ha, ips_scb_t *scb) {
mdata.pdata.pg4.RotationalOffset = 0;
mdata.pdata.pg4.MediumRotationRate = 0;
break;
case 0x8:
mdata.pdata.pg8.PageCode = 8;
mdata.pdata.pg8.PageLength = sizeof(IPS_SCSI_MODE_PAGE8);
mdata.hdr.DataLength = 3 + mdata.hdr.BlockDescLength + mdata.pdata.pg8.PageLength;
/* everything else is left set to 0 */
break;
default:
return (0);
......@@ -6744,7 +6757,7 @@ ips_register_scsi( int index){
sh->unchecked_isa_dma = sh->hostt->unchecked_isa_dma;
sh->use_clustering = sh->hostt->use_clustering;
#if LINUX_VERSION_CODE >= LinuxVersionCode(2,4,7)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,7)
sh->max_sectors = 128;
#endif
......@@ -6753,6 +6766,7 @@ ips_register_scsi( int index){
sh->max_channel = ha->nbus - 1;
sh->can_queue = ha->max_cmds-1;
IPS_ADD_HOST(sh, NULL);
return 0;
}
......@@ -6793,11 +6807,11 @@ ips_module_init(void){
return -ENODEV;
ips_driver_template.module = THIS_MODULE;
ips_order_controllers();
if( scsi_register_host(&ips_driver_template) ){
if( IPS_REGISTER_HOSTS(&ips_driver_template) ){
pci_unregister_driver(&ips_pci_driver);
return -ENODEV;
}
register_reboot_notifier(&ips_notifier);
return 0;
}
......@@ -6810,7 +6824,7 @@ ips_module_init(void){
/****************************************************************************/
static void __exit
ips_module_exit(void){
scsi_unregister_host(&ips_driver_template);
IPS_UNREGISTER_HOSTS(&ips_driver_template);
pci_unregister_driver(&ips_pci_driver);
unregister_reboot_notifier(&ips_notifier);
}
......@@ -6840,6 +6854,12 @@ static int __devinit ips_insert_device(struct pci_dev *pci_dev, const struct pci
if (rc == SUCCESS)
rc = ips_init_phase2(index);
if(ips_hotplug)
if(ips_register_scsi(index)){
ips_free(ips_ha[index]);
rc = -1;
}
if (rc == SUCCESS)
ips_num_controllers++;
......@@ -7127,7 +7147,7 @@ static int ips_init_phase2( int index )
}
#if LINUX_VERSION_CODE >= LinuxVersionCode(2,4,9)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
MODULE_LICENSE("GPL");
#endif
......
......@@ -64,11 +64,7 @@
/*
* Some handy macros
*/
#ifndef LinuxVersionCode
#define LinuxVersionCode(x,y,z) (((x)<<16)+((y)<<8)+(z))
#endif
#if LINUX_VERSION_CODE >= LinuxVersionCode(2,4,20) || defined CONFIG_HIGHIO
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20) || defined CONFIG_HIGHIO
#define IPS_HIGHIO
#define IPS_HIGHMEM_IO .highmem_io = 1,
#else
......@@ -97,14 +93,21 @@
#define IPS_SGLIST_SIZE(ha) (IPS_USE_ENH_SGLIST(ha) ? \
sizeof(IPS_ENH_SG_LIST) : sizeof(IPS_STD_SG_LIST))
#if LINUX_VERSION_CODE < LinuxVersionCode(2,4,4)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,4)
#define pci_set_dma_mask(dev,mask) (1)
#define scsi_set_pci_device(sh,dev) (0)
#endif
#if LINUX_VERSION_CODE < LinuxVersionCode(2,5,0)
#define scsi_register_host(x) scsi_register_module(MODULE_SCSI_HA,x)
#define scsi_unregister_host(x) scsi_unregister_module(MODULE_SCSI_HA,x)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#define IPS_REGISTER_HOSTS(SHT) scsi_register_module(MODULE_SCSI_HA,SHT)
#define IPS_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT)
#define IPS_ADD_HOST(shost,device)
#define IPS_REMOVE_HOST(shost)
#else
#define IPS_REGISTER_HOSTS(SHT) (!ips_detect(SHT))
#define IPS_UNREGISTER_HOSTS(SHT)
#define IPS_ADD_HOST(shost,device) scsi_add_host(shost,device)
#define IPS_REMOVE_HOST(shost) scsi_remove_host(shost)
#endif
#ifndef MDELAY
......@@ -439,7 +442,7 @@
/*
* Scsi_Host Template
*/
#if LINUX_VERSION_CODE < LinuxVersionCode(2,5,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static void ips_select_queue_depth(struct Scsi_Host *, Scsi_Device *);
static int ips_biosparam(Disk *disk, kdev_t dev, int geom[]);
#define IPS { \
......@@ -958,6 +961,20 @@ typedef struct {
uint8_t Reserved2[2];
} IPS_SCSI_MODE_PAGE4;
/*
* Sense Data Format - Page 8
*/
typedef struct {
uint8_t PageCode;
uint8_t PageLength;
uint8_t flags;
uint8_t RetentPrio;
uint16_t DisPrefetchLen;
uint16_t MinPrefetchLen;
uint16_t MaxPrefetchLen;
uint16_t MaxPrefetchCeiling;
} IPS_SCSI_MODE_PAGE8;
/*
* Sense Data Format - Block Descriptor (DASD)
*/
......@@ -985,6 +1002,7 @@ typedef struct {
union {
IPS_SCSI_MODE_PAGE3 pg3;
IPS_SCSI_MODE_PAGE4 pg4;
IPS_SCSI_MODE_PAGE8 pg8;
} pdata;
} IPS_SCSI_MODE_PAGE_DATA;
......
......@@ -527,7 +527,7 @@ static void receive_kbd_ms_chars(struct uart_sunsu_port *up, struct pt_regs *reg
}
kbd_pt_regs = regs;
#ifdef CONFIG_SERIO
serio_interrupt(&up->serio, ch, 0);
serio_interrupt(&up->serio, ch, 0, regs);
#endif
} else if (up->su_type == SU_PORT_MS) {
int ret = suncore_mouse_baud_detection(ch, is_break);
......@@ -541,7 +541,7 @@ static void receive_kbd_ms_chars(struct uart_sunsu_port *up, struct pt_regs *reg
case 0:
#ifdef CONFIG_SERIO
serio_interrupt(&up->serio, ch, 0);
serio_interrupt(&up->serio, ch, 0, regs);
#endif
break;
};
......
......@@ -303,7 +303,7 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up,
}
kbd_pt_regs = regs;
#ifdef CONFIG_SERIO
serio_interrupt(&up->serio, ch, 0);
serio_interrupt(&up->serio, ch, 0, regs);
#endif
} else if (ZS_IS_MOUSE(up)) {
int ret = suncore_mouse_baud_detection(ch, is_break);
......@@ -317,7 +317,7 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up,
case 0:
#ifdef CONFIG_SERIO
serio_interrupt(&up->serio, ch, 0);
serio_interrupt(&up->serio, ch, 0, regs);
#endif
break;
};
......@@ -1030,7 +1030,7 @@ static struct uart_driver sunzilog_reg = {
.owner = THIS_MODULE,
.driver_name = "ttyS",
#ifdef CONFIG_DEVFS_FS
.dev_name = "ttyS%d",
.dev_name = "tts/%d",
#else
.dev_name = "ttyS%d",
#endif
......@@ -1484,7 +1484,7 @@ static void __init sunzilog_prepare(void)
/*
* Temporary fix.
*/
for (channel = 0; channel < NUM_CHANNELS - 1; channel++)
for (channel = 0; channel < NUM_CHANNELS; channel++)
spin_lock_init(&sunzilog_port_table[channel].port.lock);
sunzilog_irq_chain = up = &sunzilog_port_table[0];
......
......@@ -49,7 +49,7 @@ config HID_FF
If unsure, say N.
config HID_PID
bool "PID Devices"
bool "PID Devices (Microsoft Sidewinder Force Feedback 2)"
depends on HID_FF
help
Say Y here if you have a PID-compliant joystick and wish to enable force
......@@ -67,6 +67,15 @@ config LOGITECH_FF
Note: if you say N here, this device will still be supported, but without
force feedback.
config THRUSTMASTER_FF
bool "ThrustMaster FireStorm Dual Power 2 support (EXPERIMENTAL)"
depends on HID_FF && EXPERIMENTAL
help
Say Y here if you have a THRUSTMASTER FireStore Dual Power 2,
and want to enable force feedback support for it.
Note: if you say N here, this device will still be supported, but without
force feedback.
config USB_HIDDEV
bool "/dev/hiddev raw HID device support"
depends on USB_HID
......@@ -81,7 +90,6 @@ config USB_HIDDEV
If unsure, say Y.
menu "USB HID Boot Protocol drivers"
depends on USB!=n && USB_HID!=y
......
......@@ -19,6 +19,9 @@ endif
ifeq ($(CONFIG_LOGITECH_FF),y)
hid-objs += hid-lgff.o
endif
ifeq ($(CONFIG_THRUSTMASTER_FF),y)
hid-objs += hid-tmff.o
endif
ifeq ($(CONFIG_HID_FF),y)
hid-objs += hid-ff.o
endif
......
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