Commit 916c2ff4 authored by Patrick Mochel's avatar Patrick Mochel

Merge bk://ldm@bkbits.net/linux-2.5-driverfs

into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-driverfs
parents f42ba7ce 9fb72010
...@@ -1337,6 +1337,12 @@ S: 998 East 900 South, Suite 26 ...@@ -1337,6 +1337,12 @@ S: 998 East 900 South, Suite 26
S: Provo, Utah 84606-5607 S: Provo, Utah 84606-5607
S: USA S: USA
N: Marcel Holtmann
E: marcel@holtmann.org
W: http://www.holtmann.org
D: Author of the Linux Bluetooth Subsystem PC Card drivers
S: Germany
N: Rob W. W. Hooft N: Rob W. W. Hooft
E: hooft@EMBL-Heidelberg.DE E: hooft@EMBL-Heidelberg.DE
D: Shared libs for graphics-tools and for the f2c compiler D: Shared libs for graphics-tools and for the f2c compiler
......
Information regarding the Enhanced IDE drive in Linux 2.5 Information regarding the Enhanced IDE drive in Linux 2.5
============================================================================== ==============================================================================
...@@ -301,6 +298,53 @@ There may be more options than shown -- use the source, Luke! ...@@ -301,6 +298,53 @@ There may be more options than shown -- use the source, Luke!
Everything else is rejected with a "BAD OPTION" message. Everything else is rejected with a "BAD OPTION" message.
================================================================================
IDE ATAPI streaming tape driver
-------------------------------
This driver is a part of the Linux ide driver and works in co-operation
with linux/drivers/block/ide.c.
The driver, in co-operation with ide.c, basically traverses the
request-list for the block device interface. The character device
interface, on the other hand, creates new requests, adds them
to the request-list of the block device, and waits for their completion.
Pipelined operation mode is now supported on both reads and writes.
The block device major and minor numbers are determined from the
tape's relative position in the ide interfaces, as explained in ide.c.
The character device interface consists of the following devices:
ht0 major 37, minor 0 first IDE tape, rewind on close.
ht1 major 37, minor 1 second IDE tape, rewind on close.
...
nht0 major 37, minor 128 first IDE tape, no rewind on close.
nht1 major 37, minor 129 second IDE tape, no rewind on close.
...
Run linux/scripts/MAKEDEV.ide to create the above entries.
The general magnetic tape commands compatible interface, as defined by
include/linux/mtio.h, is accessible through the character device.
General ide driver configuration options, such as the interrupt-unmask
flag, can be configured by issuing an ioctl to the block device interface,
as any other ide device.
Our own ide-tape ioctl's can be issued to either the block device or
the character device interface.
Maximal throughput with minimal bus load will usually be achieved in the
following scenario:
1. ide-tape is operating in the pipelined operation mode.
2. No buffering is performed by the user backup program.
================================================================================ ================================================================================
Some Terminology Some Terminology
......
...@@ -270,6 +270,12 @@ M: maxk@qualcomm.com ...@@ -270,6 +270,12 @@ M: maxk@qualcomm.com
W: http://bluez.sf.net W: http://bluez.sf.net
S: Maintained S: Maintained
BLUETOOTH SUBSYSTEM (PC Card Drivers)
P: Marcel Holtmann
M: marcel@holtmann.org
W: http://www.holtmann.org/linux/bluetooth/
S: Maintained
BTTV VIDEO4LINUX DRIVER BTTV VIDEO4LINUX DRIVER
P: Gerd Knorr P: Gerd Knorr
M: kraxel@bytesex.org M: kraxel@bytesex.org
......
...@@ -62,6 +62,20 @@ CONFIG_BLUEZ_HCIDTL1 ...@@ -62,6 +62,20 @@ CONFIG_BLUEZ_HCIDTL1
Say Y here to compile support for HCI DTL1 devices into the Say Y here to compile support for HCI DTL1 devices into the
kernel or say M to compile it as module (dtl1_cs.o). kernel or say M to compile it as module (dtl1_cs.o).
HCI BT3C (PC Card) device driver
CONFIG_BLUEZ_HCIBT3C
Bluetooth HCI BT3C (PC Card) driver.
This driver provides support for Bluetooth PCMCIA devices with
3Com BT3C interface:
3Com Bluetooth Card (3CRWB6096)
HP Bluetooth Card
The HCI BT3C driver uses external firmware loader program provided in
the BlueFW package. For more information, see <http://bluez.sf.net>.
Say Y here to compile support for HCI BT3C devices into the
kernel or say M to compile it as module (bt3c_cs.o).
HCI BlueCard (PC Card) device driver HCI BlueCard (PC Card) device driver
CONFIG_BLUEZ_HCIBLUECARD CONFIG_BLUEZ_HCIBLUECARD
Bluetooth HCI BlueCard (PC Card) driver. Bluetooth HCI BlueCard (PC Card) driver.
......
...@@ -14,6 +14,8 @@ fi ...@@ -14,6 +14,8 @@ fi
dep_tristate 'HCI DTL1 (PC Card) driver' CONFIG_BLUEZ_HCIDTL1 $CONFIG_PCMCIA $CONFIG_BLUEZ dep_tristate 'HCI DTL1 (PC Card) driver' CONFIG_BLUEZ_HCIDTL1 $CONFIG_PCMCIA $CONFIG_BLUEZ
dep_tristate 'HCI BT3C (PC Card) driver' CONFIG_BLUEZ_HCIBT3C $CONFIG_PCMCIA $CONFIG_BLUEZ
dep_tristate 'HCI BlueCard (PC Card) driver' CONFIG_BLUEZ_HCIBLUECARD $CONFIG_PCMCIA $CONFIG_BLUEZ dep_tristate 'HCI BlueCard (PC Card) driver' CONFIG_BLUEZ_HCIBLUECARD $CONFIG_PCMCIA $CONFIG_BLUEZ
dep_tristate 'HCI VHCI (Virtual HCI device) driver' CONFIG_BLUEZ_HCIVHCI $CONFIG_BLUEZ dep_tristate 'HCI VHCI (Virtual HCI device) driver' CONFIG_BLUEZ_HCIVHCI $CONFIG_BLUEZ
......
...@@ -6,6 +6,7 @@ obj-$(CONFIG_BLUEZ_HCIUSB) += hci_usb.o ...@@ -6,6 +6,7 @@ obj-$(CONFIG_BLUEZ_HCIUSB) += hci_usb.o
obj-$(CONFIG_BLUEZ_HCIVHCI) += hci_vhci.o obj-$(CONFIG_BLUEZ_HCIVHCI) += hci_vhci.o
obj-$(CONFIG_BLUEZ_HCIUART) += hci_uart.o obj-$(CONFIG_BLUEZ_HCIUART) += hci_uart.o
obj-$(CONFIG_BLUEZ_HCIDTL1) += dtl1_cs.o obj-$(CONFIG_BLUEZ_HCIDTL1) += dtl1_cs.o
obj-$(CONFIG_BLUEZ_HCIBT3C) += bt3c_cs.o
obj-$(CONFIG_BLUEZ_HCIBLUECARD) += bluecard_cs.o obj-$(CONFIG_BLUEZ_HCIBLUECARD) += bluecard_cs.o
hci_uart-y := hci_ldisc.o hci_uart-y := hci_ldisc.o
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -107,13 +107,14 @@ static inline void out_reg(u8 data, u8 reg) ...@@ -107,13 +107,14 @@ static inline void out_reg(u8 data, u8 reg)
* Set PIO mode for the specified drive. * Set PIO mode for the specified drive.
* This function computes timing parameters * This function computes timing parameters
* and sets controller registers accordingly. * and sets controller registers accordingly.
* It assumes IRQ's are disabled or at least that no other process will
* attempt to access the IDE registers concurrently.
*/ */
static void ali14xx_tune_drive(struct ata_device *drive, u8 pio) static void ali14xx_tune_drive(struct ata_device *drive, u8 pio)
{ {
int drive_num; int drive_num;
int time1, time2; int time1, time2;
u8 param1, param2, param3, param4; u8 param1, param2, param3, param4;
unsigned long flags;
struct ata_timing *t; struct ata_timing *t;
if (pio == 255) if (pio == 255)
...@@ -140,15 +141,12 @@ static void ali14xx_tune_drive(struct ata_device *drive, u8 pio) ...@@ -140,15 +141,12 @@ static void ali14xx_tune_drive(struct ata_device *drive, u8 pio)
/* stuff timing parameters into controller registers */ /* stuff timing parameters into controller registers */
drive_num = (drive->channel->index << 1) + drive->select.b.unit; drive_num = (drive->channel->index << 1) + drive->select.b.unit;
save_flags(flags); /* all CPUs */
cli(); /* all CPUs */
outb_p(reg_on, base_port); outb_p(reg_on, base_port);
out_reg(param1, reg_tab[drive_num].reg1); out_reg(param1, reg_tab[drive_num].reg1);
out_reg(param2, reg_tab[drive_num].reg2); out_reg(param2, reg_tab[drive_num].reg2);
out_reg(param3, reg_tab[drive_num].reg3); out_reg(param3, reg_tab[drive_num].reg3);
out_reg(param4, reg_tab[drive_num].reg4); out_reg(param4, reg_tab[drive_num].reg4);
outb_p(reg_off, base_port); outb_p(reg_off, base_port);
restore_flags(flags); /* all CPUs */
} }
/* /*
......
...@@ -218,6 +218,7 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev) ...@@ -218,6 +218,7 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev)
} }
} }
} }
if (!master_0) { if (!master_0) {
printk("%s: unable to locate PCI MASTER function\n", dev->name); printk("%s: unable to locate PCI MASTER function\n", dev->name);
return 0; return 0;
...@@ -227,15 +228,13 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev) ...@@ -227,15 +228,13 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev)
return 0; return 0;
} }
save_flags(flags);
cli(); /* all CPUs (there should only be one CPU with this chipset) */
/* /*
* Enable BusMaster and MemoryWriteAndInvalidate for the cs5530: * Enable BusMaster and MemoryWriteAndInvalidate for the cs5530:
* --> OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530 * --> OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530
*/ */
pci_read_config_word (cs5530_0, PCI_COMMAND, &pcicmd);
pci_write_config_word(cs5530_0, PCI_COMMAND, pcicmd | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE); pci_set_master(cs5530_0);
pci_set_mwi(cs5530_0);
/* /*
* Set PCI CacheLineSize to 16-bytes: * Set PCI CacheLineSize to 16-bytes:
...@@ -274,8 +273,6 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev) ...@@ -274,8 +273,6 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev)
pci_write_config_byte(master_0, 0x42, 0x00); pci_write_config_byte(master_0, 0x42, 0x00);
pci_write_config_byte(master_0, 0x43, 0xc1); pci_write_config_byte(master_0, 0x43, 0xc1);
restore_flags(flags);
return 0; return 0;
} }
......
...@@ -66,21 +66,18 @@ static void sub22 (char b, char c) ...@@ -66,21 +66,18 @@ static void sub22 (char b, char c)
} }
} }
/* Assumes IRQ's are disabled or at least that no other process will
attempt to access the IDE registers concurrently. */
static void tune_dtc2278(struct ata_device *drive, u8 pio) static void tune_dtc2278(struct ata_device *drive, u8 pio)
{ {
unsigned long flags;
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0; pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
if (pio >= 3) { if (pio >= 3) {
save_flags(flags); /* all CPUs */
cli(); /* all CPUs */
/* /*
* This enables PIO mode4 (3?) on the first interface * This enables PIO mode4 (3?) on the first interface
*/ */
sub22(1,0xc3); sub22(1,0xc3);
sub22(0,0xa0); sub22(0,0xa0);
restore_flags(flags); /* all CPUs */
} else { } else {
/* we don't know how to set it back again.. */ /* we don't know how to set it back again.. */
} }
......
/* /*
* linux/drivers/ide/hd.c
*
* Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1991, 1992 Linus Torvalds
*/ *
/*
* This is the low-level hd interrupt support. It traverses the * This is the low-level hd interrupt support. It traverses the
* request-list, using interrupts to jump between functions. As * request-list, using interrupts to jump between functions. As
* all the functions are called within interrupts, we may not * all the functions are called within interrupts, we may not
* sleep. Special care is recommended. * sleep. Special care is recommended.
* *
* modified by Drew Eckhardt to check nr of hd's from the CMOS. * modified by Drew Eckhardt to check nr of hd's from the CMOS.
* *
* Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug * Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug
...@@ -26,10 +22,10 @@ ...@@ -26,10 +22,10 @@
* Bugfix: max_sectors must be <= 255 or the wheels tend to come * Bugfix: max_sectors must be <= 255 or the wheels tend to come
* off in a hurry once you queue things up - Paul G. 02/2001 * off in a hurry once you queue things up - Paul G. 02/2001
*/ */
/* Uncomment the following if you want verbose error reports. */ /* Uncomment the following if you want verbose error reports. */
/* #define VERBOSE_ERRORS */ /* #define VERBOSE_ERRORS */
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -37,7 +33,6 @@ ...@@ -37,7 +33,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/devfs_fs_kernel.h> #include <linux/devfs_fs_kernel.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/hdreg.h>
#include <linux/genhd.h> #include <linux/genhd.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -45,6 +40,7 @@ ...@@ -45,6 +40,7 @@
#include <linux/mc146818rtc.h> /* CMOS defines */ #include <linux/mc146818rtc.h> /* CMOS defines */
#include <linux/init.h> #include <linux/init.h>
#include <linux/blkpg.h> #include <linux/blkpg.h>
#include <linux/hdreg.h>
#define REALLY_SLOW_IO #define REALLY_SLOW_IO
#include <asm/system.h> #include <asm/system.h>
...@@ -55,6 +51,15 @@ ...@@ -55,6 +51,15 @@
#define DEVICE_NR(device) (minor(device)>>6) #define DEVICE_NR(device) (minor(device)>>6)
#include <linux/blk.h> #include <linux/blk.h>
/* ATA commands we use.
*/
#define WIN_SPECIFY 0x91 /* set drive geometry translation */
#define WIN_RESTORE 0x10
#define WIN_READ 0x20 /* 28-Bit */
#define WIN_WRITE 0x30 /* 28-Bit */
#define HD_IRQ 14 /* the standard disk interrupt */
#ifdef __arm__ #ifdef __arm__
#undef HD_IRQ #undef HD_IRQ
#endif #endif
...@@ -63,6 +68,45 @@ ...@@ -63,6 +68,45 @@
#define HD_IRQ IRQ_HARDDISK #define HD_IRQ IRQ_HARDDISK
#endif #endif
/* Hd controller regster ports */
#define HD_DATA 0x1f0 /* _CTL when writing */
#define HD_ERROR 0x1f1 /* see err-bits */
#define HD_NSECTOR 0x1f2 /* nr of sectors to read/write */
#define HD_SECTOR 0x1f3 /* starting sector */
#define HD_LCYL 0x1f4 /* starting cylinder */
#define HD_HCYL 0x1f5 /* high byte of starting cyl */
#define HD_CURRENT 0x1f6 /* 101dhhhh , d=drive, hhhh=head */
#define HD_STATUS 0x1f7 /* see status-bits */
#define HD_FEATURE HD_ERROR /* same io address, read=error, write=feature */
#define HD_PRECOMP HD_FEATURE /* obsolete use of this port - predates IDE */
#define HD_COMMAND HD_STATUS /* same io address, read=status, write=cmd */
#define HD_CMD 0x3f6 /* used for resets */
#define HD_ALTSTATUS 0x3f6 /* same as HD_STATUS but doesn't clear irq */
/* Bits of HD_STATUS */
#define ERR_STAT 0x01
#define INDEX_STAT 0x02
#define ECC_STAT 0x04 /* Corrected error */
#define DRQ_STAT 0x08
#define SEEK_STAT 0x10
#define SERVICE_STAT SEEK_STAT
#define WRERR_STAT 0x20
#define READY_STAT 0x40
#define BUSY_STAT 0x80
/* Bits for HD_ERROR */
#define MARK_ERR 0x01 /* Bad address mark */
#define TRK0_ERR 0x02 /* couldn't find track 0 */
#define ABRT_ERR 0x04 /* Command aborted */
#define MCR_ERR 0x08 /* media change request */
#define ID_ERR 0x10 /* ID field not found */
#define MC_ERR 0x20 /* media changed */
#define ECC_ERR 0x40 /* Uncorrectable ECC error */
#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */
#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */
static spinlock_t hd_lock = SPIN_LOCK_UNLOCKED; static spinlock_t hd_lock = SPIN_LOCK_UNLOCKED;
static int revalidate_hddisk(kdev_t, int); static int revalidate_hddisk(kdev_t, int);
...@@ -162,12 +206,9 @@ void __init hd_setup(char *str, int *ints) ...@@ -162,12 +206,9 @@ void __init hd_setup(char *str, int *ints)
static void dump_status (const char *msg, unsigned int stat) static void dump_status (const char *msg, unsigned int stat)
{ {
unsigned long flags;
char devc; char devc;
devc = !blk_queue_empty(QUEUE) ? 'a' + DEVICE_NR(CURRENT->rq_dev) : '?'; devc = !blk_queue_empty(QUEUE) ? 'a' + DEVICE_NR(CURRENT->rq_dev) : '?';
save_flags (flags);
sti();
#ifdef VERBOSE_ERRORS #ifdef VERBOSE_ERRORS
printk("hd%c: %s: status=0x%02x { ", devc, msg, stat & 0xff); printk("hd%c: %s: status=0x%02x { ", devc, msg, stat & 0xff);
if (stat & BUSY_STAT) printk("Busy "); if (stat & BUSY_STAT) printk("Busy ");
...@@ -207,8 +248,7 @@ static void dump_status (const char *msg, unsigned int stat) ...@@ -207,8 +248,7 @@ static void dump_status (const char *msg, unsigned int stat)
hd_error = inb(HD_ERROR); hd_error = inb(HD_ERROR);
printk("hd%c: %s: error=0x%02x.\n", devc, msg, hd_error & 0xff); printk("hd%c: %s: error=0x%02x.\n", devc, msg, hd_error & 0xff);
} }
#endif /* verbose errors */ #endif
restore_flags (flags);
} }
void check_status(void) void check_status(void)
...@@ -467,7 +507,7 @@ static void write_intr(void) ...@@ -467,7 +507,7 @@ static void write_intr(void)
if (i > 0) { if (i > 0) {
SET_HANDLER(&write_intr); SET_HANDLER(&write_intr);
outsw(HD_DATA,CURRENT->buffer,256); outsw(HD_DATA,CURRENT->buffer,256);
sti(); local_irq_enable();
} else { } else {
#if (HD_DELAY > 0) #if (HD_DELAY > 0)
last_req = read_timer(); last_req = read_timer();
...@@ -500,7 +540,7 @@ static void hd_times_out(unsigned long dummy) ...@@ -500,7 +540,7 @@ static void hd_times_out(unsigned long dummy)
return; return;
disable_irq(HD_IRQ); disable_irq(HD_IRQ);
sti(); local_irq_enable();
reset = 1; reset = 1;
dev = DEVICE_NR(CURRENT->rq_dev); dev = DEVICE_NR(CURRENT->rq_dev);
printk("hd%c: timeout\n", dev+'a'); printk("hd%c: timeout\n", dev+'a');
...@@ -510,7 +550,7 @@ static void hd_times_out(unsigned long dummy) ...@@ -510,7 +550,7 @@ static void hd_times_out(unsigned long dummy)
#endif #endif
end_request(CURRENT, 0); end_request(CURRENT, 0);
} }
cli(); local_irq_disable();
hd_request(); hd_request();
enable_irq(HD_IRQ); enable_irq(HD_IRQ);
} }
...@@ -548,7 +588,7 @@ static void hd_request(void) ...@@ -548,7 +588,7 @@ static void hd_request(void)
return; return;
repeat: repeat:
del_timer(&device_timer); del_timer(&device_timer);
sti(); local_irq_enable();
if (blk_queue_empty(QUEUE)) { if (blk_queue_empty(QUEUE)) {
do_hd = NULL; do_hd = NULL;
...@@ -556,7 +596,7 @@ static void hd_request(void) ...@@ -556,7 +596,7 @@ static void hd_request(void)
} }
if (reset) { if (reset) {
cli(); local_irq_disable();
reset_hd(); reset_hd();
return; return;
} }
...@@ -688,7 +728,7 @@ static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -688,7 +728,7 @@ static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (!handler) if (!handler)
handler = unexpected_hd_interrupt; handler = unexpected_hd_interrupt;
handler(); handler();
sti(); local_irq_enable();
} }
static struct block_device_operations hd_fops = { static struct block_device_operations hd_fops = {
......
...@@ -249,12 +249,8 @@ static u8 ht_pio2timings(struct ata_device *drive, u8 pio) ...@@ -249,12 +249,8 @@ static u8 ht_pio2timings(struct ata_device *drive, u8 pio)
*/ */
static void ht_set_prefetch(struct ata_device *drive, u8 state) static void ht_set_prefetch(struct ata_device *drive, u8 state)
{ {
unsigned long flags;
int t = HT_PREFETCH_MODE << 8; int t = HT_PREFETCH_MODE << 8;
save_flags (flags); /* all CPUs */
cli(); /* all CPUs */
/* /*
* Prefetch mode and unmask irq seems to conflict * Prefetch mode and unmask irq seems to conflict
*/ */
...@@ -267,16 +263,16 @@ static void ht_set_prefetch(struct ata_device *drive, u8 state) ...@@ -267,16 +263,16 @@ static void ht_set_prefetch(struct ata_device *drive, u8 state)
drive->channel->no_unmask = 0; drive->channel->no_unmask = 0;
} }
restore_flags (flags); /* all CPUs */
#ifdef DEBUG #ifdef DEBUG
printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis")); printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis"));
#endif #endif
} }
/* Assumes IRQ's are disabled or at least that no other process will attempt to
* access the IDE registers concurrently.
*/
static void tune_ht6560b(struct ata_device *drive, u8 pio) static void tune_ht6560b(struct ata_device *drive, u8 pio)
{ {
unsigned long flags;
u8 timing; u8 timing;
switch (pio) { switch (pio) {
...@@ -288,14 +284,9 @@ static void tune_ht6560b(struct ata_device *drive, u8 pio) ...@@ -288,14 +284,9 @@ static void tune_ht6560b(struct ata_device *drive, u8 pio)
timing = ht_pio2timings(drive, pio); timing = ht_pio2timings(drive, pio);
save_flags (flags); /* all CPUs */
cli(); /* all CPUs */
drive->drive_data &= 0xff00; drive->drive_data &= 0xff00;
drive->drive_data |= timing; drive->drive_data |= timing;
restore_flags (flags); /* all CPUs */
#ifdef DEBUG #ifdef DEBUG
printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing); printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing);
#endif #endif
......
...@@ -305,8 +305,9 @@ ...@@ -305,8 +305,9 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <linux/ide.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -2914,7 +2915,7 @@ int ide_cdrom_cleanup(struct ata_device *drive) ...@@ -2914,7 +2915,7 @@ int ide_cdrom_cleanup(struct ata_device *drive)
struct cdrom_info *info = drive->driver_data; struct cdrom_info *info = drive->driver_data;
struct cdrom_device_info *devinfo = &info->devinfo; struct cdrom_device_info *devinfo = &info->devinfo;
if (ide_unregister_subdriver (drive)) if (ata_unregister_device(drive))
return 1; return 1;
if (info->buffer != NULL) if (info->buffer != NULL)
kfree(info->buffer); kfree(info->buffer);
...@@ -2973,7 +2974,7 @@ static void ide_cdrom_attach(struct ata_device *drive) ...@@ -2973,7 +2974,7 @@ static void ide_cdrom_attach(struct ata_device *drive)
printk(KERN_ERR "%s: Can't allocate a cdrom structure\n", drive->name); printk(KERN_ERR "%s: Can't allocate a cdrom structure\n", drive->name);
return; return;
} }
if (ide_register_subdriver (drive, &ide_cdrom_driver)) { if (ata_register_device(drive, &ide_cdrom_driver)) {
printk(KERN_ERR "%s: Failed to register the driver with ide.c\n", drive->name); printk(KERN_ERR "%s: Failed to register the driver with ide.c\n", drive->name);
kfree (info); kfree (info);
return; return;
......
...@@ -1279,7 +1279,7 @@ static int idedisk_cleanup(struct ata_device *drive) ...@@ -1279,7 +1279,7 @@ static int idedisk_cleanup(struct ata_device *drive)
printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n", printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n",
drive->name); drive->name);
} }
ret = ide_unregister_subdriver(drive); ret = ata_unregister_device(drive);
/* FIXME: This is killing the kernel with BUG 185 at asm/spinlocks.h /* FIXME: This is killing the kernel with BUG 185 at asm/spinlocks.h
* horribly. Check whatever we did REGISTER the device properly * horribly. Check whatever we did REGISTER the device properly
...@@ -1471,8 +1471,8 @@ static void idedisk_attach(struct ata_device *drive) ...@@ -1471,8 +1471,8 @@ static void idedisk_attach(struct ata_device *drive)
if (req[0] != '\0' && strcmp(req, "ide-disk")) if (req[0] != '\0' && strcmp(req, "ide-disk"))
return; return;
if (ide_register_subdriver(drive, &idedisk_driver)) { if (ata_register_device(drive, &idedisk_driver)) {
printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name); printk(KERN_ERR "%s: Failed to register the driver with ide.c\n", drive->name);
return; return;
} }
......
...@@ -94,9 +94,10 @@ ...@@ -94,9 +94,10 @@
#include <linux/genhd.h> #include <linux/genhd.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <linux/buffer_head.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/atapi.h> #include <linux/atapi.h>
#include <linux/buffer_head.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -1722,10 +1723,10 @@ static int idefloppy_cleanup(struct ata_device *drive) ...@@ -1722,10 +1723,10 @@ static int idefloppy_cleanup(struct ata_device *drive)
{ {
idefloppy_floppy_t *floppy = drive->driver_data; idefloppy_floppy_t *floppy = drive->driver_data;
if (ide_unregister_subdriver (drive)) if (ata_unregister_device(drive))
return 1; return 1;
drive->driver_data = NULL; drive->driver_data = NULL;
kfree (floppy); kfree(floppy);
return 0; return 0;
} }
...@@ -1779,7 +1780,7 @@ static void idefloppy_attach(struct ata_device *drive) ...@@ -1779,7 +1780,7 @@ static void idefloppy_attach(struct ata_device *drive)
drive->name); drive->name);
return; return;
} }
if (ide_register_subdriver(drive, &idefloppy_driver)) { if (ata_register_device(drive, &idefloppy_driver)) {
printk(KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name); printk(KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
kfree (floppy); kfree (floppy);
return; return;
......
...@@ -550,7 +550,8 @@ static void __init hpt374_device_order_fixup (struct pci_dev *dev, struct ata_pc ...@@ -550,7 +550,8 @@ static void __init hpt374_device_order_fixup (struct pci_dev *dev, struct ata_pc
if (!dev2) { if (!dev2) {
return; return;
} else { } else {
byte irq = 0, irq2 = 0; u8 irq = 0;
u8 irq2 = 0;
pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
pci_read_config_byte(dev2, PCI_INTERRUPT_LINE, &irq2); pci_read_config_byte(dev2, PCI_INTERRUPT_LINE, &irq2);
if (irq != irq2) { if (irq != irq2) {
......
This diff is collapsed.
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
#include "ioctl.h" #include "ioctl.h"
/* BIG GEOMETRY - dying, used only by HDIO_GETGEO_BIG_RAW */
struct hd_big_geometry {
u8 heads;
u8 sectors;
u32 cylinders;
unsigned long start;
};
/* /*
* Implement generic ioctls invoked from userspace to imlpement specific * Implement generic ioctls invoked from userspace to imlpement specific
* functionality. * functionality.
......
...@@ -89,10 +89,7 @@ static void it8172_tune_drive (struct ata_device *drive, u8 pio) ...@@ -89,10 +89,7 @@ static void it8172_tune_drive (struct ata_device *drive, u8 pio)
drive_enables |= 0x0006; drive_enables |= 0x0006;
} }
save_flags(flags);
cli();
pci_write_config_word(dev, master_port, master_data); pci_write_config_word(dev, master_port, master_data);
restore_flags(flags);
} }
#if defined(CONFIG_BLK_DEV_IDEDMA) && defined(CONFIG_IT8172_TUNING) #if defined(CONFIG_BLK_DEV_IDEDMA) && defined(CONFIG_IT8172_TUNING)
......
This diff is collapsed.
...@@ -244,13 +244,15 @@ static void compute_clocks(int pio, pio_clocks_t *clks) ...@@ -244,13 +244,15 @@ static void compute_clocks(int pio, pio_clocks_t *clks)
} }
/* Main tune procedure, called from tuneproc. */ /* Main tune procedure, called from tuneproc.
Assumes IRQ's are disabled or at least that no other process will
attempt to access the IDE registers concurrently.
*/
static void opti621_tune_drive(struct ata_device *drive, u8 pio) static void opti621_tune_drive(struct ata_device *drive, u8 pio)
{ {
/* primary and secondary drives share some registers, /* primary and secondary drives share some registers,
* so we have to program both drives * so we have to program both drives
*/ */
unsigned long flags;
u8 pio1, pio2; u8 pio1, pio2;
pio_clocks_t first, second; pio_clocks_t first, second;
int ax, drdy; int ax, drdy;
...@@ -281,9 +283,6 @@ static void opti621_tune_drive(struct ata_device *drive, u8 pio) ...@@ -281,9 +283,6 @@ static void opti621_tune_drive(struct ata_device *drive, u8 pio)
hwif->name, ax, second.data_time, second.recovery_time, drdy); hwif->name, ax, second.data_time, second.recovery_time, drdy);
#endif #endif
save_flags(flags); /* all CPUs */
cli(); /* all CPUs */
reg_base = hwif->io_ports[IDE_DATA_OFFSET]; reg_base = hwif->io_ports[IDE_DATA_OFFSET];
outb(0xc0, reg_base+CNTRL_REG); /* allow Register-B */ outb(0xc0, reg_base+CNTRL_REG); /* allow Register-B */
outb(0xff, reg_base+5); /* hmm, setupvic.exe does this ;-) */ outb(0xff, reg_base+5); /* hmm, setupvic.exe does this ;-) */
...@@ -306,8 +305,6 @@ static void opti621_tune_drive(struct ata_device *drive, u8 pio) ...@@ -306,8 +305,6 @@ static void opti621_tune_drive(struct ata_device *drive, u8 pio)
write_reg(misc, MISC_REG); /* set address setup, DRDY timings, */ write_reg(misc, MISC_REG); /* set address setup, DRDY timings, */
/* and read prefetch for both drives */ /* and read prefetch for both drives */
restore_flags(flags); /* all CPUs */
} }
/* /*
......
...@@ -1082,7 +1082,12 @@ static void channel_init(struct ata_channel *ch) ...@@ -1082,7 +1082,12 @@ static void channel_init(struct ata_channel *ch)
} }
} }
#ifdef CONFIG_BLK_DEV_HD #ifdef CONFIG_BLK_DEV_HD
if (ch->irq == HD_IRQ && ch->io_ports[IDE_DATA_OFFSET] != HD_DATA) {
/* The first "legacy" HD gets distinguished by the IRQ it is attached
* to and the IO port it takes.
*/
if (ch->irq == 14 && ch->io_ports[IDE_DATA_OFFSET] != 0x1f0) {
printk("%s: CANNOT SHARE IRQ WITH OLD HARDDISK DRIVER (hd.c)\n", ch->name); printk("%s: CANNOT SHARE IRQ WITH OLD HARDDISK DRIVER (hd.c)\n", ch->name);
return; return;
......
/* /*
* Copyright (C) 1996-2001 Linus Torvalds & author (see below) * Copyright (C) 1996-2001 Linus Torvalds & author (see below)
*/ *
/*
* Version 0.03 Cleaned auto-tune, added probe * Version 0.03 Cleaned auto-tune, added probe
* Version 0.04 Added second channel tuning * Version 0.04 Added second channel tuning
* Version 0.05 Enhanced tuning ; added qd6500 support * Version 0.05 Enhanced tuning ; added qd6500 support
...@@ -81,36 +79,12 @@ ...@@ -81,36 +79,12 @@
* bit 5 : status, but of what ? * bit 5 : status, but of what ?
* bit 6 : always set 1 by dos driver * bit 6 : always set 1 by dos driver
* bit 7 : set 1 for non-ATAPI devices on primary port * bit 7 : set 1 for non-ATAPI devices on primary port
* (maybe read-ahead and post-write buffer ?) * (maybe read-ahead and post-write buffer ?)
*/ */
static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */ static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */
static void qd_write_reg(u8 content, unsigned int reg)
{
unsigned long flags;
save_flags(flags); /* all CPUs */
cli(); /* all CPUs */
outb(content,reg);
restore_flags(flags); /* all CPUs */
}
static u8 __init qd_read_reg(unsigned int reg)
{
unsigned long flags;
u8 read;
save_flags(flags); /* all CPUs */
cli(); /* all CPUs */
read = inb(reg);
restore_flags(flags); /* all CPUs */
return read;
}
/* /*
* qd_select:
*
* This routine is invoked from ide.c to prepare for access to a given drive. * This routine is invoked from ide.c to prepare for access to a given drive.
*/ */
...@@ -120,12 +94,10 @@ static void qd_select(struct ata_device *drive) ...@@ -120,12 +94,10 @@ static void qd_select(struct ata_device *drive)
(QD_TIMREG(drive) & 0x02); (QD_TIMREG(drive) & 0x02);
if (timings[index] != QD_TIMING(drive)) if (timings[index] != QD_TIMING(drive))
qd_write_reg(timings[index] = QD_TIMING(drive), QD_TIMREG(drive)); outb(timings[index] = QD_TIMING(drive), QD_TIMREG(drive));
} }
/* /*
* qd6500_compute_timing
*
* computes the timing value where * computes the timing value where
* lower nibble represents active time, in count of VLB clocks * lower nibble represents active time, in count of VLB clocks
* upper nibble represents recovery time, in count of VLB clocks * upper nibble represents recovery time, in count of VLB clocks
...@@ -147,8 +119,6 @@ static u8 qd6500_compute_timing(struct ata_channel *hwif, int active_time, int r ...@@ -147,8 +119,6 @@ static u8 qd6500_compute_timing(struct ata_channel *hwif, int active_time, int r
} }
/* /*
* qd6580_compute_timing
*
* idem for qd6580 * idem for qd6580
*/ */
...@@ -161,8 +131,6 @@ static u8 qd6580_compute_timing(int active_time, int recovery_time) ...@@ -161,8 +131,6 @@ static u8 qd6580_compute_timing(int active_time, int recovery_time)
} }
/* /*
* qd_find_disk_type
*
* tries to find timing from dos driver's table * tries to find timing from dos driver's table
*/ */
...@@ -187,8 +155,6 @@ static int qd_find_disk_type(struct ata_device *drive, ...@@ -187,8 +155,6 @@ static int qd_find_disk_type(struct ata_device *drive,
} }
/* /*
* qd_timing_ok:
*
* check whether timings don't conflict * check whether timings don't conflict
*/ */
...@@ -201,8 +167,6 @@ static int qd_timing_ok(struct ata_device drives[]) ...@@ -201,8 +167,6 @@ static int qd_timing_ok(struct ata_device drives[])
} }
/* /*
* qd_set_timing:
*
* records the timing, and enables selectproc as needed * records the timing, and enables selectproc as needed
*/ */
...@@ -221,10 +185,6 @@ static void qd_set_timing(struct ata_device *drive, u8 timing) ...@@ -221,10 +185,6 @@ static void qd_set_timing(struct ata_device *drive, u8 timing)
printk(KERN_DEBUG "%s: %#x\n", drive->name, timing); printk(KERN_DEBUG "%s: %#x\n", drive->name, timing);
} }
/*
* qd6500_tune_drive
*/
static void qd6500_tune_drive(struct ata_device *drive, u8 pio) static void qd6500_tune_drive(struct ata_device *drive, u8 pio)
{ {
int active_time = 175; int active_time = 175;
...@@ -242,10 +202,6 @@ static void qd6500_tune_drive(struct ata_device *drive, u8 pio) ...@@ -242,10 +202,6 @@ static void qd6500_tune_drive(struct ata_device *drive, u8 pio)
qd_set_timing(drive, qd6500_compute_timing(drive->channel, active_time, recovery_time)); qd_set_timing(drive, qd6500_compute_timing(drive->channel, active_time, recovery_time));
} }
/*
* qd6580_tune_drive
*/
static void qd6580_tune_drive(struct ata_device *drive, u8 pio) static void qd6580_tune_drive(struct ata_device *drive, u8 pio)
{ {
struct ata_timing *t; struct ata_timing *t;
...@@ -291,7 +247,7 @@ static void qd6580_tune_drive(struct ata_device *drive, u8 pio) ...@@ -291,7 +247,7 @@ static void qd6580_tune_drive(struct ata_device *drive, u8 pio)
} }
if (!drive->channel->unit && drive->type != ATA_DISK) { if (!drive->channel->unit && drive->type != ATA_DISK) {
qd_write_reg(0x5f, QD_CONTROL_PORT); outb(0x5f, QD_CONTROL_PORT);
printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO and post-write buffer on %s.\n", drive->name, drive->channel->name); printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO and post-write buffer on %s.\n", drive->name, drive->channel->name);
} }
...@@ -299,8 +255,6 @@ static void qd6580_tune_drive(struct ata_device *drive, u8 pio) ...@@ -299,8 +255,6 @@ static void qd6580_tune_drive(struct ata_device *drive, u8 pio)
} }
/* /*
* qd_testreg
*
* tests if the given port is a register * tests if the given port is a register
*/ */
...@@ -329,8 +283,6 @@ static int __init qd_testreg(int port) ...@@ -329,8 +283,6 @@ static int __init qd_testreg(int port)
} }
/* /*
* qd_setup:
*
* called to setup an ata channel : adjusts attributes & links for tuning * called to setup an ata channel : adjusts attributes & links for tuning
*/ */
...@@ -349,8 +301,6 @@ void __init qd_setup(int unit, int base, int config, unsigned int data0, unsigne ...@@ -349,8 +301,6 @@ void __init qd_setup(int unit, int base, int config, unsigned int data0, unsigne
} }
/* /*
* qd_unsetup:
*
* called to unsetup an ata channel : back to default values, unlinks tuning * called to unsetup an ata channel : back to default values, unlinks tuning
*/ */
void __init qd_unsetup(int unit) { void __init qd_unsetup(int unit) {
...@@ -368,13 +318,13 @@ void __init qd_unsetup(int unit) { ...@@ -368,13 +318,13 @@ void __init qd_unsetup(int unit) {
if (tuneproc == (void *) qd6500_tune_drive) { if (tuneproc == (void *) qd6500_tune_drive) {
// will do it for both // will do it for both
qd_write_reg(QD6500_DEF_DATA, QD_TIMREG(&hwif->drives[0])); outb(QD6500_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
} else if (tuneproc == (void *) qd6580_tune_drive) { } else if (tuneproc == (void *) qd6580_tune_drive) {
if (QD_CONTROL(hwif) & QD_CONTR_SEC_DISABLED) { if (QD_CONTROL(hwif) & QD_CONTR_SEC_DISABLED) {
qd_write_reg(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); outb(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
qd_write_reg(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1])); outb(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1]));
} else { } else {
qd_write_reg(unit?QD6580_DEF_DATA2:QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); outb(unit ? QD6580_DEF_DATA2 : QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
} }
} else { } else {
printk(KERN_WARNING "Unknown qd65xx tuning fonction !\n"); printk(KERN_WARNING "Unknown qd65xx tuning fonction !\n");
...@@ -383,8 +333,6 @@ void __init qd_unsetup(int unit) { ...@@ -383,8 +333,6 @@ void __init qd_unsetup(int unit) {
} }
/* /*
* qd_probe:
*
* looks at the specified baseport, and if qd found, registers & initialises it * looks at the specified baseport, and if qd found, registers & initialises it
* return 1 if another qd may be probed * return 1 if another qd may be probed
*/ */
...@@ -394,7 +342,7 @@ int __init qd_probe(int base) ...@@ -394,7 +342,7 @@ int __init qd_probe(int base)
u8 config; u8 config;
int unit; int unit;
config = qd_read_reg(QD_CONFIG_PORT); config = inb(QD_CONFIG_PORT);
if (! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) ) return 1; if (! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) ) return 1;
...@@ -425,7 +373,7 @@ int __init qd_probe(int base) ...@@ -425,7 +373,7 @@ int __init qd_probe(int base)
/* qd6580 found */ /* qd6580 found */
control = qd_read_reg(QD_CONTROL_PORT); control = inb(QD_CONTROL_PORT);
printk(KERN_NOTICE "qd6580 at %#x\n", base); printk(KERN_NOTICE "qd6580 at %#x\n", base);
printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n", config, control, QD_ID3); printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n", config, control, QD_ID3);
...@@ -434,7 +382,7 @@ int __init qd_probe(int base) ...@@ -434,7 +382,7 @@ int __init qd_probe(int base)
/* secondary disabled */ /* secondary disabled */
printk(KERN_INFO "%s: qd6580: single IDE board\n", ide_hwifs[unit].name); printk(KERN_INFO "%s: qd6580: single IDE board\n", ide_hwifs[unit].name);
qd_setup(unit, base, config | (control << 8), QD6580_DEF_DATA, QD6580_DEF_DATA2, &qd6580_tune_drive); qd_setup(unit, base, config | (control << 8), QD6580_DEF_DATA, QD6580_DEF_DATA2, &qd6580_tune_drive);
qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT); outb(QD_DEF_CONTR, QD_CONTROL_PORT);
return 1; return 1;
} else { } else {
...@@ -443,7 +391,7 @@ int __init qd_probe(int base) ...@@ -443,7 +391,7 @@ int __init qd_probe(int base)
qd_setup(ATA_PRIMARY, base, config | (control << 8), QD6580_DEF_DATA, QD6580_DEF_DATA, &qd6580_tune_drive); qd_setup(ATA_PRIMARY, base, config | (control << 8), QD6580_DEF_DATA, QD6580_DEF_DATA, &qd6580_tune_drive);
qd_setup(ATA_SECONDARY, base, config | (control << 8), QD6580_DEF_DATA2, QD6580_DEF_DATA2, &qd6580_tune_drive); qd_setup(ATA_SECONDARY, base, config | (control << 8), QD6580_DEF_DATA2, QD6580_DEF_DATA2, &qd6580_tune_drive);
qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT); outb(QD_DEF_CONTR, QD_CONTROL_PORT);
return 0; /* no other qd65xx possible */ return 0; /* no other qd65xx possible */
} }
...@@ -454,8 +402,6 @@ int __init qd_probe(int base) ...@@ -454,8 +402,6 @@ int __init qd_probe(int base)
#ifndef MODULE #ifndef MODULE
/* /*
* init_qd65xx:
*
* called by ide.c when parsing command line * called by ide.c when parsing command line
*/ */
......
/* /*
* Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il> * Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il>
*/ *
/*
* Emulation of a SCSI host adapter for IDE ATAPI devices. * Emulation of a SCSI host adapter for IDE ATAPI devices.
* *
* With this driver, one can use the Linux SCSI drivers instead of the * With this driver, one can use the Linux SCSI drivers instead of the
* native IDE ATAPI drivers. * native IDE ATAPI drivers.
*
* Ver 0.1 Dec 3 96 Initial version.
* Ver 0.2 Jan 26 97 Fixed bug in cleanup_module() and added emulation
* of MODE_SENSE_6/MODE_SELECT_6 for cdroms. Thanks
* to Janos Farkas for pointing this out.
* Avoid using bitfields in structures for m68k.
* Added Scatter/Gather and DMA support.
* Ver 0.4 Dec 7 97 Add support for ATAPI PD/CD drives.
* Use variable timeout for each command.
* Ver 0.5 Jan 2 98 Fix previous PD/CD support.
* Allow disabling of SCSI-6 to SCSI-10 transformation.
* Ver 0.6 Jan 27 98 Allow disabling of SCSI command translation layer
* for access through /dev/sg.
* Fix MODE_SENSE_6/MODE_SELECT_6/INQUIRY translation.
* Ver 0.7 Dec 04 98 Ignore commands where lun != 0 to avoid multiple
* detection of devices with CONFIG_SCSI_MULTI_LUN
* Ver 0.8 Feb 05 99 Optical media need translation too. Reverse 0.7.
* Ver 0.9 Jul 04 99 Fix a bug in SG_SET_TRANSFORM.
*/ */
#define IDESCSI_VERSION "0.9"
#include <linux/module.h> #include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -495,9 +474,8 @@ static void idescsi_release(struct inode *inode, struct file *filp, struct ata_d ...@@ -495,9 +474,8 @@ static void idescsi_release(struct inode *inode, struct file *filp, struct ata_d
static Scsi_Host_Template template; static Scsi_Host_Template template;
static int idescsi_cleanup (struct ata_device *drive) static int idescsi_cleanup (struct ata_device *drive)
{ {
if (ide_unregister_subdriver (drive)) { if (ata_unregister_device(drive))
return 1; return 1;
}
scsi_unregister_host(&template); scsi_unregister_host(&template);
return 0; return 0;
...@@ -762,7 +740,7 @@ static void idescsi_attach(struct ata_device *drive) ...@@ -762,7 +740,7 @@ static void idescsi_attach(struct ata_device *drive)
host = scsi_register(&template, sizeof(idescsi_scsi_t)); host = scsi_register(&template, sizeof(idescsi_scsi_t));
if (!host) { if (!host) {
printk (KERN_ERR printk(KERN_ERR
"ide-scsi: %s: Can't allocate a scsi host structure\n", "ide-scsi: %s: Can't allocate a scsi host structure\n",
drive->name); drive->name);
return; return;
...@@ -771,8 +749,8 @@ static void idescsi_attach(struct ata_device *drive) ...@@ -771,8 +749,8 @@ static void idescsi_attach(struct ata_device *drive)
host->max_lun = drive->last_lun + 1; host->max_lun = drive->last_lun + 1;
host->max_id = 1; host->max_id = 1;
if (ide_register_subdriver(drive, &ata_ops)) { if (ata_register_device(drive, &ata_ops)) {
printk (KERN_ERR "ide-scsi: %s: Failed to register the driver with ide.c\n", drive->name); printk(KERN_ERR "ide-scsi: %s: Failed to register the driver with ide.c\n", drive->name);
scsi_unregister(host); scsi_unregister(host);
return; return;
} }
......
...@@ -40,43 +40,47 @@ ...@@ -40,43 +40,47 @@
static void pdump (void *, int); static void pdump (void *, int);
#endif #endif
/* Bits of HD_STATUS */
#define ERR_STAT 0x01
#define DRQ_STAT 0x08
struct freecom_udata { struct freecom_udata {
__u8 buffer[64]; /* Common command block. */ u8 buffer[64]; /* Common command block. */
}; };
typedef struct freecom_udata *freecom_udata_t; typedef struct freecom_udata *freecom_udata_t;
/* All of the outgoing packets are 64 bytes long. */ /* All of the outgoing packets are 64 bytes long. */
struct freecom_cb_wrap { struct freecom_cb_wrap {
__u8 Type; /* Command type. */ u8 Type; /* Command type. */
__u8 Timeout; /* Timeout in seconds. */ u8 Timeout; /* Timeout in seconds. */
__u8 Atapi[12]; /* An ATAPI packet. */ u8 Atapi[12]; /* An ATAPI packet. */
__u8 Filler[50]; /* Padding Data. */ u8 Filler[50]; /* Padding Data. */
}; };
struct freecom_xfer_wrap { struct freecom_xfer_wrap {
__u8 Type; /* Command type. */ u8 Type; /* Command type. */
__u8 Timeout; /* Timeout in seconds. */ u8 Timeout; /* Timeout in seconds. */
__u32 Count; /* Number of bytes to transfer. */ u32 Count; /* Number of bytes to transfer. */
__u8 Pad[58]; u8 Pad[58];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct freecom_ide_out { struct freecom_ide_out {
__u8 Type; /* Type + IDE register. */ u8 Type; /* Type + IDE register. */
__u8 Pad; u8 Pad;
__u16 Value; /* Value to write. */ u16 Value; /* Value to write. */
__u8 Pad2[60]; u8 Pad2[60];
}; };
struct freecom_ide_in { struct freecom_ide_in {
__u8 Type; /* Type | IDE register. */ u8 Type; /* Type | IDE register. */
__u8 Pad[63]; u8 Pad[63];
}; };
struct freecom_status { struct freecom_status {
__u8 Status; u8 Status;
__u8 Reason; u8 Reason;
__u16 Count; u16 Count;
__u8 Pad[60]; u8 Pad[60];
}; };
/* Freecom stuffs the interrupt status in the INDEX_STAT bit of the ide /* Freecom stuffs the interrupt status in the INDEX_STAT bit of the ide
......
This diff is collapsed.
This diff is collapsed.
...@@ -608,22 +608,20 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p) ...@@ -608,22 +608,20 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p)
} }
/* /*
* Ok, this is the main fork-routine. It copies the system process * This creates a new process as a copy of the old one,
* information (task[nr]) and sets up the necessary registers. It also * but does not actually start it yet.
* copies the data segment in its entirety. The "stack_start" and *
* "stack_top" arguments are simply passed along to the platform * It copies the registers, and all the appropriate
* specific copy_thread() routine. Most platforms ignore stack_top. * parts of the process environment (as per the clone
* For an example that's using stack_top, see * flags). The actual kick-off is left to the caller.
* arch/ia64/kernel/process.c.
*/ */
struct task_struct *do_fork(unsigned long clone_flags, static struct task_struct *copy_process(unsigned long clone_flags,
unsigned long stack_start, unsigned long stack_start,
struct pt_regs *regs, struct pt_regs *regs,
unsigned long stack_size) unsigned long stack_size)
{ {
int retval; int retval;
struct task_struct *p = NULL; struct task_struct *p = NULL;
struct completion vfork;
if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS)) if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
...@@ -680,10 +678,6 @@ struct task_struct *do_fork(unsigned long clone_flags, ...@@ -680,10 +678,6 @@ struct task_struct *do_fork(unsigned long clone_flags,
INIT_LIST_HEAD(&p->sibling); INIT_LIST_HEAD(&p->sibling);
init_waitqueue_head(&p->wait_chldexit); init_waitqueue_head(&p->wait_chldexit);
p->vfork_done = NULL; p->vfork_done = NULL;
if (clone_flags & CLONE_VFORK) {
p->vfork_done = &vfork;
init_completion(&vfork);
}
spin_lock_init(&p->alloc_lock); spin_lock_init(&p->alloc_lock);
spin_lock_init(&p->switch_lock); spin_lock_init(&p->switch_lock);
...@@ -803,20 +797,6 @@ struct task_struct *do_fork(unsigned long clone_flags, ...@@ -803,20 +797,6 @@ struct task_struct *do_fork(unsigned long clone_flags,
hash_pid(p); hash_pid(p);
nr_threads++; nr_threads++;
write_unlock_irq(&tasklist_lock); write_unlock_irq(&tasklist_lock);
if (p->ptrace & PT_PTRACED)
send_sig(SIGSTOP, p, 1);
wake_up_forked_process(p); /* do this last */
++total_forks;
if (clone_flags & CLONE_VFORK)
wait_for_completion(&vfork);
else
/*
* Let the child process run first, to avoid most of the
* COW overhead when the child exec()s afterwards.
*/
set_need_resched();
retval = 0; retval = 0;
fork_out: fork_out:
...@@ -850,6 +830,45 @@ struct task_struct *do_fork(unsigned long clone_flags, ...@@ -850,6 +830,45 @@ struct task_struct *do_fork(unsigned long clone_flags,
goto fork_out; goto fork_out;
} }
/*
* Ok, this is the main fork-routine.
*
* It copies the process, and if successful kick-starts
* it and waits for it to finish using the VM if required.
*/
struct task_struct *do_fork(unsigned long clone_flags,
unsigned long stack_start,
struct pt_regs *regs,
unsigned long stack_size)
{
struct task_struct *p;
p = copy_process(clone_flags, stack_start, regs, stack_size);
if (!IS_ERR(p)) {
struct completion vfork;
if (clone_flags & CLONE_VFORK) {
p->vfork_done = &vfork;
init_completion(&vfork);
}
if (p->ptrace & PT_PTRACED)
send_sig(SIGSTOP, p, 1);
wake_up_forked_process(p); /* do this last */
++total_forks;
if (clone_flags & CLONE_VFORK)
wait_for_completion(&vfork);
else
/*
* Let the child process run first, to avoid most of the
* COW overhead when the child exec()s afterwards.
*/
set_need_resched();
}
return p;
}
/* SLAB cache for signal_struct structures (tsk->sig) */ /* SLAB cache for signal_struct structures (tsk->sig) */
kmem_cache_t *sigact_cachep; kmem_cache_t *sigact_cachep;
......
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