head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.36 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.34 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.32 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q2:1.3.0.30 pkgsrc-2011Q2-base:1.3 pkgsrc-2009Q4:1.3.0.28 pkgsrc-2009Q4-base:1.3 pkgsrc-2008Q4:1.3.0.26 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.24 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.22 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.20 pkgsrc-2008Q2-base:1.3 pkgsrc-2008Q1:1.3.0.18 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.16 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.14 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.12 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.10 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.8 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.6 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.4 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.2 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.2.0.2 pkgsrc-2005Q4-base:1.2 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.3 date 2006.02.09.17.19.39; author agc; state dead; branches; next 1.2; 1.2 date 2005.11.03.10.54.17; author agc; state Exp; branches; next 1.1; 1.1 date 2005.10.30.21.02.57; author agc; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2005.10.30.21.02.57; author agc; state Exp; branches; next ; desc @@ 1.3 log @Remove the old intel-iscsi package - it has been superceded by netbsd-iscsi. @ text @$NetBSD: patch-af,v 1.2 2005/11/03 10:54:17 agc Exp $ --- src/disk.c 8 Oct 2005 22:21:15 -0000 1.1.1.1 +++ src/disk.c 8 Oct 2005 23:37:34 -0000 1.3 @@@@ -58,9 +58,15 @@@@ #include #endif #endif -#ifndef FreeBSD + +#ifdef __linux__ #include #endif + +#ifdef __NetBSD__ +#include "scsi_cmd_codes.h" +#endif + #include "iscsi.h" #include "util.h" #include "device.h" @@@@ -272,8 +278,13 @@@@ TRACE(TRACE_SCSI_CMD, "READ_CAPACITY\n"); data = args->send_data; - *((unsigned *) data) = HTONL(disk_num_blocks-1); // Max LBA - *((unsigned *) (data+4)) = HTONL(disk_block_len); // Block len + { + uint32_t maxLBA; + + maxLBA = (disk_num_blocks - 1); /* Max LBA */ + *((unsigned *) data) = ISCSI_HTONL(maxLBA); /* Max LBA */ + } + *((unsigned *) (data+4)) = ISCSI_HTONL(disk_block_len); /* Block len */ args->input = 8; args->length = 8; args->status = 0; @@@@ -281,7 +292,7 @@@@ case WRITE_6: - lba = NTOHL(*((unsigned *)cdb))&0x001fffff; + lba = ISCSI_NTOHL(*((unsigned *)cdb))&0x001fffff; len = cdb[4]; if (!len) len = 256; TRACE(TRACE_SCSI_CMD, "WRITE_6(lba %u, len %u blocks)\n", lba, len); @@@@ -295,7 +306,7 @@@@ case READ_6: - lba = NTOHL(*((unsigned *)cdb))&0x001fffff; + lba = ISCSI_NTOHL(*((unsigned *)cdb))&0x001fffff; len = cdb[4]; if (!len) len = 256; TRACE(TRACE_SCSI_CMD, "READ_6(lba %u, len %u blocks)\n", lba, len); @@@@ -372,6 +383,17 @@@@ args->status = 0; break; + case REPORT_LUNS: + TRACE(TRACE_SCSI_CMD, "REPORT LUNS\n"); + data = args->send_data; + data[3] = CONFIG_DISK_MAX_LUNS; + /* just report the maximum (CONFIG_DISK_MAX_LUNS) to the initiator */ + args->input = 8; + args->length = 16; + args->status = 0; + break; + + default: //TRACE_ERROR("UNKNOWN OPCODE 0x%x\n", cdb[0]); // comment to not cause confusion with some initiator args->status = 0x02; @ 1.2 log @Update package to nb1: recognise the REPORT_LUNS SCSI command in the iSCSI target, and just return the maximum number of LUNs that the target can handle. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.1.1.1 2005/10/30 21:02:57 agc Exp $ @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ d56 18 @ 1.1.1.1 log @Initial import of Intel's reference implementation of an iSCSI target (with a userlevel iSCSI test-quality initiator). This project is Intel Lab's software reference implementation of iSCSI. It has been tested to interoperate with the Cisco initiator, and conforms to RFC 3720. There are 3 forms of the iSCSI target that are produced: ufsdisk - standard iSCSI target ufsdisk_mmap - an mmap(2)-based iSCSI target uramdisk - a ramdisk iSCSI target and a testing-quality user-level iSCSI initiator called utest, which can exercise the targets above. @ text @@