Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jul 2001 21:39:32 +0100 (BST)
From:      Nick Hibma <n_hibma@webweaving.org>
To:        j mckitrick <jcm@FreeBSD-uk.eu.org>
Cc:        <freebsd-hackers@FreeBSD.ORG>, <freebsd-scsi@FreeBSD.ORG>
Subject:   Re: disconnecting from detached zip drive
Message-ID:  <20010701213608.F5327-100000@heather.plazza.uk>
In-Reply-To: <20010612122731.A81226@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Have a look at the umass driver. When I wrote the detach code I never
managed to actually detach the SIM. It would panic on reattach. I never
bothered to figure out why.

What the driver does: When the module loads it does not immediatelly
attach itself to CAM as a SIM as I might want to unload it. When it
finds a device it wants to tell CAM about it registers the SIM,
announces the device, and is ready to start servicing requests.

On detach it only removes the drive from CAM and not the SIM. However,
there is some code in there that shows how I *think* detaching the SIM
should work. So there should be a starting point.

Another example of a detachable SIM would be the AIC driver I believe.
Ask Warner Losh, at imp@freebsd.org, he wrote the detach code for that
driver I believe.

I'd be very interested to hear about it, if you find a reliable
solution.

Nick


On Tue, 12 Jun 2001, j mckitrick wrote:

>
> hi all,
>
> i'm working on turning the zip driver and all the ppbus devices into
> modules.  So far, i have the vpo (zip driver) detaching, but i have problems
> when i reattach.
>
> In the initial attach() call, we allocate a tiny bit of memory for a device
> controlling microsequence, and we call cam_sim_alloc(), xpt_bus_register(),
> and then rescan the bus.  If we fail, we call cam_simq_free() if the
> xxx_alloc call failed, and we call cam_sim_free() if xxx_register() fails.
>
> In detach(), i am experimenting (!) and right now i free() the microsequence
> (unrelated to cam) and call cam_sim_free().
>
> Here is the problem: when i detach, everything looks fine. I attach() when i
> reload the module, and the log message says it is now allocating device vpo0
> and vpo1.  There is only supposed to be vpo0, of course.  It also assigns
> these as da1 and da2, instead of da0.  Now, when i try to mount the drive, i
> get a page fault in cam and/or mount, depending on what i did in detach().
>
> What needs to be done to completely disconnect the zip drive from cam, so
> that the new attachment looks like it is starting over from scratch?
>
> Jonathon
> --
> Tech support:  Try this.  Arrange the parts in neat piles.  Stand on your
> chair until you can see over your cubicle walls.  Now shout "Does anybody
> know how to read a manual?"
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010701213608.F5327-100000>