From owner-freebsd-scsi Thu May 24 1:30:10 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from mass.dis.org (dhcp44-21.dis.org [216.240.44.21]) by hub.freebsd.org (Postfix) with ESMTP id 9A16837B422; Thu, 24 May 2001 01:30:06 -0700 (PDT) (envelope-from msmith@mass.dis.org) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.3/8.11.3) with ESMTP id f4O8c4N01021; Thu, 24 May 2001 01:38:05 -0700 (PDT) (envelope-from msmith@mass.dis.org) Message-Id: <200105240838.f4O8c4N01021@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Clemens Hermann Cc: Mike Smith , freebsd-scsi@freebsd.org, msmeyer@gmx.net Subject: Re: quick mly hack In-reply-to: Your message of "Thu, 24 May 2001 12:09:31 +0200." <20010524120931.A931@ramses.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 24 May 2001 01:38:04 -0700 From: Mike Smith 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 > Am 23.05.2001 um 23:48:57 schrieb Mike Smith: > Hi Mike, > > > We should probably lie about anything that might be an enclosure, such that > > it looks like it never actually responded in the first place. > > yes, but I do not know how to check if a device is a disk or somthing > else :-(. Could you give me a snippet or a hint how this could be done? Sure. In mly_cam.c, something like this: *** /sys/dev/mly/mly_cam.c Sat Mar 3 01:40:26 2001 --- mly_cam.c Thu May 24 01:36:11 2001 *************** *** 509,536 **** csio->scsi_status = mc->mc_status; switch(mc->mc_status) { case SCSI_STATUS_OK: /* ! * In order to report logical device type and status, we overwrite ! * the result of the INQUIRY command to logical devices. */ ! bus = csio->ccb_h.sim_priv.entries[0].field; ! if (bus >= sc->mly_controllerinfo->physical_channels_present) { ! if (csio->ccb_h.flags & CAM_CDB_POINTER) { ! cmd = *csio->cdb_io.cdb_ptr; ! } else { ! cmd = csio->cdb_io.cdb_bytes[0]; ! } ! if (cmd == INQUIRY) { target = csio->ccb_h.target_id; btl = &sc->mly_btl[bus][target]; padstr(inq->vendor, mly_describe_code(mly_table_device_type, btl->mb_type), 8); padstr(inq->product, mly_describe_code(mly_table_device_state, btl->mb_state), 16); padstr(inq->revision, "", 4); } } - debug(2, "SCSI_STATUS_OK"); - csio->ccb_h.status = CAM_REQ_CMP; break; case SCSI_STATUS_CHECK_COND: --- 509,546 ---- csio->scsi_status = mc->mc_status; switch(mc->mc_status) { case SCSI_STATUS_OK: + debug(2, "SCSI_STATUS_OK"); + csio->ccb_h.status = CAM_REQ_CMP; /* ! * We handle the result of INQUIRY commands specially in several cases. */ ! if (csio->ccb_h.flags & CAM_CDB_POINTER) { ! cmd = *csio->cdb_io.cdb_ptr; ! } else { ! cmd = csio->cdb_io.cdb_bytes[0]; ! } ! if (cmd == INQUIRY) { ! /* ! * In order to report logical device type and status, we overwrite ! * the result of the INQUIRY command to logical devices. ! */ ! bus = csio->ccb_h.sim_priv.entries[0].field; ! if (bus >= sc->mly_controllerinfo->physical_channels_present) { target = csio->ccb_h.target_id; btl = &sc->mly_btl[bus][target]; padstr(inq->vendor, mly_describe_code(mly_table_device_type, btl->mb_type), 8); padstr(inq->product, mly_describe_code(mly_table_device_state, btl->mb_state), 16); padstr(inq->revision, "", 4); } + /* + * In order to hide enclosure devices, we fail the INQUIRY command. + */ + if ((inq->device & 0x1f) == T_ENCLOSURE) { + csio->ccb_h.status = CAM_SEL_TIMEOUT; + break; + } } break; case SCSI_STATUS_CHECK_COND: Hope this helps; let me know how you go because I'd like to commit something useful, and I don't have any enclosure controllers. Regards, Mike -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message