Commit 8c6c406e authored by Paul Mackerras's avatar Paul Mackerras

Merge samba.org:/home/paulus/kernel/linux-2.5

into samba.org:/home/paulus/kernel/for-linus-ppc
parents a654a58e 49cda8eb
......@@ -56,6 +56,7 @@ o modutils 2.4.2 # insmod -V
o e2fsprogs 1.25 # tune2fs
o jfsutils 1.0.14 # fsck.jfs -V
o reiserfsprogs 3.x.1b # reiserfsck 2>&1|grep reiserfsprogs
o xfsprogs 2.1.0 # xfs_db -V
o pcmcia-cs 3.1.21 # cardmgr -V
o PPP 2.4.0 # pppd --version
o isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version
......@@ -182,6 +183,17 @@ The reiserfsprogs package should be used for reiserfs-3.6.x
versions of mkreiserfs, resize_reiserfs, debugreiserfs and
reiserfsck. These utils work on both i386 and alpha platforms.
Xfsprogs
--------
The latest version of xfsprogs contains mkfs.xfs, xfs_db, and the
xfs_repair utilities, among others, for the XFS filesystem. It is
architecture independent and any version from 2.0.0 onward should
work correctly with this version of the XFS kernel code. For the new
(v2) log format that has better support for stripe-size aligning on
LVM and MD devices at least xfsprogs 2.1.0 is needed.
Pcmcia-cs
---------
......@@ -316,6 +328,10 @@ Reiserfsprogs
-------------
o <ftp://ftp.namesys.com/pub/reiserfsprogs/reiserfsprogs-3.x.1b.tar.gz>
Xfsprogs
--------
o <ftp://oss.sgi.com/projects/xfs/download/cmd_tars/xfsprogs-2.1.0.src.tar.gz>
LVM toolset
-----------
o <http://www.sistina.com/lvm/>
......
......@@ -46,3 +46,5 @@ vfat.txt
- info on using the VFAT filesystem used in Windows NT and Windows 95
vfs.txt
- Overview of the Virtual File System
xfs.txt
- info and mount options for the XFS filesystem.
The SGI XFS Filesystem
======================
XFS is a high performance journaling filesystem which originated
on the SGI IRIX platform. It is completely multi-threaded, can
support large files and large filesystems, extended attributes,
variable block sizes, is extent based, and makes extensive use of
Btrees (directories, extents, free space) to aid both performance
and scalability.
Refer to the documentation at http://oss.sgi.com/projects/xfs/
for further details. This implementation is on-disk compatible
with the IRIX version of XFS.
Options
=======
When mounting an XFS filesystem, the following options are accepted.
biosize=size
Sets the preferred buffered I/O size (default size is 64K).
"size" must be expressed as the logarithm (base2) of the
desired I/O size.
Valid values for this option are 14 through 16, inclusive
(i.e. 16K, 32K, and 64K bytes). On machines with a 4K
pagesize, 13 (8K bytes) is also a valid size.
The preferred buffered I/O size can also be altered on an
individual file basis using the ioctl(2) system call.
dmapi/xdsm
Enable the DMAPI (Data Management API) event callouts.
irixsgid
Do not inherit the ISGID bit on subdirectories of ISGID
directories, if the process creating the subdirectory
is not a member of the parent directory group ID.
This matches IRIX behavior.
logbufs=value
Set the number of in-memory log buffers. Valid numbers range
from 2-8 inclusive.
The default value is 8 buffers for filesystems with a
blocksize of 64K, 4 buffers for filesystems with a blocksize
of 32K, 3 buffers for filesystems with a blocksize of 16K
and 2 buffers for all other configurations. Increasing the
number of buffers may increase performance on some workloads
at the cost of the memory used for the additional log buffers
and their associated control structures.
logbsize=value
Set the size of each in-memory log buffer.
Size may be specified in bytes, or in kilobytes with a "k" suffix.
Valid sizes for version 1 and version 2 logs are 16384 (16k) and
32768 (32k). Valid sizes for version 2 logs also include
65536 (64k), 131072 (128k) and 262144 (256k).
The default value for machines with more than 32MB of memory
is 32768, machines with less memory use 16384 by default.
logdev=device and rtdev=device
Use an external log (metadata journal) and/or real-time device.
An XFS filesystem has up to three parts: a data section, a log
section, and a real-time section. The real-time section is
optional, and the log section can be separate from the data
section or contained within it.
noalign
Data allocations will not be aligned at stripe unit boundaries.
noatime
Access timestamps are not updated when a file is read.
norecovery
The filesystem will be mounted without running log recovery.
If the filesystem was not cleanly unmounted, it is likely to
be inconsistent when mounted in "norecovery" mode.
Some files or directories may not be accessible because of this.
Filesystems mounted "norecovery" must be mounted read-only or
the mount will fail.
osyncisosync
Make O_SYNC writes implement true O_SYNC. WITHOUT this option,
Linux XFS behaves as if an "osyncisdsync" option is used,
which will make writes to files opened with the O_SYNC flag set
behave as if the O_DSYNC flag had been used instead.
This can result in better performance without compromising
data safety.
However if this option is not in effect, timestamp updates from
O_SYNC writes can be lost if the system crashes.
If timestamp updates are critical, use the osyncisosync option.
quota/usrquota/uqnoenforce
User disk quota accounting enabled, and limits (optionally)
enforced.
grpquota/gqnoenforce
Group disk quota accounting enabled and limits (optionally)
enforced.
sunit=value and swidth=value
Used to specify the stripe unit and width for a RAID device or
a stripe volume. "value" must be specified in 512-byte block
units.
If this option is not specified and the filesystem was made on
a stripe volume or the stripe width or unit were specified for
the RAID device at mkfs time, then the mount system call will
restore the value from the superblock. For filesystems that
are made directly on RAID devices, these options can be used
to override the information in the superblock if the underlying
disk layout changes after the filesystem has been created.
The "swidth" option is required if the "sunit" option has been
specified, and must be a multiple of the "sunit" value.
nouuid
Don't check for double mounted file systems using the file system uuid.
This is useful to mount LVM snapshot volumes.
......@@ -1912,6 +1912,14 @@ M: eis@baty.hanse.de
L: linux-x25@vger.kernel.org
S: Maintained
XFS FILESYSTEM
P: Silicon Graphics Inc
M: owner-xfs@oss.sgi.com
M: lord@sgi.com
L: linux-xfs@oss.sgi.com
W: http://oss.sgi.com/projects/xfs
S: Supported
X86 3-LEVEL PAGING (PAE) SUPPORT
P: Ingo Molnar
M: mingo@redhat.com
......
......@@ -171,6 +171,11 @@ void show_stack(unsigned long *sp)
dik_show_trace(sp);
}
void dump_stack(void)
{
show_stack(NULL);
}
void
die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15)
{
......
......@@ -230,8 +230,12 @@ watchdog_bite_hook(struct pt_regs *regs)
#endif
}
/* This is normally the 'Oops' routine */
void dump_stack(void)
{
show_stack(NULL);
}
/* This is normally the 'Oops' routine */
void
die_if_kernel(const char * str, struct pt_regs * regs, long err)
{
......
......@@ -25,6 +25,15 @@ CONFIG_SMP
If you don't know what to do here, say N.
CONFIG_HUGETLB_PAGE
This enables support for huge pages. User space applications
can make use of this support with the sys_alloc_hugepages and
sys_free_hugepages system calls. If your applications are
huge page aware and your processor (Pentium or later for x86)
supports this, then say Y here.
Otherwise, say N.
CONFIG_PREEMPT
This option reduces the latency of the kernel when reacting to
real-time or interactive events by allowing a low priority process to
......
......@@ -154,6 +154,8 @@ if [ "$CONFIG_MWINCHIP3D" = "y" ]; then
define_bool CONFIG_X86_OOSTORE y
fi
bool 'IA-32 Huge TLB Page Support (if available on processor)' CONFIG_HUGETLB_PAGE
bool 'Symmetric multi-processing support' CONFIG_SMP
bool 'Preemptible Kernel' CONFIG_PREEMPT
if [ "$CONFIG_SMP" != "y" ]; then
......
......@@ -157,24 +157,6 @@ static void __init init_amd(struct cpuinfo_x86 *c)
// return r;
}
static void amd_identify(struct cpuinfo_x86 * c)
{
u32 xlvl;
if (have_cpuid_p()) {
generic_identify(c);
/* AMD-defined flags: level 0x80000001 */
xlvl = cpuid_eax(0x80000000);
if ( (xlvl & 0xffff0000) == 0x80000000 ) {
if ( xlvl >= 0x80000001 )
c->x86_capability[1] = cpuid_edx(0x80000001);
if ( xlvl >= 0x80000004 )
get_model_name(c); /* Default name */
}
}
}
static unsigned int amd_size_cache(struct cpuinfo_x86 * c, unsigned int size)
{
/* AMD errata T13 (order #21922) */
......@@ -204,7 +186,7 @@ static struct cpu_dev amd_cpu_dev __initdata = {
},
},
.c_init = init_amd,
.c_identify = amd_identify,
.c_identify = generic_identify,
.c_size_cache = amd_size_cache,
};
......
......@@ -204,7 +204,7 @@ int __init have_cpuid_p(void)
void __init generic_identify(struct cpuinfo_x86 * c)
{
u32 tfms;
u32 tfms, xlvl;
int junk;
if (have_cpuid_p()) {
......@@ -230,6 +230,15 @@ void __init generic_identify(struct cpuinfo_x86 * c)
/* Have CPUID level 0 only - unheard of */
c->x86 = 4;
}
/* AMD-defined flags: level 0x80000001 */
xlvl = cpuid_eax(0x80000000);
if ( (xlvl & 0xffff0000) == 0x80000000 ) {
if ( xlvl >= 0x80000001 )
c->x86_capability[1] = cpuid_edx(0x80000001);
if ( xlvl >= 0x80000004 )
get_model_name(c); /* Default name */
}
}
}
......
......@@ -156,7 +156,6 @@ static void __init init_intel(struct cpuinfo_x86 *c)
}
#endif
get_model_name(c);
if (c->cpuid_level > 1) {
/* supports eax=2 call */
......
......@@ -64,6 +64,11 @@ static void __init init_transmeta(struct cpuinfo_x86 *c)
wrmsr(0x80860004, ~0, uk);
c->x86_capability[0] = cpuid_edx(0x00000001);
wrmsr(0x80860004, cap_mask, uk);
/* If we can run i686 user-space code, call us an i686 */
#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
c->x86 = 6;
}
static void transmeta_identify(struct cpuinfo_x86 * c)
......
......@@ -759,8 +759,8 @@ 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_alloc_hugepages /* 250 */
.long sys_free_hugepages
.long sys_exit_group
.rept NR_syscalls-(.-sys_call_table)/4
......
......@@ -246,3 +246,94 @@ asmlinkage int sys_olduname(struct oldold_utsname * name)
return error;
}
#ifdef CONFIG_HUGETLB_PAGE
#define HPAGE_ALIGN(x) (((unsigned long)x + (HPAGE_SIZE -1)) & HPAGE_MASK)
extern long sys_munmap(unsigned long, size_t);
/* get_addr function gets the currently unused virtaul range in
* current process's address space. It returns the LARGE_PAGE_SIZE
* aligned address (in cases of success). Other kernel generic
* routines only could gurantee that allocated address is PAGE_SIZSE aligned.
*/
static unsigned long
get_addr(unsigned long addr, unsigned long len)
{
struct vm_area_struct *vma;
if (addr) {
addr = HPAGE_ALIGN(addr);
vma = find_vma(current->mm, addr);
if (((TASK_SIZE - len) >= addr) &&
(!vma || addr + len <= vma->vm_start))
goto found_addr;
}
addr = HPAGE_ALIGN(TASK_UNMAPPED_BASE);
for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
if (TASK_SIZE - len < addr)
return -ENOMEM;
if (!vma || ((addr + len) < vma->vm_start))
goto found_addr;
addr = vma->vm_end;
}
found_addr:
addr = HPAGE_ALIGN(addr);
return addr;
}
asmlinkage unsigned long
sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag)
{
struct mm_struct *mm = current->mm;
unsigned long raddr;
int retval = 0;
extern int alloc_hugetlb_pages(int, unsigned long, unsigned long, int, int);
if (!(cpu_has_pse))
return -EINVAL;
if (key < 0)
return -EINVAL;
if (len & (HPAGE_SIZE - 1))
return -EINVAL;
down_write(&mm->mmap_sem);
raddr = get_addr(addr, len);
if (raddr == -ENOMEM)
goto raddr_out;
retval = alloc_hugetlb_pages(key, raddr, len, prot, flag);
raddr_out: up_write(&mm->mmap_sem);
if (retval < 0)
return (unsigned long) retval;
return raddr;
}
asmlinkage int
sys_free_hugepages(unsigned long addr)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
int retval;
extern int free_hugepages(struct vm_area_struct *);
vma = find_vma(current->mm, addr);
if ((!vma) || (!is_vm_hugetlb_page(vma)) || (vma->vm_start!=addr))
return -EINVAL;
down_write(&mm->mmap_sem);
spin_lock(&mm->page_table_lock);
retval = free_hugepages(vma);
spin_unlock(&mm->page_table_lock);
up_write(&mm->mmap_sem);
return retval;
}
#else
asmlinkage unsigned long
sys_alloc_hugepages(int key, unsigned long addr, size_t len, int prot, int flag)
{
return -ENOSYS;
}
asmlinkage int
sys_free_hugepages(unsigned long addr)
{
return -ENOSYS;
}
#endif
......@@ -189,6 +189,14 @@ void show_stack(unsigned long * esp)
show_trace(esp);
}
/*
* The architecture-independent dump_stack generator
*/
void dump_stack(void)
{
show_stack(0);
}
void show_registers(struct pt_regs *regs)
{
int i;
......
......@@ -12,5 +12,6 @@ O_TARGET := mm.o
obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o
obj-$(CONFIG_DISCONTIGMEM) += discontig.o
export-objs := pageattr.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
include $(TOPDIR)/Rules.make
This diff is collapsed.
......@@ -215,19 +215,14 @@ void __init permanent_kmaps_init(pgd_t *pgd_base)
void __init one_highpage_init(struct page *page, int pfn, int bad_ppro)
{
if (!page_is_ram(pfn)) {
if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
ClearPageReserved(page);
set_bit(PG_highmem, &page->flags);
set_page_count(page, 1);
__free_page(page);
totalhigh_pages++;
} else
SetPageReserved(page);
return;
}
if (bad_ppro && page_kills_ppro(pfn)) {
SetPageReserved(page);
return;
}
ClearPageReserved(page);
set_bit(PG_highmem, &page->flags);
atomic_set(&page->count, 1);
__free_page(page);
totalhigh_pages++;
}
#ifndef CONFIG_DISCONTIGMEM
......@@ -431,6 +426,13 @@ static void __init set_max_mapnr_init(void)
extern void set_max_mapnr_init(void);
#endif /* !CONFIG_DISCONTIGMEM */
#ifdef CONFIG_HUGETLB_PAGE
long htlbpagemem = 0;
int htlbpage_max;
long htlbzone_pages;
extern struct list_head htlbpage_freelist;
#endif
void __init mem_init(void)
{
extern int ppro_with_ram_bug(void);
......@@ -493,6 +495,30 @@ void __init mem_init(void)
#ifndef CONFIG_SMP
zap_low_mappings();
#endif
#ifdef CONFIG_HUGETLB_PAGE
{
long i, j;
struct page *page, *map;
/*For now reserve quarter for hugetlb_pages.*/
htlbzone_pages = (max_low_pfn >> ((HPAGE_SHIFT - PAGE_SHIFT) + 2)) ;
/*Will make this kernel command line. */
INIT_LIST_HEAD(&htlbpage_freelist);
for (i=0; i<htlbzone_pages; i++) {
page = alloc_pages(GFP_ATOMIC, HUGETLB_PAGE_ORDER);
if (page == NULL)
break;
map = page;
for (j=0; j<(HPAGE_SIZE/PAGE_SIZE); j++) {
SetPageReserved(map);
map++;
}
list_add(&page->list, &htlbpage_freelist);
}
printk("Total Huge_TLB_Page memory pages allocated %ld\n", i);
htlbzone_pages = htlbpagemem = i;
htlbpage_max = i;
}
#endif
}
#if CONFIG_X86_PAE
......
......@@ -2345,22 +2345,19 @@ static int
check_task_state(struct task_struct *task)
{
int ret = 0;
#ifdef CONFIG_SMP
/* We must wait until the state has been completely
* saved. There can be situations where the reader arrives before
* after the task is marked as STOPPED but before pfm_save_regs()
* is completed.
*/
if (task->state != TASK_ZOMBIE && task->state != TASK_STOPPED) return -EBUSY;
DBprintk(("before wait_task_inactive [%d] state %ld\n", task->pid, task->state));
wait_task_inactive(task);
DBprintk(("after wait_task_inactive [%d] state %ld\n", task->pid, task->state));
#else
if (task->state != TASK_ZOMBIE && task->state != TASK_STOPPED) {
DBprintk(("warning [%d] not in stable state %ld\n", task->pid, task->state));
ret = -EBUSY;
}
#endif
DBprintk(("before wait_task_inactive [%d] state %ld\n", task->pid, task->state));
wait_task_inactive(task);
DBprintk(("after wait_task_inactive [%d] state %ld\n", task->pid, task->state));
return ret;
}
......
......@@ -177,14 +177,9 @@ int elevator_linus_merge(request_queue_t *q, struct request **req,
if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
break;
/*
* simply "aging" of requests in queue
*/
if (elv_linus_sequence(__rq)-- <= 0)
break;
if (!(__rq->flags & REQ_CMD))
continue;
if (elv_linus_sequence(__rq) < bio_sectors(bio))
break;
......@@ -200,24 +195,20 @@ int elevator_linus_merge(request_queue_t *q, struct request **req,
}
}
return ret;
}
void elevator_linus_merge_cleanup(request_queue_t *q, struct request *req, int count)
{
struct list_head *entry;
BUG_ON(req->q != q);
/*
* second pass scan of requests that got passed over, if any
* if *req, it's either a seek or merge in the middle of the queue
*/
entry = &req->queuelist;
while ((entry = entry->next) != &q->queue_head) {
struct request *tmp;
tmp = list_entry_rq(entry);
elv_linus_sequence(tmp) -= count;
if (*req) {
struct list_head *entry = &(*req)->queuelist;
int cost = ret ? 1 : ELV_LINUS_SEEK_COST;
while ((entry = entry->next) != &q->queue_head) {
__rq = list_entry_rq(entry);
elv_linus_sequence(__rq) -= cost;
}
}
return ret;
}
void elevator_linus_merge_req(request_queue_t *q, struct request *req,
......@@ -260,8 +251,8 @@ int elevator_linus_init(request_queue_t *q, elevator_t *e)
if (!latency)
return -ENOMEM;
latency[READ] = 8192;
latency[WRITE] = 16384;
latency[READ] = 1024;
latency[WRITE] = 2048;
e->elevator_data = latency;
return 0;
......@@ -355,15 +346,6 @@ int elevator_global_init(void)
return 0;
}
void elv_merge_cleanup(request_queue_t *q, struct request *rq,
int nr_sectors)
{
elevator_t *e = &q->elevator;
if (e->elevator_merge_cleanup_fn)
e->elevator_merge_cleanup_fn(q, rq, nr_sectors);
}
int elv_merge(request_queue_t *q, struct request **rq, struct bio *bio)
{
elevator_t *e = &q->elevator;
......@@ -460,7 +442,6 @@ inline struct list_head *elv_get_sort_head(request_queue_t *q,
elevator_t elevator_linus = {
elevator_merge_fn: elevator_linus_merge,
elevator_merge_cleanup_fn: elevator_linus_merge_cleanup,
elevator_merge_req_fn: elevator_linus_merge_req,
elevator_next_req_fn: elevator_noop_next_request,
elevator_add_req_fn: elevator_linus_add_request,
......
......@@ -1508,7 +1508,6 @@ static int __make_request(request_queue_t *q, struct bio *bio)
req->biotail->bi_next = bio;
req->biotail = bio;
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
elv_merge_cleanup(q, req, nr_sectors);
drive_stat_acct(req, nr_sectors, 0);
attempt_back_merge(q, req);
goto out;
......@@ -1532,7 +1531,6 @@ static int __make_request(request_queue_t *q, struct bio *bio)
req->hard_cur_sectors = cur_nr_sectors;
req->sector = req->hard_sector = sector;
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
elv_merge_cleanup(q, req, nr_sectors);
drive_stat_acct(req, nr_sectors, 0);
attempt_front_merge(q, req);
goto out;
......
......@@ -16,20 +16,8 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
dep_mbool ' Use multi-mode by default' CONFIG_IDEDISK_MULTI_MODE $CONFIG_BLK_DEV_IDEDISK
dep_mbool ' Auto-Geometry Resizing support' CONFIG_IDEDISK_STROKE $CONFIG_BLK_DEV_IDEDISK
define_bool CONFIG_BLK_DEV_IDEDISK_VENDOR n
dep_mbool ' Fujitsu Vendor Specific' CONFIG_BLK_DEV_IDEDISK_FUJITSU $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' IBM Vendor Specific' CONFIG_BLK_DEV_IDEDISK_IBM $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' Maxtor Vendor Specific' CONFIG_BLK_DEV_IDEDISK_MAXTOR $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' Quantum Vendor Specific' CONFIG_BLK_DEV_IDEDISK_QUANTUM $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' Seagate Vendor Specific' CONFIG_BLK_DEV_IDEDISK_SEAGATE $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' Western Digital Vendor Specific' CONFIG_BLK_DEV_IDEDISK_WD $CONFIG_BLK_DEV_IDEDISK_VENDOR
define_bool CONFIG_BLK_DEV_COMMERIAL n
dep_mbool ' TiVo Commerial Application Specific' CONFIG_BLK_DEV_TIVO $CONFIG_BLK_DEV_COMMERIAL
dep_tristate ' PCMCIA IDE support' CONFIG_BLK_DEV_IDECS $CONFIG_BLK_DEV_IDE $CONFIG_PCMCIA
dep_tristate ' Include IDE/ATAPI CDROM support' CONFIG_BLK_DEV_IDECD $CONFIG_BLK_DEV_IDE
dep_mbool ' Reduce media failure retries support' CONFIG_BLK_DEV_IDECD_BAILOUT $CONFIG_BLK_DEV_IDECD
#dep_tristate ' Include IDE/ATAPI TAPE support' CONFIG_BLK_DEV_IDETAPE $CONFIG_BLK_DEV_IDE
dep_tristate ' Include IDE/ATAPI FLOPPY support' CONFIG_BLK_DEV_IDEFLOPPY $CONFIG_BLK_DEV_IDE
dep_tristate ' SCSI emulation support' CONFIG_BLK_DEV_IDESCSI $CONFIG_BLK_DEV_IDE $CONFIG_SCSI
......@@ -45,7 +33,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
if [ "$CONFIG_PCI" = "y" ]; then
bool ' Generic PCI IDE chipset support' CONFIG_BLK_DEV_IDEPCI
if [ "$CONFIG_BLK_DEV_IDEPCI" = "y" ]; then
dep_bool ' Orphan Chipset Support' CONFIG_BLK_DEV_GENERIC $CONFIG_BLK_DEV_IDEPCI
dep_bool ' Generic PCI IDE Chipset Support' CONFIG_BLK_DEV_GENERIC $CONFIG_BLK_DEV_IDEPCI
bool ' Sharing PCI IDE interrupts support' CONFIG_IDEPCI_SHARE_IRQ
bool ' Generic PCI bus-master DMA support' CONFIG_BLK_DEV_IDEDMA_PCI
bool ' Boot off-board chipsets first support' CONFIG_BLK_DEV_OFFBOARD
......@@ -55,44 +43,40 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' ATA Work(s) In Progress (EXPERIMENTAL)' CONFIG_IDEDMA_PCI_WIP $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL
dep_bool ' Good-Bad DMA Model-Firmware (WIP)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_IDEDMA_PCI_WIP
# dep_bool ' Asynchronous DMA support (WIP) (EXPERIMENTAL)' CONFIG_BLK_DEV_ADMA $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_IDEDMA_PCI_WIP $CONFIG_EXPERIMENTAL
define_bool CONFIG_BLK_DEV_ADMA $CONFIG_BLK_DEV_IDEDMA_PCI
# dep_bool ' Tag Command Queue DMA support (WIP) (EXPERIMENTAL)' CONFIG_BLK_DEV_IDEDMA_TCQ $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_IDEDMA_PCI_WIP $CONFIG_EXPERIMENTAL
dep_bool ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3
dep_bool ' AMD Viper support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' AMD Viper ATA-66 Override' CONFIG_AMD74XX_OVERRIDE $CONFIG_BLK_DEV_AMD74XX
dep_bool ' CMD64{3|6|8|9} chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' HPT34X AUTODMA support (WIP)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_IDEDMA_PCI_WIP
dep_bool ' HPT366/368/370 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI
if [ "$CONFIG_X86" = "y" -o "$CONFIG_IA64" = "y" ]; then
dep_mbool ' Intel PIIXn chipsets support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI
fi
dep_tristate ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3
dep_tristate ' AMD Viper support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' AMD Viper ATA-66 Override' CONFIG_AMD74XX_OVERRIDE $CONFIG_BLK_DEV_AMD74XX
dep_tristate ' CMD64{3|6|8|9} chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' HPT34X AUTODMA support (WIP)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_IDEDMA_PCI_WIP
dep_tristate ' HPT366/368/370 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' Intel PIIXn chipsets support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI
if [ "$CONFIG_MIPS_ITE8172" = "y" -o "$CONFIG_MIPS_IVR" = "y" ]; then
dep_mbool ' IT8172 IDE support' CONFIG_BLK_DEV_IT8172 $CONFIG_BLK_DEV_IDEDMA_PCI
fi
dep_bool ' nVidia NFORCE support' CONFIG_BLK_DEV_NFORCE $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' NS87415 chipset support' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL
# dep_bool ' Pacific Digital ADMA100 basic support' CONFIG_BLK_DEV_ADMA100 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' PROMISE PDC202{46|62|65|67} support' CONFIG_BLK_DEV_PDC202XX_OLD $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX_OLD $CONFI_BLK_DEV_IDEDMA_PCI
dep_bool ' PROMISE PDC202{68|69|70|71|75|76|77} support' CONFIG_BLK_DEV_PDC202XX_NEW $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX
dep_bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_X86
dep_bool ' ServerWorks OSB4/CSB5/CSB6 chipsets support' CONFIG_BLK_DEV_SVWKS $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Silicon Image chipset support' CONFIG_BLK_DEV_SIIMAGE $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86
dep_bool ' SLC90E66 chipset support' CONFIG_BLK_DEV_SLC90E66 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Tekram TRM290 chipset support' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' VIA82CXXX chipset support' CONFIG_BLK_DEV_VIA82CXXX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' nVidia NFORCE support' CONFIG_BLK_DEV_NFORCE $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' NS87415 chipset support' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL
dep_tristate ' PROMISE PDC202{46|62|65|67} support' CONFIG_BLK_DEV_PDC202XX_OLD $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX_OLD $CONFI_BLK_DEV_IDEDMA_PCI
dep_tristate ' PROMISE PDC202{68|69|70|71|75|76|77} support' CONFIG_BLK_DEV_PDC202XX_NEW $CONFIG_BLK_DEV_IDEDMA_PCI
# FIXME - probably wants to be one for old and for new
dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX_NEW
dep_tristate ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_X86
dep_tristate ' ServerWorks OSB4/CSB5/CSB6 chipsets support' CONFIG_BLK_DEV_SVWKS $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' Silicon Image chipset support' CONFIG_BLK_DEV_SIIMAGE $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86
dep_tristate ' SLC90E66 chipset support' CONFIG_BLK_DEV_SLC90E66 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' Tekram TRM290 chipset support' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' VIA82CXXX chipset support' CONFIG_BLK_DEV_VIA82CXXX $CONFIG_BLK_DEV_IDEDMA_PCI
if [ "$CONFIG_PPC" = "y" -o "$CONFIG_ARM" = "y" ]; then
dep_bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 $CONFIG_BLK_DEV_IDEPCI
dep_tristate ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 $CONFIG_BLK_DEV_IDEPCI
fi
fi
fi
......@@ -230,8 +214,4 @@ else
define_bool CONFIG_BLK_DEV_IDE_MODES n
fi
#dep_tristate 'Support for IDE Raid controllers (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL
#dep_tristate ' Support Promise software RAID (Fasttrak(tm)) (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID_PDC $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL $CONFIG_BLK_DEV_ATARAID
#dep_tristate ' Highpoint 370 software RAID (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID_HPT $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL $CONFIG_BLK_DEV_ATARAID
endmenu
......@@ -19,21 +19,26 @@ ide-obj-y :=
subdir-$(CONFIG_BLK_DEV_IDEPCI) += pci
subdir-$(CONFIG_BLK_DEV_IDE) += legacy ppc arm pci
# First come modules that register themselves with the core
obj-y += pci/idedriver-pci.o
# Core IDE code - must come before legacy
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_IDEPCI) += setup-pci.o
obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o
obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o
obj-$(CONFIG_PROC_FS) += ide-proc.o
obj-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o
ifeq ($(CONFIG_BLK_DEV_IDE),y)
obj-$(CONFIG_PROC_FS) += ide-proc.o
endif
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
......
......@@ -211,6 +211,8 @@ ide_startstop_t ide_dma_intr (ide_drive_t *drive)
return DRIVER(drive)->error(drive, "dma_intr", stat);
}
EXPORT_SYMBOL_GPL(ide_dma_intr);
static int ide_build_sglist (ide_drive_t *drive, struct request *rq)
{
ide_hwif_t *hwif = HWIF(drive);
......@@ -365,6 +367,8 @@ int ide_build_dmatable (ide_drive_t *drive, struct request *rq)
return 0; /* revert to PIO for this request */
}
EXPORT_SYMBOL_GPL(ide_build_dmatable);
/* Teardown mappings after DMA has completed. */
void ide_destroy_dmatable (ide_drive_t *drive)
{
......@@ -376,6 +380,8 @@ void ide_destroy_dmatable (ide_drive_t *drive)
HWIF(drive)->sg_dma_active = 0;
}
EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
static int config_drive_for_dma (ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
......@@ -1019,4 +1025,4 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
BUG();
}
EXPORT_SYMBOL_GPL(ide_setup_dma);
......@@ -23,6 +23,8 @@
#include <asm/io.h>
#include <asm/bitops.h>
#include "ide_modes.h"
/*
* IDE library routines. These are plug in code that most
* drivers can use but occasionally may be weird enough
......@@ -186,3 +188,201 @@ int ide_dma_enable (ide_drive_t *drive)
}
EXPORT_SYMBOL(ide_dma_enable);
const ide_pio_timings_t ide_pio_timings[6] = {
{ 70, 165, 600 }, /* PIO Mode 0 */
{ 50, 125, 383 }, /* PIO Mode 1 */
{ 30, 100, 240 }, /* PIO Mode 2 */
{ 30, 80, 180 }, /* PIO Mode 3 with IORDY */
{ 25, 70, 120 }, /* PIO Mode 4 with IORDY */
{ 20, 50, 100 } /* PIO Mode 5 with IORDY (nonstandard) */
};
EXPORT_SYMBOL_GPL(ide_pio_timings);
/*
* Black list. Some drives incorrectly report their maximal PIO mode,
* at least in respect to CMD640. Here we keep info on some known drives.
*/
static struct ide_pio_info {
const char *name;
int pio;
} ide_pio_blacklist [] = {
/* { "Conner Peripherals 1275MB - CFS1275A", 4 }, */
{ "Conner Peripherals 540MB - CFS540A", 3 },
{ "WDC AC2700", 3 },
{ "WDC AC2540", 3 },
{ "WDC AC2420", 3 },
{ "WDC AC2340", 3 },
{ "WDC AC2250", 0 },
{ "WDC AC2200", 0 },
{ "WDC AC21200", 4 },
{ "WDC AC2120", 0 },
{ "WDC AC2850", 3 },
{ "WDC AC1270", 3 },
{ "WDC AC1170", 1 },
{ "WDC AC1210", 1 },
{ "WDC AC280", 0 },
/* { "WDC AC21000", 4 }, */
{ "WDC AC31000", 3 },
{ "WDC AC31200", 3 },
/* { "WDC AC31600", 4 }, */
{ "Maxtor 7131 AT", 1 },
{ "Maxtor 7171 AT", 1 },
{ "Maxtor 7213 AT", 1 },
{ "Maxtor 7245 AT", 1 },
{ "Maxtor 7345 AT", 1 },
{ "Maxtor 7546 AT", 3 },
{ "Maxtor 7540 AV", 3 },
{ "SAMSUNG SHD-3121A", 1 },
{ "SAMSUNG SHD-3122A", 1 },
{ "SAMSUNG SHD-3172A", 1 },
/* { "ST51080A", 4 },
* { "ST51270A", 4 },
* { "ST31220A", 4 },
* { "ST31640A", 4 },
* { "ST32140A", 4 },
* { "ST3780A", 4 },
*/
{ "ST5660A", 3 },
{ "ST3660A", 3 },
{ "ST3630A", 3 },
{ "ST3655A", 3 },
{ "ST3391A", 3 },
{ "ST3390A", 1 },
{ "ST3600A", 1 },
{ "ST3290A", 0 },
{ "ST3144A", 0 },
{ "ST3491A", 1 }, /* reports 3, should be 1 or 2 (depending on */
/* drive) according to Seagates FIND-ATA program */
{ "QUANTUM ELS127A", 0 },
{ "QUANTUM ELS170A", 0 },
{ "QUANTUM LPS240A", 0 },
{ "QUANTUM LPS210A", 3 },
{ "QUANTUM LPS270A", 3 },
{ "QUANTUM LPS365A", 3 },
{ "QUANTUM LPS540A", 3 },
{ "QUANTUM LIGHTNING 540A", 3 },
{ "QUANTUM LIGHTNING 730A", 3 },
{ "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */
{ "QUANTUM FIREBALL_640", 3 },
{ "QUANTUM FIREBALL_1080", 3 },
{ "QUANTUM FIREBALL_1280", 3 },
{ NULL, 0 }
};
/**
* ide_scan_pio_blacklist - check for a blacklisted drive
* @model: Drive model string
*
* This routine searches the ide_pio_blacklist for an entry
* matching the start/whole of the supplied model name.
*
* Returns -1 if no match found.
* Otherwise returns the recommended PIO mode from ide_pio_blacklist[].
*/
static int ide_scan_pio_blacklist (char *model)
{
struct ide_pio_info *p;
for (p = ide_pio_blacklist; p->name != NULL; p++) {
if (strncmp(p->name, model, strlen(p->name)) == 0)
return p->pio;
}
return -1;
}
/**
* ide_get_best_pio_mode - get PIO mode fro drive
* @driver: drive to consider
* @mode_wanted: preferred mode
* @max_mode: highest allowed
* @d: pio data
*
* This routine returns the recommended PIO settings for a given drive,
* based on the drive->id information and the ide_pio_blacklist[].
* This is used by most chipset support modules when "auto-tuning".
*
* Drive PIO mode auto selection
*/
u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d)
{
int pio_mode;
int cycle_time = 0;
int use_iordy = 0;
struct hd_driveid* id = drive->id;
int overridden = 0;
int blacklisted = 0;
if (mode_wanted != 255) {
pio_mode = mode_wanted;
} else if (!drive->id) {
pio_mode = 0;
} else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) {
overridden = 1;
blacklisted = 1;
use_iordy = (pio_mode > 2);
} else {
pio_mode = id->tPIO;
if (pio_mode > 2) { /* 2 is maximum allowed tPIO value */
pio_mode = 2;
overridden = 1;
}
if (id->field_valid & 2) { /* drive implements ATA2? */
if (id->capability & 8) { /* drive supports use_iordy? */
use_iordy = 1;
cycle_time = id->eide_pio_iordy;
if (id->eide_pio_modes & 7) {
overridden = 0;
if (id->eide_pio_modes & 4)
pio_mode = 5;
else if (id->eide_pio_modes & 2)
pio_mode = 4;
else
pio_mode = 3;
}
} else {
cycle_time = id->eide_pio;
}
}
#if 0
if (drive->id->major_rev_num & 0x0004) printk("ATA-2 ");
#endif
/*
* Conservative "downgrade" for all pre-ATA2 drives
*/
if (pio_mode && pio_mode < 4) {
pio_mode--;
overridden = 1;
#if 0
use_iordy = (pio_mode > 2);
#endif
if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time)
cycle_time = 0; /* use standard timing */
}
}
if (pio_mode > max_mode) {
pio_mode = max_mode;
cycle_time = 0;
}
if (d) {
d->pio_mode = pio_mode;
d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time;
d->use_iordy = use_iordy;
d->overridden = overridden;
d->blacklisted = blacklisted;
}
return pio_mode;
}
EXPORT_SYMBOL_GPL(ide_get_best_pio_mode);
......@@ -592,6 +592,7 @@ void probe_hwif (ide_hwif_t *hwif)
{
unsigned int unit;
unsigned long flags;
unsigned int irqd;
if (hwif->noprobe)
return;
......@@ -623,7 +624,12 @@ void probe_hwif (ide_hwif_t *hwif)
return;
}
if (hwif->hw.ack_intr && hwif->irq)
/*
* We must always disable IRQ, as probe_for_drive will assert IRQ, but
* we'll install our IRQ driver much later...
*/
irqd = hwif->irq;
if (irqd)
disable_irq(hwif->irq);
local_irq_set(flags);
......@@ -659,8 +665,12 @@ void probe_hwif (ide_hwif_t *hwif)
}
local_irq_restore(flags);
if (hwif->hw.ack_intr && hwif->irq)
enable_irq(hwif->irq);
/*
* Use cached IRQ number. It might be (and is...) changed by probe
* code above
*/
if (irqd)
enable_irq(irqd);
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
......
......@@ -194,6 +194,8 @@ int noautodma = 0;
int noautodma = 1;
#endif
EXPORT_SYMBOL(noautodma);
/*
* ide_modules keeps track of the available IDE chipset/probe/driver modules.
*/
......@@ -1376,7 +1378,6 @@ void ide_intr (int irq, void *dev_id, struct pt_regs *regs)
if ((handler = hwgroup->handler) == NULL ||
hwgroup->poll_timeout != 0) {
printk("ide_intr: unexpected interrupt!\n");
/*
* Not expecting an interrupt from this drive.
* That means this could be:
......
......@@ -16,8 +16,6 @@
* breaking the fragile cmd640.c support.
*/
#ifdef CONFIG_BLK_DEV_IDE_MODES
/*
* Standard (generic) timings for PIO modes, from ATA2 specification.
* These timings are for access to the IDE data port register *only*.
......@@ -38,199 +36,6 @@ typedef struct ide_pio_data_s {
unsigned int cycle_time;
} ide_pio_data_t;
#ifndef _IDE_C
int ide_scan_pio_blacklist (char *model);
u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d);
extern const ide_pio_timings_t ide_pio_timings[6];
#else /* _IDE_C */
const ide_pio_timings_t ide_pio_timings[6] = {
{ 70, 165, 600 }, /* PIO Mode 0 */
{ 50, 125, 383 }, /* PIO Mode 1 */
{ 30, 100, 240 }, /* PIO Mode 2 */
{ 30, 80, 180 }, /* PIO Mode 3 with IORDY */
{ 25, 70, 120 }, /* PIO Mode 4 with IORDY */
{ 20, 50, 100 } /* PIO Mode 5 with IORDY (nonstandard) */
};
/*
* Black list. Some drives incorrectly report their maximal PIO mode,
* at least in respect to CMD640. Here we keep info on some known drives.
*/
static struct ide_pio_info {
const char *name;
int pio;
} ide_pio_blacklist [] = {
/* { "Conner Peripherals 1275MB - CFS1275A", 4 }, */
{ "Conner Peripherals 540MB - CFS540A", 3 },
{ "WDC AC2700", 3 },
{ "WDC AC2540", 3 },
{ "WDC AC2420", 3 },
{ "WDC AC2340", 3 },
{ "WDC AC2250", 0 },
{ "WDC AC2200", 0 },
{ "WDC AC21200", 4 },
{ "WDC AC2120", 0 },
{ "WDC AC2850", 3 },
{ "WDC AC1270", 3 },
{ "WDC AC1170", 1 },
{ "WDC AC1210", 1 },
{ "WDC AC280", 0 },
/* { "WDC AC21000", 4 }, */
{ "WDC AC31000", 3 },
{ "WDC AC31200", 3 },
/* { "WDC AC31600", 4 }, */
{ "Maxtor 7131 AT", 1 },
{ "Maxtor 7171 AT", 1 },
{ "Maxtor 7213 AT", 1 },
{ "Maxtor 7245 AT", 1 },
{ "Maxtor 7345 AT", 1 },
{ "Maxtor 7546 AT", 3 },
{ "Maxtor 7540 AV", 3 },
{ "SAMSUNG SHD-3121A", 1 },
{ "SAMSUNG SHD-3122A", 1 },
{ "SAMSUNG SHD-3172A", 1 },
/* { "ST51080A", 4 },
* { "ST51270A", 4 },
* { "ST31220A", 4 },
* { "ST31640A", 4 },
* { "ST32140A", 4 },
* { "ST3780A", 4 },
*/
{ "ST5660A", 3 },
{ "ST3660A", 3 },
{ "ST3630A", 3 },
{ "ST3655A", 3 },
{ "ST3391A", 3 },
{ "ST3390A", 1 },
{ "ST3600A", 1 },
{ "ST3290A", 0 },
{ "ST3144A", 0 },
{ "ST3491A", 1 }, /* reports 3, should be 1 or 2 (depending on */
/* drive) according to Seagates FIND-ATA program */
{ "QUANTUM ELS127A", 0 },
{ "QUANTUM ELS170A", 0 },
{ "QUANTUM LPS240A", 0 },
{ "QUANTUM LPS210A", 3 },
{ "QUANTUM LPS270A", 3 },
{ "QUANTUM LPS365A", 3 },
{ "QUANTUM LPS540A", 3 },
{ "QUANTUM LIGHTNING 540A", 3 },
{ "QUANTUM LIGHTNING 730A", 3 },
{ "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */
{ "QUANTUM FIREBALL_640", 3 },
{ "QUANTUM FIREBALL_1080", 3 },
{ "QUANTUM FIREBALL_1280", 3 },
{ NULL, 0 }
};
/*
* This routine searches the ide_pio_blacklist for an entry
* matching the start/whole of the supplied model name.
*
* Returns -1 if no match found.
* Otherwise returns the recommended PIO mode from ide_pio_blacklist[].
*/
int ide_scan_pio_blacklist (char *model)
{
struct ide_pio_info *p;
for (p = ide_pio_blacklist; p->name != NULL; p++) {
if (strncmp(p->name, model, strlen(p->name)) == 0)
return p->pio;
}
return -1;
}
/*
* This routine returns the recommended PIO settings for a given drive,
* based on the drive->id information and the ide_pio_blacklist[].
* This is used by most chipset support modules when "auto-tuning".
*/
/*
* Drive PIO mode auto selection
*/
u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d)
{
int pio_mode;
int cycle_time = 0;
int use_iordy = 0;
struct hd_driveid* id = drive->id;
int overridden = 0;
int blacklisted = 0;
if (mode_wanted != 255) {
pio_mode = mode_wanted;
} else if (!drive->id) {
pio_mode = 0;
} else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) {
overridden = 1;
blacklisted = 1;
use_iordy = (pio_mode > 2);
} else {
pio_mode = id->tPIO;
if (pio_mode > 2) { /* 2 is maximum allowed tPIO value */
pio_mode = 2;
overridden = 1;
}
if (id->field_valid & 2) { /* drive implements ATA2? */
if (id->capability & 8) { /* drive supports use_iordy? */
use_iordy = 1;
cycle_time = id->eide_pio_iordy;
if (id->eide_pio_modes & 7) {
overridden = 0;
if (id->eide_pio_modes & 4)
pio_mode = 5;
else if (id->eide_pio_modes & 2)
pio_mode = 4;
else
pio_mode = 3;
}
} else {
cycle_time = id->eide_pio;
}
}
#if 0
if (drive->id->major_rev_num & 0x0004) printk("ATA-2 ");
#endif
/*
* Conservative "downgrade" for all pre-ATA2 drives
*/
if (pio_mode && pio_mode < 4) {
pio_mode--;
overridden = 1;
#if 0
use_iordy = (pio_mode > 2);
#endif
if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time)
cycle_time = 0; /* use standard timing */
}
}
if (pio_mode > max_mode) {
pio_mode = max_mode;
cycle_time = 0;
}
if (d) {
d->pio_mode = pio_mode;
d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time;
d->use_iordy = use_iordy;
d->overridden = overridden;
d->blacklisted = blacklisted;
}
return pio_mode;
}
#endif /* _IDE_C */
#endif /* CONFIG_BLK_DEV_IDE_MODES */
#endif /* _IDE_MODES_H */
......@@ -19,6 +19,7 @@ obj-$(CONFIG_BLK_DEV_Q40IDE) += q40ide.o
obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o
# Last of all
obj-$(CONFIG_BLK_DEV_HD) += hd.o
EXTRA_CFLAGS := -I../
......
......@@ -870,3 +870,4 @@ static int parse_hd_setup (char *line) {
}
__setup("hd=", parse_hd_setup);
module_init(hd_init);
......@@ -12,7 +12,6 @@ obj-$(CONFIG_BLK_DEV_CMD640) += cmd640.o
obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o
obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o
obj-$(CONFIG_BLK_DEV_CY82C693) += cy82c693.o
obj-$(CONFIG_BLK_DEV_GENERIC) += generic.o
obj-$(CONFIG_BLK_DEV_HPT34X) += hpt34x.o
obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o
#obj-$(CONFIG_BLK_DEV_HPT37X) += hpt37x.o
......@@ -34,6 +33,9 @@ obj-$(CONFIG_BLK_DEV_SLC90E66) += slc90e66.o
obj-$(CONFIG_BLK_DEV_TRM290) += trm290.o
obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o
# Must appear at the end of the block
obj-$(CONFIG_BLK_DEV_GENERIC) += generic.o
EXTRA_CFLAGS := -I../
include $(TOPDIR)/Rules.make
......@@ -38,8 +38,6 @@ static int aec62xx_get_info (char *buffer, char **addr, off_t offset, int count)
char *chipset_nums[] = {"error", "error", "error", "error",
"error", "error", "850UF", "860",
"860R", "865", "865R", "error" };
// char *modes_33[] = {};
// char *modes_34[] = {};
int i;
for (i = 0; i < n_aec_devs; i++) {
......@@ -516,22 +514,69 @@ static void __init init_setup_aec6x80 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init aec62xx_scan_pcidev (struct pci_dev *dev)
/**
* aec62xx_init_one - called when a AEC is found
* @dev: the aec62xx device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &aec62xx_chipsets[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_ARTOP)
return 0;
for (d = aec62xx_chipsets;
d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* aec62xx_remove_one - called when an AEC is unplugged
* @dev: the device that was removed
*
* Disconnect an AEC device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void aec62xx_remove_one(struct pci_dev *dev)
{
panic("AEC62xx removal not yet supported");
}
static struct pci_device_id aec62xx_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
{ 0, },
};
static struct pci_driver driver = {
name: "AEC62xx IDE",
id_table: aec62xx_pci_tbl,
probe: aec62xx_init_one,
remove: __devexit_p(aec62xx_remove_one),
};
static int aec62xx_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void aec62xx_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(aec62xx_ide_init);
module_exit(aec62xx_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for ARTOP AEC62xx IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -99,7 +99,7 @@ static void init_hwif_aec62xx(ide_hwif_t *);
static void init_dma_aec62xx(ide_hwif_t *, unsigned long);
static ide_pci_device_t aec62xx_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP850UF,
name: "AEC6210",
......@@ -113,7 +113,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP860,
name: "AEC6260",
......@@ -127,7 +127,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP860R,
name: "AEC6260R",
......@@ -141,7 +141,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: NEVER_BOARD,
extra: 0,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP865,
name: "AEC6X80",
......@@ -155,7 +155,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP865R,
name: "AEC6X80R",
......@@ -169,11 +169,6 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: OFF_BOARD,
extra: 0,
},{
vendor: 0,
device: 0,
channels: 0,
bootable: EOL,
}
};
......
......@@ -22,6 +22,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
......@@ -623,9 +624,11 @@ static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char
/*
* We should only tune the 1533 enable if we are using an ALi
* North bridge
* North bridge. We might have no north found on some zany
* box without a device at 0:0.0. The ALi bridge will be at
* 0:0.0 so if we didn't find one we know what is cooking.
*/
if (north->vendor != PCI_VENDOR_ID_AL) {
if (north && north->vendor != PCI_VENDOR_ID_AL) {
local_irq_restore(flags);
return 0;
}
......@@ -841,45 +844,64 @@ extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/**
* init_setup_ali15x3 - set up an ALi15x3 IDE controller
* alim15x3_init_one - set up an ALi15x3 IDE controller
* @dev: PCI device to set up
* @d: IDE PCI structures
*
* Perform the actual set up for the ALi15x3.
* Perform the actual set up for an ALi15x3 that has been found by the
* hot plug layer.
*/
static void __init init_setup_ali15x3 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &ali15x3_chipsets[id->driver_data];
#if defined(CONFIG_SPARC64)
d->init_hwif = init_hwif_common_ali15x3;
#endif /* CONFIG_SPARC64 */
ide_setup_pci_device(dev, d);
return 0;
}
/**
* ali15x3_scan_pcidev - check for ali pci ide
* @dev: device found by IDE ordered scan
* ali15x3_remove_one - called with an ALi is unplugged
* @dev: the device that was removed
*
* If the device is a known ALi IDE controller we set it up and
* then return 1. If we do not know it, or set up fails we return 0
* and it will be offered to other drivers or taken generic
* Disconnect an ALi device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
int __init ali15x3_scan_pcidev (struct pci_dev *dev)
static void ali15x3_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("ALi removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_AL)
return 0;
static struct pci_device_id alim15x3_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, },
};
for (d = ali15x3_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "ALI15x3 IDE",
id_table: alim15x3_pci_tbl,
probe: alim15x3_init_one,
remove: __devexit_p(ali15x3_remove_one),
};
static int ali15x3_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void ali15x3_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(ali15x3_ide_init);
module_exit(ali15x3_ide_exit);
MODULE_AUTHOR("Michael Aubry, Andrzej Krzysztofowicz, CJ, Andre Hedrick, Alan Cox");
MODULE_DESCRIPTION("PCI driver module for ALi 15x3 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,18 +25,16 @@ static ide_pci_host_proc_t ali_procs[] __initdata = {
};
#endif /* DISPLAY_ALI_TIMINGS && CONFIG_PROC_FS */
static void init_setup_ali15x3(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_ali15x3(struct pci_dev *, const char *);
static void init_hwif_common_ali15x3(ide_hwif_t *);
static void init_hwif_ali15x3(ide_hwif_t *);
static void init_dma_ali15x3(ide_hwif_t *, unsigned long);
static ide_pci_device_t ali15x3_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_AL,
device: PCI_DEVICE_ID_AL_M5229,
name: "ALI15X3",
init_setup: init_setup_ali15x3,
init_chipset: init_chipset_ali15x3,
init_iops: NULL,
init_hwif: init_hwif_ali15x3,
......
......@@ -7,6 +7,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -392,26 +393,60 @@ static void __init init_dma_amd74xx (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_amd74xx (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit amd74xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &amd74xx_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init amd74xx_scan_pcidev (struct pci_dev *dev)
/**
* amd74xx_remove_one - called with an AMD IDE is unplugged
* @dev: the device that was removed
*
* Disconnect an AMD IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void amd74xx_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("AMD IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_AMD)
return 0;
static struct pci_device_id amd74xx_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_COBRA_7401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7409, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7411, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ 0, },
};
static struct pci_driver driver = {
name: "AMD IDE",
id_table: amd74xx_pci_tbl,
probe: amd74xx_init_one,
remove: __devexit_p(amd74xx_remove_one),
};
static int amd74xx_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
for (d = amd74xx_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static void amd74xx_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(amd74xx_ide_init);
module_exit(amd74xx_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for AMD IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,17 +25,15 @@ static ide_pci_host_proc_t amd74xx_procs[] __initdata = {
};
#endif /* defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_amd74xx(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *);
static void init_hwif_amd74xx(ide_hwif_t *);
static void init_dma_amd74xx(ide_hwif_t *, unsigned long);
static ide_pci_device_t amd74xx_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_COBRA_7401,
name: "AMD7401",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......@@ -45,11 +43,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
extra: 0
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_VIPER_7409,
name: "AMD7409",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......@@ -59,11 +56,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
extra: 0
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_VIPER_7411,
name: "AMD7411",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......@@ -73,11 +69,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
extra: 0
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_OPUS_7441,
name: "AMD7441",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......@@ -87,11 +82,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
extra: 0
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_8111_IDE,
name: "AMD8111",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......
/* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16
*
* linux/drivers/ide/cmd64x.c Version 1.22 June 9, 2000
* linux/drivers/ide/cmd64x.c Version 1.30 Sept 10, 2002
*
* cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
* Note, this driver is not used at all on other systems because
......@@ -15,6 +15,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/delay.h>
......@@ -727,10 +728,12 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif)
if (dev->device == PCI_DEVICE_ID_CMD_643)
hwif->ultra_mask = 0x80;
if (dev->device == PCI_DEVICE_ID_CMD_646)
{
if (class_rev > 0x04)
hwif->ultra_mask = 0x07;
else
hwif->ultra_mask = 0x80;
}
#ifdef CONFIG_BLK_DEV_IDEDMA
hwif->ide_dma_check = &cmd64x_config_drive_for_dma;
......@@ -758,10 +761,6 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif)
#endif /* CONFIG_BLK_DEV_IDEDMA */
}
/**
* FIXME: not required ?
*/
static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase)
{
ide_setup_dma(hwif, dmabase, 8);
......@@ -769,30 +768,59 @@ static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &cmd64x_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
/**
* FIXME: not required either ?
* cmd64x_remove_one - called with an CMD64x is unplugged
* @dev: the device that was removed
*
* Disconnect a CMD64x device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void __init init_setup_cmd64x (struct pci_dev *dev, ide_pci_device_t *d)
static void cmd64x_remove_one(struct pci_dev *dev)
{
ide_setup_pci_device(dev, d);
panic("CMD64x removal not yet supported");
}
int __init cmd64x_scan_pcidev (struct pci_dev *dev)
static struct pci_device_id cmd64x_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_643, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ 0, },
};
static struct pci_driver driver = {
name: "CMD64x IDE",
id_table: cmd64x_pci_tbl,
probe: cmd64x_init_one,
remove: __devexit_p(cmd64x_remove_one),
};
static int cmd64x_ide_init(void)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_CMD)
return 0;
return ide_pci_register_driver(&driver);
}
for (d = cmd64x_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static void cmd64x_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(cmd64x_ide_init);
module_exit(cmd64x_ide_exit);
MODULE_AUTHOR("Eddie Dost, David Miller, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for CMD64x IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -79,17 +79,15 @@ static ide_pci_host_proc_t cmd64x_procs[] __initdata = {
};
#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_cmd64x(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *);
static void init_hwif_cmd64x(ide_hwif_t *);
static void init_dma_cmd64x(ide_hwif_t *, unsigned long);
static ide_pci_device_t cmd64x_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_643,
name: "CMD643",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x,
init_iops: NULL,
init_hwif: init_hwif_cmd64x,
......@@ -99,11 +97,10 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_646,
name: "CMD646",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x,
init_iops: NULL,
init_hwif: init_hwif_cmd64x,
......@@ -113,11 +110,10 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_648,
name: "CMD648",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x,
init_iops: NULL,
init_hwif: init_hwif_cmd64x,
......@@ -131,7 +127,6 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_649,
name: "CMD649",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x,
init_iops: NULL,
init_hwif: init_hwif_cmd64x,
......
/*
* linux/drivers/ide/cs5530.c Version 0.6 Mar. 18, 2000
* linux/drivers/ide/cs5530.c Version 0.7 Sept 10, 2002
*
* Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org>
* Ditto of GNU General Public License.
......@@ -12,6 +12,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -419,44 +420,56 @@ static void __init init_dma_cs5530 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/**
* init_setup_cs5530 - set up a CS5530 IDE
* @dev: PCI device
* @d: PCI ide device info
*
* FIXME: this function can go away too
*/
static void __init init_setup_cs5530 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &cs5530_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
/**
* cs5530_scan_pcidev - set up any CS5530 device
* @dev: pci device to check
* cs5530_remove_one - called when a CS5530 is unplugged
* @dev: the device that was removed
*
* Check if the device is a 5530 IDE controller. If it is then
* claim and set up the interface. Return 1 if we claimed the
* interface or zero if it is not ours
* Disconnect an Cyrix device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
int __init cs5530_scan_pcidev (struct pci_dev *dev)
static void cs5530_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("Cyrix removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_CYRIX)
return 0;
static struct pci_device_id cs5530_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = cs5530_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "CS5530 IDE",
id_table: cs5530_pci_tbl,
probe: cs5530_init_one,
remove: __devexit_p(cs5530_remove_one),
};
static int cs5530_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void cs5530_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(cs5530_ide_init);
module_exit(cs5530_ide_exit);
MODULE_AUTHOR("Mark Lord");
MODULE_DESCRIPTION("PCI driver module for Cyrix/NS 5530 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,17 +25,15 @@ static ide_pci_host_proc_t cs5530_procs[] __initdata = {
};
#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */
static void init_setup_cs5530(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_cs5530(struct pci_dev *, const char *);
static void init_hwif_cs5530(ide_hwif_t *);
static void init_dma_cs5530(ide_hwif_t *, unsigned long);
static ide_pci_device_t cs5530_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_CYRIX,
device: PCI_DEVICE_ID_CYRIX_5530_IDE,
name: "CS5530",
init_setup: init_setup_cs5530,
init_chipset: init_chipset_cs5530,
init_iops: NULL,
init_hwif: init_hwif_cs5530,
......
/*
* linux/drivers/ide/cy82c693.c Version 0.34 Dec. 13, 1999
* linux/drivers/ide/cy82c693.c Version 0.40 Sep. 10, 2002
*
* Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer
* Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>, Integrater
......@@ -29,8 +29,7 @@
* - first tests with DMA look okay, they seem to work, but there is a
* problem with sound - the BusMaster IDE TimeOut should fixed this
*
*
* History:
* Ancient History:
* AMH@1999-08-24: v0.34 init_cy82c693_chip moved to pci_init_cy82c693
* ASK@1999-01-23: v0.33 made a few minor code clean ups
* removed DMA clock speed setting by default
......@@ -46,6 +45,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/delay.h>
......@@ -418,29 +418,56 @@ void __init init_dma_cy82c693 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
void __init init_setup_cy82c693 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &cy82c693_chipsets[id->driver_data];
if ((!(PCI_FUNC(dev->devfn) & 1) ||
(!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))))
return; /* CY82C693 is more than only a IDE controller */
return 0; /* CY82C693 is more than only a IDE controller */
ide_setup_pci_device(dev, d);
return 0;
}
int __init cy82c693_scan_pcidev (struct pci_dev *dev)
/**
* cy82c693_remove_one - called with an Cypress is unplugged
* @dev: the device that was removed
*
* Disconnect an Cypress device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void cy82c693_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("Cypress removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_CONTAQ)
return 0;
static struct pci_device_id cy82c693_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = cy82c693_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "Cypress IDE",
id_table: cy82c693_pci_tbl,
probe: cy82c693_init_one,
remove: __devexit_p(cy82c693_remove_one),
};
static int cy82c693_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void cy82c693_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(cy82c693_ide_init);
module_exit(cy82c693_ide_exit);
MODULE_AUTHOR("Andreas Krebs, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for the Cypress CY82C693 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -64,17 +64,15 @@ typedef struct pio_clocks_s {
u8 time_8; /* clocks for 8bit (0xF0=Active/data, 0x0F=Recovery) */
} pio_clocks_t;
extern void init_setup_cy82c693(struct pci_dev *, ide_pci_device_t *);
extern unsigned int init_chipset_cy82c693(struct pci_dev *, const char *);
extern void init_hwif_cy82c693(ide_hwif_t *);
extern void init_dma_cy82c693(ide_hwif_t *, unsigned long);
static ide_pci_device_t cy82c693_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_CONTAQ,
device: PCI_DEVICE_ID_CONTAQ_82C693,
name: "CY82C693",
init_setup: init_setup_cy82c693,
init_chipset: init_chipset_cy82c693,
init_iops: NULL,
init_hwif: init_hwif_cy82c693,
......
/*
* linux/drivers/ide/pci-orphan.c Version 0.01 December 8, 1997
* linux/drivers/ide/generic.c Version 0.10 Sept 11, 2002
*
* Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
*/
......@@ -9,6 +9,7 @@
#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -84,19 +85,10 @@ static void __init init_setup_unknown (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init generic_scan_pcidev (struct pci_dev *dev)
{
ide_pci_device_t *d;
for (d = generic_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
#if 0
/* Logic to add back later on */
if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
ide_pci_device_t *unknown = unknown_chipset;
// unknown->vendor = dev->vendor;
......@@ -105,5 +97,75 @@ int __init generic_scan_pcidev (struct pci_dev *dev)
return 1;
}
return 0;
#endif
/**
* generic_init_one - called when a PIIX is found
* @dev: the generic device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &generic_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* generic_remove_one - called when PCI IDE is unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void generic_remove_one(struct pci_dev *dev)
{
panic("PCI IDE removal not yet supported");
}
static struct pci_device_id generic_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
{ PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
{ 0, },
};
static struct pci_driver driver = {
name: "PCI IDE",
id_table: generic_pci_tbl,
probe: generic_init_one,
remove: __devexit_p(generic_remove_one),
};
static int generic_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void generic_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(generic_ide_init);
module_exit(generic_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for generic PCI IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -11,7 +11,7 @@ static void init_hwif_generic(ide_hwif_t *);
static void init_dma_generic(ide_hwif_t *, unsigned long);
static ide_pci_device_t generic_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_NS,
device: PCI_DEVICE_ID_NS_87410,
name: "NS87410",
......@@ -25,7 +25,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_SAMURAI_IDE,
name: "SAMURAI",
......@@ -39,7 +39,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_HOLTEK,
device: PCI_DEVICE_ID_HOLTEK_6565,
name: "HT6565",
......@@ -53,7 +53,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8673F,
name: "UM8673F",
......@@ -67,7 +67,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8886A,
name: "UM8886A",
......@@ -81,7 +81,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 5 */
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8886BF,
name: "UM8886BF",
......@@ -95,7 +95,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 6 */
vendor: PCI_VENDOR_ID_HINT,
device: PCI_DEVICE_ID_HINT_VXPROII_IDE,
name: "HINT_IDE",
......@@ -109,7 +109,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 7 */
vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C561,
name: "VIA_IDE",
......@@ -123,7 +123,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 8 */
vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C558,
name: "OPTI621V",
......@@ -146,7 +146,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
};
static ide_pci_device_t unknown_chipset[] __initdata = {
{
{ /* 0 */
vendor: 0,
device: 0,
name: "PCI_IDE",
......
/*
* linux/drivers/ide/hpt34x.c Version 0.31 June. 9, 2000
* linux/drivers/ide/hpt34x.c Version 0.40 Sept 10, 2002
*
* Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
* May be copied or modified under the terms of the GNU General Public License
......@@ -25,6 +25,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -321,34 +322,61 @@ static void __init init_dma_hpt34x (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_hpt34x (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
char *chipset_names[] = {"HPT343", "HPT345"};
ide_pci_device_t *d = &hpt34x_chipsets[id->driver_data];
static char *chipset_names[] = {"HPT343", "HPT345"};
u16 pcicmd = 0;
pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
strcpy(d->name, chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]);
d->name = chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0];
d->bootable = (pcicmd & PCI_COMMAND_MEMORY) ? OFF_BOARD : NEVER_BOARD;
ide_setup_pci_device(dev, d);
return 0;
}
int __init hpt34x_scan_pcidev (struct pci_dev *dev)
/**
* hpt34x_remove_one - called with an hpt34x is unplugged
* @dev: the device that was removed
*
* Disconnect an hpt34x device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void hpt34x_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("hpt34x removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_TTI)
return 0;
static struct pci_device_id hpt34x_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT343, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = hpt34x_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "HPT34x IDE",
id_table: hpt34x_pci_tbl,
probe: hpt34x_init_one,
remove: __devexit_p(hpt34x_remove_one),
};
static int hpt34x_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void hpt34x_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(hpt34x_ide_init);
module_exit(hpt34x_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for Highpoint 34x IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -31,17 +31,15 @@ static ide_pci_host_proc_t hpt34x_procs[] __initdata = {
};
#endif /* defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_hpt34x(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *);
static void init_hwif_hpt34x(ide_hwif_t *);
static void init_dma_hpt34x(ide_hwif_t *, unsigned long);
static ide_pci_device_t hpt34x_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT343,
name: "HPT34X",
init_setup: init_setup_hpt34x,
init_chipset: init_chipset_hpt34x,
init_iops: NULL,
init_hwif: init_hwif_hpt34x,
......
......@@ -44,6 +44,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -1167,23 +1168,70 @@ static void __init init_setup_hpt366 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init hpt366_scan_pcidev (struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_TTI)
return 0;
if (dev->device == PCI_DEVICE_ID_TTI_HPT343)
return 0;
/**
* hpt366_init_one - called when an HPT366 is found
* @dev: the hpt366 device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &hpt366_chipsets[id->driver_data];
for (d = hpt366_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* hpt366_remove_one - called when an HPT366 is unplugged
* @dev: the device that was removed
*
* Disconnect a HPT366 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void hpt366_remove_one(struct pci_dev *dev)
{
panic("HPT366 removal not yet supported");
}
static struct pci_device_id hpt366_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT302, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
{ 0, },
};
static struct pci_driver driver = {
name: "HPT366 IDE",
id_table: hpt366_pci_tbl,
probe: hpt366_init_one,
remove: __devexit_p(hpt366_remove_one),
};
static int hpt366_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void hpt366_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(hpt366_ide_init);
module_exit(hpt366_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for Highpoint HPT366 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -442,7 +442,7 @@ static void init_hwif_hpt366(ide_hwif_t *);
static void init_dma_hpt366(ide_hwif_t *, unsigned long);
static ide_pci_device_t hpt366_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT366,
name: "HPT366",
......@@ -456,7 +456,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 240
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT372,
name: "HPT372A",
......@@ -470,7 +470,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT302,
name: "HPT302",
......@@ -484,7 +484,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT371,
name: "HPT371",
......@@ -498,7 +498,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT374,
name: "HPT374",
......
......@@ -29,6 +29,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
......@@ -297,29 +298,56 @@ static void __init init_dma_it8172 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_it8172 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit it8172_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &it8172_chipsets[id->driver_data];
if ((!(PCI_FUNC(dev->devfn) & 1) ||
(!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))))
return; /* IT8172 is more than only a IDE controller */
return 0; /* IT8172 is more than only a IDE controller */
ide_setup_pci_device(dev, d);
return 0;
}
static int __init it8172_scan_pcidev (struct pci_dev *dev)
/**
* it8172_remove_one - called with an IT8172 is unplugged
* @dev: the device that was removed
*
* Disconnect an IT8172 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void it8172_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("IT8172 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_ITE)
return 0;
static struct pci_device_id it8172_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_IT8172G, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = it8172_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "IT8172IDE",
id_table: it8172_pci_tbl,
probe: it8172_init_one,
remove: __devexit_p(it8172_remove_one),
};
static int it8172_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void it8172_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(it8172_ide_init);
module_exit(it8172_ide_exit);
MODULE_AUTHOR("SteveL@mvista.com");
MODULE_DESCRIPTION("PCI driver module for ITE 8172 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -20,7 +20,7 @@ static void init_hwif_it8172(ide_hwif_t *);
static void init_dma_it8172(ide_hwif_t *, unsigned long);
static ide_pci_device_t it8172_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_ITE,
device: PCI_DEVICE_ID_ITE_IT8172G,
name: "IT8172G",
......
/*
* linux/drivers/ide/ns87415.c Version 1.01 Mar. 18, 2000
* linux/drivers/ide/ns87415.c Version 2.00 Sep. 10, 2002
*
* Copyright (C) 1997-1998 Mark Lord <mlord@pobox.com>
* Copyright (C) 1998 Eddie C. Dost <ecd@skynet.be>
......@@ -9,6 +9,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/timer.h>
......@@ -229,26 +230,55 @@ static void __init init_dma_ns87415 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_ns87415 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &ns87415_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init ns87415_scan_pcidev (struct pci_dev *dev)
/**
* ns87415_remove_one - called with an NS87415 is unplugged
* @dev: the device that was removed
*
* Disconnect an NS87415 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void ns87415_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("NS87415 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_NS)
return 0;
static struct pci_device_id ns87415_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = ns87415_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "NS87415IDE",
id_table: ns87415_pci_tbl,
probe: ns87415_init_one,
remove: __devexit_p(ns87415_remove_one),
};
static int ns87415_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void ns87415_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(ns87415_ide_init);
module_exit(ns87415_ide_exit);
MODULE_AUTHOR("Mark Lord, Eddie Dost, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for NS87415 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -5,16 +5,14 @@
#include <linux/pci.h>
#include <linux/ide.h>
static void init_setup_ns87415(struct pci_dev *, ide_pci_device_t *);
static void init_hwif_ns87415(ide_hwif_t *);
static void init_dma_ns87415(ide_hwif_t *, unsigned long);
static ide_pci_device_t ns87415_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_NS,
device: PCI_DEVICE_ID_NS_87415,
name: "NS87415",
init_setup: init_setup_ns87415,
init_chipset: NULL,
init_iops: NULL,
init_hwif: init_hwif_ns87415,
......
......@@ -7,6 +7,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -91,8 +92,8 @@ static u8 nforce_ratemask (ide_drive_t *drive)
*/
static int nforce_tune_chipset (ide_drive_t *drive, u8 xferspeed)
{
u8 drive_pci[] = { 0x63, 0x62, 0x61, 0x60 };
u8 drive_pci2[] = { 0x5b, 0x5a, 0x59, 0x58 };
static const u8 drive_pci[] = { 0x63, 0x62, 0x61, 0x60 };
static const u8 drive_pci2[] = { 0x5b, 0x5a, 0x59, 0x58 };
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
......@@ -336,27 +337,55 @@ static void __init init_dma_nforce (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/* FIXME - not needed */
static void __init init_setup_nforce (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit nforce_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &nvidia_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init nforce_scan_pcidev (struct pci_dev *dev)
/**
* nforce_remove_one - called with an nForce is unplugged
* @dev: the device that was removed
*
* Disconnect an nForce device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void nforce_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("nForce removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_NVIDIA)
return 0;
static struct pci_device_id nforce_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = nvidia_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "nForce IDE",
id_table: nforce_pci_tbl,
probe: nforce_init_one,
remove: __devexit_p(nforce_remove_one),
};
static int nforce_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void nforce_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(nforce_ide_init);
module_exit(nforce_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for nVidia nForce IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,7 +25,6 @@ static ide_pci_host_proc_t nforce_procs[] __initdata = {
};
#endif /* defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_nforce(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_nforce(struct pci_dev *, const char *);
static void init_hwif_nforce(ide_hwif_t *);
static void init_dma_nforce(ide_hwif_t *, unsigned long);
......@@ -35,7 +34,6 @@ static ide_pci_device_t nvidia_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_NVIDIA,
device: PCI_DEVICE_ID_NVIDIA_NFORCE_IDE,
name: "NFORCE",
init_setup: init_setup_nforce,
init_chipset: init_chipset_nforce,
init_iops: NULL,
init_hwif: init_hwif_nforce,
......@@ -45,12 +43,8 @@ static ide_pci_device_t nvidia_chipsets[] __initdata = {
enablebits: {{0x50,0x01,0x01}, {0x50,0x02,0x02}},
bootable: ON_BOARD,
extra: 0,
},{
vendor: 0,
device: 0,
channels: 0,
bootable: EOL,
}
};
#endif /* NFORCE_H */
/*
* linux/drivers/ide/opti621.c Version 0.6 Jan 02, 1999
* linux/drivers/ide/opti621.c Version 0.7 Sept 10, 2002
*
* Copyright (C) 1996-1998 Linus Torvalds & authors (see below)
*/
......@@ -91,6 +91,7 @@
#define OPTI621_DEBUG /* define for debug messages */
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -363,21 +364,56 @@ static void __init init_setup_opti621 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init opti621_scan_pcidev (struct pci_dev *dev)
static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &opti621_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
if (dev->vendor != PCI_VENDOR_ID_OPTI)
return 0;
/**
* opti621_remove_one - called with an Opti621 is unplugged
* @dev: the device that was removed
*
* Disconnect an Opti621 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void opti621_remove_one(struct pci_dev *dev)
{
panic("Opti621 removal not yet supported");
}
for (d = opti621_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_device_id opti621_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
static struct pci_driver driver = {
name: "Opti621 IDE",
id_table: opti621_pci_tbl,
probe: opti621_init_one,
remove: __devexit_p(opti621_remove_one),
};
static int opti621_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void opti621_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(opti621_ide_init);
module_exit(opti621_ide_exit);
MODULE_AUTHOR("Jaromir Koutek, Jan Harkes, Mark Lord");
MODULE_DESCRIPTION("PCI driver module for Opti621 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -10,7 +10,7 @@ static void init_hwif_opti621(ide_hwif_t *);
static void init_dma_opti621(ide_hwif_t *, unsigned long);
static ide_pci_device_t opti621_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C621,
name: "OPTI621",
......@@ -24,7 +24,7 @@ static ide_pci_device_t opti621_chipsets[] __initdata = {
enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C825,
name: "OPTI621X",
......
This diff is collapsed.
......@@ -15,6 +15,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -646,21 +647,71 @@ static void __init init_setup_pdc20276 (struct pci_dev *dev, ide_pci_device_t *d
ide_setup_pci_device(dev, d);
}
int __init pdcnew_scan_pcidev (struct pci_dev *dev)
/**
* pdc202new_init_one - called when a pdc202xx is found
* @dev: the pdc202new device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &pdcnew_chipsets[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_PROMISE)
return 0;
for (d = pdcnew_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* pdc202new_remove_one - called when a pdc202xx is unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void pdc202new_remove_one(struct pci_dev *dev)
{
panic("Promise IDE removal not yet supported");
}
static struct pci_device_id pdc202new_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20268, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20269, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20270, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20271, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20275, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20276, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20277, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
{ 0, },
};
static struct pci_driver driver = {
name: "Promise IDE",
id_table: pdc202new_pci_tbl,
probe: pdc202new_init_one,
remove: __devexit_p(pdc202new_remove_one),
};
static int pdc202new_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void pdc202new_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(pdc202new_ide_init);
module_exit(pdc202new_ide_exit);
MODULE_AUTHOR("Andre Hedrick, Frank Tiernan");
MODULE_DESCRIPTION("PCI driver module for Promise PDC20268 and higher");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -226,7 +226,7 @@ static void init_hwif_pdc202new(ide_hwif_t *);
static void init_dma_pdc202new(ide_hwif_t *, unsigned long);
static ide_pci_device_t pdcnew_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20268,
name: "PDC20268",
......@@ -240,7 +240,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20269,
name: "PDC20269",
......@@ -254,7 +254,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20270,
name: "PDC20270",
......@@ -272,7 +272,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20271,
name: "PDC20271",
......@@ -286,7 +286,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20275,
name: "PDC20275",
......@@ -300,7 +300,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 5 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20276,
name: "PDC20276",
......@@ -318,7 +318,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 6 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20277,
name: "PDC20277",
......
/*
* linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002
* linux/drivers/ide/pdc202xx.c Version 0.36 Sept 11, 2002
*
* Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
*
......@@ -30,6 +30,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -918,21 +919,69 @@ static void __init init_setup_pdc202xx (struct pci_dev *dev, ide_pci_device_t *d
ide_setup_pci_device(dev, d);
}
int __init pdc202xx_scan_pcidev (struct pci_dev *dev)
/**
* pdc202xx_init_one - called when a PDC202xx is found
* @dev: the pdc202xx device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &pdc202xx_chipsets[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_PROMISE)
return 0;
for (d = pdc202xx_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* pdc202xx_remove_one - called with the IDE to be unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void pdc202xx_remove_one(struct pci_dev *dev)
{
panic("Promise IDE removal not yet supported");
}
static struct pci_device_id pdc202xx_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20246, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20262, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20263, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20265, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20267, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ 0, },
};
static struct pci_driver driver = {
name: "Promise Old IDE",
id_table: pdc202xx_pci_tbl,
probe: pdc202xx_init_one,
remove: __devexit_p(pdc202xx_remove_one),
};
static int pdc202xx_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void pdc202xx_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(pdc202xx_ide_init);
module_exit(pdc202xx_ide_exit);
MODULE_AUTHOR("Andre Hedrick, Frank Tiernan");
MODULE_DESCRIPTION("PCI driver module for older Promise IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -226,7 +226,7 @@ static void init_hwif_pdc202xx(ide_hwif_t *);
static void init_dma_pdc202xx(ide_hwif_t *, unsigned long);
static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20246,
name: "PDC20246",
......@@ -244,7 +244,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 16,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20262,
name: "PDC20262",
......@@ -262,7 +262,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 48,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20263,
name: "PDC20263",
......@@ -280,7 +280,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 48,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20265,
name: "PDC20265",
......@@ -297,7 +297,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 48,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20267,
name: "PDC20267",
......
/*
* linux/drivers/ide/pdcadma.c Version 0.01 June 21, 2001
* linux/drivers/ide/pdcadma.c Version 0.05 Sept 10, 2002
*
* Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
* May be copied or modified under the terms of the GNU General Public License
......@@ -127,26 +127,55 @@ static void __init init_dma_pdcadma (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_pdcadma (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit pdcadma_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &pdcadma_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 1;
}
int __init pdcadma_scan_pcidev (struct pci_dev *dev)
/**
* pdcadma_remove_one - called when a PDCADMA is unplugged
* @dev: the device that was removed
*
* Disconnect a PDCADMA device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void pdcadma_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_PDC)
return 0;
for (d = pdcadma_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
panic("PDCADMA removal not yet supported");
}
static struct pci_device_id pdcadma_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PDC, PCI_DEVICE_ID_PDC_1841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
static struct pci_driver driver = {
name: "PDCADMA-IDE",
id_table: pdcadma_pci_tbl,
probe: pdcadma_init_one,
remove: __devexit_p(pdcadma_remove_one),
};
static int pdcadma_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void pdcadma_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(pdcadma_ide_init);
module_exit(pdcadma_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for PDCADMA IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -31,7 +31,7 @@ static void init_hwif_pdcadma(ide_hwif_t *);
static void init_dma_pdcadma(ide_hwif_t *, unsigned long);
static ide_pci_device_t pdcadma_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_PDC,
device: PCI_DEVICE_ID_PDC_1841,
name: "PDCADMA",
......
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.
......@@ -94,7 +94,7 @@ struct ti_lynx {
struct lynx_send_data {
pcl_t pcl_start, pcl;
struct hpsb_packet *queue, *queue_last;
struct list_head queue;
spinlock_t queue_lock;
dma_addr_t header_dma, data_dma;
int channel;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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