Commit 189ea5d0 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 3ed5a695 a21dffe4
request_firmware() hotplug interface:
------------------------------------
Copyright (C) 2003 Manuel Estrada Sainz <ranty@debian.org>
Why:
---
Today, the most extended way to use firmware in the Linux kernel is linking
it statically in a header file. Which has political and technical issues:
1) Some firmware is not legal to redistribute.
2) The firmware occupies memory permanently, even though it often is just
used once.
3) Some people, like the Debian crowd, don't consider some firmware free
enough and remove entire drivers (e.g.: keyspan).
about in-kernel persistence:
---------------------------
Under some circumstances, as explained below, it would be interesting to keep
firmware images in non-swappable kernel memory or even in the kernel image
(probably within initramfs).
Note that this functionality has not been implemented.
- Why OPTIONAL in-kernel persistence may be a good idea sometimes:
- If the device that needs the firmware is needed to access the
filesystem. When upon some error the device has to be reset and the
firmware reloaded, it won't be possible to get it from userspace.
e.g.:
- A diskless client with a network card that needs firmware.
- The filesystem is stored in a disk behind an scsi device
that needs firmware.
- Replacing buggy DSDT/SSDT ACPI tables on boot.
Note: this would require the persistent objects to be included
within the kernel image, probably within initramfs.
And the same device can be needed to access the filesystem or not depending
on the setup, so I think that the choice on what firmware to make
persistent should be left to userspace.
- Why register_firmware()+__init can be useful:
- For boot devices needing firmware.
- To make the transition easier:
The firmware can be declared __init and register_firmware()
called on module_init. Then the firmware is warranted to be
there even if "firmware hotplug userspace" is not there yet or
it doesn't yet provide the needed firmware.
Once the firmware is widely available in userspace, it can be
removed from the kernel. Or made optional (CONFIG_.*_FIRMWARE).
In either case, if firmware hotplug support is there, it can move the
firmware out of kernel memory into the real filesystem for later
usage.
Note: If persistence is implemented on top of initramfs,
register_firmware() may not be appropriate.
/*
* firmware_sample_driver.c -
*
* Copyright (c) 2003 Manuel Estrada Sainz <ranty@debian.org>
*
* Sample code on how to use request_firmware() from drivers.
*
* Note that register_firmware() is currently useless.
*
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include "linux/firmware.h"
#define WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
#ifdef WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
char __init inkernel_firmware[] = "let's say that this is firmware\n";
#endif
static struct device ghost_device = {
.name = "Ghost Device",
.bus_id = "ghost0",
};
static void sample_firmware_load(char *firmware, int size)
{
u8 buf[size+1];
memcpy(buf, firmware, size);
buf[size] = '\0';
printk("firmware_sample_driver: firmware: %s\n", buf);
}
static void sample_probe_default(void)
{
/* uses the default method to get the firmware */
const struct firmware *fw_entry;
printk("firmware_sample_driver: a ghost device got inserted :)\n");
if(request_firmware(&fw_entry, "sample_driver_fw", &ghost_device)!=0)
{
printk(KERN_ERR
"firmware_sample_driver: Firmware not available\n");
return;
}
sample_firmware_load(fw_entry->data, fw_entry->size);
release_firmware(fw_entry);
/* finish setting up the device */
}
static void sample_probe_specific(void)
{
/* Uses some specific hotplug support to get the firmware from
* userspace directly into the hardware, or via some sysfs file */
/* NOTE: This currently doesn't work */
printk("firmware_sample_driver: a ghost device got inserted :)\n");
if(request_firmware(NULL, "sample_driver_fw", &ghost_device)!=0)
{
printk(KERN_ERR
"firmware_sample_driver: Firmware load failed\n");
return;
}
/* request_firmware blocks until userspace finished, so at
* this point the firmware should be already in the device */
/* finish setting up the device */
}
static void sample_probe_async_cont(const struct firmware *fw, void *context)
{
if(!fw){
printk(KERN_ERR
"firmware_sample_driver: firmware load failed\n");
return;
}
printk("firmware_sample_driver: device pointer \"%s\"\n",
(char *)context);
sample_firmware_load(fw->data, fw->size);
}
static void sample_probe_async(void)
{
/* Let's say that I can't sleep */
int error;
error = request_firmware_nowait (THIS_MODULE,
"sample_driver_fw", &ghost_device,
"my device pointer",
sample_probe_async_cont);
if(error){
printk(KERN_ERR
"firmware_sample_driver:"
" request_firmware_nowait failed\n");
}
}
static int sample_init(void)
{
#ifdef WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
register_firmware("sample_driver_fw", inkernel_firmware,
sizeof(inkernel_firmware));
#endif
device_initialize(&ghost_device);
/* since there is no real hardware insertion I just call the
* sample probe functions here */
sample_probe_specific();
sample_probe_default();
sample_probe_async();
return 0;
}
static void __exit sample_exit(void)
{
}
module_init (sample_init);
module_exit (sample_exit);
MODULE_LICENSE("GPL");
/*
* firmware_sample_firmware_class.c -
*
* Copyright (c) 2003 Manuel Estrada Sainz <ranty@debian.org>
*
* NOTE: This is just a probe of concept, if you think that your driver would
* be well served by this mechanism please contact me first.
*
* DON'T USE THIS CODE AS IS
*
*/
#include <linux/device.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/timer.h>
#include <asm/hardirq.h>
#include "linux/firmware.h"
MODULE_AUTHOR("Manuel Estrada Sainz <ranty@debian.org>");
MODULE_DESCRIPTION("Hackish sample for using firmware class directly");
MODULE_LICENSE("GPL");
static inline struct class_device *to_class_dev(struct kobject *obj)
{
return container_of(obj,struct class_device,kobj);
}
static inline
struct class_device_attribute *to_class_dev_attr(struct attribute *_attr)
{
return container_of(_attr,struct class_device_attribute,attr);
}
int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr);
int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
struct firmware_priv {
char fw_id[FIRMWARE_NAME_MAX];
s32 loading:2;
u32 abort:1;
};
extern struct class firmware_class;
static ssize_t firmware_loading_show(struct class_device *class_dev, char *buf)
{
struct firmware_priv *fw_priv = class_get_devdata(class_dev);
return sprintf(buf, "%d\n", fw_priv->loading);
}
static ssize_t firmware_loading_store(struct class_device *class_dev,
const char *buf, size_t count)
{
struct firmware_priv *fw_priv = class_get_devdata(class_dev);
int prev_loading = fw_priv->loading;
fw_priv->loading = simple_strtol(buf, NULL, 10);
switch(fw_priv->loading){
case -1:
/* abort load an panic */
break;
case 1:
/* setup load */
break;
case 0:
if(prev_loading==1){
/* finish load and get the device back to working
* state */
}
break;
}
return count;
}
static CLASS_DEVICE_ATTR(loading, 0644,
firmware_loading_show, firmware_loading_store);
static ssize_t firmware_data_read(struct kobject *kobj,
char *buffer, loff_t offset, size_t count)
{
struct class_device *class_dev = to_class_dev(kobj);
struct firmware_priv *fw_priv = class_get_devdata(class_dev);
/* read from the devices firmware memory */
return count;
}
static ssize_t firmware_data_write(struct kobject *kobj,
char *buffer, loff_t offset, size_t count)
{
struct class_device *class_dev = to_class_dev(kobj);
struct firmware_priv *fw_priv = class_get_devdata(class_dev);
/* write to the devices firmware memory */
return count;
}
static struct bin_attribute firmware_attr_data = {
.attr = {.name = "data", .mode = 0644},
.size = 0,
.read = firmware_data_read,
.write = firmware_data_write,
};
static int fw_setup_class_device(struct class_device *class_dev,
const char *fw_name,
struct device *device)
{
int retval = 0;
struct firmware_priv *fw_priv = kmalloc(sizeof(struct firmware_priv),
GFP_KERNEL);
if(!fw_priv){
retval = -ENOMEM;
goto out;
}
memset(fw_priv, 0, sizeof(*fw_priv));
memset(class_dev, 0, sizeof(*class_dev));
strncpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX);
fw_priv->fw_id[FIRMWARE_NAME_MAX-1] = '\0';
strncpy(class_dev->class_id, device->bus_id, BUS_ID_SIZE);
class_dev->class_id[BUS_ID_SIZE-1] = '\0';
class_dev->dev = device;
class_dev->class = &firmware_class,
class_set_devdata(class_dev, fw_priv);
retval = class_device_register(class_dev);
if (retval){
printk(KERN_ERR "%s: class_device_register failed\n",
__FUNCTION__);
goto error_free_fw_priv;
}
retval = sysfs_create_bin_file(&class_dev->kobj, &firmware_attr_data);
if (retval){
printk(KERN_ERR "%s: sysfs_create_bin_file failed\n",
__FUNCTION__);
goto error_unreg_class_dev;
}
retval = class_device_create_file(class_dev,
&class_device_attr_loading);
if (retval){
printk(KERN_ERR "%s: class_device_create_file failed\n",
__FUNCTION__);
goto error_remove_data;
}
goto out;
error_remove_data:
sysfs_remove_bin_file(&class_dev->kobj, &firmware_attr_data);
error_unreg_class_dev:
class_device_unregister(class_dev);
error_free_fw_priv:
kfree(fw_priv);
out:
return retval;
}
static void fw_remove_class_device(struct class_device *class_dev)
{
struct firmware_priv *fw_priv = class_get_devdata(class_dev);
class_device_remove_file(class_dev, &class_device_attr_loading);
sysfs_remove_bin_file(&class_dev->kobj, &firmware_attr_data);
class_device_unregister(class_dev);
}
static struct class_device *class_dev;
static struct device my_device = {
.name = "Sample Device",
.bus_id = "my_dev0",
};
static int __init firmware_sample_init(void)
{
int error;
device_initialize(&my_device);
class_dev = kmalloc(sizeof(struct class_device), GFP_KERNEL);
if(!class_dev)
return -ENOMEM;
error = fw_setup_class_device(class_dev, "my_firmware_image",
&my_device);
if(error){
kfree(class_dev);
return error;
}
return 0;
}
static void __exit firmware_sample_exit(void)
{
struct firmware_priv *fw_priv = class_get_devdata(class_dev);
fw_remove_class_device(class_dev);
kfree(fw_priv);
kfree(class_dev);
}
module_init(firmware_sample_init);
module_exit(firmware_sample_exit);
#!/bin/sh
# Simple hotplug script sample:
#
# Both $DEVPATH and $FIRMWARE are already provided in the environment.
HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/
echo 1 > /sysfs/$DEVPATH/loading
cat $HOTPLUG_FW_DIR/$FIRMWARE > /sysfs/$DEVPATH/data
echo 0 > /sysfs/$DEVPATH/loading
# To cancel the load in case of error:
#
# echo -1 > /sysfs/$DEVPATH/loading
#
...@@ -5,15 +5,8 @@ Patrick Mochel <mochel@osdl.org> ...@@ -5,15 +5,8 @@ Patrick Mochel <mochel@osdl.org>
Updated: 3 June 2003 Updated: 3 June 2003
Copyright (c) Patrick Mochel Copyright (c) 2003 Patrick Mochel
Copyright (c) Open Source Development Labs Copyright (c) 2003 Open Source Development Labs
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
0. Introduction 0. Introduction
......
...@@ -653,6 +653,8 @@ source "drivers/parport/Kconfig" ...@@ -653,6 +653,8 @@ source "drivers/parport/Kconfig"
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/pnp/Kconfig" source "drivers/pnp/Kconfig"
......
...@@ -156,7 +156,7 @@ EXPORT_SYMBOL(sys_exit); ...@@ -156,7 +156,7 @@ EXPORT_SYMBOL(sys_exit);
EXPORT_SYMBOL(sys_write); EXPORT_SYMBOL(sys_write);
EXPORT_SYMBOL(sys_read); EXPORT_SYMBOL(sys_read);
EXPORT_SYMBOL(sys_lseek); EXPORT_SYMBOL(sys_lseek);
EXPORT_SYMBOL(__kernel_execve); EXPORT_SYMBOL(execve);
EXPORT_SYMBOL(sys_setsid); EXPORT_SYMBOL(sys_setsid);
EXPORT_SYMBOL(sys_wait4); EXPORT_SYMBOL(sys_wait4);
......
...@@ -606,7 +606,8 @@ ret_from_fork: ...@@ -606,7 +606,8 @@ ret_from_fork:
.globl kernel_thread .globl kernel_thread
.ent kernel_thread .ent kernel_thread
kernel_thread: kernel_thread:
ldgp $gp, 0($27) /* we can be called from a module */ /* We can be called from a module. */
ldgp $gp, 0($27)
.prologue 1 .prologue 1
subq $sp, SP_OFF+6*8, $sp subq $sp, SP_OFF+6*8, $sp
br $1, 2f /* load start address */ br $1, 2f /* load start address */
...@@ -654,26 +655,56 @@ kernel_thread: ...@@ -654,26 +655,56 @@ kernel_thread:
.end kernel_thread .end kernel_thread
/* /*
* __kernel_execve(path, argv, envp, regs) * execve(path, argv, envp)
*/ */
.align 4 .align 4
.globl __kernel_execve .globl execve
.ent __kernel_execve .ent execve
__kernel_execve: execve:
ldgp $gp, 0($27) /* we can be called from modules. */ /* We can be called from a module. */
subq $sp, 16, $sp ldgp $gp, 0($27)
.frame $sp, 16, $26, 0 lda $sp, -(32+SIZEOF_PT_REGS+8)($sp)
.frame $sp, 32+SIZEOF_PT_REGS+8, $26, 0
stq $26, 0($sp) stq $26, 0($sp)
stq $19, 8($sp) stq $16, 8($sp)
stq $17, 16($sp)
stq $18, 24($sp)
.prologue 1 .prologue 1
jsr $26, do_execve
lda $16, 32($sp)
lda $17, 0
lda $18, SIZEOF_PT_REGS
bsr $26, memset !samegp
/* Avoid the HAE being gratuitously wrong, which would cause us
to do the whole turn off interrupts thing and restore it. */
ldq $2, alpha_mv+HAE_CACHE
stq $2, 152+32($sp)
ldq $16, 8($sp)
ldq $17, 16($sp)
ldq $18, 24($sp)
lda $19, 32($sp)
bsr $26, do_execve !samegp
ldq $26, 0($sp)
bne $0, 1f /* error! */ bne $0, 1f /* error! */
ldq $sp, 8($sp)
/* Move the temporary pt_regs struct from its current location
to the top of the kernel stack frame. See copy_thread for
details for a normal process. */
lda $16, 0x4000 - SIZEOF_PT_REGS($8)
lda $17, 32($sp)
lda $18, SIZEOF_PT_REGS
bsr $26, memmove !samegp
/* Take that over as our new stack frame and visit userland! */
lda $sp, 0x4000 - SIZEOF_PT_REGS($8)
br $31, ret_from_sys_call br $31, ret_from_sys_call
1: ldq $26, 0($sp)
addq $sp, 16, $sp 1: lda $sp, 32+SIZEOF_PT_REGS+8($sp)
ret ret
.end __kernel_execve .end execve
/* /*
......
...@@ -291,6 +291,7 @@ srmcons_init(void) ...@@ -291,6 +291,7 @@ srmcons_init(void)
driver->type = TTY_DRIVER_TYPE_SYSTEM; driver->type = TTY_DRIVER_TYPE_SYSTEM;
driver->subtype = SYSTEM_TYPE_SYSCONS; driver->subtype = SYSTEM_TYPE_SYSCONS;
driver->init_termios = tty_std_termios; driver->init_termios = tty_std_termios;
tty_set_operations(driver, &srmcons_ops);
err = tty_register_driver(driver); err = tty_register_driver(driver);
if (err) { if (err) {
put_tty_driver(driver); put_tty_driver(driver);
......
...@@ -15,15 +15,23 @@ ...@@ -15,15 +15,23 @@
.globl bcopy .globl bcopy
.ent bcopy .ent bcopy
bcopy: bcopy:
ldgp $29, 0($27)
.prologue 1
mov $16,$0 mov $16,$0
mov $17,$16 mov $17,$16
mov $0,$17 mov $0,$17
br $31, memmove !samegp
.end bcopy .end bcopy
.align 4 .align 4
.globl memmove .globl memmove
.ent memmove .ent memmove
memmove: memmove:
ldgp $29, 0($27)
unop
nop
.prologue 1
addq $16,$18,$4 addq $16,$18,$4
addq $17,$18,$5 addq $17,$18,$5
cmpule $4,$17,$1 /* dest + n <= src */ cmpule $4,$17,$1 /* dest + n <= src */
...@@ -32,7 +40,7 @@ memmove: ...@@ -32,7 +40,7 @@ memmove:
bis $1,$2,$1 bis $1,$2,$1
mov $16,$0 mov $16,$0
xor $16,$17,$2 xor $16,$17,$2
bne $1,memcpy bne $1,memcpy !samegp
and $2,7,$2 /* Test for src/dest co-alignment. */ and $2,7,$2 /* Test for src/dest co-alignment. */
and $16,7,$1 and $16,7,$1
......
...@@ -188,7 +188,7 @@ oprofile_arch_init(struct oprofile_operations **ops) ...@@ -188,7 +188,7 @@ oprofile_arch_init(struct oprofile_operations **ops)
} }
void __exit void
oprofile_arch_exit(void) oprofile_arch_exit(void)
{ {
} }
...@@ -703,6 +703,8 @@ endchoice ...@@ -703,6 +703,8 @@ endchoice
source "fs/Kconfig.binfmt" source "fs/Kconfig.binfmt"
source "drivers/base/Kconfig"
config PM config PM
bool "Power Management support" bool "Power Management support"
---help--- ---help---
......
...@@ -297,6 +297,8 @@ config CMDLINE ...@@ -297,6 +297,8 @@ config CMDLINE
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
source "drivers/pnp/Kconfig" source "drivers/pnp/Kconfig"
......
...@@ -515,6 +515,8 @@ config ETRAX_POWERBUTTON_BIT ...@@ -515,6 +515,8 @@ config ETRAX_POWERBUTTON_BIT
endmenu endmenu
source "drivers/base/Kconfig"
# bring in Etrax built-in drivers # bring in Etrax built-in drivers
source "arch/cris/drivers/Kconfig" source "arch/cris/drivers/Kconfig"
......
...@@ -145,6 +145,8 @@ source "fs/Kconfig.binfmt" ...@@ -145,6 +145,8 @@ source "fs/Kconfig.binfmt"
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/block/Kconfig" source "drivers/block/Kconfig"
source "drivers/ide/Kconfig" source "drivers/ide/Kconfig"
......
...@@ -1194,6 +1194,8 @@ source "fs/Kconfig.binfmt" ...@@ -1194,6 +1194,8 @@ source "fs/Kconfig.binfmt"
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
......
...@@ -281,19 +281,19 @@ unsigned long get_cmos_time(void) ...@@ -281,19 +281,19 @@ unsigned long get_cmos_time(void)
return retval; return retval;
} }
static struct sysdev_class rtc_sysclass = { static struct sysdev_class pit_sysclass = {
set_kset_name("rtc"), set_kset_name("pit"),
}; };
/* XXX this driverfs stuff should probably go elsewhere later -john */ /* XXX this driverfs stuff should probably go elsewhere later -john */
static struct sys_device device_i8253 = { static struct sys_device device_i8253 = {
.id = 0, .id = 0,
.cls = &rtc_sysclass, .cls = &pit_sysclass,
}; };
static int time_init_device(void) static int time_init_device(void)
{ {
int error = sysdev_class_register(&rtc_sysclass); int error = sysdev_class_register(&pit_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_i8253); error = sys_device_register(&device_i8253);
return error; return error;
......
...@@ -534,6 +534,8 @@ endif ...@@ -534,6 +534,8 @@ endif
endmenu endmenu
source "drivers/base/Kconfig"
if !IA64_HP_SIM if !IA64_HP_SIM
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
......
...@@ -573,6 +573,8 @@ endif ...@@ -573,6 +573,8 @@ endif
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/block/Kconfig" source "drivers/block/Kconfig"
......
...@@ -515,6 +515,8 @@ config PM ...@@ -515,6 +515,8 @@ config PM
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
......
...@@ -744,6 +744,8 @@ if ISA ...@@ -744,6 +744,8 @@ if ISA
source "drivers/pnp/Kconfig" source "drivers/pnp/Kconfig"
endif endif
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
......
...@@ -361,6 +361,8 @@ endmenu ...@@ -361,6 +361,8 @@ endmenu
source "drivers/pci/Kconfig" source "drivers/pci/Kconfig"
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
......
...@@ -170,6 +170,8 @@ source "fs/Kconfig.binfmt" ...@@ -170,6 +170,8 @@ source "fs/Kconfig.binfmt"
endmenu endmenu
source "drivers/base/Kconfig"
# source "drivers/mtd/Kconfig" # source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
......
...@@ -1163,6 +1163,8 @@ config PIN_TLB ...@@ -1163,6 +1163,8 @@ config PIN_TLB
depends on ADVANCED_OPTIONS && 8xx depends on ADVANCED_OPTIONS && 8xx
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/pnp/Kconfig" source "drivers/pnp/Kconfig"
......
...@@ -241,6 +241,8 @@ config CMDLINE ...@@ -241,6 +241,8 @@ config CMDLINE
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
......
...@@ -229,6 +229,8 @@ config PCMCIA ...@@ -229,6 +229,8 @@ config PCMCIA
bool bool
default n default n
source "drivers/base/Kconfig"
menu "SCSI support" menu "SCSI support"
config SCSI config SCSI
......
...@@ -767,6 +767,8 @@ source "fs/Kconfig.binfmt" ...@@ -767,6 +767,8 @@ source "fs/Kconfig.binfmt"
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
......
...@@ -319,6 +319,8 @@ config PRINTER ...@@ -319,6 +319,8 @@ config PRINTER
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/video/Kconfig" source "drivers/video/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
......
...@@ -521,6 +521,8 @@ config WATCHDOG_RIO ...@@ -521,6 +521,8 @@ config WATCHDOG_RIO
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/video/Kconfig" source "drivers/video/Kconfig"
source "drivers/serial/Kconfig" source "drivers/serial/Kconfig"
......
...@@ -171,6 +171,8 @@ endmenu ...@@ -171,6 +171,8 @@ endmenu
source "init/Kconfig" source "init/Kconfig"
source "drivers/base/Kconfig"
source "arch/um/Kconfig_char" source "arch/um/Kconfig_char"
source "arch/um/Kconfig_block" source "arch/um/Kconfig_block"
......
...@@ -249,6 +249,8 @@ endmenu ...@@ -249,6 +249,8 @@ endmenu
############################################################################# #############################################################################
source "drivers/base/Kconfig"
source drivers/mtd/Kconfig source drivers/mtd/Kconfig
source drivers/parport/Kconfig source drivers/parport/Kconfig
......
...@@ -397,6 +397,8 @@ config UID16 ...@@ -397,6 +397,8 @@ config UID16
endmenu endmenu
source "drivers/base/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig" source "drivers/parport/Kconfig"
......
menu "Generic Driver Options"
config FW_LOADER
tristate "Hotplug firmware loading support"
---help---
This option is provided for the case where no in-kernel-tree modules
require hotplug firmware loading support, but a module built outside
the kernel tree does.
endmenu
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
obj-y := core.o sys.o interface.o power.o bus.o \ obj-y := core.o sys.o interface.o power.o bus.o \
driver.o class.o platform.o \ driver.o class.o platform.o \
cpu.o firmware.o init.o map.o cpu.o firmware.o init.o map.o
obj-$(CONFIG_FW_LOADER) += firmware_class.o
obj-$(CONFIG_NUMA) += node.o memblk.o obj-$(CONFIG_NUMA) += node.o memblk.o
This diff is collapsed.
...@@ -74,6 +74,8 @@ void sysdev_remove_file(struct sys_device * s, struct sysdev_attribute * a) ...@@ -74,6 +74,8 @@ void sysdev_remove_file(struct sys_device * s, struct sysdev_attribute * a)
sysfs_remove_file(&s->kobj,&a->attr); sysfs_remove_file(&s->kobj,&a->attr);
} }
EXPORT_SYMBOL(sysdev_create_file);
EXPORT_SYMBOL(sysdev_remove_file);
/* /*
* declare system_subsys * declare system_subsys
...@@ -171,6 +173,9 @@ int sys_device_register(struct sys_device * sysdev) ...@@ -171,6 +173,9 @@ int sys_device_register(struct sys_device * sysdev)
/* Make sure the kset is set */ /* Make sure the kset is set */
sysdev->kobj.kset = &cls->kset; sysdev->kobj.kset = &cls->kset;
/* But make sure we point to the right type for sysfs translation */
sysdev->kobj.ktype = &ktype_sysdev;
/* set the kobject name */ /* set the kobject name */
snprintf(sysdev->kobj.name,KOBJ_NAME_LEN,"%s%d", snprintf(sysdev->kobj.name,KOBJ_NAME_LEN,"%s%d",
cls->kset.kobj.name,sysdev->id); cls->kset.kobj.name,sysdev->id);
...@@ -218,9 +223,6 @@ void sys_device_unregister(struct sys_device * sysdev) ...@@ -218,9 +223,6 @@ void sys_device_unregister(struct sys_device * sysdev)
if (drv->remove) if (drv->remove)
drv->remove(sysdev); drv->remove(sysdev);
} }
list_del_init(&sysdev->entry);
up_write(&system_subsys.rwsem); up_write(&system_subsys.rwsem);
kobject_unregister(&sysdev->kobj); kobject_unregister(&sysdev->kobj);
......
...@@ -6,4 +6,4 @@ obj-$(CONFIG_ISDN_DRV_ACT2000) += act2000.o ...@@ -6,4 +6,4 @@ obj-$(CONFIG_ISDN_DRV_ACT2000) += act2000.o
# Multipart objects. # Multipart objects.
act2000-objs := module.o capi.o act2000_isa.o act2000-y := module.o capi.o act2000_isa.o
...@@ -13,4 +13,3 @@ obj-$(CONFIG_ISDN_CAPI_CAPIFS) += capifs.o ...@@ -13,4 +13,3 @@ obj-$(CONFIG_ISDN_CAPI_CAPIFS) += capifs.o
kernelcapi-y := kcapi.o capiutil.o capilib.o kernelcapi-y := kcapi.o capiutil.o capilib.o
kernelcapi-$(CONFIG_PROC_FS) += kcapi_proc.o kernelcapi-$(CONFIG_PROC_FS) += kcapi_proc.o
kernelcapi-objs := $(kernelcapi-y)
...@@ -6,4 +6,4 @@ obj-$(CONFIG_ISDN_DIVERSION) += dss1_divert.o ...@@ -6,4 +6,4 @@ obj-$(CONFIG_ISDN_DIVERSION) += dss1_divert.o
# Multipart objects. # Multipart objects.
dss1_divert-objs := isdn_divert.o divert_procfs.o divert_init.o dss1_divert-y := isdn_divert.o divert_procfs.o divert_init.o
...@@ -7,15 +7,13 @@ obj-$(CONFIG_ISDN_DRV_EICON_DIVAS) += divas.o ...@@ -7,15 +7,13 @@ obj-$(CONFIG_ISDN_DRV_EICON_DIVAS) += divas.o
# Multipart objects. # Multipart objects.
eicon-objs := eicon_mod.o eicon_isa.o eicon_pci.o eicon_idi.o \ eicon-y := eicon_mod.o eicon_isa.o eicon_pci.o \
eicon_io.o eicon_idi.o eicon_io.o
divas-objs := common.o idi.o bri.o pri.o log.o xlog.o kprintf.o fpga.o \ eicon-$(CONFIG_ISDN_DRV_EICON_PCI) += common.o idi.o bri.o pri.o log.o \
fourbri.o lincfg.o linchr.o linsys.o linio.o Divas_mod.o xlog.o kprintf.o fpga.o fourbri.o lincfg.o \
linchr.o linsys.o linio.o
# Optional parts of multipart objects. divas-y := common.o idi.o bri.o pri.o log.o xlog.o \
kprintf.o fpga.o fourbri.o lincfg.o \
linchr.o linsys.o linio.o Divas_mod.o
eicon-objs-$(CONFIG_ISDN_DRV_EICON_PCI) += common.o idi.o bri.o pri.o log.o \
xlog.o kprintf.o fpga.o fourbri.o lincfg.o linchr.o \
linsys.o linio.o
eicon-objs += $(eicon-objs-y)
...@@ -123,7 +123,7 @@ eicon_isa_find_card(int Mem, int Irq, char * Id) ...@@ -123,7 +123,7 @@ eicon_isa_find_card(int Mem, int Irq, char * Id)
int int
eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb) { eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb) {
int tmp; int tmp;
int timeout; unsigned long timeout;
eicon_isa_codebuf cbuf; eicon_isa_codebuf cbuf;
unsigned char *code; unsigned char *code;
eicon_isa_boot *boot; eicon_isa_boot *boot;
...@@ -300,7 +300,7 @@ int ...@@ -300,7 +300,7 @@ int
eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) { eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) {
eicon_isa_boot *boot; eicon_isa_boot *boot;
int tmp; int tmp;
int timeout; unsigned long timeout;
int j; int j;
eicon_isa_codebuf cbuf; eicon_isa_codebuf cbuf;
unsigned char *code; unsigned char *code;
......
...@@ -239,6 +239,7 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev) ...@@ -239,6 +239,7 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev)
goto err_unmap; goto err_unmap;
} }
cinfo->capi_ctrl.owner = THIS_MODULE;
cinfo->capi_ctrl.driver_name = "b1pciv4"; cinfo->capi_ctrl.driver_name = "b1pciv4";
cinfo->capi_ctrl.driverdata = cinfo; cinfo->capi_ctrl.driverdata = cinfo;
cinfo->capi_ctrl.register_appl = b1dma_register_appl; cinfo->capi_ctrl.register_appl = b1dma_register_appl;
...@@ -249,7 +250,6 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev) ...@@ -249,7 +250,6 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev)
cinfo->capi_ctrl.procinfo = b1pciv4_procinfo; cinfo->capi_ctrl.procinfo = b1pciv4_procinfo;
cinfo->capi_ctrl.ctr_read_proc = b1dmactl_read_proc; cinfo->capi_ctrl.ctr_read_proc = b1dmactl_read_proc;
strcpy(cinfo->capi_ctrl.name, card->name); strcpy(cinfo->capi_ctrl.name, card->name);
cinfo->capi_ctrl.owner = THIS_MODULE;
retval = attach_capi_ctr(&cinfo->capi_ctrl); retval = attach_capi_ctr(&cinfo->capi_ctrl);
if (retval) { if (retval) {
......
...@@ -95,6 +95,7 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq, ...@@ -95,6 +95,7 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq,
b1_reset(card->port); b1_reset(card->port);
b1_getrevision(card); b1_getrevision(card);
cinfo->capi_ctrl.owner = THIS_MODULE;
cinfo->capi_ctrl.driver_name = "b1pcmcia"; cinfo->capi_ctrl.driver_name = "b1pcmcia";
cinfo->capi_ctrl.driverdata = cinfo; cinfo->capi_ctrl.driverdata = cinfo;
cinfo->capi_ctrl.register_appl = b1_register_appl; cinfo->capi_ctrl.register_appl = b1_register_appl;
...@@ -105,7 +106,6 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq, ...@@ -105,7 +106,6 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq,
cinfo->capi_ctrl.procinfo = b1pcmcia_procinfo; cinfo->capi_ctrl.procinfo = b1pcmcia_procinfo;
cinfo->capi_ctrl.ctr_read_proc = b1ctl_read_proc; cinfo->capi_ctrl.ctr_read_proc = b1ctl_read_proc;
strcpy(cinfo->capi_ctrl.name, card->name); strcpy(cinfo->capi_ctrl.name, card->name);
cinfo->capi_ctrl.owner = THIS_MODULE;
retval = attach_capi_ctr(&cinfo->capi_ctrl); retval = attach_capi_ctr(&cinfo->capi_ctrl);
if (retval) { if (retval) {
......
...@@ -109,6 +109,7 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev) ...@@ -109,6 +109,7 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev)
goto err_unmap; goto err_unmap;
} }
cinfo->capi_ctrl.owner = THIS_MODULE;
cinfo->capi_ctrl.driver_name = "t1pci"; cinfo->capi_ctrl.driver_name = "t1pci";
cinfo->capi_ctrl.driverdata = cinfo; cinfo->capi_ctrl.driverdata = cinfo;
cinfo->capi_ctrl.register_appl = b1dma_register_appl; cinfo->capi_ctrl.register_appl = b1dma_register_appl;
...@@ -119,7 +120,6 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev) ...@@ -119,7 +120,6 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev)
cinfo->capi_ctrl.procinfo = t1pci_procinfo; cinfo->capi_ctrl.procinfo = t1pci_procinfo;
cinfo->capi_ctrl.ctr_read_proc = b1dmactl_read_proc; cinfo->capi_ctrl.ctr_read_proc = b1dmactl_read_proc;
strcpy(cinfo->capi_ctrl.name, card->name); strcpy(cinfo->capi_ctrl.name, card->name);
cinfo->capi_ctrl.owner = THIS_MODULE;
retval = attach_capi_ctr(&cinfo->capi_ctrl); retval = attach_capi_ctr(&cinfo->capi_ctrl);
if (retval) { if (retval) {
......
# Makefile for the Eicon DIVA ISDN drivers. # Makefile for the Eicon DIVA ISDN drivers.
# Multipart objects.
divas-objs := divasmain.o divasfunc.o di.o io.o istream.o diva.o dlist.o divasproc.o diva_dma.o
divacapi-objs := capimain.o capifunc.o message.o capidtmf.o
divadidd-objs := diva_didd.o diddfunc.o dadapter.o
diva_mnt-objs := divamnt.o mntfunc.o debug.o maintidi.o
diva_idi-objs := divasi.o idifunc.o um_idi.o dqueue.o dlist.o
# Optional parts of multipart objects.
divas-objs-$(CONFIG_ISDN_DIVAS_BRIPCI) += os_bri.o s_bri.o
divas-objs-$(CONFIG_ISDN_DIVAS_4BRIPCI) += os_4bri.o s_4bri.o
divas-objs-$(CONFIG_ISDN_DIVAS_PRIPCI) += os_pri.o s_pri.o
divas-objs += $(sort $(divas-objs-y))
# Each configuration option enables a list of files. # Each configuration option enables a list of files.
obj-$(CONFIG_ISDN_DIVAS) += divadidd.o divas.o obj-$(CONFIG_ISDN_DIVAS) += divadidd.o divas.o
obj-$(CONFIG_ISDN_DIVAS_MAINT) += diva_mnt.o obj-$(CONFIG_ISDN_DIVAS_MAINT) += diva_mnt.o
obj-$(CONFIG_ISDN_DIVAS_USERIDI) += diva_idi.o obj-$(CONFIG_ISDN_DIVAS_USERIDI) += diva_idi.o
obj-$(CONFIG_ISDN_DIVAS_DIVACAPI) += divacapi.o obj-$(CONFIG_ISDN_DIVAS_DIVACAPI) += divacapi.o
# Multipart objects.
divas-y := divasmain.o divasfunc.o di.o io.o istream.o \
diva.o dlist.o divasproc.o diva_dma.o
divas-$(CONFIG_ISDN_DIVAS_BRIPCI) += os_bri.o s_bri.o
divas-$(CONFIG_ISDN_DIVAS_4BRIPCI) += os_4bri.o s_4bri.o
divas-$(CONFIG_ISDN_DIVAS_PRIPCI) += os_pri.o s_pri.o
divacapi-y := capimain.o capifunc.o message.o capidtmf.o
divadidd-y := diva_didd.o diddfunc.o dadapter.o
diva_mnt-y := divamnt.o mntfunc.o debug.o maintidi.o
diva_idi-y := divasi.o idifunc.o um_idi.o dqueue.o dlist.o
...@@ -17,47 +17,45 @@ obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_hfcpci.o ...@@ -17,47 +17,45 @@ obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_hfcpci.o
# Multipart objects. # Multipart objects.
hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o \ hisax_st5481-y := st5481_init.o st5481_usb.o st5481_d.o \
st5481_hdlc.o st5481_b.o st5481_hdlc.o
hisax-objs := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \
lmgr.o q931.o callc.o fsm.o cert.o
# Optional parts of multipart objects. hisax-y := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \
hisax-objs-$(CONFIG_HISAX_EURO) += l3dss1.o lmgr.o q931.o callc.o fsm.o cert.o
hisax-objs-$(CONFIG_HISAX_NI1) += l3ni1.o hisax-$(CONFIG_HISAX_EURO) += l3dss1.o
hisax-objs-$(CONFIG_HISAX_1TR6) += l3_1tr6.o hisax-$(CONFIG_HISAX_NI1) += l3ni1.o
hisax-$(CONFIG_HISAX_1TR6) += l3_1tr6.o
hisax-objs-$(CONFIG_HISAX_16_0) += teles0.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_16_3) += teles3.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_16_0) += teles0.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_TELESPCI) += telespci.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_16_3) += teles3.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_S0BOX) += s0box.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_TELESPCI) += telespci.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_AVM_A1) += avm_a1.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_S0BOX) += s0box.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_AVM_A1_PCMCIA) += avm_a1p.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_AVM_A1) += avm_a1.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o hisax-$(CONFIG_HISAX_AVM_A1_PCMCIA) += avm_a1p.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o ipac.o hisax-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o
hisax-objs-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o ipac.o
hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipac.o ipacx.o hisax-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o ipac.o hisax-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipac.o ipacx.o
hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o hisax-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o ipac.o
hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o ipac.o isar.o hisax-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o
hisax-objs-$(CONFIG_HISAX_SPORTSTER) += sportster.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o ipac.o \
hisax-objs-$(CONFIG_HISAX_MIC) += mic.o isac.o arcofi.o hscx.o isar.o
hisax-objs-$(CONFIG_HISAX_NETJET) += nj_s.o netjet.o isac.o arcofi.o hisax-$(CONFIG_HISAX_SPORTSTER) += sportster.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_NETJET_U) += nj_u.o netjet.o icc.o hisax-$(CONFIG_HISAX_MIC) += mic.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_HFCS) += hfcscard.o hfc_2bds0.o hisax-$(CONFIG_HISAX_NETJET) += nj_s.o netjet.o isac.o arcofi.o
hisax-objs-$(CONFIG_HISAX_HFC_PCI) += hfc_pci.o hisax-$(CONFIG_HISAX_NETJET_U) += nj_u.o netjet.o icc.o
hisax-objs-$(CONFIG_HISAX_HFC_SX) += hfc_sx.o hisax-$(CONFIG_HISAX_HFCS) += hfcscard.o hfc_2bds0.o
hisax-objs-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_HFC_PCI) += hfc_pci.o
hisax-objs-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o hisax-$(CONFIG_HISAX_HFC_SX) += hfc_sx.o
hisax-objs-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_BKM_A4T) += bkm_a4t.o isac.o arcofi.o jade.o hisax-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o
hisax-objs-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o ipac.o hisax-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o ipac.o hisax-$(CONFIG_HISAX_BKM_A4T) += bkm_a4t.o isac.o arcofi.o jade.o
hisax-objs-$(CONFIG_HISAX_W6692) += w6692.o hisax-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o ipac.o
hisax-objs-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o hisax-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o ipac.o
#hisax-objs-$(CONFIG_HISAX_TESTEMU) += testemu.o hisax-$(CONFIG_HISAX_W6692) += w6692.o
hisax-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o
hisax-objs += $(hisax-objs-y) #hisax-$(CONFIG_HISAX_TESTEMU) += testemu.o
CERT := $(shell cd $(src); md5sum -c md5sums.asc > /dev/null 2> /dev/null ;echo $$?) CERT := $(shell cd $(src); md5sum -c md5sums.asc > /dev/null 2> /dev/null ;echo $$?)
CFLAGS_cert.o := -DCERTIFICATION=$(CERT) CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
...@@ -153,6 +153,8 @@ static dev_link_t *avma1cs_attach(void) ...@@ -153,6 +153,8 @@ static dev_link_t *avma1cs_attach(void)
/* Initialize the dev_link_t structure */ /* Initialize the dev_link_t structure */
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
if (!link)
return NULL;
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
link->release.function = &avma1cs_release; link->release.function = &avma1cs_release;
link->release.data = (u_long)link; link->release.data = (u_long)link;
...@@ -186,6 +188,10 @@ static dev_link_t *avma1cs_attach(void) ...@@ -186,6 +188,10 @@ static dev_link_t *avma1cs_attach(void)
/* Allocate space for private device-specific data */ /* Allocate space for private device-specific data */
local = kmalloc(sizeof(local_info_t), GFP_KERNEL); local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
if (!local) {
kfree(link);
return NULL;
}
memset(local, 0, sizeof(local_info_t)); memset(local, 0, sizeof(local_info_t));
link->priv = local; link->priv = local;
......
...@@ -6,11 +6,6 @@ obj-$(CONFIG_HYSDN) += hysdn.o ...@@ -6,11 +6,6 @@ obj-$(CONFIG_HYSDN) += hysdn.o
# Multipart objects. # Multipart objects.
hysdn-objs := hysdn_procconf.o hysdn_proclog.o boardergo.o hysdn_boot.o \ hysdn-y := hysdn_procconf.o hysdn_proclog.o boardergo.o \
hysdn_sched.o hysdn_net.o hysdn_init.o hysdn_boot.o hysdn_sched.o hysdn_net.o hysdn_init.o
hysdn-$(CONFIG_HYSDN_CAPI) += hycapi.o
# Optional parts of multipart objects.
hysdn-objs-$(CONFIG_HYSDN_CAPI) += hycapi.o
hysdn-objs += $(hysdn-objs-y)
...@@ -98,7 +98,8 @@ put_log_buffer(hysdn_card * card, char *cp) ...@@ -98,7 +98,8 @@ put_log_buffer(hysdn_card * card, char *cp)
{ {
struct log_data *ib; struct log_data *ib;
struct procdata *pd = card->proclog; struct procdata *pd = card->proclog;
int i, flags; int i;
unsigned long flags;
if (!pd) if (!pd)
return; return;
...@@ -300,7 +301,8 @@ hysdn_log_close(struct inode *ino, struct file *filep) ...@@ -300,7 +301,8 @@ hysdn_log_close(struct inode *ino, struct file *filep)
struct log_data *inf; struct log_data *inf;
struct procdata *pd; struct procdata *pd;
hysdn_card *card; hysdn_card *card;
int flags, retval = 0; int retval = 0;
unsigned long flags;
lock_kernel(); lock_kernel();
......
...@@ -7,20 +7,13 @@ obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o ...@@ -7,20 +7,13 @@ obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o
# Multipart objects. # Multipart objects.
isdn-objs := isdn_net_lib.o \ isdn-y := isdn_net_lib.o isdn_fsm.o isdn_tty.o \
isdn_fsm.o \ isdn_v110.o isdn_common.o
isdn_tty.o isdn_v110.o \ isdn-$(CONFIG_ISDN_NET_SIMPLE) += isdn_net.o
isdn_common.o \ isdn-$(CONFIG_ISDN_NET_CISCO) += isdn_ciscohdlck.o
isdn-$(CONFIG_ISDN_PPP) += isdn_ppp.o isdn_ppp_ccp.o
# Optional parts of multipart objects. isdn-$(CONFIG_ISDN_PPP_VJ) += isdn_ppp_vj.o
isdn-$(CONFIG_ISDN_MPP) += isdn_ppp_mp.o
isdn-objs-$(CONFIG_ISDN_NET_SIMPLE) += isdn_net.o isdn-$(CONFIG_ISDN_X25) += isdn_concap.o isdn_x25iface.o
isdn-objs-$(CONFIG_ISDN_NET_CISCO) += isdn_ciscohdlck.o isdn-$(CONFIG_ISDN_AUDIO) += isdn_audio.o
isdn-objs-$(CONFIG_ISDN_PPP) += isdn_ppp.o isdn_ppp_ccp.o isdn-$(CONFIG_ISDN_TTY_FAX) += isdn_ttyfax.o
isdn-objs-$(CONFIG_ISDN_PPP_VJ) += isdn_ppp_vj.o
isdn-objs-$(CONFIG_ISDN_MPP) += isdn_ppp_mp.o
isdn-objs-$(CONFIG_ISDN_X25) += isdn_concap.o isdn_x25iface.o
isdn-objs-$(CONFIG_ISDN_AUDIO) += isdn_audio.o
isdn-objs-$(CONFIG_ISDN_TTY_FAX) += isdn_ttyfax.o
isdn-objs += $(isdn-objs-y)
...@@ -300,7 +300,6 @@ static void bsd_free (void *state) ...@@ -300,7 +300,6 @@ static void bsd_free (void *state)
* Finally release the structure itself. * Finally release the structure itself.
*/ */
kfree (db); kfree (db);
MOD_DEC_USE_COUNT;
} }
} }
...@@ -355,8 +354,6 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data) ...@@ -355,8 +354,6 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data)
return NULL; return NULL;
} }
MOD_INC_USE_COUNT;
/* /*
* If this is the compression buffer then there is no length data. * If this is the compression buffer then there is no length data.
* For decompression, the length information is needed as well. * For decompression, the length information is needed as well.
...@@ -907,6 +904,7 @@ static int bsd_decompress (void *state, struct sk_buff *skb_in, struct sk_buff * ...@@ -907,6 +904,7 @@ static int bsd_decompress (void *state, struct sk_buff *skb_in, struct sk_buff *
*************************************************************/ *************************************************************/
static struct isdn_ppp_compressor ippp_bsd_compress = { static struct isdn_ppp_compressor ippp_bsd_compress = {
.owner = THIS_MODULE,
.num = CI_BSD_COMPRESS, .num = CI_BSD_COMPRESS,
.alloc = bsd_alloc, .alloc = bsd_alloc,
.free = bsd_free, .free = bsd_free,
......
...@@ -259,11 +259,14 @@ ippp_ccp_free(struct ippp_ccp *ccp) ...@@ -259,11 +259,14 @@ ippp_ccp_free(struct ippp_ccp *ccp)
{ {
int id; int id;
if (ccp->comp_stat) if (ccp->comp_stat) {
ccp->compressor->free(ccp->comp_stat); ccp->compressor->free(ccp->comp_stat);
if (ccp->decomp_stat) module_put(ccp->compressor->owner);
}
if (ccp->decomp_stat) {
ccp->decompressor->free(ccp->decomp_stat); ccp->decompressor->free(ccp->decomp_stat);
module_put(ccp->decompressor->owner);
}
for (id = 0; id < 256; id++) { for (id = 0; id < 256; id++) {
if (ccp->reset->rs[id]) if (ccp->reset->rs[id])
ippp_ccp_reset_free_state(ccp, id); ippp_ccp_reset_free_state(ccp, id);
...@@ -553,13 +556,14 @@ ippp_ccp_send_ccp(struct ippp_ccp *ccp, struct sk_buff *skb) ...@@ -553,13 +556,14 @@ ippp_ccp_send_ccp(struct ippp_ccp *ccp, struct sk_buff *skb)
} }
} }
static struct isdn_ppp_compressor *ipc_head = NULL; static LIST_HEAD(ipc_head);
static spinlock_t ipc_head_lock;
int int
ippp_ccp_set_compressor(struct ippp_ccp *ccp, int unit, ippp_ccp_set_compressor(struct ippp_ccp *ccp, int unit,
struct isdn_ppp_comp_data *data) struct isdn_ppp_comp_data *data)
{ {
struct isdn_ppp_compressor *ipc = ipc_head; struct isdn_ppp_compressor *ipc;
int ret; int ret;
void *stat; void *stat;
int num = data->num; int num = data->num;
...@@ -568,34 +572,48 @@ ippp_ccp_set_compressor(struct ippp_ccp *ccp, int unit, ...@@ -568,34 +572,48 @@ ippp_ccp_set_compressor(struct ippp_ccp *ccp, int unit,
printk(KERN_DEBUG "[%d] Set %scompressor type %d\n", unit, printk(KERN_DEBUG "[%d] Set %scompressor type %d\n", unit,
data->flags & IPPP_COMP_FLAG_XMIT ? "" : "de", num); data->flags & IPPP_COMP_FLAG_XMIT ? "" : "de", num);
for (ipc = ipc_head; ipc; ipc = ipc->next) { spin_lock(&ipc_head_lock);
if (ipc->num != num) list_for_each_entry(ipc, &ipc_head, list) {
continue; if (ipc->num == num &&
try_module_get(ipc->owner))
goto found;
}
spin_unlock(&ipc_head_lock);
return -EINVAL;
found:
spin_unlock(&ipc_head_lock);
stat = ipc->alloc(data); stat = ipc->alloc(data);
if (!stat) { if (!stat) {
printk(KERN_ERR "Can't alloc (de)compression!\n"); printk(KERN_ERR "Can't alloc (de)compression!\n");
break; goto err;
} }
ret = ipc->init(stat, data, unit, 0); ret = ipc->init(stat, data, unit, 0);
if(!ret) { if(!ret) {
printk(KERN_ERR "Can't init (de)compression!\n"); printk(KERN_ERR "Can't init (de)compression!\n");
ipc->free(stat); ipc->free(stat);
break; goto err;
} }
if (data->flags & IPPP_COMP_FLAG_XMIT) { if (data->flags & IPPP_COMP_FLAG_XMIT) {
if (ccp->comp_stat) if (ccp->comp_stat) {
ccp->compressor->free(ccp->comp_stat); ccp->compressor->free(ccp->comp_stat);
module_put(ccp->compressor->owner);
}
ccp->comp_stat = stat; ccp->comp_stat = stat;
ccp->compressor = ipc; ccp->compressor = ipc;
} else { } else {
if (ccp->decomp_stat) if (ccp->decomp_stat) {
ccp->decompressor->free(ccp->decomp_stat); ccp->decompressor->free(ccp->decomp_stat);
module_put(ccp->decompressor->owner);
}
ccp->decomp_stat = stat; ccp->decomp_stat = stat;
ccp->decompressor = ipc; ccp->decompressor = ipc;
} }
return 0; return 0;
}
err:
module_put(ipc->owner);
return -EINVAL; return -EINVAL;
} }
...@@ -606,36 +624,34 @@ ippp_ccp_get_compressors(unsigned long protos[8]) ...@@ -606,36 +624,34 @@ ippp_ccp_get_compressors(unsigned long protos[8])
int i, j; int i, j;
memset(protos, 0, sizeof(unsigned long) * 8); memset(protos, 0, sizeof(unsigned long) * 8);
for (ipc = ipc_head; ipc; ipc = ipc->next) {
spin_lock(&ipc_head_lock);
list_for_each_entry(ipc, &ipc_head, list) {
j = ipc->num / (sizeof(long)*8); j = ipc->num / (sizeof(long)*8);
i = ipc->num % (sizeof(long)*8); i = ipc->num % (sizeof(long)*8);
if (j < 8) if (j < 8)
protos[j] |= 1 << i; protos[j] |= 1 << i;
} }
spin_unlock(&ipc_head_lock);
} }
int int
isdn_ppp_register_compressor(struct isdn_ppp_compressor *ipc) isdn_ppp_register_compressor(struct isdn_ppp_compressor *ipc)
{ {
ipc->next = ipc_head; spin_lock(&ipc_head_lock);
ipc->prev = NULL; list_add_tail(&ipc->list, &ipc_head);
if (ipc_head) { spin_unlock(&ipc_head_lock);
ipc_head->prev = ipc;
}
ipc_head = ipc;
return 0; return 0;
} }
int int
isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *ipc) isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *ipc)
{ {
if (ipc->prev) spin_lock(&ipc_head_lock);
ipc->prev->next = ipc->next; list_del(&ipc->list);
else spin_unlock(&ipc_head_lock);
ipc_head = ipc->next;
if (ipc->next)
ipc->next->prev = ipc->prev;
ipc->prev = ipc->next = NULL;
return 0; return 0;
} }
...@@ -1983,7 +1983,7 @@ modem_write_profile(atemu * m) ...@@ -1983,7 +1983,7 @@ modem_write_profile(atemu * m)
memcpy(m->pmsn, m->msn, ISDN_MSNLEN); memcpy(m->pmsn, m->msn, ISDN_MSNLEN);
memcpy(m->plmsn, m->lmsn, ISDN_LMSNLEN); memcpy(m->plmsn, m->lmsn, ISDN_LMSNLEN);
if (dev->profd) if (dev->profd)
group_send_sig_info(SIGIO, SEND_SIG_PRIV, dev->profd); kill_pg_info(SIGIO, SEND_SIG_PRIV, dev->profd->pgrp);
} }
static struct tty_operations modem_ops = { static struct tty_operations modem_ops = {
...@@ -2095,11 +2095,10 @@ isdn_tty_init(void) ...@@ -2095,11 +2095,10 @@ isdn_tty_init(void)
#endif #endif
kfree(info->xmit_buf - 4); kfree(info->xmit_buf - 4);
} }
err_unregister_tty: tty_unregister_driver(m->tty_modem);
tty_unregister_driver(&isdn_mdm->tty_modem);
err: err:
put_tty_driver(&isdn_mdm->tty_modem); put_tty_driver(m->tty_modem);
isdn_mdm->tty_modem = NULL; m->tty_modem = NULL;
return retval; return retval;
} }
...@@ -2118,9 +2117,9 @@ isdn_tty_exit(void) ...@@ -2118,9 +2117,9 @@ isdn_tty_exit(void)
#endif #endif
kfree(info->xmit_buf - 4); kfree(info->xmit_buf - 4);
} }
tty_unregister_driver(&isdn_mdm->tty_modem); tty_unregister_driver(isdn_mdm.tty_modem);
put_tty_driver(&isdn_mdm->tty_modem); put_tty_driver(isdn_mdm.tty_modem);
isdn_mdm->tty_modem = NULL; isdn_mdm.tty_modem = NULL;
} }
/* /*
......
...@@ -303,7 +303,7 @@ isdn_tty_cmd_FCLASS1(char **p, modem_info * info) ...@@ -303,7 +303,7 @@ isdn_tty_cmd_FCLASS1(char **p, modem_info * info)
isdn_ctrl c; isdn_ctrl c;
int par; int par;
struct isdn_slot *slot; struct isdn_slot *slot;
long flags; unsigned long flags;
for (c.parm.aux.cmd = 0; c.parm.aux.cmd < 7; c.parm.aux.cmd++) for (c.parm.aux.cmd = 0; c.parm.aux.cmd < 7; c.parm.aux.cmd++)
if (!strncmp(p[0], cmd[c.parm.aux.cmd], 2)) if (!strncmp(p[0], cmd[c.parm.aux.cmd], 2))
......
#
# Makefile for the isdnloop ISDN device driver # Makefile for the isdnloop ISDN device driver
#
# Each configuration option enables a list of files. # Each configuration option enables a list of files.
......
...@@ -6,4 +6,4 @@ obj-$(CONFIG_ISDN_DRV_PCBIT) += pcbit.o ...@@ -6,4 +6,4 @@ obj-$(CONFIG_ISDN_DRV_PCBIT) += pcbit.o
# Multipart objects. # Multipart objects.
pcbit-objs := module.o edss1.o drv.o layer2.o capi.o callbacks.o pcbit-y := module.o edss1.o drv.o layer2.o capi.o callbacks.o
...@@ -6,5 +6,5 @@ obj-$(CONFIG_ISDN_DRV_SC) += sc.o ...@@ -6,5 +6,5 @@ obj-$(CONFIG_ISDN_DRV_SC) += sc.o
# Multipart objects. # Multipart objects.
sc-objs := shmem.o init.o debug.o packet.o command.o event.o \ sc-y := shmem.o init.o debug.o packet.o command.o event.o \
ioctl.o interrupt.o message.o timer.o ioctl.o interrupt.o message.o timer.o
...@@ -6,5 +6,6 @@ obj-$(CONFIG_ISDN_DRV_TPAM) += tpam.o ...@@ -6,5 +6,6 @@ obj-$(CONFIG_ISDN_DRV_TPAM) += tpam.o
# Multipart objects. # Multipart objects.
tpam-objs := tpam_main.o tpam_nco.o tpam_memory.o tpam_commands.o \ tpam-y := tpam_main.o tpam_nco.o tpam_memory.o \
tpam_queues.o tpam_hdlc.o tpam_crcpc.o tpam_commands.o tpam_queues.o tpam_hdlc.o \
tpam_crcpc.o
...@@ -145,6 +145,7 @@ irqreturn_t tpam_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -145,6 +145,7 @@ irqreturn_t tpam_irq(int irq, void *dev_id, struct pt_regs *regs)
do { do {
hpic = readl(card->bar0 + TPAM_HPIC_REGISTER); hpic = readl(card->bar0 + TPAM_HPIC_REGISTER);
if (waiting_too_long++ > 0xfffffff) { if (waiting_too_long++ > 0xfffffff) {
kfree_skb(skb);
spin_unlock(&card->lock); spin_unlock(&card->lock);
printk(KERN_ERR "TurboPAM(tpam_irq): " printk(KERN_ERR "TurboPAM(tpam_irq): "
"waiting too long...\n"); "waiting too long...\n");
......
...@@ -4,29 +4,11 @@ void *pnp_alloc(long size); ...@@ -4,29 +4,11 @@ void *pnp_alloc(long size);
int pnp_interface_attach_device(struct pnp_dev *dev); int pnp_interface_attach_device(struct pnp_dev *dev);
void pnp_name_device(struct pnp_dev *dev); void pnp_name_device(struct pnp_dev *dev);
void pnp_fixup_device(struct pnp_dev *dev); void pnp_fixup_device(struct pnp_dev *dev);
void pnp_free_resources(struct pnp_resources *resources); void pnp_free_option(struct pnp_option *option);
int __pnp_add_device(struct pnp_dev *dev); int __pnp_add_device(struct pnp_dev *dev);
void __pnp_remove_device(struct pnp_dev *dev); void __pnp_remove_device(struct pnp_dev *dev);
/* resource conflict types */
#define CONFLICT_TYPE_NONE 0x0000 /* there are no conflicts, other than those in the link */
#define CONFLICT_TYPE_RESERVED 0x0001 /* the resource requested was reserved */
#define CONFLICT_TYPE_IN_USE 0x0002 /* there is a conflict because the resource is in use */
#define CONFLICT_TYPE_PCI 0x0004 /* there is a conflict with a pci device */
#define CONFLICT_TYPE_INVALID 0x0008 /* the resource requested is invalid */
#define CONFLICT_TYPE_INTERNAL 0x0010 /* resources within the device conflict with each ohter */
#define CONFLICT_TYPE_PNP_WARM 0x0020 /* there is a conflict with a pnp device that is active */
#define CONFLICT_TYPE_PNP_COLD 0x0040 /* there is a conflict with a pnp device that is disabled */
/* conflict search modes */
#define SEARCH_WARM 1 /* check for conflicts with active devices */
#define SEARCH_COLD 0 /* check for conflicts with disabled devices */
struct pnp_dev * pnp_check_port_conflicts(struct pnp_dev * dev, int idx, int mode);
int pnp_check_port(struct pnp_dev * dev, int idx); int pnp_check_port(struct pnp_dev * dev, int idx);
struct pnp_dev * pnp_check_mem_conflicts(struct pnp_dev * dev, int idx, int mode);
int pnp_check_mem(struct pnp_dev * dev, int idx); int pnp_check_mem(struct pnp_dev * dev, int idx);
struct pnp_dev * pnp_check_irq_conflicts(struct pnp_dev * dev, int idx, int mode);
int pnp_check_irq(struct pnp_dev * dev, int idx); int pnp_check_irq(struct pnp_dev * dev, int idx);
struct pnp_dev * pnp_check_dma_conflicts(struct pnp_dev * dev, int idx, int mode);
int pnp_check_dma(struct pnp_dev * dev, int idx); int pnp_check_dma(struct pnp_dev * dev, int idx);
...@@ -104,8 +104,8 @@ static void pnp_free_ids(struct pnp_dev *dev) ...@@ -104,8 +104,8 @@ static void pnp_free_ids(struct pnp_dev *dev)
static void pnp_release_device(struct device *dmdev) static void pnp_release_device(struct device *dmdev)
{ {
struct pnp_dev * dev = to_pnp_dev(dmdev); struct pnp_dev * dev = to_pnp_dev(dmdev);
if (dev->possible) pnp_free_option(dev->independent);
pnp_free_resources(dev->possible); pnp_free_option(dev->dependent);
pnp_free_ids(dev); pnp_free_ids(dev);
kfree(dev); kfree(dev);
} }
...@@ -122,7 +122,7 @@ int __pnp_add_device(struct pnp_dev *dev) ...@@ -122,7 +122,7 @@ int __pnp_add_device(struct pnp_dev *dev)
list_add_tail(&dev->global_list, &pnp_global); list_add_tail(&dev->global_list, &pnp_global);
list_add_tail(&dev->protocol_list, &dev->protocol->devices); list_add_tail(&dev->protocol_list, &dev->protocol->devices);
spin_unlock(&pnp_lock); spin_unlock(&pnp_lock);
pnp_auto_config_dev(dev);
ret = device_register(&dev->dev); ret = device_register(&dev->dev);
if (ret == 0) if (ret == 0)
pnp_interface_attach_device(dev); pnp_interface_attach_device(dev);
......
...@@ -168,7 +168,8 @@ static void pnp_print_mem(pnp_info_buffer_t *buffer, char *space, struct pnp_mem ...@@ -168,7 +168,8 @@ static void pnp_print_mem(pnp_info_buffer_t *buffer, char *space, struct pnp_mem
pnp_printf(buffer, ", %s\n", s); pnp_printf(buffer, ", %s\n", s);
} }
static void pnp_print_resources(pnp_info_buffer_t *buffer, char *space, struct pnp_resources *res, int dep) static void pnp_print_option(pnp_info_buffer_t *buffer, char *space,
struct pnp_option *option, int dep)
{ {
char *s; char *s;
struct pnp_port *port; struct pnp_port *port;
...@@ -176,7 +177,8 @@ static void pnp_print_resources(pnp_info_buffer_t *buffer, char *space, struct p ...@@ -176,7 +177,8 @@ static void pnp_print_resources(pnp_info_buffer_t *buffer, char *space, struct p
struct pnp_dma *dma; struct pnp_dma *dma;
struct pnp_mem *mem; struct pnp_mem *mem;
switch (res->priority) { if (dep) {
switch (option->priority) {
case PNP_RES_PRIORITY_PREFERRED: case PNP_RES_PRIORITY_PREFERRED:
s = "preferred"; s = "preferred";
break; break;
...@@ -189,36 +191,41 @@ static void pnp_print_resources(pnp_info_buffer_t *buffer, char *space, struct p ...@@ -189,36 +191,41 @@ static void pnp_print_resources(pnp_info_buffer_t *buffer, char *space, struct p
default: default:
s = "invalid"; s = "invalid";
} }
if (dep > 0)
pnp_printf(buffer, "Dependent: %02i - Priority %s\n",dep, s); pnp_printf(buffer, "Dependent: %02i - Priority %s\n",dep, s);
for (port = res->port; port; port = port->next) }
for (port = option->port; port; port = port->next)
pnp_print_port(buffer, space, port); pnp_print_port(buffer, space, port);
for (irq = res->irq; irq; irq = irq->next) for (irq = option->irq; irq; irq = irq->next)
pnp_print_irq(buffer, space, irq); pnp_print_irq(buffer, space, irq);
for (dma = res->dma; dma; dma = dma->next) for (dma = option->dma; dma; dma = dma->next)
pnp_print_dma(buffer, space, dma); pnp_print_dma(buffer, space, dma);
for (mem = res->mem; mem; mem = mem->next) for (mem = option->mem; mem; mem = mem->next)
pnp_print_mem(buffer, space, mem); pnp_print_mem(buffer, space, mem);
} }
static ssize_t pnp_show_possible_resources(struct device *dmdev, char *buf)
static ssize_t pnp_show_options(struct device *dmdev, char *buf)
{ {
struct pnp_dev *dev = to_pnp_dev(dmdev); struct pnp_dev *dev = to_pnp_dev(dmdev);
struct pnp_resources * res = dev->possible; struct pnp_option * independent = dev->independent;
int ret, dep = 0; struct pnp_option * dependent = dev->dependent;
int ret, dep = 1;
pnp_info_buffer_t *buffer = (pnp_info_buffer_t *) pnp_info_buffer_t *buffer = (pnp_info_buffer_t *)
pnp_alloc(sizeof(pnp_info_buffer_t)); pnp_alloc(sizeof(pnp_info_buffer_t));
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
buffer->len = PAGE_SIZE; buffer->len = PAGE_SIZE;
buffer->buffer = buf; buffer->buffer = buf;
buffer->curr = buffer->buffer; buffer->curr = buffer->buffer;
while (res){ if (independent)
if (dep == 0) pnp_print_option(buffer, "", independent, 0);
pnp_print_resources(buffer, "", res, dep);
else while (dependent){
pnp_print_resources(buffer, " ", res, dep); pnp_print_option(buffer, " ", dependent, dep);
res = res->dep; dependent = dependent->next;
dep++; dep++;
} }
ret = (buffer->curr - buf); ret = (buffer->curr - buf);
...@@ -226,97 +233,8 @@ static ssize_t pnp_show_possible_resources(struct device *dmdev, char *buf) ...@@ -226,97 +233,8 @@ static ssize_t pnp_show_possible_resources(struct device *dmdev, char *buf)
return ret; return ret;
} }
static DEVICE_ATTR(possible,S_IRUGO,pnp_show_possible_resources,NULL); static DEVICE_ATTR(options,S_IRUGO,pnp_show_options,NULL);
static void pnp_print_conflict_node(pnp_info_buffer_t *buffer, struct pnp_dev * dev)
{
if (!dev)
return;
pnp_printf(buffer, "'%s'.\n", dev->dev.bus_id);
}
static void pnp_print_conflict_desc(pnp_info_buffer_t *buffer, int conflict)
{
if (!conflict)
return;
pnp_printf(buffer, " Conflict Detected: %2x - ", conflict);
switch (conflict) {
case CONFLICT_TYPE_RESERVED:
pnp_printf(buffer, "manually reserved.\n");
break;
case CONFLICT_TYPE_IN_USE:
pnp_printf(buffer, "currently in use.\n");
break;
case CONFLICT_TYPE_PCI:
pnp_printf(buffer, "PCI device.\n");
break;
case CONFLICT_TYPE_INVALID:
pnp_printf(buffer, "invalid.\n");
break;
case CONFLICT_TYPE_INTERNAL:
pnp_printf(buffer, "another resource on this device.\n");
break;
case CONFLICT_TYPE_PNP_WARM:
pnp_printf(buffer, "active PnP device ");
break;
case CONFLICT_TYPE_PNP_COLD:
pnp_printf(buffer, "disabled PnP device ");
break;
default:
pnp_printf(buffer, "Unknown conflict.\n");
break;
}
}
static void pnp_print_conflict(pnp_info_buffer_t *buffer, struct pnp_dev * dev, int idx, int type)
{
struct pnp_dev * cdev, * wdev = NULL;
int conflict;
switch (type) {
case IORESOURCE_IO:
conflict = pnp_check_port(dev, idx);
if (conflict == CONFLICT_TYPE_PNP_WARM)
wdev = pnp_check_port_conflicts(dev, idx, SEARCH_WARM);
cdev = pnp_check_port_conflicts(dev, idx, SEARCH_COLD);
break;
case IORESOURCE_MEM:
conflict = pnp_check_mem(dev, idx);
if (conflict == CONFLICT_TYPE_PNP_WARM)
wdev = pnp_check_mem_conflicts(dev, idx, SEARCH_WARM);
cdev = pnp_check_mem_conflicts(dev, idx, SEARCH_COLD);
break;
case IORESOURCE_IRQ:
conflict = pnp_check_irq(dev, idx);
if (conflict == CONFLICT_TYPE_PNP_WARM)
wdev = pnp_check_irq_conflicts(dev, idx, SEARCH_WARM);
cdev = pnp_check_irq_conflicts(dev, idx, SEARCH_COLD);
break;
case IORESOURCE_DMA:
conflict = pnp_check_dma(dev, idx);
if (conflict == CONFLICT_TYPE_PNP_WARM)
wdev = pnp_check_dma_conflicts(dev, idx, SEARCH_WARM);
cdev = pnp_check_dma_conflicts(dev, idx, SEARCH_COLD);
break;
default:
return;
}
pnp_print_conflict_desc(buffer, conflict);
if (wdev)
pnp_print_conflict_node(buffer, wdev);
if (cdev) {
pnp_print_conflict_desc(buffer, CONFLICT_TYPE_PNP_COLD);
pnp_print_conflict_node(buffer, cdev);
}
}
static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf) static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
{ {
...@@ -332,12 +250,6 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf) ...@@ -332,12 +250,6 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
buffer->buffer = buf; buffer->buffer = buf;
buffer->curr = buffer->buffer; buffer->curr = buffer->buffer;
pnp_printf(buffer,"mode = ");
if (dev->config_mode & PNP_CONFIG_MANUAL)
pnp_printf(buffer,"manual\n");
else
pnp_printf(buffer,"auto\n");
pnp_printf(buffer,"state = "); pnp_printf(buffer,"state = ");
if (dev->active) if (dev->active)
pnp_printf(buffer,"active\n"); pnp_printf(buffer,"active\n");
...@@ -350,7 +262,6 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf) ...@@ -350,7 +262,6 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
pnp_printf(buffer," 0x%lx-0x%lx \n", pnp_printf(buffer," 0x%lx-0x%lx \n",
pnp_port_start(dev, i), pnp_port_start(dev, i),
pnp_port_end(dev, i)); pnp_port_end(dev, i));
pnp_print_conflict(buffer, dev, i, IORESOURCE_IO);
} }
} }
for (i = 0; i < PNP_MAX_MEM; i++) { for (i = 0; i < PNP_MAX_MEM; i++) {
...@@ -359,21 +270,18 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf) ...@@ -359,21 +270,18 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
pnp_printf(buffer," 0x%lx-0x%lx \n", pnp_printf(buffer," 0x%lx-0x%lx \n",
pnp_mem_start(dev, i), pnp_mem_start(dev, i),
pnp_mem_end(dev, i)); pnp_mem_end(dev, i));
pnp_print_conflict(buffer, dev, i, IORESOURCE_MEM);
} }
} }
for (i = 0; i < PNP_MAX_IRQ; i++) { for (i = 0; i < PNP_MAX_IRQ; i++) {
if (pnp_irq_valid(dev, i)) { if (pnp_irq_valid(dev, i)) {
pnp_printf(buffer,"irq"); pnp_printf(buffer,"irq");
pnp_printf(buffer," %ld \n", pnp_irq(dev, i)); pnp_printf(buffer," %ld \n", pnp_irq(dev, i));
pnp_print_conflict(buffer, dev, i, IORESOURCE_IRQ);
} }
} }
for (i = 0; i < PNP_MAX_DMA; i++) { for (i = 0; i < PNP_MAX_DMA; i++) {
if (pnp_dma_valid(dev, i)) { if (pnp_dma_valid(dev, i)) {
pnp_printf(buffer,"dma"); pnp_printf(buffer,"dma");
pnp_printf(buffer," %ld \n", pnp_dma(dev, i)); pnp_printf(buffer," %ld \n", pnp_dma(dev, i));
pnp_print_conflict(buffer, dev, i, IORESOURCE_DMA);
} }
} }
ret = (buffer->curr - buf); ret = (buffer->curr - buf);
...@@ -381,7 +289,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf) ...@@ -381,7 +289,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
return ret; return ret;
} }
extern int pnp_resolve_conflicts(struct pnp_dev *dev); extern struct semaphore pnp_res_mutex;
static ssize_t static ssize_t
pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count) pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count)
...@@ -390,6 +298,12 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count ...@@ -390,6 +298,12 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count
char *buf = (void *)ubuf; char *buf = (void *)ubuf;
int retval = 0; int retval = 0;
if (dev->status & PNP_ATTACHED) {
retval = -EBUSY;
pnp_info("Device %s cannot be configured because it is in use.", dev->dev.bus_id);
goto done;
}
while (isspace(*buf)) while (isspace(*buf))
++buf; ++buf;
if (!strnicmp(buf,"disable",7)) { if (!strnicmp(buf,"disable",7)) {
...@@ -400,41 +314,30 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count ...@@ -400,41 +314,30 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count
retval = pnp_activate_dev(dev); retval = pnp_activate_dev(dev);
goto done; goto done;
} }
if (!strnicmp(buf,"reset",5)) { if (!strnicmp(buf,"fill",4)) {
if (!dev->active) if (dev->active)
goto done;
retval = pnp_disable_dev(dev);
if (retval)
goto done; goto done;
retval = pnp_activate_dev(dev); retval = pnp_auto_config_dev(dev);
goto done; goto done;
} }
if (!strnicmp(buf,"auto",4)) { if (!strnicmp(buf,"auto",4)) {
if (dev->active) if (dev->active)
goto done; goto done;
pnp_init_resources(&dev->res);
retval = pnp_auto_config_dev(dev); retval = pnp_auto_config_dev(dev);
goto done; goto done;
} }
if (!strnicmp(buf,"clear",5)) { if (!strnicmp(buf,"clear",5)) {
if (dev->active) if (dev->active)
goto done; goto done;
spin_lock(&pnp_lock); pnp_init_resources(&dev->res);
dev->config_mode = PNP_CONFIG_MANUAL;
pnp_init_resource_table(&dev->res);
if (dev->rule)
dev->rule->depnum = 0;
spin_unlock(&pnp_lock);
goto done;
}
if (!strnicmp(buf,"resolve",7)) {
retval = pnp_resolve_conflicts(dev);
goto done; goto done;
} }
if (!strnicmp(buf,"get",3)) { if (!strnicmp(buf,"get",3)) {
spin_lock(&pnp_lock); down(&pnp_res_mutex);
if (pnp_can_read(dev)) if (pnp_can_read(dev))
dev->protocol->get(dev, &dev->res); dev->protocol->get(dev, &dev->res);
spin_unlock(&pnp_lock); up(&pnp_res_mutex);
goto done; goto done;
} }
if (!strnicmp(buf,"set",3)) { if (!strnicmp(buf,"set",3)) {
...@@ -442,9 +345,8 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count ...@@ -442,9 +345,8 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count
if (dev->active) if (dev->active)
goto done; goto done;
buf += 3; buf += 3;
spin_lock(&pnp_lock); pnp_init_resources(&dev->res);
dev->config_mode = PNP_CONFIG_MANUAL; down(&pnp_res_mutex);
pnp_init_resource_table(&dev->res);
while (1) { while (1) {
while (isspace(*buf)) while (isspace(*buf))
++buf; ++buf;
...@@ -514,7 +416,7 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count ...@@ -514,7 +416,7 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count
} }
break; break;
} }
spin_unlock(&pnp_lock); up(&pnp_res_mutex);
goto done; goto done;
} }
done: done:
...@@ -543,7 +445,7 @@ static DEVICE_ATTR(id,S_IRUGO,pnp_show_current_ids,NULL); ...@@ -543,7 +445,7 @@ static DEVICE_ATTR(id,S_IRUGO,pnp_show_current_ids,NULL);
int pnp_interface_attach_device(struct pnp_dev *dev) int pnp_interface_attach_device(struct pnp_dev *dev)
{ {
device_create_file(&dev->dev,&dev_attr_possible); device_create_file(&dev->dev,&dev_attr_options);
device_create_file(&dev->dev,&dev_attr_resources); device_create_file(&dev->dev,&dev_attr_resources);
device_create_file(&dev->dev,&dev_attr_id); device_create_file(&dev->dev,&dev_attr_id);
return 0; return 0;
......
This diff is collapsed.
This diff is collapsed.
...@@ -935,6 +935,10 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node) ...@@ -935,6 +935,10 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node)
dev->capabilities |= PNP_REMOVABLE; dev->capabilities |= PNP_REMOVABLE;
dev->protocol = &pnpbios_protocol; dev->protocol = &pnpbios_protocol;
/* clear out the damaged flags */
if (!dev->active)
pnp_init_resources(&dev->res);
pnp_add_device(dev); pnp_add_device(dev);
pnpbios_interface_attach_device(node); pnpbios_interface_attach_device(node);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
static void quirk_awe32_resources(struct pnp_dev *dev) static void quirk_awe32_resources(struct pnp_dev *dev)
{ {
struct pnp_port *port, *port2, *port3; struct pnp_port *port, *port2, *port3;
struct pnp_resources *res = dev->possible->dep; struct pnp_option *res = dev->dependent;
/* /*
* Unfortunately the isapnp_add_port_resource is too tightly bound * Unfortunately the isapnp_add_port_resource is too tightly bound
...@@ -38,7 +38,7 @@ static void quirk_awe32_resources(struct pnp_dev *dev) ...@@ -38,7 +38,7 @@ static void quirk_awe32_resources(struct pnp_dev *dev)
* two extra ports (at offset 0x400 and 0x800 from the one given) by * two extra ports (at offset 0x400 and 0x800 from the one given) by
* hand. * hand.
*/ */
for ( ; res ; res = res->dep ) { for ( ; res ; res = res->next ) {
port2 = pnp_alloc(sizeof(struct pnp_port)); port2 = pnp_alloc(sizeof(struct pnp_port));
if (!port2) if (!port2)
return; return;
...@@ -62,9 +62,9 @@ static void quirk_awe32_resources(struct pnp_dev *dev) ...@@ -62,9 +62,9 @@ static void quirk_awe32_resources(struct pnp_dev *dev)
static void quirk_cmi8330_resources(struct pnp_dev *dev) static void quirk_cmi8330_resources(struct pnp_dev *dev)
{ {
struct pnp_resources *res = dev->possible->dep; struct pnp_option *res = dev->dependent;
for ( ; res ; res = res->dep ) { for ( ; res ; res = res->next ) {
struct pnp_irq *irq; struct pnp_irq *irq;
struct pnp_dma *dma; struct pnp_dma *dma;
...@@ -82,7 +82,7 @@ static void quirk_cmi8330_resources(struct pnp_dev *dev) ...@@ -82,7 +82,7 @@ static void quirk_cmi8330_resources(struct pnp_dev *dev)
static void quirk_sb16audio_resources(struct pnp_dev *dev) static void quirk_sb16audio_resources(struct pnp_dev *dev)
{ {
struct pnp_port *port; struct pnp_port *port;
struct pnp_resources *res = dev->possible->dep; struct pnp_option *res = dev->dependent;
int changed = 0; int changed = 0;
/* /*
...@@ -91,7 +91,7 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev) ...@@ -91,7 +91,7 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
* auto-configured. * auto-configured.
*/ */
for( ; res ; res = res->dep ) { for( ; res ; res = res->next ) {
port = res->port; port = res->port;
if(!port) if(!port)
continue; continue;
...@@ -118,11 +118,11 @@ static void quirk_opl3sax_resources(struct pnp_dev *dev) ...@@ -118,11 +118,11 @@ static void quirk_opl3sax_resources(struct pnp_dev *dev)
* doesn't allow a DMA channel of 0, afflicted card is an * doesn't allow a DMA channel of 0, afflicted card is an
* OPL3Sax where x=4. * OPL3Sax where x=4.
*/ */
struct pnp_resources *res; struct pnp_option *res;
int max; int max;
res = dev->possible; res = dev->dependent;
max = 0; max = 0;
for (res = res->dep; res; res = res->dep) { for (; res; res = res->next) {
if (res->dma->map > max) if (res->dma->map > max)
max = res->dma->map; max = res->dma->map;
} }
......
This diff is collapsed.
/* /*
* support.c - provides standard pnp functions for the use of pnp protocol drivers, * support.c - provides standard pnp functions for the use of pnp protocol drivers,
* *
* Copyright 2002 Adam Belay <ambx1@neo.rr.com> * Copyright 2003 Adam Belay <ambx1@neo.rr.com>
* *
* Resource parsing functions are based on those in the linux pnpbios driver. * Resource parsing functions are based on those in the linux pnpbios driver.
* Copyright Christian Schmidt, Tom Lees, David Hinds, Alan Cox, Thomas Hood, * Copyright Christian Schmidt, Tom Lees, David Hinds, Alan Cox, Thomas Hood,
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/ctype.h>
#ifdef CONFIG_PNP_DEBUG #ifdef CONFIG_PNP_DEBUG
#define DEBUG #define DEBUG
...@@ -122,7 +123,7 @@ unsigned char * pnp_parse_current_resources(unsigned char * p, unsigned char * e ...@@ -122,7 +123,7 @@ unsigned char * pnp_parse_current_resources(unsigned char * p, unsigned char * e
return NULL; return NULL;
/* Blank the resource table values */ /* Blank the resource table values */
pnp_init_resource_table(res); pnp_init_resources(res);
while ((char *)p < (char *)end) { while ((char *)p < (char *)end) {
...@@ -250,51 +251,51 @@ unsigned char * pnp_parse_current_resources(unsigned char * p, unsigned char * e ...@@ -250,51 +251,51 @@ unsigned char * pnp_parse_current_resources(unsigned char * p, unsigned char * e
* Possible resource reading functions * * Possible resource reading functions *
*/ */
static void possible_mem(unsigned char *p, int size, int depnum, struct pnp_dev *dev) static void possible_mem(unsigned char *p, int size, struct pnp_option *option)
{ {
struct pnp_mem * mem; struct pnp_mem * mem;
mem = pnp_alloc(sizeof(struct pnp_mem)); mem = pnp_alloc(sizeof(struct pnp_mem));
if (!mem) if (!mem)
return; return;
mem->min = ((p[3] << 8) | p[2]) << 8; mem->min = ((p[5] << 8) | p[4]) << 8;
mem->max = ((p[5] << 8) | p[4]) << 8; mem->max = ((p[7] << 8) | p[6]) << 8;
mem->align = (p[7] << 8) | p[6]; mem->align = (p[9] << 8) | p[8];
mem->size = ((p[9] << 8) | p[8]) << 8; mem->size = ((p[11] << 8) | p[10]) << 8;
mem->flags = p[1]; mem->flags = p[3];
pnp_add_mem_resource(dev,depnum,mem); pnp_register_mem_resource(option,mem);
return; return;
} }
static void possible_mem32(unsigned char *p, int size, int depnum, struct pnp_dev *dev) static void possible_mem32(unsigned char *p, int size, struct pnp_option *option)
{ {
struct pnp_mem * mem; struct pnp_mem * mem;
mem = pnp_alloc(sizeof(struct pnp_mem)); mem = pnp_alloc(sizeof(struct pnp_mem));
if (!mem) if (!mem)
return; return;
mem->min = (p[5] << 24) | (p[4] << 16) | (p[3] << 8) | p[2]; mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
mem->max = (p[9] << 24) | (p[8] << 16) | (p[7] << 8) | p[6]; mem->max = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8];
mem->align = (p[13] << 24) | (p[12] << 16) | (p[11] << 8) | p[10]; mem->align = (p[15] << 24) | (p[14] << 16) | (p[13] << 8) | p[12];
mem->size = (p[17] << 24) | (p[16] << 16) | (p[15] << 8) | p[14]; mem->size = (p[19] << 24) | (p[18] << 16) | (p[17] << 8) | p[16];
mem->flags = p[1]; mem->flags = p[3];
pnp_add_mem_resource(dev,depnum,mem); pnp_register_mem_resource(option,mem);
return; return;
} }
static void possible_fixed_mem32(unsigned char *p, int size, int depnum, struct pnp_dev *dev) static void possible_fixed_mem32(unsigned char *p, int size, struct pnp_option *option)
{ {
struct pnp_mem * mem; struct pnp_mem * mem;
mem = pnp_alloc(sizeof(struct pnp_mem)); mem = pnp_alloc(sizeof(struct pnp_mem));
if (!mem) if (!mem)
return; return;
mem->min = mem->max = (p[5] << 24) | (p[4] << 16) | (p[3] << 8) | p[2]; mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
mem->size = (p[9] << 24) | (p[8] << 16) | (p[7] << 8) | p[6]; mem->size = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8];
mem->align = 0; mem->align = 0;
mem->flags = p[1]; mem->flags = p[3];
pnp_add_mem_resource(dev,depnum,mem); pnp_register_mem_resource(option,mem);
return; return;
} }
static void possible_irq(unsigned char *p, int size, int depnum, struct pnp_dev *dev) static void possible_irq(unsigned char *p, int size, struct pnp_option *option)
{ {
struct pnp_irq * irq; struct pnp_irq * irq;
irq = pnp_alloc(sizeof(struct pnp_irq)); irq = pnp_alloc(sizeof(struct pnp_irq));
...@@ -303,11 +304,13 @@ static void possible_irq(unsigned char *p, int size, int depnum, struct pnp_dev ...@@ -303,11 +304,13 @@ static void possible_irq(unsigned char *p, int size, int depnum, struct pnp_dev
irq->map = (p[2] << 8) | p[1]; irq->map = (p[2] << 8) | p[1];
if (size > 2) if (size > 2)
irq->flags = p[3]; irq->flags = p[3];
pnp_add_irq_resource(dev,depnum,irq); else
irq->flags = IORESOURCE_IRQ_HIGHEDGE;
pnp_register_irq_resource(option,irq);
return; return;
} }
static void possible_dma(unsigned char *p, int size, int depnum, struct pnp_dev *dev) static void possible_dma(unsigned char *p, int size, struct pnp_option *option)
{ {
struct pnp_dma * dma; struct pnp_dma * dma;
dma = pnp_alloc(sizeof(struct pnp_dma)); dma = pnp_alloc(sizeof(struct pnp_dma));
...@@ -315,11 +318,11 @@ static void possible_dma(unsigned char *p, int size, int depnum, struct pnp_dev ...@@ -315,11 +318,11 @@ static void possible_dma(unsigned char *p, int size, int depnum, struct pnp_dev
return; return;
dma->map = p[1]; dma->map = p[1];
dma->flags = p[2]; dma->flags = p[2];
pnp_add_dma_resource(dev,depnum,dma); pnp_register_dma_resource(option,dma);
return; return;
} }
static void possible_port(unsigned char *p, int size, int depnum, struct pnp_dev *dev) static void possible_port(unsigned char *p, int size, struct pnp_option *option)
{ {
struct pnp_port * port; struct pnp_port * port;
port = pnp_alloc(sizeof(struct pnp_port)); port = pnp_alloc(sizeof(struct pnp_port));
...@@ -330,11 +333,11 @@ static void possible_port(unsigned char *p, int size, int depnum, struct pnp_dev ...@@ -330,11 +333,11 @@ static void possible_port(unsigned char *p, int size, int depnum, struct pnp_dev
port->align = p[6]; port->align = p[6];
port->size = p[7]; port->size = p[7];
port->flags = p[1] ? PNP_PORT_FLAG_16BITADDR : 0; port->flags = p[1] ? PNP_PORT_FLAG_16BITADDR : 0;
pnp_add_port_resource(dev,depnum,port); pnp_register_port_resource(option,port);
return; return;
} }
static void possible_fixed_port(unsigned char *p, int size, int depnum, struct pnp_dev *dev) static void possible_fixed_port(unsigned char *p, int size, struct pnp_option *option)
{ {
struct pnp_port * port; struct pnp_port * port;
port = pnp_alloc(sizeof(struct pnp_port)); port = pnp_alloc(sizeof(struct pnp_port));
...@@ -344,7 +347,7 @@ static void possible_fixed_port(unsigned char *p, int size, int depnum, struct p ...@@ -344,7 +347,7 @@ static void possible_fixed_port(unsigned char *p, int size, int depnum, struct p
port->size = p[3]; port->size = p[3];
port->align = 0; port->align = 0;
port->flags = PNP_PORT_FLAG_FIXED; port->flags = PNP_PORT_FLAG_FIXED;
pnp_add_port_resource(dev,depnum,port); pnp_register_port_resource(option,port);
return; return;
} }
...@@ -358,12 +361,14 @@ static void possible_fixed_port(unsigned char *p, int size, int depnum, struct p ...@@ -358,12 +361,14 @@ static void possible_fixed_port(unsigned char *p, int size, int depnum, struct p
unsigned char * pnp_parse_possible_resources(unsigned char * p, unsigned char * end, struct pnp_dev *dev) unsigned char * pnp_parse_possible_resources(unsigned char * p, unsigned char * end, struct pnp_dev *dev)
{ {
int len, depnum = 0, dependent = 0; int len, priority = 0;
struct pnp_option *option;
if (!p) if (!p)
return NULL; return NULL;
if (pnp_build_resource(dev, 0) == NULL) option = pnp_register_independent_option(dev);
if (!option)
return NULL; return NULL;
while ((char *)p < (char *)end) { while ((char *)p < (char *)end) {
...@@ -375,21 +380,21 @@ unsigned char * pnp_parse_possible_resources(unsigned char * p, unsigned char * ...@@ -375,21 +380,21 @@ unsigned char * pnp_parse_possible_resources(unsigned char * p, unsigned char *
{ {
if (len != 9) if (len != 9)
goto lrg_err; goto lrg_err;
possible_mem(p,len,depnum,dev); possible_mem(p,len,option);
break; break;
} }
case LARGE_TAG_MEM32: case LARGE_TAG_MEM32:
{ {
if (len != 17) if (len != 17)
goto lrg_err; goto lrg_err;
possible_mem32(p,len,depnum,dev); possible_mem32(p,len,option);
break; break;
} }
case LARGE_TAG_FIXEDMEM32: case LARGE_TAG_FIXEDMEM32:
{ {
if (len != 9) if (len != 9)
goto lrg_err; goto lrg_err;
possible_fixed_mem32(p,len,depnum,dev); possible_fixed_mem32(p,len,option);
break; break;
} }
default: /* an unkown tag */ default: /* an unkown tag */
...@@ -410,46 +415,46 @@ unsigned char * pnp_parse_possible_resources(unsigned char * p, unsigned char * ...@@ -410,46 +415,46 @@ unsigned char * pnp_parse_possible_resources(unsigned char * p, unsigned char *
{ {
if (len < 2 || len > 3) if (len < 2 || len > 3)
goto sm_err; goto sm_err;
possible_irq(p,len,depnum,dev); possible_irq(p,len,option);
break; break;
} }
case SMALL_TAG_DMA: case SMALL_TAG_DMA:
{ {
if (len != 2) if (len != 2)
goto sm_err; goto sm_err;
possible_dma(p,len,depnum,dev); possible_dma(p,len,option);
break; break;
} }
case SMALL_TAG_STARTDEP: case SMALL_TAG_STARTDEP:
{ {
if (len > 1) if (len > 1)
goto sm_err; goto sm_err;
dependent = 0x100 | PNP_RES_PRIORITY_ACCEPTABLE; priority = 0x100 | PNP_RES_PRIORITY_ACCEPTABLE;
if (len > 0) if (len > 0)
dependent = 0x100 | p[1]; priority = 0x100 | p[1];
pnp_build_resource(dev,dependent); option = pnp_register_dependent_option(dev, priority);
depnum = pnp_get_max_depnum(dev); if (!option)
return NULL;
break; break;
} }
case SMALL_TAG_ENDDEP: case SMALL_TAG_ENDDEP:
{ {
if (len != 0) if (len != 0)
goto sm_err; goto sm_err;
depnum = 0;
break; break;
} }
case SMALL_TAG_PORT: case SMALL_TAG_PORT:
{ {
if (len != 7) if (len != 7)
goto sm_err; goto sm_err;
possible_port(p,len,depnum,dev); possible_port(p,len,option);
break; break;
} }
case SMALL_TAG_FIXEDPORT: case SMALL_TAG_FIXEDPORT:
{ {
if (len != 3) if (len != 3)
goto sm_err; goto sm_err;
possible_fixed_port(p,len,depnum,dev); possible_fixed_port(p,len,option);
break; break;
} }
case SMALL_TAG_END: case SMALL_TAG_END:
...@@ -481,12 +486,12 @@ static void write_mem(unsigned char *p, struct resource * res) ...@@ -481,12 +486,12 @@ static void write_mem(unsigned char *p, struct resource * res)
{ {
unsigned long base = res->start; unsigned long base = res->start;
unsigned long len = res->end - res->start + 1; unsigned long len = res->end - res->start + 1;
p[2] = (base >> 8) & 0xff;
p[3] = ((base >> 8) >> 8) & 0xff;
p[4] = (base >> 8) & 0xff; p[4] = (base >> 8) & 0xff;
p[5] = ((base >> 8) >> 8) & 0xff; p[5] = ((base >> 8) >> 8) & 0xff;
p[8] = (len >> 8) & 0xff; p[6] = (base >> 8) & 0xff;
p[9] = ((len >> 8) >> 8) & 0xff; p[7] = ((base >> 8) >> 8) & 0xff;
p[10] = (len >> 8) & 0xff;
p[11] = ((len >> 8) >> 8) & 0xff;
return; return;
} }
...@@ -494,32 +499,32 @@ static void write_mem32(unsigned char *p, struct resource * res) ...@@ -494,32 +499,32 @@ static void write_mem32(unsigned char *p, struct resource * res)
{ {
unsigned long base = res->start; unsigned long base = res->start;
unsigned long len = res->end - res->start + 1; unsigned long len = res->end - res->start + 1;
p[2] = base & 0xff; p[4] = base & 0xff;
p[3] = (base >> 8) & 0xff; p[5] = (base >> 8) & 0xff;
p[4] = (base >> 16) & 0xff; p[6] = (base >> 16) & 0xff;
p[5] = (base >> 24) & 0xff; p[7] = (base >> 24) & 0xff;
p[6] = base & 0xff; p[8] = base & 0xff;
p[7] = (base >> 8) & 0xff; p[9] = (base >> 8) & 0xff;
p[8] = (base >> 16) & 0xff; p[10] = (base >> 16) & 0xff;
p[9] = (base >> 24) & 0xff; p[11] = (base >> 24) & 0xff;
p[14] = len & 0xff; p[16] = len & 0xff;
p[15] = (len >> 8) & 0xff; p[17] = (len >> 8) & 0xff;
p[16] = (len >> 16) & 0xff; p[18] = (len >> 16) & 0xff;
p[17] = (len >> 24) & 0xff; p[19] = (len >> 24) & 0xff;
return; return;
} }
static void write_fixed_mem32(unsigned char *p, struct resource * res) static void write_fixed_mem32(unsigned char *p, struct resource * res)
{ unsigned long base = res->start; { unsigned long base = res->start;
unsigned long len = res->end - res->start + 1; unsigned long len = res->end - res->start + 1;
p[2] = base & 0xff; p[4] = base & 0xff;
p[3] = (base >> 8) & 0xff; p[5] = (base >> 8) & 0xff;
p[4] = (base >> 16) & 0xff; p[6] = (base >> 16) & 0xff;
p[5] = (base >> 24) & 0xff; p[7] = (base >> 24) & 0xff;
p[6] = len & 0xff; p[8] = len & 0xff;
p[7] = (len >> 8) & 0xff; p[9] = (len >> 8) & 0xff;
p[8] = (len >> 16) & 0xff; p[10] = (len >> 16) & 0xff;
p[9] = (len >> 24) & 0xff; p[11] = (len >> 24) & 0xff;
return; return;
} }
...@@ -630,7 +635,7 @@ unsigned char * pnp_write_resources(unsigned char * p, unsigned char * end, stru ...@@ -630,7 +635,7 @@ unsigned char * pnp_write_resources(unsigned char * p, unsigned char * end, stru
{ {
if (len != 2) if (len != 2)
goto sm_err; goto sm_err;
write_dma(p, &res->dma_resource[irq]); write_dma(p, &res->dma_resource[dma]);
dma++; dma++;
break; break;
} }
......
...@@ -315,19 +315,6 @@ static const struct pnp_device_id pnp_dev_table[] = { ...@@ -315,19 +315,6 @@ static const struct pnp_device_id pnp_dev_table[] = {
MODULE_DEVICE_TABLE(pnp, pnp_dev_table); MODULE_DEVICE_TABLE(pnp, pnp_dev_table);
static inline void avoid_irq_share(struct pnp_dev *dev)
{
unsigned int map = 0x1FF8;
struct pnp_irq *irq;
struct pnp_resources *res = dev->possible;
serial8250_get_irq_map(&map);
for ( ; res; res = res->dep)
for (irq = res->irq; irq; irq = irq->next)
irq->map = map;
}
static char *modem_names[] __devinitdata = { static char *modem_names[] __devinitdata = {
"MODEM", "Modem", "modem", "FAX", "Fax", "fax", "MODEM", "Modem", "modem", "FAX", "Fax", "fax",
"56K", "56k", "K56", "33.6", "28.8", "14.4", "56K", "56k", "K56", "33.6", "28.8", "14.4",
...@@ -346,6 +333,29 @@ static int __devinit check_name(char *name) ...@@ -346,6 +333,29 @@ static int __devinit check_name(char *name)
return 0; return 0;
} }
static int __devinit check_resources(struct pnp_option *option)
{
struct pnp_option *tmp;
if (!option)
return 0;
for (tmp = option; tmp; tmp = tmp->next) {
struct pnp_port *port;
for (port = tmp->port; port; port = port->next)
if ((port->size == 8) &&
((port->min == 0x2f8) ||
(port->min == 0x3f8) ||
(port->min == 0x2e8) ||
#ifdef CONFIG_X86_PC9800
(port->min == 0x8b0) ||
#endif
(port->min == 0x3e8)))
return 1;
}
return 0;
}
/* /*
* Given a complete unknown PnP device, try to use some heuristics to * Given a complete unknown PnP device, try to use some heuristics to
* detect modems. Currently use such heuristic set: * detect modems. Currently use such heuristic set:
...@@ -357,30 +367,16 @@ static int __devinit check_name(char *name) ...@@ -357,30 +367,16 @@ static int __devinit check_name(char *name)
* PnP modems, alternatively we must hardcode all modems in pnp_devices[] * PnP modems, alternatively we must hardcode all modems in pnp_devices[]
* table. * table.
*/ */
static int serial_pnp_guess_board(struct pnp_dev *dev, int *flags) static int __devinit serial_pnp_guess_board(struct pnp_dev *dev, int *flags)
{ {
struct pnp_resources *res = dev->possible;
struct pnp_resources *resa;
if (!(check_name(dev->dev.name) || (dev->card && check_name(dev->card->dev.name)))) if (!(check_name(dev->dev.name) || (dev->card && check_name(dev->card->dev.name))))
return -ENODEV; return -ENODEV;
if (!res) if (check_resources(dev->independent))
return -ENODEV; return 0;
for (resa = res->dep; resa; resa = resa->dep) { if (check_resources(dev->dependent))
struct pnp_port *port;
for (port = res->port; port; port = port->next)
if ((port->size == 8) &&
((port->min == 0x2f8) ||
(port->min == 0x3f8) ||
(port->min == 0x2e8) ||
#ifdef CONFIG_X86_PC9800
(port->min == 0x8b0) ||
#endif
(port->min == 0x3e8)))
return 0; return 0;
}
return -ENODEV; return -ENODEV;
} }
...@@ -395,8 +391,6 @@ serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id) ...@@ -395,8 +391,6 @@ serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
if (flags & SPCI_FL_NO_SHIRQ)
avoid_irq_share(dev);
memset(&serial_req, 0, sizeof(serial_req)); memset(&serial_req, 0, sizeof(serial_req));
serial_req.irq = pnp_irq(dev,0); serial_req.irq = pnp_irq(dev,0);
serial_req.port = pnp_port_start(dev, 0); serial_req.port = pnp_port_start(dev, 0);
......
...@@ -57,6 +57,15 @@ num_online_cpus(void) ...@@ -57,6 +57,15 @@ num_online_cpus(void)
return hweight64(cpu_online_map); return hweight64(cpu_online_map);
} }
extern inline int
any_online_cpu(unsigned int mask)
{
if (mask & cpu_online_map)
return __ffs(mask & cpu_online_map);
return -1;
}
extern int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, unsigned long cpu); extern int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, unsigned long cpu);
#else /* CONFIG_SMP */ #else /* CONFIG_SMP */
......
...@@ -593,13 +593,7 @@ static inline long read(int fd, char * buf, size_t nr) ...@@ -593,13 +593,7 @@ static inline long read(int fd, char * buf, size_t nr)
return sys_read(fd, buf, nr); return sys_read(fd, buf, nr);
} }
extern int __kernel_execve(char *, char **, char **, struct pt_regs *); extern long execve(char *, char **, char **);
static inline long execve(char * file, char ** argvp, char ** envp)
{
struct pt_regs regs;
memset(&regs, 0, sizeof(regs));
return __kernel_execve(file, argvp, envp, &regs);
}
extern long sys_setsid(void); extern long sys_setsid(void);
static inline long setsid(void) static inline long setsid(void)
......
...@@ -822,19 +822,19 @@ xor_alpha_prefetch_5: \n\ ...@@ -822,19 +822,19 @@ xor_alpha_prefetch_5: \n\
"); ");
static struct xor_block_template xor_block_alpha = { static struct xor_block_template xor_block_alpha = {
name: "alpha", .name = "alpha",
do_2: xor_alpha_2, .do_2 = xor_alpha_2,
do_3: xor_alpha_3, .do_3 = xor_alpha_3,
do_4: xor_alpha_4, .do_4 = xor_alpha_4,
do_5: xor_alpha_5, .do_5 = xor_alpha_5,
}; };
static struct xor_block_template xor_block_alpha_prefetch = { static struct xor_block_template xor_block_alpha_prefetch = {
name: "alpha prefetch", .name = "alpha prefetch",
do_2: xor_alpha_prefetch_2, .do_2 = xor_alpha_prefetch_2,
do_3: xor_alpha_prefetch_3, .do_3 = xor_alpha_prefetch_3,
do_4: xor_alpha_prefetch_4, .do_4 = xor_alpha_prefetch_4,
do_5: xor_alpha_prefetch_5, .do_5 = xor_alpha_prefetch_5,
}; };
/* For grins, also test the generic routines. */ /* For grins, also test the generic routines. */
......
#ifndef _LINUX_FIRMWARE_H
#define _LINUX_FIRMWARE_H
#include <linux/module.h>
#include <linux/types.h>
#define FIRMWARE_NAME_MAX 30
struct firmware {
size_t size;
u8 *data;
};
int request_firmware(const struct firmware **fw, const char *name,
struct device *device);
int request_firmware_nowait(
struct module *module,
const char *name, struct device *device, void *context,
void (*cont)(const struct firmware *fw, void *context));
void release_firmware(const struct firmware *fw);
void register_firmware(const char *name, const u8 *data, size_t size);
#endif
...@@ -283,7 +283,7 @@ typedef struct atemu { ...@@ -283,7 +283,7 @@ typedef struct atemu {
#endif #endif
int mdmcmdl; /* Length of Modem-Commandbuffer */ int mdmcmdl; /* Length of Modem-Commandbuffer */
int pluscount; /* Counter for +++ sequence */ int pluscount; /* Counter for +++ sequence */
int lastplus; /* Timestamp of last + */ unsigned long lastplus; /* Timestamp of last + */
char mdmcmd[255]; /* Modem-Commandbuffer */ char mdmcmd[255]; /* Modem-Commandbuffer */
unsigned int charge; /* Charge units of current connection */ unsigned int charge; /* Charge units of current connection */
} atemu; } atemu;
......
...@@ -95,7 +95,8 @@ struct isdn_ppp_resetparams { ...@@ -95,7 +95,8 @@ struct isdn_ppp_resetparams {
* check the original include for more information * check the original include for more information
*/ */
struct isdn_ppp_compressor { struct isdn_ppp_compressor {
struct isdn_ppp_compressor *next, *prev; struct module *owner;
struct list_head list;
int num; /* CCP compression protocol number */ int num; /* CCP compression protocol number */
void *(*alloc) (struct isdn_ppp_comp_data *); void *(*alloc) (struct isdn_ppp_comp_data *);
......
...@@ -602,6 +602,8 @@ ...@@ -602,6 +602,8 @@
#define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049 #define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049
#define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A #define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A
#define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B #define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B
#define PCI_DEVICE_ID_HP_REO_SBA 0x10f0
#define PCI_DEVICE_ID_HP_REO_IOC 0x10f1
#define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b #define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b
#define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223 #define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223
#define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226 #define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226
......
This diff is collapsed.
...@@ -72,7 +72,6 @@ struct sys_device { ...@@ -72,7 +72,6 @@ struct sys_device {
u32 id; u32 id;
struct sysdev_class * cls; struct sysdev_class * cls;
struct kobject kobj; struct kobject kobj;
struct list_head entry;
}; };
extern int sys_device_register(struct sys_device *); extern int sys_device_register(struct sys_device *);
......
...@@ -592,7 +592,6 @@ EXPORT_SYMBOL(__tasklet_hi_schedule); ...@@ -592,7 +592,6 @@ EXPORT_SYMBOL(__tasklet_hi_schedule);
/* init task, for moving kthread roots - ought to export a function ?? */ /* init task, for moving kthread roots - ought to export a function ?? */
EXPORT_SYMBOL(init_task); EXPORT_SYMBOL(init_task);
EXPORT_SYMBOL(init_thread_union);
EXPORT_SYMBOL(tasklist_lock); EXPORT_SYMBOL(tasklist_lock);
EXPORT_SYMBOL(find_task_by_pid); EXPORT_SYMBOL(find_task_by_pid);
......
...@@ -100,6 +100,9 @@ static void fill_kobj_path(struct kset *kset, struct kobject *kobj, char *path, ...@@ -100,6 +100,9 @@ static void fill_kobj_path(struct kset *kset, struct kobject *kobj, char *path,
#define BUFFER_SIZE 1024 /* should be enough memory for the env */ #define BUFFER_SIZE 1024 /* should be enough memory for the env */
#define NUM_ENVP 32 /* number of env pointers */ #define NUM_ENVP 32 /* number of env pointers */
static unsigned long sequence_num;
static spinlock_t sequence_lock = SPIN_LOCK_UNLOCKED;
static void kset_hotplug(const char *action, struct kset *kset, static void kset_hotplug(const char *action, struct kset *kset,
struct kobject *kobj) struct kobject *kobj)
{ {
...@@ -112,6 +115,7 @@ static void kset_hotplug(const char *action, struct kset *kset, ...@@ -112,6 +115,7 @@ static void kset_hotplug(const char *action, struct kset *kset,
int kobj_path_length; int kobj_path_length;
char *kobj_path = NULL; char *kobj_path = NULL;
char *name = NULL; char *name = NULL;
unsigned long seq;
/* If the kset has a filter operation, call it. If it returns /* If the kset has a filter operation, call it. If it returns
failure, no hotplug event is required. */ failure, no hotplug event is required. */
...@@ -152,6 +156,13 @@ static void kset_hotplug(const char *action, struct kset *kset, ...@@ -152,6 +156,13 @@ static void kset_hotplug(const char *action, struct kset *kset,
envp [i++] = scratch; envp [i++] = scratch;
scratch += sprintf(scratch, "ACTION=%s", action) + 1; scratch += sprintf(scratch, "ACTION=%s", action) + 1;
spin_lock(&sequence_lock);
seq = sequence_num++;
spin_unlock(&sequence_lock);
envp [i++] = scratch;
scratch += sprintf(scratch, "SEQNUM=%ld", seq) + 1;
kobj_path_length = get_kobj_path_length (kset, kobj); kobj_path_length = get_kobj_path_length (kset, kobj);
kobj_path = kmalloc (kobj_path_length, GFP_KERNEL); kobj_path = kmalloc (kobj_path_length, GFP_KERNEL);
if (!kobj_path) if (!kobj_path)
......
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