lkml.org 
[lkml]   [2000]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subjectscsi_unregister_device
Hello all,

As part of our final year project, we are implementing a network based on
SCSI to use as a cheap fast eth link.

This module is made of two parts:

-sn: A scsi device that talk with the scsi mid layer
-scsinet: A network device driver that talks with sn.

We made a module based on code allready made for kernel 2.1.97, ported
it to 2.4.0test10, and put it as a module. The module allready loads,
both subsystems are initialized and the kernel dosen't crash :))

The problem happens when we try to load our module without a SCSI device
driver loaded (We use Symbios 53c8xx). When that happens, we register
sn with scsi_register_device, but when we try to init scsinet, it fails
(there are no devices to talk to, so it will fail). So, before our
module is unloaded, we try to unregister the sn device using
scsi_unregister_device. All is allright, the module get's out, but, the
usage count of the scsi_mod.o dosen't decrement. So it stays blocked in
the kernel and we can't unload it...

the relevant code is something like:

static int __init init_sc(void)
{
int ret;

sn_template.module=THIS_MODULE;
if ((ret=scsi_register_module(MODULE_SCSI_DEV,&sn_template))!=0)
return ret;

if ((ret=register_netdev(&scsinet_template)!=0)
{
scsi_unregister_module(MODULE_SCSI_DEV,&sn_template);
sn_template.dev_max=0;
return ret;
}

return 0;
}

sn_template is the template for the scsi device, scsinet_template is the
template for a ehternet driver.

Anyone knows what we are doing wrong?

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

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.034 / U:6.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site