Date: Wed, 07 Aug 2002 09:21:02 -0600 From: "Justin T. Gibbs" <gibbs@scsiguy.com> To: Jean-franXois Dalbosco <jdalbosc@enserg.fr> Subject: Re: CAM and the passthrough device Message-ID: <943380000.1028733662@aslan.scsiguy.com> In-Reply-To: <200208071336.g77DagTe031718@enserg.enserg.fr> References: <200208071336.g77DagTe031718@enserg.enserg.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
> /*************************************************/ > /* 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?943380000.1028733662>