From owner-freebsd-scsi Wed Nov 20 13:45:38 2002 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E865937B401 for ; Wed, 20 Nov 2002 13:45:36 -0800 (PST) Received: from magic.adaptec.com (magic.adaptec.com [208.236.45.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 685D443E3B for ; Wed, 20 Nov 2002 13:45:36 -0800 (PST) (envelope-from Scott_Long@adaptec.com) Received: from redfish.adaptec.com (redfish.adaptec.com [162.62.50.11]) by magic.adaptec.com (8.11.6+Sun/8.11.6) with ESMTP id gAKLjZj21862; Wed, 20 Nov 2002 13:45:35 -0800 (PST) Received: from OTCEXC01.otc.adaptec.com (otcexc01.otc.adaptec.com [10.12.1.27]) by redfish.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id NAA09523; Wed, 20 Nov 2002 13:45:34 -0800 (PST) Received: by otcexc01.otc.adaptec.com with Internet Mail Service (5.5.2653.19) id <4TQCXY5Y>; Wed, 20 Nov 2002 16:45:34 -0500 Message-ID: <6100BCEB85F8E244959C756C04E0EDD161CB94@otcexc01.otc.adaptec.com> From: "Long, Scott" To: "'Nate Lawson'" , Chuck Tuffli Cc: freebsd-scsi@FreeBSD.ORG Subject: RE: SIM as loadable module? Date: Wed, 20 Nov 2002 16:45:24 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Ok, I'm getting really confused. Chuck, is the problem that the bus doesn't get scanned at all, ever, or that it doesn't get scanned when loaded as a module? Have you tried doing a 'camcontrol rescan' on the bus after loading the module? See below... > > On Wed, 20 Nov 2002, Chuck Tuffli wrote: > > On Mon, Nov 18, 2002 at 10:16:06PM -0700, Kenneth D. Merry wrote: > > > On Mon, Nov 18, 2002 at 23:47:13 -0500, Long, Scott wrote: > > > > > > One question is whether the card gets probed when you > statically compile > > > the driver into the kernel. > > > > I haven't tried this yet. Maybe the question I'm asking is does the > > CAM automatically scan new buses or is a scan initiated by > camcontrol > > for loadable modules. > > It gets scanned on boot. If you load a module, it does not start a > rescan automatically although the periph drivers are notified > by an async > callback. > > > > Another is, what happens when you rescan that bus? > (camcontrol devlist -v > > > should show which SCSI bus is allocated to your driver.) > > > > smallrocks# camcontrol devlist -v > > scbus0 on tach0 bus 0: > > < > at scbus0 target -1 lun -1 () > > scbus1 on tach1 bus 0: > > < > at scbus1 target -1 lun -1 () > > scbus-1 on xpt0 bus 0: > > < > at scbus-1 target -1 lun > -1 (xpt0) > > This looks like it's attaching but the target id is invalid. > Can you show > your tach_attach routine where you set up the SIM and then register? This devlist output is correct. The target id for each bus is displayed as -1 on SCSI also. Now, this output only verifies that the SIM is being registered, not that your SIM action method is actually working. You can write a trivial bit of code to send a PATH_INQ to one of these busses and see if that is working. As for how to handle the target id assignment of the SIM's bus, I think that you're making it more complicated that it needs to be. CAM's bus scan algorithm is smart enough to not attempt to probe the target number that you've specified as belonging to the host. I'm not sure if setting it to cpi->max_target + 1 will confuse CAM or not, but I highly doubt it. The bus_id number is another thing that CAM doesn't really care about, so as long as you provide a number that the user/applications agree is logical, everything is fine. Scott To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message