From owner-freebsd-scsi Wed Aug 7 10: 5: 4 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 9AE6337B400 for ; Wed, 7 Aug 2002 10:05:01 -0700 (PDT) Received: from magic.adaptec.com (magic.adaptec.com [208.236.45.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2208C43E42 for ; Wed, 7 Aug 2002 10:05:01 -0700 (PDT) (envelope-from gibbs@scsiguy.com) Received: from redfish.adaptec.com (redfish.adaptec.com [162.62.50.11]) by magic.adaptec.com (8.10.2+Sun/8.10.2) with ESMTP id g77H4vG26568 for ; Wed, 7 Aug 2002 10:04:57 -0700 (PDT) Received: from btc.btc.adaptec.com (btc.btc.adaptec.com [10.100.0.52]) by redfish.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id KAA22813 for ; Wed, 7 Aug 2002 10:04:56 -0700 (PDT) Received: from [10.100.253.70] (aslan [10.100.253.70]) by btc.btc.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id LAA28306 for ; Wed, 7 Aug 2002 11:04:53 -0600 (MDT) Date: Wed, 07 Aug 2002 09:21:02 -0600 From: "Justin T. Gibbs" To: Jean-franXois Dalbosco Message-ID: <943380000.1028733662@aslan.scsiguy.com> In-Reply-To: <200208071336.g77DagTe031718@enserg.enserg.fr> References: <200208071336.g77DagTe031718@enserg.enserg.fr> X-Mailer: Mulberry/2.2.1 (Linux/x86) Subject: Re: CAM and the passthrough device X-Resent-Mailer: Mulberry/2.2.1 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 > /*************************************************/ > /* fullfill the ccb a 2nd time for */ > /* another opcode */ > /*************************************************/ ... > bzero( &ccb->csio.cdb_io.cdb_bytes,10); > ccb->csio.cdb_io.cdb_bytes[0]=(u_int8_t)0xE0; This is a vendor unique command, so I don't really know what format it takes, but it certainly looks like you have a bug here. > // ccb->csio.cdb_io.cdb_bytes[9]=(u_int8_t)0x80; > > ccb->csio.cdb_io.cdb_bytes[2]=/* Adresse Page */(u_int8_t)AdrPage; > ccb->csio.cdb_io.cdb_bytes[3]=/* Adresse Page & 0x00FF */AdrPage & > 0x00FF; Multi-byte integers in SCSI are in BigEndian format. The code above sets both cdb[2] and cdb[3] to the low byte of the page address. The code should look like: scsi_ulto2b(AdrPage, &ccb->csio.cdb_io.cdb_bytes[2]); which is equivalent to doing: ccb->csio.cdb_io.cdb_bytes[2] = AdrPage; ccb->csio.cdb_io.cdb_bytes[3] = AdrPage >> 8; > ccb->csio.cdb_io.cdb_bytes[7]=1 | 0x80; > ccb->csio.cdb_io.cdb_bytes[8]=1 & 0x00FF; Is this really what you had in mind? 1 & 0x00FF == 1 -- Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message