Commit 88a5656f authored by Vojtech Pavlik's avatar Vojtech Pavlik

Merge suse.cz:/home/vojtech/bk/linus into suse.cz:/home/vojtech/bk/input

parents a80694cb 0e9387ab
......@@ -128,9 +128,6 @@ archmrproper:
vmlinux: arch/alpha/vmlinux.lds.s
arch/$(ARCH)/vmlinux.lds.s: arch/$(ARCH)/vmlinux.lds.S
$(CPP) $(CPPFLAGS) $(CPPFLAGS_$@) -D__ASSEMBLY__ -P -C -U$(ARCH) $< -o $@
bootpfile:
@$(MAKEBOOT) bootpfile
......
......@@ -8,7 +8,7 @@
static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
struct mm_struct init_mm = INIT_MM(init_mm);
struct task_struct init_task = INIT_TASK(init_task);
......
......@@ -343,7 +343,7 @@ pcibios_fixup_pbus_ranges(struct pci_bus * bus,
}
int
pcibios_enable_device(struct pci_dev *dev)
pcibios_enable_device(struct pci_dev *dev, int mask)
{
/* Nothing to do, since we enable all devices at startup. */
return 0;
......
......@@ -592,108 +592,19 @@ static int
do_signal(sigset_t *oldset, struct pt_regs * regs, struct switch_stack * sw,
unsigned long r0, unsigned long r19)
{
siginfo_t info;
int signr;
unsigned long single_stepping = ptrace_cancel_bpt(current);
if (!oldset)
oldset = &current->blocked;
while (1) {
unsigned long signr;
struct k_sigaction *ka;
siginfo_t info;
spin_lock_irq(&current->sigmask_lock);
signr = dequeue_signal(&current->blocked, &info);
spin_unlock_irq(&current->sigmask_lock);
if (!signr)
break;
if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
schedule();
single_stepping |= ptrace_cancel_bpt(current);
/* We're back. Did the debugger cancel the sig? */
if (!(signr = current->exit_code))
continue;
current->exit_code = 0;
/* The debugger continued. Ignore SIGSTOP. */
if (signr == SIGSTOP)
continue;
/* Update the siginfo structure. Is this good? */
if (signr != info.si_signo) {
info.si_signo = signr;
info.si_errno = 0;
info.si_code = SI_USER;
info.si_pid = current->parent->pid;
info.si_uid = current->parent->uid;
}
/* If the (new) signal is now blocked, requeue it. */
if (sigismember(&current->blocked, signr)) {
send_sig_info(signr, &info, current);
continue;
}
}
ka = &current->sig->action[signr-1];
if (ka->sa.sa_handler == SIG_IGN) {
if (signr != SIGCHLD)
continue;
/* Check for SIGCHLD: it's special. */
while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
/* nothing */;
continue;
}
if (ka->sa.sa_handler == SIG_DFL) {
int exit_code = signr & 0x7f;
/* Init gets no signals it doesn't want. */
if (current->pid == 1)
continue;
switch (signr) {
case SIGCONT: case SIGCHLD: case SIGWINCH:
continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU:
if (is_orphaned_pgrp(current->pgrp))
continue;
/* FALLTHRU */
case SIGSTOP:
current->state = TASK_STOPPED;
current->exit_code = signr;
if (!(current->parent->sig->action[SIGCHLD-1]
.sa.sa_flags & SA_NOCLDSTOP))
notify_parent(current, SIGCHLD);
schedule();
single_stepping |= ptrace_cancel_bpt(current);
continue;
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ:
if (do_coredump(signr, regs))
exit_code |= 0x80;
/* FALLTHRU */
default:
lock_kernel();
sig_exit(signr, exit_code, &info);
/* NOTREACHED */
}
continue;
}
signr = get_signal_to_deliver(&info, regs);
if (signr > 0) {
/* Whee! Actually deliver the signal. */
struct k_sigaction *ka = &current->sig->action[signr-1];
if (r0) syscall_restart(r0, r19, regs, ka);
handle_signal(signr, ka, &info, oldset, regs, sw);
if (single_stepping)
......
......@@ -759,6 +759,9 @@ ENTRY(sys_call_table)
.long sys_io_getevents
.long sys_io_submit
.long sys_io_cancel
.long sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
.long sys_ni_syscall /* sys_free_hugepages */
.long sys_exit_group
.rept NR_syscalls-(.-sys_call_table)/4
.long sys_ni_syscall
......
......@@ -13,7 +13,7 @@ obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := busmouse.o console.o generic_serial.o ip2main.o \
ite_gpio.o misc.o nvram.o pty.o random.o rtc.o \
ite_gpio.o misc.o nvram.o random.o rtc.o \
selection.o sonypi.o sysrq.o tty_io.o tty_ioctl.o
obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o
......
......@@ -34,26 +34,12 @@
#include "../zftape/zftape-buffers.h"
#include "../zftape/zftape-ctl.h"
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,18)
# define FT_KSYM(sym) EXPORT_SYMBOL(sym);
#else
# define FT_KSYM(sym) X(sym),
#endif
#if LINUX_VERSION_CODE < KERNEL_VER(2,1,18)
struct symbol_table zft_symbol_table = {
#include <linux/symtab_begin.h>
#endif
/* zftape-init.c */
FT_KSYM(zft_cmpr_register)
FT_KSYM(zft_cmpr_unregister)
EXPORT_SYMBOL(zft_cmpr_register);
EXPORT_SYMBOL(zft_cmpr_unregister);
/* zftape-read.c */
FT_KSYM(zft_fetch_segment_fraction)
EXPORT_SYMBOL(zft_fetch_segment_fraction);
/* zftape-buffers.c */
FT_KSYM(zft_vmalloc_once)
FT_KSYM(zft_vmalloc_always)
FT_KSYM(zft_vfree)
#if LINUX_VERSION_CODE < KERNEL_VER(2,1,18)
#include <linux/symtab_end.h>
};
#endif
EXPORT_SYMBOL(zft_vmalloc_once);
EXPORT_SYMBOL(zft_vmalloc_always);
EXPORT_SYMBOL(zft_vfree);
This diff is collapsed.
......@@ -7,61 +7,36 @@
# Note : at this point, these files are compiled on all systems.
# In the future, some of these should be built conditionally.
#
export-objs := ide-taskfile.o ide.o ide-probe.o
export-objs := ide-iops.o ide-taskfile.o ide-proc.o ide.o ide-probe.o ide-dma.o ide-lib.o setup-pci.o
obj-$(CONFIG_BLK_DEV_IDE) += ide-mod.o ide-probe-mod.o
obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o
all-subdirs := arm legacy pci ppc
mod-subdirs := arm legacy pci ppc
obj-y :=
obj-m :=
ide-obj-y :=
subdir-$(CONFIG_BLK_DEV_IDEPCI) += pci
subdir-$(CONFIG_BLK_DEV_IDE) += legacy ppc arm pci
obj-$(CONFIG_BLK_DEV_IDE) += ide-probe.o ide-geometry.o ide-iops.o ide-taskfile.o ide.o ide-lib.o
obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk.o
obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd.o
obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o
obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy.o
obj-$(CONFIG_BLK_DEV_IT8172) += it8172.o
obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o
obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o
ide-obj-$(CONFIG_BLK_DEV_ADMA100) += adma100.o
ide-obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o
ide-obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o
ide-obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o
ide-obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o
ide-obj-$(CONFIG_BLK_DEV_BUDDHA) += buddha.o
ide-obj-$(CONFIG_BLK_DEV_CMD640) += cmd640.o
ide-obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o
ide-obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o
ide-obj-$(CONFIG_BLK_DEV_CY82C693) += cy82c693.o
ide-obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o
ide-obj-$(CONFIG_BLK_DEV_FALCON_IDE) += falconide.o
ide-obj-$(CONFIG_BLK_DEV_GAYLE) += gayle.o
ide-obj-$(CONFIG_BLK_DEV_Q40IDE) += q40ide.o
ide-obj-$(CONFIG_BLK_DEV_HPT34X) += hpt34x.o
ide-obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o
ide-obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o
ide-obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o
ide-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o
ide-obj-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ide-m8xx.o
ide-obj-$(CONFIG_BLK_DEV_IDEPCI) += ide-pci.o
ide-obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o
ide-obj-$(CONFIG_BLK_DEV_IDE_PMAC) += ide-pmac.o
ide-obj-$(CONFIG_BLK_DEV_IDE_SWARM) += ide-swarm.o
ide-obj-$(CONFIG_BLK_DEV_MAC_IDE) += macide.o
ide-obj-$(CONFIG_BLK_DEV_NS87415) += ns87415.o
ide-obj-$(CONFIG_BLK_DEV_OPTI621) += opti621.o
ide-obj-$(CONFIG_BLK_DEV_SVWKS) += serverworks.o
ide-obj-$(CONFIG_BLK_DEV_PDC202XX) += pdc202xx.o
ide-obj-$(CONFIG_BLK_DEV_PDC4030) += pdc4030.o
ide-obj-$(CONFIG_BLK_DEV_PIIX) += piix.o
ide-obj-$(CONFIG_BLK_DEV_QD65XX) += qd65xx.o
ide-obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o
ide-obj-$(CONFIG_BLK_DEV_RZ1000) += rz1000.o
ide-obj-$(CONFIG_BLK_DEV_SIS5513) += sis5513.o
ide-obj-$(CONFIG_BLK_DEV_SLC90E66) += slc90e66.o
ide-obj-$(CONFIG_BLK_DEV_SL82C105) += sl82c105.o
ide-obj-$(CONFIG_BLK_DEV_TRM290) += trm290.o
ide-obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o
ide-obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o
obj-$(CONFIG_PROC_FS) += ide-proc.o
ide-obj-$(CONFIG_PROC_FS) += ide-proc.o
obj-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o
ide-mod-objs := ide-taskfile.o ide.o $(ide-obj-y)
ide-probe-mod-objs := ide-probe.o ide-geometry.o
ifeq ($(CONFIG_BLK_DEV_IDE),y)
obj-y += pci/idedriver-pci.o
obj-y += legacy/idedriver-legacy.o
obj-y += ppc/idedriver-ppc.o
obj-y += arm/idedriver-arm.o
endif
include $(TOPDIR)/Rules.make
O_TARGET := idedriver-arm.o
obj-y :=
obj-m :=
obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o
obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o
EXTRA_CFLAGS := -I../
include $(TOPDIR)/Rules.make
/*
* linux/drivers/ide/ide-adma.c Version 0.00 June 24, 2001
*
* Copyright (c) 2001 Andre Hedrick <andre@linux-ide.org>
*
* Asynchronous DMA -- TBA, this is a holding file.
*
*/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -6,8 +6,6 @@
#include <linux/mc146818rtc.h>
#include <asm/io.h>
#ifdef CONFIG_BLK_DEV_IDE
/*
* We query CMOS about hard disks : it could be that we have a SCSI/ESDI/etc
* controller that is BIOS compatible with ST-506, and thus showing up in our
......@@ -25,14 +23,12 @@
* If a drive is not actually on the primary interface, then these parameters
* will be ignored. This results in the user having to supply the logical
* drive geometry as a boot parameter for each drive not on the primary i/f.
*/
/*
*
* The only "perfect" way to handle this would be to modify the setup.[cS] code
* to do BIOS calls Int13h/Fn08h and Int13h/Fn48h to get all of the drive info
* for us during initialization. I have the necessary docs -- any takers? -ml
*/
/*
* I did this, but it doesnt work - there is no reasonable way to find the
*
* I did this, but it doesn't work - there is no reasonable way to find the
* correspondence between the BIOS numbering of the disks and the Linux
* numbering. -aeb
*
......@@ -51,14 +47,13 @@ void probe_cmos_for_drives (ide_hwif_t *hwif)
{
#ifdef __i386__
extern struct drive_info_struct drive_info;
byte cmos_disks, *BIOS = (byte *) &drive_info;
u8 cmos_disks, *BIOS = (u8 *) &drive_info;
int unit;
unsigned long flags;
#ifdef CONFIG_BLK_DEV_PDC4030
if (hwif->chipset == ide_pdc4030 && hwif->channel != 0)
return;
#endif /* CONFIG_BLK_DEV_PDC4030 */
spin_lock_irqsave(&rtc_lock, flags);
cmos_disks = CMOS_READ(0x12);
spin_unlock_irqrestore(&rtc_lock, flags);
......@@ -68,7 +63,7 @@ void probe_cmos_for_drives (ide_hwif_t *hwif)
if ((cmos_disks & (0xf0 >> (unit*4)))
&& !drive->present && !drive->nobios) {
unsigned short cyl = *(unsigned short *)BIOS;
u16 cyl = *(u16 *)BIOS;
unsigned char head = *(BIOS+2);
unsigned char sect = *(BIOS+14);
if (cyl > 0 && head > 0 && sect > 0 && sect < 64) {
......@@ -86,10 +81,7 @@ void probe_cmos_for_drives (ide_hwif_t *hwif)
}
#endif
}
#endif /* CONFIG_BLK_DEV_IDE */
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
extern ide_drive_t * get_info_ptr(kdev_t);
extern unsigned long current_capacity (ide_drive_t *);
......@@ -98,10 +90,11 @@ extern unsigned long current_capacity (ide_drive_t *);
* If heads is nonzero: find a translation with this many heads and S=63.
* Otherwise: find out how OnTrack Disk Manager would translate the disk.
*/
static void
ontrack(ide_drive_t *drive, int heads, unsigned int *c, int *h, int *s) {
static const byte dm_head_vals[] = {4, 8, 16, 32, 64, 128, 255, 0};
const byte *headp = dm_head_vals;
static void ontrack(ide_drive_t *drive, int heads, unsigned int *c, int *h, int *s)
{
static const u8 dm_head_vals[] = {4, 8, 16, 32, 64, 128, 255, 0};
const u8 *headp = dm_head_vals;
unsigned long total;
/*
......@@ -153,6 +146,7 @@ ontrack(ide_drive_t *drive, int heads, unsigned int *c, int *h, int *s) {
* an IDE disk drive, or if a geometry was "forced" on the commandline.
* Returns 1 if the geometry translation was successful.
*/
int ide_xlate_1024 (kdev_t i_rdev, int xparm, int ptheads, const char *msg)
{
ide_drive_t *drive;
......@@ -217,8 +211,7 @@ int ide_xlate_1024 (kdev_t i_rdev, int xparm, int ptheads, const char *msg)
set_capacity(drive->disk, current_capacity(drive));
if (ret)
printk("%s%s [%d/%d/%d]", msg, msg1,
printk(KERN_INFO "%s%s [%d/%d/%d]", msg, msg1,
drive->bios_cyl, drive->bios_head, drive->bios_sect);
return ret;
}
#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
This diff is collapsed.
#include <linux/config.h>
#define __NO_VERSION__
#include <linux/module.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/major.h>
#include <linux/errno.h>
#include <linux/genhd.h>
#include <linux/blkpg.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/bitops.h>
/*
* IDE library routines. These are plug in code that most
* drivers can use but occasionally may be weird enough
* to want to do their own thing with
*
* Add common non I/O op stuff here. Make sure it has proper
* kernel-doc function headers or your patch will be rejected
*/
/**
* ide_xfer_verbose - return IDE mode names
* @xfer_rate: rate to name
*
* Returns a constant string giving the name of the mode
* requested.
*/
char *ide_xfer_verbose (u8 xfer_rate)
{
switch(xfer_rate) {
case XFER_UDMA_7: return("UDMA 7");
case XFER_UDMA_6: return("UDMA 6");
case XFER_UDMA_5: return("UDMA 5");
case XFER_UDMA_4: return("UDMA 4");
case XFER_UDMA_3: return("UDMA 3");
case XFER_UDMA_2: return("UDMA 2");
case XFER_UDMA_1: return("UDMA 1");
case XFER_UDMA_0: return("UDMA 0");
case XFER_MW_DMA_2: return("MW DMA 2");
case XFER_MW_DMA_1: return("MW DMA 1");
case XFER_MW_DMA_0: return("MW DMA 0");
case XFER_SW_DMA_2: return("SW DMA 2");
case XFER_SW_DMA_1: return("SW DMA 1");
case XFER_SW_DMA_0: return("SW DMA 0");
case XFER_PIO_4: return("PIO 4");
case XFER_PIO_3: return("PIO 3");
case XFER_PIO_2: return("PIO 2");
case XFER_PIO_1: return("PIO 1");
case XFER_PIO_0: return("PIO 0");
case XFER_PIO_SLOW: return("PIO SLOW");
default: return("XFER ERROR");
}
}
EXPORT_SYMBOL(ide_xfer_verbose);
/**
* ide_dma_speed - compute DMA speed
* @drive: drive
* @mode; intended mode
*
* Checks the drive capabilities and returns the speed to use
* for the transfer. Returns -1 if the requested mode is unknown
* (eg PIO)
*/
u8 ide_dma_speed(ide_drive_t *drive, u8 mode)
{
struct hd_driveid *id = drive->id;
ide_hwif_t *hwif = HWIF(drive);
u8 speed = 0;
if (drive->media != ide_disk && hwif->atapi_dma == 0)
return 0;
switch(mode) {
case 0x04:
if ((id->dma_ultra & 0x0040) &&
(id->dma_ultra & hwif->ultra_mask))
{ speed = XFER_UDMA_6; break; }
case 0x03:
if ((id->dma_ultra & 0x0020) &&
(id->dma_ultra & hwif->ultra_mask))
{ speed = XFER_UDMA_5; break; }
case 0x02:
if ((id->dma_ultra & 0x0010) &&
(id->dma_ultra & hwif->ultra_mask))
{ speed = XFER_UDMA_4; break; }
if ((id->dma_ultra & 0x0008) &&
(id->dma_ultra & hwif->ultra_mask))
{ speed = XFER_UDMA_3; break; }
case 0x01:
if ((id->dma_ultra & 0x0004) &&
(id->dma_ultra & hwif->ultra_mask))
{ speed = XFER_UDMA_2; break; }
if ((id->dma_ultra & 0x0002) &&
(id->dma_ultra & hwif->ultra_mask))
{ speed = XFER_UDMA_1; break; }
if ((id->dma_ultra & 0x0001) &&
(id->dma_ultra & hwif->ultra_mask))
{ speed = XFER_UDMA_0; break; }
case 0x00:
if ((id->dma_mword & 0x0004) &&
(id->dma_mword & hwif->mwdma_mask))
{ speed = XFER_MW_DMA_2; break; }
if ((id->dma_mword & 0x0002) &&
(id->dma_mword & hwif->mwdma_mask))
{ speed = XFER_MW_DMA_1; break; }
if ((id->dma_mword & 0x0001) &&
(id->dma_mword & hwif->mwdma_mask))
{ speed = XFER_MW_DMA_0; break; }
if ((id->dma_1word & 0x0004) &&
(id->dma_1word & hwif->swdma_mask))
{ speed = XFER_SW_DMA_2; break; }
if ((id->dma_1word & 0x0002) &&
(id->dma_1word & hwif->swdma_mask))
{ speed = XFER_SW_DMA_1; break; }
if ((id->dma_1word & 0x0001) &&
(id->dma_1word & hwif->swdma_mask))
{ speed = XFER_SW_DMA_0; break; }
}
// printk("%s: %s: mode 0x%02x, speed 0x%02x\n",
// __FUNCTION__, drive->name, mode, speed);
return speed;
}
EXPORT_SYMBOL(ide_dma_speed);
/**
* ide_rate_filter - return best speed for mode
* @mode: modes available
* @speed: desired speed
*
* Given the available DMA/UDMA mode this function returns
* the best available speed at or below the speed requested.
*/
u8 ide_rate_filter (u8 mode, u8 speed)
{
#ifdef CONFIG_BLK_DEV_IDEDMA
static u8 speed_max[] = {
XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4,
XFER_UDMA_5, XFER_UDMA_6
};
// printk("%s: mode 0x%02x, speed 0x%02x\n", __FUNCTION__, mode, speed);
/* So that we remember to update this if new modes appear */
if (mode > 4)
BUG();
return min(speed, speed_max[mode]);
#else /* !CONFIG_BLK_DEV_IDEDMA */
return min(speed, XFER_PIO_4);
#endif /* CONFIG_BLK_DEV_IDEDMA */
}
EXPORT_SYMBOL(ide_rate_filter);
int ide_dma_enable (ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
struct hd_driveid *id = drive->id;
return ((int) ((((id->dma_ultra >> 8) & hwif->ultra_mask) ||
((id->dma_mword >> 8) & hwif->mwdma_mask) ||
((id->dma_1word >> 8) & hwif->swdma_mask)) ? 1 : 0));
}
EXPORT_SYMBOL(ide_dma_enable);
This diff is collapsed.
......@@ -21,12 +21,6 @@
#include <linux/isapnp.h>
#ifndef PREPARE_FUNC
#define PREPARE_FUNC(dev) (dev->prepare)
#define ACTIVATE_FUNC(dev) (dev->activate)
#define DEACTIVATE_FUNC(dev) (dev->deactivate)
#endif
#define DEV_IO(dev, index) (dev->resource[index].start)
#define DEV_IRQ(dev, index) (dev->irq_resource[index].start)
......@@ -54,6 +48,7 @@ struct pnp_dev_t {
};
/* Generic initialisation function for ISA PnP IDE interface */
static int __init pnpide_generic_init(struct pci_dev *dev, int enable)
{
hw_regs_t hw;
......@@ -66,13 +61,16 @@ static int __init pnpide_generic_init(struct pci_dev *dev, int enable)
return 1;
ide_setup_ports(&hw, (ide_ioreg_t) DEV_IO(dev, 0),
generic_ide_offsets, (ide_ioreg_t) DEV_IO(dev, 1),
0, NULL, DEV_IRQ(dev, 0));
generic_ide_offsets,
(ide_ioreg_t) DEV_IO(dev, 1),
0, NULL,
// generic_pnp_ide_iops,
DEV_IRQ(dev, 0));
index = ide_register_hw(&hw, NULL);
if (index != -1) {
printk("ide%d: %s IDE interface\n", index, DEV_NAME(dev));
printk(KERN_INFO "ide%d: %s IDE interface\n", index, DEV_NAME(dev));
return 0;
}
......@@ -88,7 +86,6 @@ struct pnp_dev_t idepnp_devices[] __initdata = {
{ 0 }
};
#ifdef MODULE
#define NR_PNP_DEVICES 8
struct pnp_dev_inst {
struct pci_dev *dev;
......@@ -96,11 +93,11 @@ struct pnp_dev_inst {
};
static struct pnp_dev_inst devices[NR_PNP_DEVICES];
static int pnp_ide_dev_idx = 0;
#endif
/*
* Probe for ISA PnP IDE interfaces.
*/
void __init pnpide_init(int enable)
{
struct pci_dev *dev = NULL;
......@@ -109,19 +106,18 @@ void __init pnpide_init(int enable)
if (!isapnp_present())
return;
#ifdef MODULE
/* Module unload, deactivate all registered devices. */
if (!enable) {
int i;
for (i = 0; i < pnp_ide_dev_idx; i++) {
dev = devices[i].dev;
devices[i].dev_type->init_fn(dev, 0);
if (DEACTIVATE_FUNC(devices[i].dev))
DEACTIVATE_FUNC(devices[i].dev)(devices[i].dev);
if (dev->deactivate)
dev->deactivate(dev);
}
return;
}
#endif
for (dev_type = idepnp_devices; dev_type->vendor; dev_type++) {
while ((dev = isapnp_find_dev(NULL, dev_type->vendor,
dev_type->device, dev))) {
......@@ -129,20 +125,20 @@ void __init pnpide_init(int enable)
if (dev->active)
continue;
if (PREPARE_FUNC(dev) && (PREPARE_FUNC(dev))(dev) < 0) {
printk("ide: %s prepare failed\n", DEV_NAME(dev));
if (dev->prepare && dev->prepare(dev) < 0) {
printk(KERN_ERR"ide-pnp: %s prepare failed\n", DEV_NAME(dev));
continue;
}
if (ACTIVATE_FUNC(dev) && (ACTIVATE_FUNC(dev))(dev) < 0) {
printk("ide: %s activate failed\n", DEV_NAME(dev));
if (dev->activate && dev->activate(dev) < 0) {
printk(KERN_ERR"ide: %s activate failed\n", DEV_NAME(dev));
continue;
}
/* Call device initialization function */
if (dev_type->init_fn(dev, 1)) {
if (DEACTIVATE_FUNC(dev))
DEACTIVATE_FUNC(dev)(dev);
if (dev->deactivate(dev))
dev->deactivate(dev);
} else {
#ifdef MODULE
/*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment