Re: re-scan ide devices

Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de)
Tue, 6 Jul 1999 15:13:07 +0200 (MEST)


Hallo,

with 2.0 and a the appropriate kernel settings, insertying following
code as a module used to work to rescan the ide1 bus. I didn't try
with 2.2 yet:

#include <linux/config.h>
#include <linux/module.h>
#include <linux/hdreg.h>
#include <linux/kernel.h>
#include "linux/version.h"

static int host;

int init_module(void)
{
host = ide_register(0x170, 0x376, 15);
if (host == -1)
{
printk(KERN_NOTICE "IDE-Register failed on host %d \n", host);
return host;
}
printk(KERN_NOTICE "IDE-Register successfull on host %d \n", host);
return 0;
}

void cleanup_module(void)
{
printk(KERN_NOTICE "Trying to ide_unregister host %d\n", host);
ide_unregister(host);
}

/*
elektron:~/tmp/misc> gcc -O2 -Wall -D__KERNEL__ -DMODVERSIONS -include /usr/include/linux/modversions.h -
I/usr/src/linux/include -DMODULE -DCPU=586 -c -o ideinsert.o ideinsert.c
Copyright David Hinds <dhinds@hyper.stanford.edu>,
Uwe Bonnes
*/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/