Commit 0f883b8d authored by David S. Miller's avatar David S. Miller

Merge bk://kernel.bkbits.net/acme/hlist-2.5

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents 0b13af99 e6e93266
No related merge requests found
......@@ -206,7 +206,7 @@ void setup_arch(char **cmdline_p)
printk("based on 2.0.38 port by Lineo Inc. <mleslie@lineo.com>.\n");
#endif
#ifdef CONFIG_DRAGEN2
printk("Dragon Engine II board support by Georges Menie\n");
printk("DragonEngine II board support by Georges Menie\n");
#endif
#ifdef DEBUG
......
......@@ -290,6 +290,7 @@ _found_ram: /* Vectored here on bus err */
movec %d0, %CACR /* Enable cache */
#ifdef CONFIG_ROMFS_FS
/*
* Move ROM filesystem above bss :-)
*/
......@@ -311,6 +312,12 @@ _copy_romfs:
cmp.l %a0, %a2 /* Check if at end */
bne _copy_romfs
#else /* CONFIG_ROMFS_FS */
lea.l _ebss, %a1
move.l %a1, _ramstart
#endif /* CONFIG_ROMFS_FS */
/*
* Zero out the bss region.
*/
......
......@@ -122,6 +122,4 @@ void config_BSP(char *command, int len)
mach_hwclk = NULL;
mach_set_clock_mmss = NULL;
mach_reset = BSP_reset;
config_M68328_irq();
}
......@@ -103,11 +103,6 @@ config PARISC64
enable this option otherwise. The 64bit kernel is significantly bigger
and slower than the 32bit one.
config COMPAT
bool
depends on PARISC64
default y
config PDC_NARROW
bool "32-bit firmware"
depends on PARISC64
......@@ -145,6 +140,14 @@ config PREEMPT
# bool "Preemptible Kernel"
default n
config COMPAT
bool
depends on PARISC64
default y
config HPUX
bool "Support for HP-UX binaries"
config NR_CPUS
int "Maximum number of CPUs (2-32)"
depends on SMP
......@@ -165,6 +168,7 @@ config KCORE_ELF
config BINFMT_SOM
tristate "Kernel support for SOM binaries"
depends on HPUX
help
SOM is a binary executable format inherited from HP/UX. Say Y here
to be able to load and execute SOM binaries directly.
......
......@@ -57,8 +57,10 @@ head-$(CONFIG_PARISC64) := arch/parisc/kernel/head64.o
CFLAGS += $(cflags-y)
core-y += $(addprefix arch/parisc/, kernel/pdc_cons.o kernel/process.o \
mm/ kernel/ hpux/ math-emu/ kernel/init_task.o )
kernel-y := mm/ kernel/ math-emu/ kernel/init_task.o
kernel-$(CONFIG_HPUX) += hpux/
core-y += $(addprefix arch/parisc/, $(kernel-y))
libs-y += arch/parisc/lib/ `$(CC) -print-libgcc-file-name`
drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/
......
......@@ -4,8 +4,7 @@
head-y := head.o
head-$(CONFIG_PARISC64) := head64.o
extra-y := init_task.o pdc_cons.o process.o \
unaligned.o $(head-y)
extra-y := init_task.o $(head-y)
AFLAGS_entry.o := -traditional
AFLAGS_pacache.o := -traditional
......@@ -14,7 +13,7 @@ obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \
pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \
ptrace.o hardware.o inventory.o drivers.o semaphore.o \
signal.o hpmc.o real2.o parisc_ksyms.o unaligned.o \
processor.o pdc_chassis.o
process.o processor.o pdc_cons.o pdc_chassis.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_PA11) += pci-dma.o
......
......@@ -546,7 +546,7 @@ __kernel_thread:
LDREG -PT_SZ_ALGN-RP_OFFSET(%r30), %r2
ldo -PT_SZ_ALGN(%r30), %r30
bv %r0(%r2)
ldw TASK_PID(%r28), %r28
nop
/*
* Child Returns here
......
......@@ -1785,9 +1785,6 @@ static int do_atm_ioctl(unsigned int fd, unsigned int cmd32, unsigned long arg)
return -EINVAL;
}
#ifdef CONFIG_GENRTC
#endif
#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
/* This really belongs in include/linux/drm.h -DaveM */
#include "../../../drivers/char/drm/drm.h"
......
......@@ -43,8 +43,8 @@
#undef DEBUG_IRQ
#undef PARISC_IRQ_CR16_COUNTS
extern void timer_interrupt(int, void *, struct pt_regs *);
extern void ipi_interrupt(int, void *, struct pt_regs *);
extern irqreturn_t timer_interrupt(int, void *, struct pt_regs *);
extern irqreturn_t ipi_interrupt(int, void *, struct pt_regs *);
#ifdef DEBUG_IRQ
#define DBG_IRQ(irq, x) if ((irq) != TIMER_IRQ) printk x
......@@ -583,7 +583,7 @@ struct irq_region *alloc_irq_region( int count, struct irq_region_ops *ops,
/* FIXME: SMP, flags, bottom halves, rest */
int request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
irqreturn_t (*handler)(int, void *, struct pt_regs *),
unsigned long irqflags,
const char * devname,
void *dev_id)
......
This diff is collapsed.
......@@ -7,22 +7,24 @@
#include <linux/kernel.h>
#include <linux/string.h>
EXPORT_SYMBOL_NOVERS(memscan);
EXPORT_SYMBOL_NOVERS(memset);
EXPORT_SYMBOL(memchr);
EXPORT_SYMBOL(memcmp);
EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(memmove);
EXPORT_SYMBOL(memscan);
EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(strcat);
EXPORT_SYMBOL(strchr);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strcmp);
EXPORT_SYMBOL(strcpy);
EXPORT_SYMBOL(strlen);
EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strncat);
EXPORT_SYMBOL(strncmp);
EXPORT_SYMBOL(strncpy);
EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
EXPORT_SYMBOL(strpbrk);
#include <asm/hardware.h> /* struct parisc_device for asm/pci.h */
#include <linux/pci.h>
......@@ -39,7 +41,6 @@ EXPORT_SYMBOL(disable_irq);
#include <asm/processor.h>
EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(boot_cpu_data);
EXPORT_SYMBOL(map_hpux_gateway_page);
#ifdef CONFIG_EISA
EXPORT_SYMBOL(EISA_bus);
#endif
......@@ -72,12 +73,16 @@ EXPORT_SYMBOL(lclear_user);
#ifndef __LP64__
/* Needed so insmod can set dp value */
extern int $global$;
EXPORT_SYMBOL_NOVERS($global$);
EXPORT_SYMBOL($global$);
#endif
EXPORT_SYMBOL(register_parisc_driver);
EXPORT_SYMBOL(unregister_parisc_driver);
EXPORT_SYMBOL(print_pci_hwpath);
EXPORT_SYMBOL(print_pa_hwpath);
EXPORT_SYMBOL(pdc_iodc_read);
EXPORT_SYMBOL(pdc_tod_read);
EXPORT_SYMBOL(pdc_tod_set);
#include <asm/io.h>
EXPORT_SYMBOL(__ioremap);
......@@ -105,7 +110,12 @@ EXPORT_SYMBOL(outsl);
#include <asm/cache.h>
EXPORT_SYMBOL(flush_kernel_dcache_range_asm);
EXPORT_SYMBOL(flush_kernel_dcache_page);
EXPORT_SYMBOL(flush_data_cache_local);
EXPORT_SYMBOL(flush_kernel_icache_range_asm);
EXPORT_SYMBOL(__flush_dcache_page);
EXPORT_SYMBOL(flush_all_caches);
EXPORT_SYMBOL(dcache_stride);
EXPORT_SYMBOL(flush_cache_all_local);
#include <asm/unistd.h>
extern long sys_open(const char *, int, int);
......@@ -131,6 +141,7 @@ EXPORT_SYMBOL(csum_partial_copy_from_user);
EXPORT_SYMBOL(pdc_add_valid);
EXPORT_SYMBOL(pdc_lan_station_id);
EXPORT_SYMBOL(pdc_get_initiator);
EXPORT_SYMBOL(pdc_sti_call);
extern void $$divI(void);
extern void $$divU(void);
......@@ -156,39 +167,39 @@ extern void $$divI_12(void);
extern void $$divI_14(void);
extern void $$divI_15(void);
EXPORT_SYMBOL_NOVERS($$divI);
EXPORT_SYMBOL_NOVERS($$divU);
EXPORT_SYMBOL_NOVERS($$remI);
EXPORT_SYMBOL_NOVERS($$remU);
EXPORT_SYMBOL_NOVERS($$mulI);
EXPORT_SYMBOL_NOVERS($$divU_3);
EXPORT_SYMBOL_NOVERS($$divU_5);
EXPORT_SYMBOL_NOVERS($$divU_6);
EXPORT_SYMBOL_NOVERS($$divU_9);
EXPORT_SYMBOL_NOVERS($$divU_10);
EXPORT_SYMBOL_NOVERS($$divU_12);
EXPORT_SYMBOL_NOVERS($$divU_7);
EXPORT_SYMBOL_NOVERS($$divU_14);
EXPORT_SYMBOL_NOVERS($$divU_15);
EXPORT_SYMBOL_NOVERS($$divI_3);
EXPORT_SYMBOL_NOVERS($$divI_5);
EXPORT_SYMBOL_NOVERS($$divI_6);
EXPORT_SYMBOL_NOVERS($$divI_7);
EXPORT_SYMBOL_NOVERS($$divI_9);
EXPORT_SYMBOL_NOVERS($$divI_10);
EXPORT_SYMBOL_NOVERS($$divI_12);
EXPORT_SYMBOL_NOVERS($$divI_14);
EXPORT_SYMBOL_NOVERS($$divI_15);
EXPORT_SYMBOL($$divI);
EXPORT_SYMBOL($$divU);
EXPORT_SYMBOL($$remI);
EXPORT_SYMBOL($$remU);
EXPORT_SYMBOL($$mulI);
EXPORT_SYMBOL($$divU_3);
EXPORT_SYMBOL($$divU_5);
EXPORT_SYMBOL($$divU_6);
EXPORT_SYMBOL($$divU_9);
EXPORT_SYMBOL($$divU_10);
EXPORT_SYMBOL($$divU_12);
EXPORT_SYMBOL($$divU_7);
EXPORT_SYMBOL($$divU_14);
EXPORT_SYMBOL($$divU_15);
EXPORT_SYMBOL($$divI_3);
EXPORT_SYMBOL($$divI_5);
EXPORT_SYMBOL($$divI_6);
EXPORT_SYMBOL($$divI_7);
EXPORT_SYMBOL($$divI_9);
EXPORT_SYMBOL($$divI_10);
EXPORT_SYMBOL($$divI_12);
EXPORT_SYMBOL($$divI_14);
EXPORT_SYMBOL($$divI_15);
extern void __ashrdi3(void);
extern void __ashldi3(void);
extern void __lshrdi3(void);
extern void __muldi3(void);
EXPORT_SYMBOL_NOVERS(__ashrdi3);
EXPORT_SYMBOL_NOVERS(__ashldi3);
EXPORT_SYMBOL_NOVERS(__lshrdi3);
EXPORT_SYMBOL_NOVERS(__muldi3);
EXPORT_SYMBOL(__ashrdi3);
EXPORT_SYMBOL(__ashldi3);
EXPORT_SYMBOL(__lshrdi3);
EXPORT_SYMBOL(__muldi3);
#ifdef __LP64__
extern void __divdi3(void);
......@@ -196,16 +207,16 @@ extern void __udivdi3(void);
extern void __umoddi3(void);
extern void __moddi3(void);
EXPORT_SYMBOL_NOVERS(__divdi3);
EXPORT_SYMBOL_NOVERS(__udivdi3);
EXPORT_SYMBOL_NOVERS(__umoddi3);
EXPORT_SYMBOL_NOVERS(__moddi3);
EXPORT_SYMBOL(__divdi3);
EXPORT_SYMBOL(__udivdi3);
EXPORT_SYMBOL(__umoddi3);
EXPORT_SYMBOL(__moddi3);
#endif
#ifndef __LP64__
extern void $$dyncall(void);
EXPORT_SYMBOL_NOVERS($$dyncall);
EXPORT_SYMBOL($$dyncall);
#endif
#include <asm/pgtable.h>
EXPORT_SYMBOL_NOVERS(vmalloc_start);
EXPORT_SYMBOL(vmalloc_start);
......@@ -24,6 +24,7 @@
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/major.h>
#include <linux/tty.h>
#include <asm/page.h>
#include <asm/types.h>
#include <asm/system.h>
......@@ -52,12 +53,24 @@ static int pdc_console_setup(struct console *co, char *options)
return 0;
}
#if defined(CONFIG_PDC_CONSOLE) || defined(CONFIG_SERIAL_MUX)
#if defined(CONFIG_PDC_CONSOLE)
#define PDC_CONSOLE_DEVICE pdc_console_device
static kdev_t pdc_console_device (struct console *c)
static struct tty_driver * pdc_console_device (struct console *c, int *index)
{
extern struct tty_driver console_driver;
*index = c->index ? c->index-1 : fg_console;
return &console_driver;
}
#elif defined(CONFIG_SERIAL_MUX)
#warning CONFIG_SERIAL_MUX
#define PDC_CONSOLE_DEVICE pdc_console_device
#warning "FIXME - should be: static struct tty_driver * pdc_console_device (struct console *c, int *index)"
static kdev_t pdc_console_device (struct console *c, int *index)
{
return mk_kdev(MUX_MAJOR, 0);
}
#else
#define PDC_CONSOLE_DEVICE NULL
#endif
......
......@@ -10,33 +10,23 @@
#define __KERNEL_SYSCALLS__
#include <stdarg.h>
#include <linux/elf.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/personality.h>
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/version.h>
#include <linux/elf.h>
#include <linux/personality.h>
#include <asm/machdep.h>
#include <asm/offsets.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/offsets.h>
#include <asm/pdc.h>
#include <asm/pdc_chassis.h>
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
int hlt_counter;
......@@ -224,18 +214,14 @@ int
sys_clone(unsigned long clone_flags, unsigned long usp,
struct pt_regs *regs)
{
struct task_struct *p;
int *user_tid = (int *)regs->gr[26];
p = do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0, user_tid, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
return do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0, user_tid, NULL);
}
int
sys_vfork(struct pt_regs *regs)
{
struct task_struct *p;
p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gr[30], regs, 0, NULL, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gr[30], regs, 0, NULL, NULL);
}
int
......@@ -251,7 +237,9 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
* Make them const so the compiler knows they live in .text */
extern void * const ret_from_kernel_thread;
extern void * const child_return;
#ifdef CONFIG_HPUX
extern void * const hpux_child_return;
#endif
*cregs = *pregs;
......@@ -295,7 +283,11 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
+ (pregs->gr[21] & (INIT_THREAD_SIZE - 1));
cregs->gr[30] = usp;
if (p->personality == PER_HPUX) {
#ifdef CONFIG_HPUX
cregs->kpc = (unsigned long) &hpux_child_return;
#else
BUG();
#endif
} else {
cregs->kpc = (unsigned long) &child_return;
}
......
......@@ -145,6 +145,7 @@ static int __init processor_probe(struct parisc_device *dev)
/* initialize counters */
memset(p, 0, sizeof(struct cpuinfo_parisc));
p->loops_per_jiffy = loops_per_jiffy;
p->dev = dev; /* Save IODC data in case we need it */
p->hpa = dev->hpa; /* save CPU hpa */
p->cpuid = cpuid; /* save CPU id */
......@@ -356,8 +357,8 @@ show_cpuinfo (struct seq_file *m, void *v)
show_cache_info(m);
seq_printf(m, "bogomips\t: %lu.%02lu\n",
loops_per_jiffy / (500000 / HZ),
(loops_per_jiffy / (5000 / HZ)) % 100);
cpu_data[n].loops_per_jiffy / (500000 / HZ),
(cpu_data[n].loops_per_jiffy / (5000 / HZ)) % 100);
seq_printf(m, "software id\t: %ld\n\n",
boot_cpu_data.pdc.model.sw_id);
......
......@@ -309,7 +309,8 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
}
#endif
#if CACHE_FLUSHING_IS_NOT_BROKEN
#undef CACHE_FLUSHING_IS_NOT_BROKEN
#ifdef CACHE_FLUSHING_IS_NOT_BROKEN
flush_user_icache_range((unsigned long) &frame->tramp[0],
(unsigned long) &frame->tramp[4]);
#else
......
......@@ -147,7 +147,7 @@ halt_processor(void)
}
void
irqreturn_t
ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
int this_cpu = smp_processor_id();
......@@ -256,7 +256,7 @@ ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} /* Switch */
} /* while (ops) */
}
return;
return IRQ_HANDLED;
}
......@@ -515,14 +515,14 @@ static struct task_struct *fork_by_hand(void)
* don't care about the regs settings since
* we'll never reschedule the forked task.
*/
return do_fork(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
return copy_process(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
}
/*
* Bring one cpu online.
*/
static int smp_boot_one_cpu(int cpuid, int cpunum)
static int __init smp_boot_one_cpu(int cpuid, int cpunum)
{
struct task_struct *idle;
long timeout;
......@@ -537,9 +537,11 @@ static int smp_boot_one_cpu(int cpuid, int cpunum)
* Sheesh . . .
*/
if ((idle = fork_by_hand()) == 0)
idle = fork_by_hand();
if (IS_ERR(idle))
panic("SMP: fork failed for CPU:%d", cpuid);
wake_up_forked_process(idle);
init_idle(idle, cpunum);
unhash_process(idle);
idle->thread_info->cpu = cpunum;
......@@ -613,7 +615,7 @@ static int smp_boot_one_cpu(int cpuid, int cpunum)
void __init smp_boot_cpus(void)
{
int i, cpu_count = 1;
unsigned long bogosum = loops_per_jiffy; /* Count Monarch */
unsigned long bogosum = cpu_data[0].loops_per_jiffy; /* Count Monarch */
/* REVISIT - assumes first CPU reported by PAT PDC is BSP */
int bootstrap_processor=cpu_data[0].cpuid; /* CPU ID of BSP */
......@@ -650,7 +652,7 @@ void __init smp_boot_cpus(void)
if (smp_boot_one_cpu(cpu_data[i].cpuid, cpu_count) < 0)
continue;
bogosum += loops_per_jiffy;
bogosum += cpu_data[i].loops_per_jiffy;
cpu_count++; /* Count good CPUs only... */
cpu_present_mask |= 1UL << i;
......
......@@ -30,10 +30,7 @@
#include <linux/slab.h>
#include <linux/uio.h>
#include <linux/nfs_fs.h>
#include <linux/smb_fs.h>
#include <linux/smb_mount.h>
#include <linux/ncp_fs.h>
#include <linux/quota.h>
#include <linux/sunrpc/svc.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/cache.h>
......@@ -42,11 +39,6 @@
#include <linux/poll.h>
#include <linux/personality.h>
#include <linux/stat.h>
#include <linux/filter.h> /* for setsockopt() */
#include <linux/icmpv6.h> /* for setsockopt() */
#include <linux/netfilter_ipv4/ip_queue.h> /* for setsockopt() */
#include <linux/netfilter_ipv4/ip_tables.h> /* for setsockopt() */
#include <linux/netfilter_ipv6/ip6_tables.h> /* for setsockopt() */
#include <linux/highmem.h>
#include <linux/highuid.h>
#include <linux/mman.h>
......@@ -62,9 +54,6 @@
#include "sys32.h"
#define A(__x) ((unsigned long)(__x))
#undef DEBUG
#ifdef DEBUG
......@@ -73,34 +62,6 @@
#define DBG(x)
#endif
/* For this source file, we want overflow handling. */
#undef high2lowuid
#undef high2lowgid
#undef low2highuid
#undef low2highgid
#undef SET_UID16
#undef SET_GID16
#undef NEW_TO_OLD_UID
#undef NEW_TO_OLD_GID
#undef SET_OLDSTAT_UID
#undef SET_OLDSTAT_GID
#undef SET_STAT_UID
#undef SET_STAT_GID
#define high2lowuid(uid) ((uid) > 65535) ? (u16)overflowuid : (u16)(uid)
#define high2lowgid(gid) ((gid) > 65535) ? (u16)overflowgid : (u16)(gid)
#define low2highuid(uid) ((uid) == (u16)-1) ? (uid_t)-1 : (uid_t)(uid)
#define low2highgid(gid) ((gid) == (u16)-1) ? (gid_t)-1 : (gid_t)(gid)
#define SET_UID16(var, uid) var = high2lowuid(uid)
#define SET_GID16(var, gid) var = high2lowgid(gid)
#define NEW_TO_OLD_UID(uid) high2lowuid(uid)
#define NEW_TO_OLD_GID(gid) high2lowgid(gid)
#define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid)
#define SET_OLDSTAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid)
#define SET_STAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid)
#define SET_STAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid)
/*
* count32() counts the number of arguments/envelopes. It is basically
* a copy of count() from fs/exec.c, except that it works
......@@ -145,7 +106,7 @@ static int copy_strings32(int argc, u32 *argv, struct linux_binprm *bprm)
if (get_user(str, argv + argc) ||
!str ||
!(len = strnlen_user((char *)A(str), bprm->p)))
!(len = strnlen_user((char *)compat_ptr(str), bprm->p)))
return -EFAULT;
if (bprm->p < len)
......@@ -181,7 +142,7 @@ static int copy_strings32(int argc, u32 *argv, struct linux_binprm *bprm)
if (new)
memset(kaddr+offset+len, 0, PAGE_SIZE-offset-len);
}
err = copy_from_user(kaddr + offset, (char *)A(str), bytes_to_copy);
err = copy_from_user(kaddr + offset, (char *)compat_ptr(str), bytes_to_copy);
flush_dcache_page(page);
kunmap(page);
......@@ -784,7 +745,7 @@ do_readv_writev32(int type, struct file *file, const struct compat_iovec *vector
__get_user(len, &vector->iov_len);
__get_user(buf, &vector->iov_base);
tot_len += len;
ivp->iov_base = (void *)A(buf);
ivp->iov_base = compat_ptr(buf);
ivp->iov_len = (compat_size_t) len;
vector++;
ivp++;
......@@ -1215,67 +1176,6 @@ asmlinkage int sys32_nfsservctl(int cmd, void *argp, void *resp)
return ret;
}
#include <linux/quota.h>
struct dqblk32 {
__u32 dqb_bhardlimit;
__u32 dqb_bsoftlimit;
__u32 dqb_curblocks;
__u32 dqb_ihardlimit;
__u32 dqb_isoftlimit;
__u32 dqb_curinodes;
compat_time_t dqb_btime;
compat_time_t dqb_itime;
};
asmlinkage int sys32_quotactl(int cmd, const char *special, int id, unsigned long addr)
{
#if 0
extern int sys_quotactl(int cmd, const char *special, int id, caddr_t addr);
int cmds = cmd >> SUBCMDSHIFT;
int err;
struct dqblk d;
char *spec;
switch (cmds) {
case Q_GETQUOTA:
break;
case Q_SETQUOTA:
case Q_SETUSE:
case Q_SETQLIM:
if (copy_from_user (&d, (struct dqblk32 *)addr,
sizeof (struct dqblk32)))
return -EFAULT;
d.dqb_itime = ((struct dqblk32 *)&d)->dqb_itime;
d.dqb_btime = ((struct dqblk32 *)&d)->dqb_btime;
break;
default:
return sys_quotactl(cmd, special,
id, (caddr_t)addr);
}
spec = getname (special);
err = PTR_ERR(spec);
if (IS_ERR(spec)) return err;
KERNEL_SYSCALL(err, sys_quotactl, cmd, (const char *)spec, id, (caddr_t)&d);
putname (spec);
if (cmds == Q_GETQUOTA) {
__kernel_time_t b = d.dqb_btime, i = d.dqb_itime;
((struct dqblk32 *)&d)->dqb_itime = i;
((struct dqblk32 *)&d)->dqb_btime = b;
if (copy_to_user ((struct dqblk32 *)addr, &d,
sizeof (struct dqblk32)))
return -EFAULT;
}
return err;
#endif
/* TODO */
BUG();
return -EINVAL;
}
extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count);
typedef long __kernel_loff_t32; /* move this to asm/posix_types.h? */
......
......@@ -496,7 +496,7 @@ sys_call_table:
ENTRY_SAME(delete_module)
ENTRY_SAME(ni_syscall) /* 130: get_kernel_syms */
/* time_t inside struct dqblk */
ENTRY_DIFF(quotactl) /* -- FIXME, doesn't work */
ENTRY_SAME(quotactl)
ENTRY_SAME(getpgid)
ENTRY_SAME(fchdir)
ENTRY_SAME(bdflush)
......
......@@ -76,7 +76,7 @@ parisc_do_profile(struct pt_regs *regs)
atomic_inc((atomic_t *)&prof_buffer[pc]);
}
void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
long now;
long next_tick;
......@@ -127,6 +127,8 @@ void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* check soft power switch status */
if (cpu == 0 && !atomic_read(&power_tasklet.count))
tasklet_schedule(&power_tasklet);
return IRQ_HANDLED;
}
/*** converted from ia64 ***/
......
......@@ -114,6 +114,12 @@ void show_regs(struct pt_regs *regs)
printk("%s CPU: %8d CR30: " RFMT " CR31: " RFMT "\n",
level, current_thread_info()->cpu, cr30, cr31);
printk("%s ORIG_R28: " RFMT "\n", level, regs->orig_r28);
printk(level);
print_symbol(" IAOQ[0]: %s\n", regs->iaoq[0]);
printk(level);
print_symbol(" IAOQ[1]: %s\n", regs->iaoq[1]);
printk(level);
print_symbol(" RP(r2): %s\n", regs->gr[2]);
}
......
......@@ -10,6 +10,7 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
#include <linux/delay.h>
......@@ -666,6 +667,7 @@ static void __init gateway_init(void)
PAGE_SIZE, PAGE_GATEWAY);
}
#ifdef CONFIG_HPUX
void
map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm)
{
......@@ -734,6 +736,8 @@ map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm)
pg_table = (pte_t *) __va(pg_table) + start_pte;
set_pte(pg_table, __mk_pte(address, PAGE_GATEWAY));
}
EXPORT_SYMBOL(map_hpux_gateway_page);
#endif
extern void flush_tlb_all_local(void);
......
......@@ -7,10 +7,11 @@
* @author John Levon <levon@movementarian.org>
*/
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/oprofile.h>
#include <linux/init.h>
extern void timer_init(struct oprofile_operations ** ops);
int __init oprofile_arch_init(struct oprofile_operations ** ops)
......
......@@ -452,7 +452,6 @@ sys32_alarm(unsigned int seconds)
sorts of things, like timeval and itimerval. */
extern struct timezone sys_tz;
extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
asmlinkage long
sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
......@@ -474,18 +473,21 @@ asmlinkage long
sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz)
{
struct timeval ktv;
struct timespec kts;
struct timezone ktz;
if (tv) {
if (get_tv32(&ktv, tv))
return -EFAULT;
kts.tv_sec = ktv.tv_sec;
kts.tv_nsec = ktv.tv_usec * NSEC_PER_USEC;
}
if (tz) {
if (copy_from_user(&ktz, tz, sizeof(ktz)))
return -EFAULT;
}
return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL);
return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
}
struct linux32_dirent {
......
......@@ -398,24 +398,6 @@ static int __init ethif_probe(struct net_device *dev)
return -ENODEV;
}
#ifdef CONFIG_NET_FC
static int fcif_probe(struct net_device *dev)
{
if (dev->base_addr == -1)
return 1;
if (1
#ifdef CONFIG_IPHASE5526
&& iph5526_probe(dev)
#endif
&& 1 ) {
return 1; /* -ENODEV or -EAGAIN would be more accurate. */
}
return 0;
}
#endif /* CONFIG_NET_FC */
#ifdef CONFIG_ETHERTAP
static struct net_device tap0_dev = {
.name = "tap0",
......@@ -589,22 +571,6 @@ static struct net_device tr0_dev = {
#endif
#ifdef CONFIG_NET_FC
static struct net_device fc1_dev = {
.name = "fc1",
.next = NEXT_DEV,
.init = fcif_probe
};
static struct net_device fc0_dev = {
.name = "fc0",
.next = &fc1_dev,
.init = fcif_probe
};
#undef NEXT_DEV
#define NEXT_DEV (&fc0_dev)
#endif
#ifdef CONFIG_SBNI
static struct net_device sbni7_dev = {
.name = "sbni7",
......
......@@ -239,19 +239,7 @@ int __init iph5526_probe(struct net_device *dev)
static int __init iph5526_probe_pci(struct net_device *dev)
{
#ifdef MODULE
struct fc_info *fi = (struct fc_info *)dev->priv;
#else
struct fc_info *fi = fc[count];
static int count;
int err;
if (!fi)
return -ENODEV;
fc_setup(dev);
count++;
#endif
fi->dev = dev;
dev->base_addr = fi->base_addr;
dev->irq = fi->irq;
......@@ -4479,8 +4467,6 @@ static char buf[80];
return buf;
}
#ifdef MODULE
#define NAMELEN 8 /* # of chars for storing dev->name */
static struct net_device *dev_fc[MAX_FC_CARDS];
......@@ -4491,7 +4477,7 @@ static int bad; /* 0xbad = bad sig or no reset ack */
static int scsi_registered;
int init_module(void)
static int __init iph5526_init(void)
{
int i = 0;
......@@ -4530,7 +4516,7 @@ int init_module(void)
return 0;
}
void cleanup_module(void)
static void __exit iph5526_exit(void)
{
int i = 0;
while(fc[i] != NULL) {
......@@ -4549,7 +4535,9 @@ void cleanup_module(void)
if (scsi_registered == TRUE)
scsi_unregister_host(&driver_template);
}
#endif /* MODULE */
module_init(iph5526_init);
module_exit(iph5526_exit);
void clean_up_memory(struct fc_info *fi)
{
......
......@@ -52,7 +52,7 @@
if(!(expr)) { \
printk( "Assertion failed! %s,%s,%s,line=%d\n",\
#expr,__FILE__,__FUNCTION__,__LINE__); \
##func}
func}
#endif
/* convert hex value to ascii hex */
......
......@@ -125,4 +125,27 @@ config CHASSIS_LCD_LED
If unsure, say Y.
config HOTPLUG
bool "Support for hot-pluggable devices"
---help---
Say Y here if you want to plug devices into your computer while
the system is running, and be able to use them quickly. In many
cases, the devices can likewise be unplugged at any time too.
One well known example of this is PCMCIA- or PC-cards, credit-card
size devices such as network cards, modems or hard drives which are
plugged into slots found on all modern laptop computers. Another
example, used on modern desktops as well as laptops, is USB.
Enable HOTPLUG and KMOD, and build a modular kernel. Get agent
software (at <http://linux-hotplug.sourceforge.net/>) and install it.
Then your kernel will automatically call out to a user mode "policy
agent" (/sbin/hotplug) to load modules and set up software needed
to use devices as you hotplug them.
source "drivers/pcmcia/Kconfig"
source "drivers/pci/hotplug/Kconfig"
endmenu
......@@ -381,7 +381,7 @@ static struct irq_region_ops dino_irq_ops = {
* ilr_loop counter is a kluge to prevent a "stuck" IRQ line from
* wedging the CPU. Could be removed or made optional at some point.
*/
static void
static irqreturn_t
dino_isr(int irq, void *intr_dev, struct pt_regs *regs)
{
struct dino_device *dino_dev = DINO_DEV(intr_dev);
......@@ -441,7 +441,9 @@ dino_isr(int irq, void *intr_dev, struct pt_regs *regs)
if (--ilr_loop > 0)
goto ilr_again;
printk("Dino %lx: stuck interrupt %d\n", dino_dev->hba.base_addr, mask);
return IRQ_NONE;
}
return IRQ_HANDLED;
}
static int dino_choose_irq(struct parisc_device *dev)
......
......@@ -213,7 +213,7 @@ static struct irq_region eisa_irq_region = {
.action = action,
};
static void eisa_irq(int _, void *intr_dev, struct pt_regs *regs)
static irqreturn_t eisa_irq(int _, void *intr_dev, struct pt_regs *regs)
{
extern void do_irq(struct irqaction *a, int i, struct pt_regs *p);
int irq = gsc_readb(0xfc01f000); /* EISA supports 16 irqs */
......@@ -262,11 +262,13 @@ static void eisa_irq(int _, void *intr_dev, struct pt_regs *regs)
eisa_out8(master_mask, 0x21);
}
spin_unlock_irqrestore(&eisa_irq_lock, flags);
return IRQ_HANDLED;
}
static void dummy_irq2_handler(int _, void *dev, struct pt_regs *regs)
static irqreturn_t dummy_irq2_handler(int _, void *dev, struct pt_regs *regs)
{
printk(KERN_ALERT "eisa: uhh, irq2?\n");
return IRQ_HANDLED;
}
static void init_eisa_pic(void)
......
......@@ -4,6 +4,7 @@
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/eisa_eeprom.h>
......
......@@ -79,7 +79,7 @@ EXPORT_SYMBOL(gsc_claim_irq);
#define GSC_MASK_IRQ(x) (1<<(GSC_FIX_IRQ(x)))
/* Common interrupt demultiplexer used by Asp, Lasi & Wax. */
void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs)
irqreturn_t busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs)
{
unsigned long irq;
struct busdevice *busdev = (struct busdevice *) dev;
......@@ -101,6 +101,7 @@ void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs)
do_irq_mask(irq, busdev->busdev_region, regs);
}
return IRQ_HANDLED;
}
static void
......
......@@ -43,4 +43,4 @@ int gsc_common_irqsetup(struct parisc_device *parent, struct busdevice *busdev);
extern int gsc_alloc_irq(struct gsc_irq *dev); /* dev needs an irq */
extern int gsc_claim_irq(struct gsc_irq *dev, int irq); /* dev needs this irq */
void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs);
irqreturn_t busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs);
......@@ -605,7 +605,7 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev)
}
static void
static irqreturn_t
iosapic_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
struct vector_info *vi = (struct vector_info *)dev_id;
......@@ -623,6 +623,8 @@ iosapic_interrupt(int irq, void *dev_id, struct pt_regs * regs)
** I/O SAPIC must always issue EOI.
*/
IOSAPIC_EOI(vi->vi_eoi_addr, vi->vi_eoi_data);
return IRQ_HANDLED;
}
......
......@@ -3,7 +3,7 @@
*
* (c) Copyright 2000 Red Hat Software
* (c) Copyright 2000 Helge Deller <hdeller@redhat.com>
* (c) Copyright 2001-2002 Helge Deller <deller@gmx.de>
* (c) Copyright 2001-2003 Helge Deller <deller@gmx.de>
* (c) Copyright 2001 Randolph Chung <tausq@debian.org>
*
* This program is free software; you can redistribute it and/or modify
......@@ -13,7 +13,7 @@
*
* TODO:
* - speed-up calculations with inlined assembler
* - interface to write to second row of LCD from /proc
* - interface to write to second row of LCD from /proc (if technically possible)
*/
#include <linux/config.h>
......@@ -22,10 +22,11 @@
#include <linux/init.h>
#include <linux/types.h>
#include <linux/ioport.h>
#include <linux/bitops.h>
#include <linux/version.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
#include <linux/in.h>
#include <linux/interrupt.h>
#include <linux/kernel_stat.h>
#include <linux/reboot.h>
......@@ -59,10 +60,6 @@ static char lcd_text[32];
#endif
#define CALC_ADD(val, comp, add) \
(val<=(comp/8) ? add/16 : val<=(comp/4) ? add/8 : val<=(comp/2) ? add/4 : add)
struct lcd_block {
unsigned char command; /* stores the command byte */
unsigned char on; /* value for turning LED on */
......@@ -341,93 +338,81 @@ static void led_LCD_driver(unsigned char leds)
/*
**
** led_get_net_stats()
** led_get_net_activity()
**
** calculate the TX- & RX-troughput on the network interfaces in
** the system for usage in the LED code
**
** calculate if there was TX- or RX-troughput on the network interfaces
** (analog to dev_get_info() from net/core/dev.c)
**
*/
static unsigned long led_net_rx_counter, led_net_tx_counter;
static void led_get_net_stats(int addvalue)
static __inline__ int led_get_net_activity(void)
{
#ifdef CONFIG_NET
#ifndef CONFIG_NET
return 0;
#else
static unsigned long rx_total_last, tx_total_last;
unsigned long rx_total, tx_total;
struct net_device *dev;
struct net_device_stats *stats;
int retval;
rx_total = tx_total = 0;
/* we are running as a tasklet, so locking dev_base
/* we are running as tasklet, so locking dev_base
* for reading should be OK */
read_lock(&dev_base_lock);
for (dev = dev_base; dev != NULL; dev = dev->next) {
if (dev->get_stats) {
stats = dev->get_stats(dev);
rx_total += stats->rx_packets;
tx_total += stats->tx_packets;
}
for (dev = dev_base; dev; dev = dev->next) {
struct net_device_stats *stats;
struct in_device *in_dev = __in_dev_get(dev);
if (!in_dev || !in_dev->ifa_list)
continue;
if (LOOPBACK(in_dev->ifa_list->ifa_local))
continue;
if (!dev->get_stats)
continue;
stats = dev->get_stats(dev);
rx_total += stats->rx_packets;
tx_total += stats->tx_packets;
}
read_unlock(&dev_base_lock);
rx_total -= rx_total_last;
tx_total -= tx_total_last;
if (rx_total)
led_net_rx_counter += CALC_ADD(rx_total, tx_total, addvalue);
if (tx_total)
led_net_tx_counter += CALC_ADD(tx_total, rx_total, addvalue);
rx_total_last += rx_total;
tx_total_last += tx_total;
retval = 0;
if (rx_total != rx_total_last) {
rx_total_last = rx_total;
retval |= LED_LAN_RCV;
}
if (tx_total != tx_total_last) {
tx_total_last = tx_total;
retval |= LED_LAN_TX;
}
return retval;
#endif
}
/*
**
** led_get_diskio_stats()
** led_get_diskio_activity()
**
** calculate the disk-io througput in the system
** (analog to linux/fs/proc/proc_misc.c)
** calculate if there was disk-io in the system
**
*/
static unsigned long led_diskio_counter;
static void led_get_diskio_stats(int addvalue)
static __inline__ int led_get_diskio_activity(void)
{
static unsigned int diskio_total_last, diskio_max;
int major, disk, total;
static unsigned long last_pgpgin, last_pgpgout;
struct page_state pgstat;
int changed;
total = 0;
#if 0
/*
* this section will no longer work in 2.5, as we no longer
* have either kstat.dk_drive nor DK_MAX_*. It can probably
* be rewritten to use the per-disk statistics now kept in the
* gendisk, but since I have no HP machines to test it on, I'm
* not really up to that. ricklind@us.ibm.com 11/7/02
*/
for (major = 0; major < DK_MAX_MAJOR; major++) {
for (disk = 0; disk < DK_MAX_DISK; disk++)
total += dkstat.drive[major][disk];
}
total -= diskio_total_last;
if (total) {
if (total >= diskio_max) {
led_diskio_counter += addvalue;
diskio_max = total; /* new maximum value found */
} else
led_diskio_counter += CALC_ADD(total, diskio_max, addvalue);
}
#endif
get_full_page_state(&pgstat); /* get no of sectors in & out */
/* Just use a very simple calculation here. Do not care about overflow,
since we only want to know if there was activity or not. */
changed = (pgstat.pgpgin != last_pgpgin) || (pgstat.pgpgout != last_pgpgout);
last_pgpgin = pgstat.pgpgin;
last_pgpgout = pgstat.pgpgout;
diskio_total_last += total;
return (changed ? LED_DISK_IO : 0);
}
......@@ -443,16 +428,23 @@ static void led_get_diskio_stats(int addvalue)
- optimizations
*/
static unsigned char currentleds; /* stores current value of the LEDs */
#define HEARTBEAT_LEN (HZ*6/100)
#define HEARTBEAT_2ND_RANGE_START (HZ*22/100)
#define HEARTBEAT_2ND_RANGE_END (HEARTBEAT_2ND_RANGE_START + HEARTBEAT_LEN)
#if HZ==100
#define NORMALIZED_COUNT(count) (count)
#else
#warning "Untested situation HZ != 100 !!"
#define NORMALIZED_COUNT(count) (count/(HZ/100))
#endif
static void led_tasklet_func(unsigned long unused)
{
static unsigned int count, count_HZ;
static unsigned char lastleds;
unsigned char currentleds; /* stores current value of the LEDs */
static unsigned long count; /* static incremented value, not wrapped */
static unsigned long count_HZ; /* counter in range 0..HZ */
/* exit if not initialized */
if (!led_func_ptr)
......@@ -463,6 +455,8 @@ static void led_tasklet_func(unsigned long unused)
if (++count_HZ == HZ)
count_HZ = 0;
currentleds = lastleds;
if (led_heartbeat)
{
/* flash heartbeat-LED like a real heart (2 x short then a long delay) */
......@@ -473,42 +467,25 @@ static void led_tasklet_func(unsigned long unused)
currentleds &= ~LED_HEARTBEAT;
}
/* gather network and diskio statistics and flash LEDs respectively */
if (led_lanrxtx)
/* look for network activity and flash LEDs respectively */
if (led_lanrxtx && ((NORMALIZED_COUNT(count)+(8/2)) & 7) == 0)
{
if ((count & 31) == 0)
led_get_net_stats(30);
if (led_net_rx_counter) {
led_net_rx_counter--;
currentleds |= LED_LAN_RCV;
}
else
currentleds &= ~LED_LAN_RCV;
if (led_net_tx_counter) {
led_net_tx_counter--;
currentleds |= LED_LAN_TX;
}
else
currentleds &= ~LED_LAN_TX;
currentleds &= ~(LED_LAN_RCV | LED_LAN_TX);
currentleds |= led_get_net_activity();
}
if (led_diskio)
/* avoid to calculate diskio-stats at same irq as netio-stats */
if (led_diskio && (NORMALIZED_COUNT(count) & 7) == 0)
{
/* avoid to calculate diskio-stats at same irq as netio-stats ! */
if ((count & 31) == 15)
led_get_diskio_stats(30);
if (led_diskio_counter) {
led_diskio_counter--;
currentleds |= LED_DISK_IO;
}
else
currentleds &= ~LED_DISK_IO;
currentleds &= ~LED_DISK_IO;
currentleds |= led_get_diskio_activity();
}
/* blink all LEDs twice a second if we got an Oops (HPMC) */
if (oops_in_progress) {
currentleds = (count_HZ<=(HZ/2)) ? 0 : 0xff;
}
/* update the LCD/LEDs */
if (currentleds != lastleds) {
led_func_ptr(currentleds);
......
......@@ -90,7 +90,7 @@ superio_inform_irq(int irq)
sio_dev.iosapic_irq = irq;
}
static void
static irqreturn_t
superio_interrupt(int irq, void *devp, struct pt_regs *regs)
{
struct superio_device *sio = (struct superio_device *)devp;
......@@ -107,7 +107,7 @@ superio_interrupt(int irq, void *devp, struct pt_regs *regs)
/* HACK: need to investigate why this happens if SMP enabled */
BUG(); /* This shouldn't happen */
#endif
return;
return IRQ_HANDLED;
}
/* Check to see which device is interrupting */
......@@ -117,7 +117,7 @@ superio_interrupt(int irq, void *devp, struct pt_regs *regs)
if (local_irq == 2 || local_irq > 7) {
printk(KERN_ERR "SuperIO: slave interrupted!\n");
BUG();
return;
return IRQ_HANDLED;
}
if (local_irq == 7) {
......@@ -128,7 +128,7 @@ superio_interrupt(int irq, void *devp, struct pt_regs *regs)
results = inb(IC_PIC1+0);
if ((results & 0x80) == 0) { /* if ISR7 not set: spurious */
printk(KERN_WARNING "SuperIO: spurious interrupt!\n");
return;
return IRQ_HANDLED;
}
}
......@@ -141,7 +141,7 @@ superio_interrupt(int irq, void *devp, struct pt_regs *regs)
/* set EOI */
outb((OCW2_SEOI|local_irq),IC_PIC1 + 0);
return;
return IRQ_HANDLED;
}
/* Initialize Super I/O device */
......
......@@ -81,9 +81,10 @@ static int clear_epp_timeout(struct parport *pb)
* of these are in parport_gsc.h.
*/
static void parport_gsc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static irqreturn_t parport_gsc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
parport_generic_irq(irq, (struct parport *) dev_id, regs);
return IRQ_HANDLED;
}
void parport_gsc_write_data(struct parport *p, unsigned char d)
......
......@@ -39,7 +39,6 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/proc_fs.h>
#define IN_CARD_SERVICES
#include <pcmcia/cs_types.h>
......
......@@ -169,7 +169,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void
DEBUG(3, "cs: read_cb_mem(%d, %#x, %u)\n", space, addr, len);
dev = pci_find_slot(s->cap.cb_dev->subordinate->number, 0);
dev = pci_find_slot(s->cb_dev->subordinate->number, 0);
if (!dev)
goto fail;
......@@ -239,7 +239,7 @@ static void cardbus_assign_irqs(struct pci_bus *bus, int irq)
int cb_alloc(struct pcmcia_socket * s)
{
struct pci_bus *bus = s->cap.cb_dev->subordinate;
struct pci_bus *bus = s->cb_dev->subordinate;
struct pci_dev *dev;
unsigned int max, pass;
......@@ -258,17 +258,17 @@ int cb_alloc(struct pcmcia_socket * s)
*/
pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
cardbus_assign_irqs(bus, s->cap.pci_irq);
cardbus_assign_irqs(bus, s->pci_irq);
pci_enable_bridges(bus);
pci_bus_add_devices(bus);
s->irq.AssignedIRQ = s->cap.pci_irq;
s->irq.AssignedIRQ = s->pci_irq;
return CS_SUCCESS;
}
void cb_free(struct pcmcia_socket * s)
{
struct pci_dev *bridge = s->cap.cb_dev;
struct pci_dev *bridge = s->cb_dev;
cb_release_cis_mem(s);
......
......@@ -87,8 +87,8 @@ void release_cis_mem(struct pcmcia_socket *s)
if (s->cis_mem.sys_start != 0) {
s->cis_mem.flags &= ~MAP_ACTIVE;
s->ss_entry->set_mem_map(s, &s->cis_mem);
if (!(s->cap.features & SS_CAP_STATIC_MAP))
release_mem_region(s->cis_mem.sys_start, s->cap.map_size);
if (!(s->features & SS_CAP_STATIC_MAP))
release_mem_region(s->cis_mem.sys_start, s->map_size);
iounmap(s->cis_virt);
s->cis_mem.sys_start = 0;
s->cis_virt = NULL;
......@@ -104,26 +104,26 @@ static unsigned char *
set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags)
{
pccard_mem_map *mem = &s->cis_mem;
if (!(s->cap.features & SS_CAP_STATIC_MAP) &&
if (!(s->features & SS_CAP_STATIC_MAP) &&
mem->sys_start == 0) {
int low = !(s->cap.features & SS_CAP_PAGE_REGS);
int low = !(s->features & SS_CAP_PAGE_REGS);
validate_mem(s);
mem->sys_start = 0;
if (find_mem_region(&mem->sys_start, s->cap.map_size,
s->cap.map_size, low, "card services", s)) {
if (find_mem_region(&mem->sys_start, s->map_size,
s->map_size, low, "card services", s)) {
printk(KERN_NOTICE "cs: unable to map card memory!\n");
return NULL;
}
mem->sys_stop = mem->sys_start+s->cap.map_size-1;
s->cis_virt = ioremap(mem->sys_start, s->cap.map_size);
mem->sys_stop = mem->sys_start+s->map_size-1;
s->cis_virt = ioremap(mem->sys_start, s->map_size);
}
mem->card_start = card_offset;
mem->flags = flags;
s->ss_entry->set_mem_map(s, mem);
if (s->cap.features & SS_CAP_STATIC_MAP) {
if (s->features & SS_CAP_STATIC_MAP) {
if (s->cis_virt)
iounmap(s->cis_virt);
s->cis_virt = ioremap(mem->sys_start, s->cap.map_size);
s->cis_virt = ioremap(mem->sys_start, s->map_size);
}
return s->cis_virt;
}
......@@ -178,21 +178,21 @@ int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
addr *= 2;
}
card_offset = addr & ~(s->cap.map_size-1);
card_offset = addr & ~(s->map_size-1);
while (len) {
sys = set_cis_map(s, card_offset, flags);
if (!sys) {
memset(ptr, 0xff, len);
return -1;
}
end = sys + s->cap.map_size;
sys = sys + (addr & (s->cap.map_size-1));
end = sys + s->map_size;
sys = sys + (addr & (s->map_size-1));
for ( ; len > 0; len--, buf++, sys += inc) {
if (sys == end)
break;
*buf = readb(sys);
}
card_offset += s->cap.map_size;
card_offset += s->map_size;
addr = 0;
}
}
......@@ -239,20 +239,20 @@ void write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
addr *= 2;
}
card_offset = addr & ~(s->cap.map_size-1);
card_offset = addr & ~(s->map_size-1);
while (len) {
sys = set_cis_map(s, card_offset, flags);
if (!sys)
return; /* FIXME: error */
end = sys + s->cap.map_size;
sys = sys + (addr & (s->cap.map_size-1));
end = sys + s->map_size;
sys = sys + (addr & (s->map_size-1));
for ( ; len > 0; len--, buf++, sys += inc) {
if (sys == end)
break;
writeb(*buf, sys);
}
card_offset += s->cap.map_size;
card_offset += s->map_size;
addr = 0;
}
}
......@@ -418,7 +418,7 @@ int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple)
tuple->TupleLink = tuple->Flags = 0;
#ifdef CONFIG_CARDBUS
if (s->state & SOCKET_CARDBUS) {
struct pci_dev *dev = s->cap.cb_dev;
struct pci_dev *dev = s->cb_dev;
u_int ptr;
pci_bus_read_config_dword(dev->subordinate, 0, PCI_CARDBUS_CIS, &ptr);
tuple->CISOffset = ptr & ~7;
......
......@@ -44,7 +44,6 @@
#include <linux/timer.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/pm.h>
#include <linux/pci.h>
#include <linux/device.h>
......@@ -129,11 +128,6 @@ socket_state_t dead_socket = {
LIST_HEAD(pcmcia_socket_list);
DECLARE_RWSEM(pcmcia_socket_list_rwsem);
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_pccard = NULL;
#endif
/*====================================================================*/
/* String tables for error messages */
......@@ -281,24 +275,7 @@ static int init_socket(struct pcmcia_socket *s)
return s->ss_entry->init(s);
}
/*====================================================================*/
#if defined(CONFIG_PROC_FS) && defined(PCMCIA_DEBUG)
static int proc_read_clients(char *buf, char **start, off_t pos,
int count, int *eof, void *data)
{
struct pcmcia_socket *s = data;
client_handle_t c;
char *p = buf;
for (c = s->clients; c; c = c->next)
p += sprintf(p, "fn %x: '%s' [attr 0x%04x] [state 0x%04x]\n",
c->Function, c->dev_info, c->Attributes, c->state);
return (p - buf);
}
#endif
/*======================================================================
/*====================================================================
Low-level PC Card interface drivers need to register with Card
Services using these calls.
......@@ -375,7 +352,6 @@ static int pcmcia_add_socket(struct class_device *class_dev)
spin_lock_init(&socket->lock);
init_socket(socket);
socket->ss_entry->inquire_socket(socket, &socket->cap);
init_completion(&socket->thread_done);
init_waitqueue_head(&socket->thread_wait);
......@@ -388,20 +364,6 @@ static int pcmcia_add_socket(struct class_device *class_dev)
wait_for_completion(&socket->thread_done);
BUG_ON(!socket->thread);
#ifdef CONFIG_PROC_FS
if (proc_pccard) {
char name[3];
sprintf(name, "%02d", socket->sock);
socket->proc = proc_mkdir(name, proc_pccard);
if (socket->proc)
socket->ss_entry->proc_setup(socket, socket->proc);
#ifdef PCMCIA_DEBUG
if (socket->proc)
create_proc_read_entry("clients", 0, socket->proc,
proc_read_clients, socket);
#endif
}
#endif
return 0;
}
......@@ -410,16 +372,6 @@ static void pcmcia_remove_socket(struct class_device *class_dev)
struct pcmcia_socket *socket = class_get_devdata(class_dev);
client_t *client;
#ifdef CONFIG_PROC_FS
if (proc_pccard) {
char name[3];
sprintf(name, "%02d", socket->sock);
#ifdef PCMCIA_DEBUG
remove_proc_entry("clients", socket->proc);
#endif
remove_proc_entry(name, proc_pccard);
}
#endif
if (socket->thread) {
init_completion(&socket->thread_done);
socket->thread = NULL;
......@@ -435,6 +387,12 @@ static void pcmcia_remove_socket(struct class_device *class_dev)
socket->ss_entry = NULL;
}
static void pcmcia_release_socket(struct class_device *class_dev)
{
struct pcmcia_socket *socket = class_get_devdata(class_dev);
complete(&socket->socket_released);
}
/**
* pcmcia_register_socket - add a new pcmcia socket device
......@@ -473,7 +431,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
/* set proper values in socket->dev */
socket->dev.class_data = socket;
socket->dev.class = &pcmcia_socket_class;
snprintf(socket->dev.class_id, BUS_ID_SIZE, "pcmcia_socket%u\n", socket->sock);
snprintf(socket->dev.class_id, BUS_ID_SIZE, "pcmcia_socket%u", socket->sock);
/* register with the device core */
if (class_device_register(&socket->dev)) {
......@@ -498,6 +456,8 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
DEBUG(0, "cs: pcmcia_unregister_socket(0x%p)\n", socket->ss_entry);
init_completion(&socket->socket_released);
/* remove from the device core */
class_device_unregister(&socket->dev);
......@@ -505,6 +465,9 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
down_write(&pcmcia_socket_list_rwsem);
list_del(&socket->socket_list);
up_write(&pcmcia_socket_list_rwsem);
/* wait for sysfs to drop all references */
wait_for_completion(&socket->socket_released);
} /* pcmcia_unregister_socket */
EXPORT_SYMBOL(pcmcia_unregister_socket);
......@@ -918,8 +881,8 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
*base, align);
align = 0;
}
if ((s->cap.features & SS_CAP_STATIC_MAP) && s->cap.io_offset) {
*base = s->cap.io_offset | (*base & 0x0fff);
if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) {
*base = s->io_offset | (*base & 0x0fff);
return 0;
}
/* Check for an already-allocated window that must conflict with
......@@ -966,7 +929,7 @@ static void release_io_space(struct pcmcia_socket *s, ioaddr_t base,
ioaddr_t num)
{
int i;
if(!(s->cap.features & SS_CAP_STATIC_MAP))
if(!(s->features & SS_CAP_STATIC_MAP))
release_region(base, num);
for (i = 0; i < MAX_IO_WIN; i++) {
if ((s->io[i].BasePort <= base) &&
......@@ -1183,7 +1146,7 @@ int pcmcia_get_configuration_info(client_handle_t handle,
config->Function = fn;
config->Vcc = s->socket.Vcc;
config->Vpp1 = config->Vpp2 = s->socket.Vpp;
config->Option = s->cap.cb_dev->subordinate->number;
config->Option = s->cb_dev->subordinate->number;
if (s->state & SOCKET_CARDBUS_CONFIG) {
config->Attributes = CONF_VALID_CLIENT;
config->IntType = INT_CARDBUS;
......@@ -1356,7 +1319,7 @@ struct pci_bus *pcmcia_lookup_bus(client_handle_t handle)
if (!(s->state & SOCKET_CARDBUS))
return NULL;
return s->cap.cb_dev->subordinate;
return s->cb_dev->subordinate;
}
EXPORT_SYMBOL(pcmcia_lookup_bus);
......@@ -1728,7 +1691,7 @@ int pcmcia_release_irq(client_handle_t handle, irq_req_t *req)
}
#ifdef CONFIG_PCMCIA_PROBE
if (req->AssignedIRQ != s->cap.pci_irq)
if (req->AssignedIRQ != s->pci_irq)
undo_irq(req->Attributes, req->AssignedIRQ);
#endif
......@@ -1753,7 +1716,7 @@ int pcmcia_release_window(window_handle_t win)
s->state &= ~SOCKET_WIN_REQ(win->index);
/* Release system memory */
if(!(s->cap.features & SS_CAP_STATIC_MAP))
if(!(s->features & SS_CAP_STATIC_MAP))
release_mem_region(win->base, win->size);
win->handle->state &= ~CLIENT_WIN_REQ(win->index);
......@@ -1978,22 +1941,22 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
return CS_IN_USE;
/* Short cut: if there are no ISA interrupts, then it is PCI */
if (!s->cap.irq_mask) {
irq = s->cap.pci_irq;
if (!s->irq_mask) {
irq = s->pci_irq;
ret = (irq) ? 0 : CS_IN_USE;
#ifdef CONFIG_PCMCIA_PROBE
} else if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must match */
irq = s->irq.AssignedIRQ;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int mask = req->IRQInfo2 & s->cap.irq_mask;
u_int mask = req->IRQInfo2 & s->irq_mask;
ret = ((mask >> irq) & 1) ? 0 : CS_BAD_ARGS;
} else
ret = ((req->IRQInfo1&IRQ_MASK) == irq) ? 0 : CS_BAD_ARGS;
} else {
ret = CS_IN_USE;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int try, mask = req->IRQInfo2 & s->cap.irq_mask;
u_int try, mask = req->IRQInfo2 & s->irq_mask;
for (try = 0; try < 2; try++) {
for (irq = 0; irq < 32; irq++)
if ((mask >> irq) & 1) {
......@@ -2014,7 +1977,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
if (request_irq(irq, req->Handler,
((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
(s->functions > 1) ||
(irq == s->cap.pci_irq)) ? SA_SHIRQ : 0,
(irq == s->pci_irq)) ? SA_SHIRQ : 0,
handle->dev_info, req->Instance))
return CS_IN_USE;
}
......@@ -2052,13 +2015,13 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
/* Window size defaults to smallest available */
if (req->Size == 0)
req->Size = s->cap.map_size;
align = (((s->cap.features & SS_CAP_MEM_ALIGN) ||
req->Size = s->map_size;
align = (((s->features & SS_CAP_MEM_ALIGN) ||
(req->Attributes & WIN_STRICT_ALIGN)) ?
req->Size : s->cap.map_size);
if (req->Size & (s->cap.map_size-1))
req->Size : s->map_size);
if (req->Size & (s->map_size-1))
return CS_BAD_SIZE;
if ((req->Base && (s->cap.features & SS_CAP_STATIC_MAP)) ||
if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) ||
(req->Base & (align-1)))
return CS_BAD_BASE;
if (req->Base)
......@@ -2078,10 +2041,10 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
win->base = req->Base;
win->size = req->Size;
if (!(s->cap.features & SS_CAP_STATIC_MAP) &&
if (!(s->features & SS_CAP_STATIC_MAP) &&
find_mem_region(&win->base, win->size, align,
(req->Attributes & WIN_MAP_BELOW_1MB) ||
!(s->cap.features & SS_CAP_PAGE_REGS),
!(s->features & SS_CAP_PAGE_REGS),
(*handle)->dev_info, s))
return CS_IN_USE;
(*handle)->state |= CLIENT_WIN_REQ(w);
......@@ -2541,12 +2504,10 @@ EXPORT_SYMBOL(pcmcia_write_memory);
EXPORT_SYMBOL(dead_socket);
EXPORT_SYMBOL(CardServices);
EXPORT_SYMBOL(MTDHelperEntry);
#ifdef CONFIG_PROC_FS
EXPORT_SYMBOL(proc_pccard);
#endif
struct class pcmcia_socket_class = {
.name = "pcmcia_socket",
.release = pcmcia_release_socket,
};
EXPORT_SYMBOL(pcmcia_socket_class);
......@@ -2564,9 +2525,6 @@ static int __init init_pcmcia_cs(void)
DEBUG(0, "%s\n", version);
class_register(&pcmcia_socket_class);
class_interface_register(&pcmcia_socket);
#ifdef CONFIG_PROC_FS
proc_pccard = proc_mkdir("pccard", proc_bus);
#endif
return 0;
}
......@@ -2574,11 +2532,6 @@ static int __init init_pcmcia_cs(void)
static void __exit exit_pcmcia_cs(void)
{
printk(KERN_INFO "unloading Kernel Card Services\n");
#ifdef CONFIG_PROC_FS
if (proc_pccard) {
remove_proc_entry("pccard", proc_bus);
}
#endif
release_resource_db();
class_interface_unregister(&pcmcia_socket);
class_unregister(&pcmcia_socket_class);
......
......@@ -173,18 +173,10 @@ int try_irq(u_int Attributes, int irq, int specific);
void undo_irq(u_int Attributes, int irq);
int adjust_resource_info(client_handle_t handle, adjust_t *adj);
void release_resource_db(void);
int proc_read_io(char *buf, char **start, off_t pos,
int count, int *eof, void *data);
int proc_read_mem(char *buf, char **start, off_t pos,
int count, int *eof, void *data);
extern struct rw_semaphore pcmcia_socket_list_rwsem;
extern struct list_head pcmcia_socket_list;
#ifdef CONFIG_PROC_FS
extern struct proc_dir_entry *proc_pccard;
#endif
#ifdef PCMCIA_DEBUG
extern int pc_debug;
#define DEBUG(n, args...) do { if (pc_debug>(n)) printk(KERN_DEBUG args); } while (0)
......
......@@ -164,6 +164,8 @@ void pcmcia_unregister_driver(struct pcmcia_driver *driver)
EXPORT_SYMBOL(pcmcia_unregister_driver);
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_pccard = NULL;
static int proc_read_drivers_callback(struct device_driver *driver, void *d)
{
char **p = d;
......@@ -929,6 +931,7 @@ static int __init init_pcmcia_bus(void)
major_dev = i;
#ifdef CONFIG_PROC_FS
proc_pccard = proc_mkdir("pccard", proc_bus);
if (proc_pccard)
create_proc_read_entry("drivers",0,proc_pccard,proc_read_drivers,NULL);
#endif
......@@ -944,8 +947,10 @@ static void __exit exit_pcmcia_bus(void)
class_interface_unregister(&pcmcia_bus_interface);
#ifdef CONFIG_PROC_FS
if (proc_pccard)
if (proc_pccard) {
remove_proc_entry("drivers", proc_pccard);
remove_proc_entry("pccard", proc_bus);
}
#endif
if (major_dev != -1)
unregister_chrdev(major_dev, "pcmcia");
......
......@@ -68,13 +68,11 @@ static struct pccard_operations i82092aa_operations = {
.init = i82092aa_init,
.suspend = i82092aa_suspend,
.register_callback = i82092aa_register_callback,
.inquire_socket = i82092aa_inquire_socket,
.get_status = i82092aa_get_status,
.get_socket = i82092aa_get_socket,
.set_socket = i82092aa_set_socket,
.set_io_map = i82092aa_set_io_map,
.set_mem_map = i82092aa_set_mem_map,
.proc_setup = i82092aa_proc_setup,
};
/* The card can do upto 4 sockets, allocate a structure for each of them */
......@@ -86,7 +84,6 @@ struct socket_info {
2 = card but not initialized,
3 = operational card */
int io_base; /* base io address of the socket */
socket_cap_t cap;
unsigned int pending_events; /* Pending events on this interface */
......@@ -141,10 +138,10 @@ static int __init i82092aa_pci_probe(struct pci_dev *dev, const struct pci_devic
for (i = 0;i<socket_count;i++) {
sockets[i].card_state = 1; /* 1 = present but empty */
sockets[i].io_base = pci_resource_start(dev, 0);
sockets[i].cap.features |= SS_CAP_PCCARD;
sockets[i].cap.map_size = 0x1000;
sockets[i].cap.irq_mask = 0;
sockets[i].cap.pci_irq = dev->irq;
sockets[i].socket.features |= SS_CAP_PCCARD;
sockets[i].socket.map_size = 0x1000;
sockets[i].socket.irq_mask = 0;
sockets[i].socket.pci_irq = dev->irq;
sockets[i].number = i;
......@@ -488,16 +485,6 @@ static int i82092aa_register_callback(struct pcmcia_socket *socket, void (*handl
return 0;
} /* i82092aa_register_callback */
static int i82092aa_inquire_socket(struct pcmcia_socket *socket, socket_cap_t *cap)
{
unsigned int sock = container_of(socket, struct socket_info, socket)->number;
enter("i82092aa_inquire_socket");
*cap = sockets[sock].cap;
leave("i82092aa_inquire_socket");
return 0;
} /* i82092aa_inquire_socket */
static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
{
unsigned int sock = container_of(socket, struct socket_info, socket)->number;
......@@ -832,12 +819,6 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
return 0;
}
static void i82092aa_proc_setup(struct pcmcia_socket *socket, struct proc_dir_entry *base)
{
}
/* Module stuff */
static int i82092aa_module_init(void)
{
enter("i82092aa_module_init");
......
......@@ -36,8 +36,6 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
static int i82092aa_init(struct pcmcia_socket *socket);
static int i82092aa_suspend(struct pcmcia_socket *socket);
static int i82092aa_register_callback(struct pcmcia_socket *socket, void (*handler)(void *, unsigned int), void * info);
static int i82092aa_inquire_socket(struct pcmcia_socket *socket, socket_cap_t *cap);
static void i82092aa_proc_setup(struct pcmcia_socket *socket, struct proc_dir_entry *base);
#endif
......@@ -45,7 +45,6 @@
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/device.h>
......@@ -162,15 +161,11 @@ struct i82365_socket {
u_short type, flags;
struct pcmcia_socket socket;
unsigned int number;
socket_cap_t cap;
ioaddr_t ioaddr;
u_short psock;
u_char cs_irq, intr;
void (*handler)(void *info, u_int events);
void *info;
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc;
#endif
union {
cirrus_state_t cirrus;
vg46x_state_t vg46x;
......@@ -762,9 +757,9 @@ static void __init add_pcic(int ns, int type)
/* Update socket interrupt information, capabilities */
for (i = 0; i < ns; i++) {
t[i].cap.features |= SS_CAP_PCCARD;
t[i].cap.map_size = 0x1000;
t[i].cap.irq_mask = mask;
t[i].socket.features |= SS_CAP_PCCARD;
t[i].socket.map_size = 0x1000;
t[i].socket.irq_mask = mask;
t[i].cs_irq = isa_irq;
}
......@@ -911,7 +906,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev,
active = 0;
for (i = 0; i < sockets; i++) {
if ((socket[i].cs_irq != irq) &&
(socket[i].cap.pci_irq != irq))
(socket[i].socket.pci_irq != irq))
continue;
handled = 1;
ISA_LOCK(i, flags);
......@@ -983,15 +978,6 @@ static int pcic_register_callback(struct pcmcia_socket *s, void (*handler)(void
/*====================================================================*/
static int pcic_inquire_socket(struct pcmcia_socket *s, socket_cap_t *cap)
{
unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
*cap = socket[sock].cap;
return 0;
} /* pcic_inquire_socket */
/*====================================================================*/
static int i365_get_status(u_short sock, u_int *value)
{
u_int status;
......@@ -1113,7 +1099,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state)
/* IO card, RESET flag, IO interrupt */
reg = t->intr;
if (state->io_irq != t->cap.pci_irq) reg |= state->io_irq;
if (state->io_irq != t->socket.pci_irq) reg |= state->io_irq;
reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET;
reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0;
i365_set(sock, I365_INTCTL, reg);
......@@ -1288,71 +1274,42 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
/*======================================================================
Routines for accessing socket information and register dumps via
/proc/bus/pccard/...
/sys/class/pcmcia_socket/...
======================================================================*/
#ifdef CONFIG_PROC_FS
static int proc_read_info(char *buf, char **start, off_t pos,
int count, int *eof, void *data)
static ssize_t show_info(struct class_device *class_dev, char *buf)
{
struct i82365_socket *s = data;
char *p = buf;
p += sprintf(p, "type: %s\npsock: %d\n",
pcic[s->type].name, s->psock);
return (p - buf);
struct i82365_socket *s = container_of(class_dev, struct i82365_socket, socket.dev);
return sprintf(buf, "type: %s\npsock: %d\n",
pcic[s->type].name, s->psock);
}
static int proc_read_exca(char *buf, char **start, off_t pos,
int count, int *eof, void *data)
static ssize_t show_exca(struct class_device *class_dev, char *buf)
{
u_short sock = (struct i82365_socket *)data - socket;
char *p = buf;
int i, top;
u_long flags = 0;
ISA_LOCK(sock, flags);
top = 0x40;
for (i = 0; i < top; i += 4) {
if (i == 0x50) {
p += sprintf(p, "\n");
i = 0x100;
struct i82365_socket *s = container_of(class_dev, struct i82365_socket, socket.dev);
unsigned short sock;
int i;
ssize_t ret = 0;
unsigned long flags = 0;
sock = s->number;
ISA_LOCK(sock, flags);
for (i = 0; i < 0x40; i += 4) {
ret += sprintf(buf, "%02x %02x %02x %02x%s",
i365_get(sock,i), i365_get(sock,i+1),
i365_get(sock,i+2), i365_get(sock,i+3),
((i % 16) == 12) ? "\n" : " ");
buf += ret;
}
p += sprintf(p, "%02x %02x %02x %02x%s",
i365_get(sock,i), i365_get(sock,i+1),
i365_get(sock,i+2), i365_get(sock,i+3),
((i % 16) == 12) ? "\n" : " ");
}
ISA_UNLOCK(sock, flags);
return (p - buf);
}
ISA_UNLOCK(sock, flags);
static void pcic_proc_setup(struct pcmcia_socket *sock, struct proc_dir_entry *base)
{
struct i82365_socket *s = container_of(sock, struct i82365_socket, socket);
if (s->flags & IS_ALIVE)
return;
create_proc_read_entry("info", 0, base, proc_read_info, s);
create_proc_read_entry("exca", 0, base, proc_read_exca, s);
s->proc = base;
}
static void pcic_proc_remove(u_short sock)
{
struct proc_dir_entry *base = socket[sock].proc;
if (base == NULL) return;
remove_proc_entry("info", base);
remove_proc_entry("exca", base);
return ret;
}
#else
#define pcic_proc_setup NULL
#endif /* CONFIG_PROC_FS */
static CLASS_DEVICE_ATTR(exca, S_IRUGO, show_exca, NULL);
static CLASS_DEVICE_ATTR(info, S_IRUGO, show_info, NULL);
/*====================================================================*/
......@@ -1447,13 +1404,11 @@ static struct pccard_operations pcic_operations = {
.init = pcic_init,
.suspend = pcic_suspend,
.register_callback = pcic_register_callback,
.inquire_socket = pcic_inquire_socket,
.get_status = pcic_get_status,
.get_socket = pcic_get_socket,
.set_socket = pcic_set_socket,
.set_io_map = pcic_set_io_map,
.set_mem_map = pcic_set_mem_map,
.proc_setup = pcic_proc_setup,
};
/*====================================================================*/
......@@ -1526,6 +1481,9 @@ static int __init init_i82365(void)
poll_timer.expires = jiffies + poll_interval;
add_timer(&poll_timer);
}
class_device_create_file(&socket[i].socket.dev, &class_device_attr_info);
class_device_create_file(&socket[i].socket.dev, &class_device_attr_exca);
return 0;
......@@ -1534,11 +1492,9 @@ static int __init init_i82365(void)
static void __exit exit_i82365(void)
{
int i;
for (i = 0; i < sockets; i++) {
pcmcia_unregister_socket(&socket[i].socket);
#ifdef CONFIG_PROC_FS
pcic_proc_remove(i);
#endif
}
platform_device_unregister(&i82365_device);
if (poll_interval != 0)
......
......@@ -41,7 +41,6 @@
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/timer.h>
#include <linux/proc_fs.h>
#include <linux/pci.h>
#include <asm/irq.h>
#include <asm/io.h>
......@@ -346,17 +345,17 @@ static int cis_readable(struct pcmcia_socket *s, u_long base)
cisinfo_t info1, info2;
int ret;
s->cis_mem.sys_start = base;
s->cis_mem.sys_stop = base+s->cap.map_size-1;
s->cis_virt = ioremap(base, s->cap.map_size);
s->cis_mem.sys_stop = base+s->map_size-1;
s->cis_virt = ioremap(base, s->map_size);
ret = pcmcia_validate_cis(s->clients, &info1);
/* invalidate mapping and CIS cache */
iounmap(s->cis_virt);
destroy_cis_cache(s);
if ((ret != 0) || (info1.Chains == 0))
return 0;
s->cis_mem.sys_start = base+s->cap.map_size;
s->cis_mem.sys_stop = base+2*s->cap.map_size-1;
s->cis_virt = ioremap(base+s->cap.map_size, s->cap.map_size);
s->cis_mem.sys_start = base+s->map_size;
s->cis_mem.sys_stop = base+2*s->map_size-1;
s->cis_virt = ioremap(base+s->map_size, s->map_size);
ret = pcmcia_validate_cis(s->clients, &info2);
iounmap(s->cis_virt);
destroy_cis_cache(s);
......@@ -368,14 +367,14 @@ static int checksum(struct pcmcia_socket *s, u_long base)
{
int i, a, b, d;
s->cis_mem.sys_start = base;
s->cis_mem.sys_stop = base+s->cap.map_size-1;
s->cis_virt = ioremap(base, s->cap.map_size);
s->cis_mem.sys_stop = base+s->map_size-1;
s->cis_virt = ioremap(base, s->map_size);
s->cis_mem.card_start = 0;
s->cis_mem.flags = MAP_ACTIVE;
s->ss_entry->set_mem_map(s, &s->cis_mem);
/* Don't bother checking every word... */
a = 0; b = -1;
for (i = 0; i < s->cap.map_size; i += 44) {
for (i = 0; i < s->map_size; i += 44) {
d = readl(s->cis_virt+i);
a += d; b &= d;
}
......@@ -385,7 +384,7 @@ static int checksum(struct pcmcia_socket *s, u_long base)
static int checksum_match(struct pcmcia_socket *s, u_long base)
{
int a = checksum(s, base), b = checksum(s, base+s->cap.map_size);
int a = checksum(s, base), b = checksum(s, base+s->map_size);
return ((a == b) && (a >= 0));
}
......@@ -406,19 +405,19 @@ static int do_mem_probe(u_long base, u_long num, struct pcmcia_socket *s)
bad = fail = 0;
step = (num < 0x20000) ? 0x2000 : ((num>>4) & ~0x1fff);
/* cis_readable wants to map 2x map_size */
if (step < 2 * s->cap.map_size)
step = 2 * s->cap.map_size;
if (step < 2 * s->map_size)
step = 2 * s->map_size;
for (i = j = base; i < base+num; i = j + step) {
if (!fail) {
for (j = i; j < base+num; j += step)
if ((check_mem_resource(j, step, s->cap.cb_dev) == 0) &&
if ((check_mem_resource(j, step, s->cb_dev) == 0) &&
cis_readable(s, j))
break;
fail = ((i == base) && (j == base+num));
}
if (fail) {
for (j = i; j < base+num; j += 2*step)
if ((check_mem_resource(j, 2*step, s->cap.cb_dev) == 0) &&
if ((check_mem_resource(j, 2*step, s->cb_dev) == 0) &&
checksum_match(s, j) && checksum_match(s, j + step))
break;
}
......@@ -457,7 +456,7 @@ void validate_mem(struct pcmcia_socket *s)
static u_char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
static int hi = 0, lo = 0;
u_long b, i, ok = 0;
int force_low = !(s->cap.features & SS_CAP_PAGE_REGS);
int force_low = !(s->features & SS_CAP_PAGE_REGS);
if (!probe_mem)
return;
......@@ -541,7 +540,7 @@ int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align,
for (try = (try >= m->base) ? try : try+align;
(try >= m->base) && (try+num <= m->base+m->num);
try += align) {
if (request_io_resource(try, num, name, s->cap.cb_dev) == 0) {
if (request_io_resource(try, num, name, s->cb_dev) == 0) {
*base = try;
ret = 0;
goto out;
......@@ -573,7 +572,7 @@ int find_mem_region(u_long *base, u_long num, u_long align,
for (try = (try >= m->base) ? try : try+align;
(try >= m->base) && (try+num <= m->base+m->num);
try += align) {
if (request_mem_resource(try, num, name, s->cap.cb_dev) == 0) {
if (request_mem_resource(try, num, name, s->cb_dev) == 0) {
*base = try;
ret = 0;
goto out;
......
......@@ -37,7 +37,6 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/config.h>
#include <linux/proc_fs.h>
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
......
......@@ -12,7 +12,6 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <pcmcia/ss.h>
#include <asm/hardware.h>
......
......@@ -45,7 +45,6 @@
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/notifier.h>
#include <linux/proc_fs.h>
#include <linux/version.h>
#include <linux/interrupt.h>
......@@ -370,51 +369,6 @@ sa1100_pcmcia_register_callback(struct pcmcia_socket *sock,
}
/* sa1100_pcmcia_inquire_socket()
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Implements the inquire_socket() operation for the in-kernel PCMCIA
* service (formerly SS_InquireSocket in Card Services). We set
* SS_CAP_STATIC_MAP, which disables the memory resource database
* check. (Mapped memory is set up within the socket driver itself.)
*
* In conjunction with the STATIC_MAP capability is a new field,
* `io_offset', recommended by David Hinds. Rather than go through
* the SetIOMap interface (which is not quite suited for communicating
* window locations up from the socket driver), we just pass up
* an offset which is applied to client-requested base I/O addresses
* in alloc_io_space().
*
* SS_CAP_STATIC_MAP: don't bother with the (user-configured) memory
* resource database; we instead pass up physical address ranges
* and allow other parts of Card Services to deal with remapping.
*
* SS_CAP_PCCARD: we can deal with 16-bit PCMCIA & CF cards, but
* not 32-bit CardBus devices.
*
* Return value is irrelevant; the pcmcia subsystem ignores it.
*/
static int
sa1100_pcmcia_inquire_socket(struct pcmcia_socket *sock, socket_cap_t *cap)
{
struct sa1100_pcmcia_socket *skt = to_sa1100_socket(sock);
int ret = -1;
if (skt) {
DEBUG(2, "%s() for sock %u\n", __FUNCTION__, skt->nr);
cap->features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
cap->irq_mask = 0;
cap->map_size = PAGE_SIZE;
cap->pci_irq = skt->irq;
cap->io_offset = (unsigned long)skt->virt_io;
ret = 0;
}
return ret;
}
/* sa1100_pcmcia_get_status()
* ^^^^^^^^^^^^^^^^^^^^^^^^^^
* Implements the get_status() operation for the in-kernel PCMCIA
......@@ -615,9 +569,6 @@ sa1100_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *map
return 0;
}
#if defined(CONFIG_PROC_FS)
struct bittbl {
unsigned int mask;
const char *name;
......@@ -659,17 +610,16 @@ dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, i
*p = b;
}
/* sa1100_pcmcia_proc_status()
/* show_status()
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Implements the /proc/bus/pccard/??/status file.
* Implements the /sys/class/pcmcia_socket/??/status file.
*
* Returns: the number of characters added to the buffer
*/
static int
sa1100_pcmcia_proc_status(char *buf, char **start, off_t pos,
int count, int *eof, void *data)
static ssize_t show_status(struct class_device *class_dev, char *buf)
{
struct sa1100_pcmcia_socket *skt = data;
struct sa1100_pcmcia_socket *skt = container_of(class_dev,
struct sa1100_pcmcia_socket, socket.dev);
unsigned int clock = cpufreq_get(0);
unsigned long mecr = MECR;
char *p = buf;
......@@ -701,42 +651,19 @@ sa1100_pcmcia_proc_status(char *buf, char **start, off_t pos,
return p-buf;
}
static CLASS_DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
/* sa1100_pcmcia_proc_setup()
* ^^^^^^^^^^^^^^^^^^^^^^^^^^
* Implements the proc_setup() operation for the in-kernel PCMCIA
* service (formerly SS_ProcSetup in Card Services).
*
* Returns: 0 on success, -1 on error
*/
static void
sa1100_pcmcia_proc_setup(struct pcmcia_socket *sock, struct proc_dir_entry *base)
{
struct proc_dir_entry *entry;
if ((entry = create_proc_entry("status", 0, base)) == NULL){
printk(KERN_ERR "unable to install \"status\" procfs entry\n");
return;
}
entry->read_proc = sa1100_pcmcia_proc_status;
entry->data = to_sa1100_socket(sock);
}
#else
#define sa1100_pcmcia_proc_setup NULL
#endif /* defined(CONFIG_PROC_FS) */
static struct pccard_operations sa11xx_pcmcia_operations = {
.owner = THIS_MODULE,
.init = sa1100_pcmcia_sock_init,
.suspend = sa1100_pcmcia_suspend,
.register_callback = sa1100_pcmcia_register_callback,
.inquire_socket = sa1100_pcmcia_inquire_socket,
.get_status = sa1100_pcmcia_get_status,
.get_socket = sa1100_pcmcia_get_socket,
.set_socket = sa1100_pcmcia_set_socket,
.set_io_map = sa1100_pcmcia_set_io_map,
.set_mem_map = sa1100_pcmcia_set_mem_map,
.proc_setup = sa1100_pcmcia_proc_setup
};
int sa11xx_request_irqs(struct sa1100_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr)
......@@ -905,6 +832,12 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
if (ret)
goto out_err_6;
skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
skt->socket.irq_mask = 0;
skt->socket.map_size = PAGE_SIZE;
skt->socket.pci_irq = skt->irq;
skt->socket.io_offset = (unsigned long)skt->virt_io;
skt->status = sa1100_pcmcia_skt_state(skt);
ret = pcmcia_register_socket(&skt->socket);
......@@ -914,6 +847,8 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
WARN_ON(skt->socket.sock != i);
add_timer(&skt->poll_timer);
class_device_create_file(&skt->socket.dev, &class_device_attr_status);
}
dev_set_drvdata(dev, sinfo);
......
......@@ -9,7 +9,6 @@
#ifndef _ASM_ARCH_PCMCIA
#define _ASM_ARCH_PCMCIA
#include <linux/proc_fs.h>
/* include the world */
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
......
......@@ -42,7 +42,6 @@
#include <linux/timer.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/workqueue.h>
#include <linux/device.h>
......@@ -130,14 +129,6 @@ static int tcic_timer_pending;
static int sockets;
static struct tcic_socket socket_table[2];
static socket_cap_t tcic_cap = {
/* only 16-bit cards, memory windows must be size-aligned */
.features = SS_CAP_PCCARD | SS_CAP_MEM_ALIGN,
.irq_mask = 0x4cf8, /* irq 14, 11, 10, 7, 6, 5, 4, 3 */
.map_size = 0x1000, /* 4K minimum window size */
/* No PCI or CardBus support */
};
/*====================================================================*/
/* Trick when selecting interrupts: the TCIC sktirq pin is supposed
......@@ -445,6 +436,14 @@ static int __init init_tcic(void)
socket_table[sockets].handler = NULL;
socket_table[sockets].info = NULL;
socket_table[sockets].id = get_tcic_id();
/* only 16-bit cards, memory windows must be size-aligned */
/* No PCI or CardBus support */
socket_table[sockets].socket.features = SS_CAP_PCCARD | SS_CAP_MEM_ALIGN;
/* irq 14, 11, 10, 7, 6, 5, 4, 3 */
socket_table[sockets].socket.irq_mask = 0x4cf8;
/* 4K minimum window size */
socket_table[sockets].socket.map_size = 0x1000;
sockets++;
}
......@@ -479,11 +478,13 @@ static int __init init_tcic(void)
else
for (i = mask = 0; i < 16; i++)
mask |= (1<<irq_list[i]);
mask &= tcic_cap.irq_mask;
/* irq 14, 11, 10, 7, 6, 5, 4, 3 */
mask &= 0x4cf8;
/* Scan interrupts */
mask = irq_scan(mask);
tcic_cap.irq_mask = mask;
for (i=0;i<sockets;i++)
socket_table[i].socket.irq_mask = mask;
/* Check for only two interrupts available */
scan = (mask & (mask-1));
......@@ -502,7 +503,7 @@ static int __init init_tcic(void)
if (cs_irq == 0) poll_interval = HZ;
}
if (tcic_cap.irq_mask & (1 << 11))
if (socket_table[0].socket.irq_mask & (1 << 11))
printk("sktirq is irq 11, ");
if (cs_irq != 0)
printk("status change on irq %d\n", cs_irq);
......@@ -680,14 +681,6 @@ static int tcic_get_status(struct pcmcia_socket *sock, u_int *value)
/*====================================================================*/
static int tcic_inquire_socket(struct pcmcia_socket *sock, socket_cap_t *cap)
{
*cap = tcic_cap;
return 0;
} /* tcic_inquire_socket */
/*====================================================================*/
static int tcic_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
{
u_short psock = container_of(sock, struct tcic_socket, socket)->psock;
......@@ -897,10 +890,6 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m
/*====================================================================*/
static void tcic_proc_setup(struct pcmcia_socket *sock, struct proc_dir_entry *base)
{
}
static int tcic_init(struct pcmcia_socket *s)
{
int i;
......@@ -930,13 +919,11 @@ static struct pccard_operations tcic_operations = {
.init = tcic_init,
.suspend = tcic_suspend,
.register_callback = tcic_register_callback,
.inquire_socket = tcic_inquire_socket,
.get_status = tcic_get_status,
.get_socket = tcic_get_socket,
.set_socket = tcic_set_socket,
.set_io_map = tcic_set_io_map,
.set_mem_map = tcic_set_mem_map,
.proc_setup = tcic_proc_setup,
};
/*====================================================================*/
......
......@@ -394,10 +394,6 @@ static int yenta_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *
return 0;
}
static void yenta_proc_setup(struct pcmcia_socket *sock, struct proc_dir_entry *base)
{
/* Not done yet */
}
static unsigned int yenta_events(struct yenta_socket *socket)
{
......@@ -519,22 +515,13 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
*/
static void yenta_get_socket_capabilities(struct yenta_socket *socket, u32 isa_irq_mask)
{
socket->cap.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD | SS_CAP_CARDBUS;
socket->cap.map_size = 0x1000;
socket->cap.pci_irq = socket->cb_irq;
socket->cap.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
socket->cap.cb_dev = socket->dev;
printk("Yenta IRQ list %04x, PCI irq%d\n", socket->cap.irq_mask, socket->cb_irq);
}
static int yenta_inquire_socket(struct pcmcia_socket *sock, socket_cap_t *cap)
{
struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
*cap = socket->cap;
socket->socket.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD | SS_CAP_CARDBUS;
socket->socket.map_size = 0x1000;
socket->socket.pci_irq = socket->cb_irq;
socket->socket.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
socket->socket.cb_dev = socket->dev;
return 0;
printk("Yenta IRQ list %04x, PCI irq%d\n", socket->socket.irq_mask, socket->cb_irq);
}
......@@ -764,6 +751,9 @@ static void yenta_close(struct pci_dev *dev)
{
struct yenta_socket *sock = pci_get_drvdata(dev);
/* we don't want a dying socket registered */
pcmcia_unregister_socket(&sock->socket);
/* Disable all events so we don't die in an IRQ storm */
cb_writel(sock, CB_SOCKET_MASK, 0x0);
exca_writeb(sock, I365_CSCINT, 0);
......@@ -777,7 +767,6 @@ static void yenta_close(struct pci_dev *dev)
iounmap(sock->base);
yenta_free_resources(sock);
pcmcia_unregister_socket(&sock->socket);
pci_set_drvdata(dev, NULL);
}
......@@ -797,13 +786,11 @@ static struct pccard_operations yenta_socket_operations = {
.init = yenta_init,
.suspend = yenta_suspend,
.register_callback = yenta_register_callback,
.inquire_socket = yenta_inquire_socket,
.get_status = yenta_get_status,
.get_socket = yenta_get_socket,
.set_socket = yenta_set_socket,
.set_io_map = yenta_set_io_map,
.set_mem_map = yenta_set_mem_map,
.proc_setup = yenta_proc_setup,
};
......
......@@ -101,7 +101,6 @@ struct yenta_socket {
void *base;
void (*handler)(void *, unsigned int);
void *info;
socket_cap_t cap;
spinlock_t event_lock;
unsigned int events;
struct work_struct tq_task;
......
......@@ -686,6 +686,9 @@ static int scsi_add_lun(Scsi_Device *sdev, char *inq_result, int *bflags)
* function */
sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED;
sdev->use_10_for_rw = 1;
sdev->use_10_for_ms = 0;
if(sdev->host->hostt->slave_configure)
sdev->host->hostt->slave_configure(sdev);
......
......@@ -1265,8 +1265,6 @@ sd_init_onedisk(struct scsi_disk * sdkp, struct gendisk *disk)
if (sdkp->media_present)
sd_read_cache_type(sdkp, disk->disk_name, SRpnt, buffer);
SRpnt->sr_device->use_10_for_rw = 1;
SRpnt->sr_device->use_10_for_ms = 0;
SRpnt->sr_device->remap = 1;
leave:
......
......@@ -524,8 +524,6 @@ static int sr_probe(struct device *dev)
sprintf(cd->cdi.name, "sr%d", minor);
sdev->sector_size = 2048; /* A guess, just in case */
sdev->use_10_for_rw = 1;
sdev->use_10_for_ms = 0;
sdev->remap = 1;
/* FIXME: need to handle a get_capabilities failure properly ?? */
......
......@@ -21,8 +21,6 @@
#include <linux/interrupt.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/config.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/fcntl.h>
#include <linux/mm.h>
......@@ -395,7 +393,7 @@ static _INLINE_ void transmit_chars(struct mcf_serial *info)
/*
* This is the serial driver's generic interrupt routine
*/
void mcfrs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
irqreturn_t mcfrs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
struct mcf_serial *info;
unsigned char isr;
......@@ -407,7 +405,7 @@ void mcfrs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
receive_chars(info, regs, isr);
if (isr & MCFUART_UIR_TXREADY)
transmit_chars(info);
return;
return IRQ_HANDLED;
}
/*
......@@ -643,10 +641,17 @@ static void mcfrs_change_speed(struct mcf_serial *info)
}
if (cflag & PARENB) {
if (cflag & PARODD)
mr1 |= MCFUART_MR1_PARITYODD;
else
mr1 |= MCFUART_MR1_PARITYEVEN;
if (cflag & CMSPAR) {
if (cflag & PARODD)
mr1 |= MCFUART_MR1_PARITYMARK;
else
mr1 |= MCFUART_MR1_PARITYSPACE;
} else {
if (cflag & PARODD)
mr1 |= MCFUART_MR1_PARITYODD;
else
mr1 |= MCFUART_MR1_PARITYEVEN;
}
} else {
mr1 |= MCFUART_MR1_PARITYNONE;
}
......@@ -735,8 +740,8 @@ static int mcfrs_write(struct tty_struct * tty, int from_user,
local_save_flags(flags);
while (1) {
local_irq_disable();
c = min(count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
SERIAL_XMIT_SIZE - info->xmit_head));
c = min(count, (int) min(((int)SERIAL_XMIT_SIZE) - info->xmit_cnt - 1,
((int)SERIAL_XMIT_SIZE) - info->xmit_head));
if (c <= 0) {
local_irq_restore(flags);
......@@ -748,8 +753,8 @@ static int mcfrs_write(struct tty_struct * tty, int from_user,
copy_from_user(mcfrs_tmp_buf, buf, c);
local_irq_restore(flags);
local_irq_disable();
c = min(c, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
SERIAL_XMIT_SIZE - info->xmit_head));
c = min(c, (int) min(((int)SERIAL_XMIT_SIZE) - info->xmit_cnt - 1,
((int)SERIAL_XMIT_SIZE) - info->xmit_head));
memcpy(info->xmit_buf + info->xmit_head, mcfrs_tmp_buf, c);
up(&mcfrs_tmp_buf_sem);
} else
......@@ -1558,7 +1563,7 @@ static struct tty_operations mcfrs_ops = {
.start = mcfrs_start,
.hangup = mcfrs_hangup,
.read_proc = mcfrs_readproc,
}
};
/* mcfrs_init inits the driver */
static int __init
......
......@@ -1076,3 +1076,9 @@ struct sti_struct * sti_get_rom(unsigned int index)
return sti_roms[index-1];
}
EXPORT_SYMBOL(sti_get_rom);
MODULE_AUTHOR("Philipp Rumpf, Helge Deller, Thomas Bogendoerfer");
MODULE_DESCRIPTION("Core STI driver for HP's NGLE series graphics cards in HP PARISC machines");
MODULE_LICENSE("GPL v2");
......@@ -66,6 +66,7 @@
#include <linux/pci.h>
#include <asm/grfioctl.h> /* for HP-UX compatibility */
#include <asm/uaccess.h>
#include "sticore.h"
......@@ -111,6 +112,7 @@ struct stifb_info {
int deviceSpecificConfig;
};
static int __initdata bpp = 8; /* parameter from modprobe */
static int __initdata stifb_force_bpp[MAX_STI_ROMS];
/* ------------------- chipset specific functions -------------------------- */
......@@ -1336,6 +1338,8 @@ stifb_init(void)
sti = sti_get_rom(i);
if (!sti)
break;
if (bpp > 0)
stifb_force_bpp[i] = bpp;
stifb_init_fb(sti, stifb_force_bpp[i]);
}
return 0;
......@@ -1355,8 +1359,14 @@ stifb_cleanup(void)
sti = sti_get_rom(i);
if (!sti)
break;
if (sti->info)
if (sti->info) {
struct fb_info *info = sti->info;
unregister_framebuffer(sti->info);
release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
release_mem_region(info->fix.smem_start, info->fix.smem_len);
fb_dealloc_cmap(&info->cmap);
kfree(info);
}
sti->info = NULL;
}
}
......@@ -1372,9 +1382,10 @@ stifb_setup(char *options)
if (strncmp(options, "bpp", 3) == 0) {
options += 3;
for (i = 0; i < MAX_STI_ROMS; i++) {
if (*options++ == ':')
if (*options++ == ':') {
stifb_force_bpp[i] = simple_strtoul(options, &options, 10);
else
bpp = -1;
} else
break;
}
}
......@@ -1390,7 +1401,7 @@ module_exit(stifb_cleanup);
MODULE_AUTHOR("Helge Deller <deller@gmx.de>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>");
MODULE_DESCRIPTION("Framebuffer driver for HP's NGLE series graphics cards in HP PARISC machines");
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL v2");
MODULE_PARM(bpp, "i");
MODULE_PARM_DESC(mem, "Bits per pixel (default: 8)");
......
......@@ -64,6 +64,7 @@
#include <linux/dirent.h>
#include <linux/ctype.h>
#include <linux/ioctl32.h>
#include <linux/ncp_fs.h>
#include <net/sock.h> /* siocdevprivate_ioctl */
#include <net/bluetooth/bluetooth.h>
......
......@@ -4,6 +4,7 @@
* Architecture specific compatibility types
*/
#include <linux/types.h>
#include <linux/sched.h>
#define COMPAT_USER_HZ 100
......@@ -124,4 +125,12 @@ static inline void *compat_ptr(compat_uptr_t uptr)
return (void *)(unsigned long)uptr;
}
static __inline__ void *compat_alloc_user_space(long len)
{
struct pt_regs *regs = &current->thread.regs;
unsigned long usp = regs->gr[30];
return (void *)(usp + len);
}
#endif /* _ASM_PARISC_COMPAT_H */
......@@ -178,10 +178,11 @@
#define PF_HP_SBP 0x08000000
/*
* The following definitions are those for 32-bit ELF binaries on a 32-bit kernel
* and for 64-bit binaries on a 64-bit kernel. To run 32-bit binaries on a 64-bit
* kernel, arch/parisc64/kernel/binfmt_elf32.c defines these macros appropriately
* and then #includes binfmt_elf.c, which then includes this file.
* The following definitions are those for 32-bit ELF binaries on a 32-bit
* kernel and for 64-bit binaries on a 64-bit kernel. To run 32-bit binaries
* on a 64-bit kernel, arch/parisc64/kernel/binfmt_elf32.c defines these
* macros appropriately and then #includes binfmt_elf.c, which then includes
* this file.
*/
#ifndef ELF_CLASS
......@@ -267,6 +268,8 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
typedef double elf_fpreg_t;
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
struct task_struct;
extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
......
......@@ -4,9 +4,16 @@
/*
* Allocate a 8 Mb temporary mapping area for copy_user_page/clear_user_page.
* This area needs to be aligned on a 8 Mb boundary.
*
* FIXME:
*
* For PA-RISC, this has no meaning. It is starting to be used on x86
* for vsyscalls. PA will probably do this using space registers.
*/
/* This TMPALIAS_MAP_START reserves some of the memory where the
* FIXMAP region is on x86. It's only real use is to constrain
* VMALLOC_END (see pktable.h) */
#define TMPALIAS_MAP_START (__PAGE_OFFSET - 0x01000000)
#define FIXADDR_START ((unsigned long)TMPALIAS_MAP_START)
#endif
......@@ -24,10 +24,10 @@
struct mod_arch_specific
{
unsigned long got_offset;
unsigned long fdesc_offset, fdesc_count;
unsigned long stub_offset;
unsigned long stub_count;
unsigned long got_offset, got_count, got_max;
unsigned long fdesc_offset, fdesc_count, fdesc_max;
unsigned long stub_offset, stub_count, stub_max;
unsigned long init_stub_offset, init_stub_count, init_stub_max;
};
#endif /* _ASM_PARISC_MODULE_H */
......@@ -35,7 +35,7 @@
*/
int pdc_chassis_send_status(int message);
void __init parisc_pdc_chassis_init(void);
void parisc_pdc_chassis_init(void);
/*
......
......@@ -109,7 +109,8 @@ extern void *vmalloc_start;
#define PCXL_DMA_MAP_SIZE (8*1024*1024)
#define VMALLOC_START ((unsigned long)vmalloc_start)
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#define VMALLOC_END (FIXADDR_START)
/* this is a fixmap remnant, see fixmap.h */
#define VMALLOC_END (TMPALIAS_MAP_START)
#endif
/* NB: The tlb miss handlers make certain assumptions about the order */
......@@ -122,6 +123,7 @@ extern void *vmalloc_start;
#define _PAGE_GATEWAY_BIT 28 /* (0x008) privilege promotion allowed */
#define _PAGE_DMB_BIT 27 /* (0x010) Data Memory Break enable (B bit) */
#define _PAGE_DIRTY_BIT 26 /* (0x020) Page Dirty (D bit) */
#define _PAGE_FILE_BIT _PAGE_DIRTY_BIT /* overload this bit */
#define _PAGE_REFTRAP_BIT 25 /* (0x040) Page Ref. Trap enable (T bit) */
#define _PAGE_NO_CACHE_BIT 24 /* (0x080) Uncached Page (U bit) */
#define _PAGE_ACCESSED_BIT 23 /* (0x100) Software: Page Accessed */
......@@ -135,6 +137,17 @@ extern void *vmalloc_start;
#define xlate_pabit(x) (31 - x)
/* this defines the shift to the usable bits in the PTE it is set so
* that the valid bits _PAGE_PRESENT_BIT and _PAGE_USER_BIT are set
* to zero */
#define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT)
/* this is how many bits may be used by the file functions */
#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT)
#define pte_to_pgoff(pte) (pte_val(pte) >> PTE_SHIFT)
#define pgoff_to_pte(off) ((pte_t) { ((off) << PTE_SHIFT) | _PAGE_FILE })
#define _PAGE_READ (1 << xlate_pabit(_PAGE_READ_BIT))
#define _PAGE_WRITE (1 << xlate_pabit(_PAGE_WRITE_BIT))
#define _PAGE_RW (_PAGE_READ | _PAGE_WRITE)
......@@ -148,6 +161,7 @@ extern void *vmalloc_start;
#define _PAGE_PRESENT (1 << xlate_pabit(_PAGE_PRESENT_BIT))
#define _PAGE_FLUSH (1 << xlate_pabit(_PAGE_FLUSH_BIT))
#define _PAGE_USER (1 << xlate_pabit(_PAGE_USER_BIT))
#define _PAGE_FILE (1 << xlate_pabit(_PAGE_FILE_BIT))
#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | _PAGE_DIRTY | _PAGE_ACCESSED)
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
......@@ -256,6 +270,8 @@ extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; }
extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
extern inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
extern inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_READ; return pte; }
extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
......
......@@ -92,6 +92,7 @@ struct cpuinfo_parisc {
unsigned long fp_model;
unsigned int state;
struct parisc_device *dev;
unsigned long loops_per_jiffy;
};
extern struct system_cpuinfo_parisc boot_cpu_data;
......
......@@ -7,7 +7,6 @@
#define _ASMPARISC_TIMEX_H
#include <asm/system.h>
#include <linux/time.h>
#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
......
......@@ -720,6 +720,7 @@
#define __NR_epoll_ctl (__NR_Linux + 225)
#define __NR_epoll_wait (__NR_Linux + 226)
#define __NR_remap_file_pages (__NR_Linux + 227)
#define __NR_semtimedop (__NR_Linux + 228)
#define __NR_Linux_syscalls 228
......
......@@ -105,12 +105,15 @@ extern int allocate_resource(struct resource *root, struct resource *new,
extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name);
/* Compatibility cruft */
#define check_region(start,n) __check_region(&ioport_resource, (start), (n))
#define release_region(start,n) __release_region(&ioport_resource, (start), (n))
#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
extern int __deprecated __check_region(struct resource *, unsigned long, unsigned long);
extern int __check_region(struct resource *, unsigned long, unsigned long);
extern void __release_region(struct resource *, unsigned long, unsigned long);
static inline int __deprecated check_region(unsigned long s, unsigned long n)
{
return __check_region(&ioport_resource, s, n);
}
#endif /* _LINUX_IOPORT_H */
......@@ -40,7 +40,7 @@ struct kparam_string {
#define __module_param_call(prefix, name, set, get, arg, perm) \
static char __param_str_##name[] __initdata = prefix #name; \
static struct kernel_param const __param_##name \
__attribute__ ((unused,__section__ ("__param"))) \
__attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
= { __param_str_##name, perm, set, get, arg }
#define module_param_call(name, set, get, arg, perm) \
......
......@@ -52,16 +52,6 @@
#define SS_XVCARD 0x2000
#define SS_PENDING 0x4000
/* for InquireSocket */
typedef struct socket_cap_t {
u_int features;
u_int irq_mask;
u_int map_size;
ioaddr_t io_offset;
u_char pci_irq;
struct pci_dev *cb_dev;
} socket_cap_t;
/* InquireSocket capabilities */
#define SS_CAP_PAGE_REGS 0x0001
#define SS_CAP_VIRTUAL_BUS 0x0002
......@@ -133,13 +123,11 @@ struct pccard_operations {
int (*init)(struct pcmcia_socket *sock);
int (*suspend)(struct pcmcia_socket *sock);
int (*register_callback)(struct pcmcia_socket *sock, void (*handler)(void *, unsigned int), void * info);
int (*inquire_socket)(struct pcmcia_socket *sock, socket_cap_t *cap);
int (*get_status)(struct pcmcia_socket *sock, u_int *value);
int (*get_socket)(struct pcmcia_socket *sock, socket_state_t *state);
int (*set_socket)(struct pcmcia_socket *sock, socket_state_t *state);
int (*set_io_map)(struct pcmcia_socket *sock, struct pccard_io_map *io);
int (*set_mem_map)(struct pcmcia_socket *sock, struct pccard_mem_map *mem);
void (*proc_setup)(struct pcmcia_socket *sock, struct proc_dir_entry *base);
};
/*
......@@ -147,15 +135,6 @@ struct pccard_operations {
*/
struct pcmcia_socket;
struct pcmcia_socket_class_data {
unsigned int nsock; /* number of sockets */
unsigned int sock_offset; /* socket # (which is
* returned to driver) = sock_offset + (0, 1, .. , (nsock-1) */
struct pccard_operations *ops; /* see above */
struct pcmcia_socket *s_info;
struct class_device class_dev; /* generic class structure */
};
typedef struct erase_busy_t {
eraseq_entry_t *erase;
client_handle_t client;
......@@ -193,7 +172,6 @@ struct pcmcia_socket {
spinlock_t lock;
struct pccard_operations * ss_entry;
socket_state_t socket;
socket_cap_t cap;
u_int state;
u_short functions;
u_short lock_count;
......@@ -215,13 +193,19 @@ struct pcmcia_socket {
char *fake_cis;
struct list_head socket_list;
struct completion socket_released;
/* deprecated */
unsigned int sock; /* socket number */
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc;
#endif
/* socket capabilities */
u_int features;
u_int irq_mask;
u_int map_size;
ioaddr_t io_offset;
u_char pci_irq;
struct pci_dev * cb_dev;
/* state thread */
struct semaphore skt_sem; /* protects socket h/w state */
......
......@@ -383,7 +383,7 @@ asmlinkage void __init start_kernel(void)
{
char * command_line;
extern char saved_command_line[];
extern struct kernel_param __start___param, __stop___param;
extern struct kernel_param __start___param[], __stop___param[];
/*
* Interrupts are still disabled. Do necessary setups, then
* enable them
......@@ -403,8 +403,8 @@ asmlinkage void __init start_kernel(void)
build_all_zonelists();
page_alloc_init();
printk("Kernel command line: %s\n", saved_command_line);
parse_args("Booting kernel", command_line, &__start___param,
&__stop___param - &__start___param,
parse_args("Booting kernel", command_line, __start___param,
__stop___param - __start___param,
&unknown_bootoption);
trap_init();
rcu_init();
......
......@@ -168,11 +168,11 @@ asmlinkage long sys_settimeofday(struct timeval __user *tv, struct timezone __us
if (tv) {
if (copy_from_user(&new_tv, tv, sizeof(*tv)))
return -EFAULT;
new_tv.tv_nsec *= NSEC_PER_USEC;
}
if (tz) {
if (copy_from_user(&new_tz, tz, sizeof(*tz)))
return -EFAULT;
new_tv.tv_nsec *= NSEC_PER_USEC;
}
return do_sys_settimeofday(tv ? &new_tv : NULL, tz ? &new_tz : NULL);
......
......@@ -111,7 +111,7 @@ int ip_rt_max_delay = 10 * HZ;
int ip_rt_max_size;
int ip_rt_gc_timeout = RT_GC_TIMEOUT;
int ip_rt_gc_interval = 60 * HZ;
int ip_rt_gc_min_interval = 5 * HZ;
int ip_rt_gc_min_interval = HZ / 2;
int ip_rt_redirect_number = 9;
int ip_rt_redirect_load = HZ / 50;
int ip_rt_redirect_silence = ((HZ / 50) << (9 + 1));
......@@ -456,6 +456,25 @@ static int rt_may_expire(struct rtable *rth, unsigned long tmo1, unsigned long t
out: return ret;
}
/* Bits of score are:
* 31: very valuable
* 30: not quite useless
* 29..0: usage counter
*/
static inline u32 rt_score(struct rtable *rt)
{
u32 score = rt->u.dst.__use;
if (rt_valuable(rt))
score |= (1<<31);
if (!rt->fl.iif ||
!(rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL)))
score |= (1<<30);
return score;
}
/* This runs via a timer and thus is always in BH context. */
static void rt_check_expire(unsigned long dummy)
{
......@@ -720,10 +739,19 @@ static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp)
{
struct rtable *rth, **rthp;
unsigned long now = jiffies;
unsigned long now;
struct rtable *cand, **candp;
u32 min_score;
int chain_length;
int attempts = !in_softirq();
restart:
chain_length = 0;
min_score = ~(u32)0;
cand = NULL;
candp = NULL;
now = jiffies;
rthp = &rt_hash_table[hash].chain;
spin_lock_bh(&rt_hash_table[hash].lock);
......@@ -755,9 +783,35 @@ static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp)
return 0;
}
if (!atomic_read(&rth->u.dst.__refcnt)) {
u32 score = rt_score(rth);
if (score <= min_score) {
cand = rth;
candp = rthp;
min_score = score;
}
}
chain_length++;
rthp = &rth->u.rt_next;
}
if (cand) {
/* ip_rt_gc_elasticity used to be average length of chain
* length, when exceeded gc becomes really aggressive.
*
* The second limit is less certain. At the moment it allows
* only 2 entries per bucket. We will see.
*/
if (chain_length > ip_rt_gc_elasticity ||
(chain_length > 1 && !(min_score & (1<<31)))) {
*candp = cand->u.rt_next;
rt_free(cand);
}
}
/* Try to bind route to arp only if it is output
route or unicast forwarding path.
*/
......
......@@ -290,9 +290,10 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
if (addr_type == IPV6_ADDR_MAPPED) {
struct sockaddr_in sin;
if (__ipv6_only_sock(sk))
return -ENETUNREACH;
if (__ipv6_only_sock(sk)) {
err = -ENETUNREACH;
goto out;
}
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = daddr->s6_addr32[3];
sin.sin_port = usin->sin6_port;
......@@ -300,8 +301,8 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
err = udp_connect(sk, (struct sockaddr*) &sin, sizeof(sin));
ipv4_connected:
if (err < 0)
return err;
if (err)
goto out;
ipv6_addr_set(&np->daddr, 0, 0, htonl(0x0000ffff), inet->daddr);
......@@ -314,7 +315,7 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
ipv6_addr_set(&np->rcv_saddr, 0, 0, htonl(0x0000ffff),
inet->rcv_saddr);
}
return 0;
goto out;
}
if (addr_type&IPV6_ADDR_LINKLOCAL) {
......@@ -322,8 +323,8 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
usin->sin6_scope_id) {
if (sk->sk_bound_dev_if &&
sk->sk_bound_dev_if != usin->sin6_scope_id) {
fl6_sock_release(flowlabel);
return -EINVAL;
err = -EINVAL;
goto out;
}
sk->sk_bound_dev_if = usin->sin6_scope_id;
if (!sk->sk_bound_dev_if &&
......@@ -332,8 +333,10 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
}
/* Connect to link-local address requires an interface */
if (!sk->sk_bound_dev_if)
return -EINVAL;
if (!sk->sk_bound_dev_if) {
err = -EINVAL;
goto out;
}
}
ipv6_addr_copy(&np->daddr, daddr);
......@@ -370,31 +373,33 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
if ((err = dst->error) != 0) {
dst_release(dst);
fl6_sock_release(flowlabel);
return err;
goto out;
}
/* get the source address used in the appropriate device */
err = ipv6_get_saddr(dst, daddr, &fl.fl6_src);
if (err == 0) {
if (ipv6_addr_any(&np->saddr))
ipv6_addr_copy(&np->saddr, &fl.fl6_src);
if (ipv6_addr_any(&np->rcv_saddr)) {
ipv6_addr_copy(&np->rcv_saddr, &fl.fl6_src);
inet->rcv_saddr = LOOPBACK4_IPV6;
}
if (err) {
dst_release(dst);
goto out;
}
ip6_dst_store(sk, dst,
!ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
&np->daddr : NULL);
if (ipv6_addr_any(&np->saddr))
ipv6_addr_copy(&np->saddr, &fl.fl6_src);
sk->sk_state = TCP_ESTABLISHED;
if (ipv6_addr_any(&np->rcv_saddr)) {
ipv6_addr_copy(&np->rcv_saddr, &fl.fl6_src);
inet->rcv_saddr = LOOPBACK4_IPV6;
}
fl6_sock_release(flowlabel);
ip6_dst_store(sk, dst,
!ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
&np->daddr : NULL);
sk->sk_state = TCP_ESTABLISHED;
out:
fl6_sock_release(flowlabel);
return err;
}
......
......@@ -79,10 +79,7 @@
#include <linux/mount.h>
#include <linux/security.h>
#include <linux/compat.h>
#if defined(CONFIG_KMOD) && defined(CONFIG_NET)
#include <linux/kmod.h>
#endif
#ifdef CONFIG_NET_RADIO
#include <linux/wireless.h> /* Note : will define WIRELESS_EXT */
......@@ -770,11 +767,9 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unlock_kernel();
sock = SOCKET_I(inode);
#ifdef CONFIG_NET
if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
err = dev_ioctl(cmd, (void *)arg);
} else
#endif /* CONFIG_NET */
#ifdef WIRELESS_EXT
if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {
err = dev_ioctl(cmd, (void *)arg);
......@@ -795,11 +790,8 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case SIOCGIFBR:
case SIOCSIFBR:
err = -ENOPKG;
#ifdef CONFIG_KMOD
if (!br_ioctl_hook)
request_module("bridge");
#endif
down(&br_ioctl_mutex);
if (br_ioctl_hook)
......@@ -809,10 +801,9 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case SIOCGIFVLAN:
case SIOCSIFVLAN:
err = -ENOPKG;
#ifdef CONFIG_KMOD
if (!vlan_ioctl_hook)
request_module("8021q");
#endif
down(&vlan_ioctl_mutex);
if (vlan_ioctl_hook)
err = vlan_ioctl_hook(arg);
......@@ -826,10 +817,9 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case SIOCADDDLCI:
case SIOCDELDLCI:
err = -ENOPKG;
#ifdef CONFIG_KMOD
if (!dlci_ioctl_hook)
request_module("dlci");
#endif
if (dlci_ioctl_hook) {
down(&dlci_ioctl_mutex);
err = dlci_ioctl_hook(cmd, (void *)arg);
......@@ -1021,7 +1011,7 @@ int sock_create(int family, int type, int protocol, struct socket **res)
if (err)
return err;
#if defined(CONFIG_KMOD) && defined(CONFIG_NET)
#if defined(CONFIG_KMOD)
/* Attempt to load a protocol module if the find failed.
*
* 12/09/1996 Marcin: But! this makes REALLY only sense, if the user
......
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