Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2000 21:16:38 +0100 (BST)
From:      Nick Hibma <n_hibma@calcaphon.com>
To:        FreeBSD SCSI Mailing List <scsi@FreeBSD.org>
Subject:   Bus rescan (second try)
Message-ID:  <Pine.BSF.4.20.0003281838430.1890-100000@localhost>

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

The fragment below is intended to rescan the bus on connection of a
device. The problem is that cam_periph_find always returns NULL, because
a SIM does not seem to have a periph.

An option would be to make xpt_periph available in cam_periph.h. Or
someone telling me how to do the rescan on connection of a drive.

I think I've tried everything imaginable.

Nick


        /* Create a path and lookup the peripheral for the SIM */
        if (xpt_create_path(&path, NULL, cam_sim_path(umass_sim),
                            UMASS_SCSIID_HOST, 0)
            != CAM_REQ_CMP)
                return;
        periph = cam_periph_find(path, DEVNAME);
        if (periph == NULL) {
                DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d: no periph\n",
                        USBDEVNAME(sc->sc_dev), cam_sim_path(umass_sim),
                        device_get_unit(sc->sc_dev), 0));
                xpt_free_path(path);
                return;
        }
        xpt_free_path(path);

        /* Lookup the path again, but now include the periph in the path*/
        if (xpt_create_path(&path, periph, cam_sim_path(umass_sim),
                            UMASS_SCSIID_HOST, 0)
            != CAM_REQ_CMP)
                return;

        xpt_setup_ccb(&ccb->ccb_h, path, 5/*priority (low)*/);
        ccb->ccb_h.func_code = XPT_SCAN_BUS;
        ccb->ccb_h.cbfcnp = umass_cam_rescan_callback;
        ccb->crcn.flags = CAM_FLAG_NONE;
        xpt_action(ccb);


--
n_hibma@webweaving.org
n_hibma@freebsd.org                                          USB project
http://www.etla.net/~n_hibma/







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?Pine.BSF.4.20.0003281838430.1890-100000>