From owner-freebsd-scsi@FreeBSD.ORG Thu Oct 13 16:47:09 2005 Return-Path: X-Original-To: scsi@freebsd.org 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 00CD216A41F; Thu, 13 Oct 2005 16:47:08 +0000 (GMT) (envelope-from danny@cs.huji.ac.il) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90BCB43D45; Thu, 13 Oct 2005 16:47:08 +0000 (GMT) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1EQ6EU-0001vS-Ax; Thu, 13 Oct 2005 18:47:06 +0200 X-Mailer: exmh version 2.7.0 06/18/2004 with nmh-1.0.4 To: scsi@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 13 Oct 2005 18:47:06 +0200 From: Danny Braniss Message-ID: Cc: "Kenneth D. Merry" Subject: iSCSI/CAM & tags X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 16:47:09 -0000 I need to 'syncronize' the discovery of devices on the target with the iscsi module so that is can set the tag opening size. At the moment im doing this in the user mode control (iscontrol) with a sleep. ... sleep(5); // this call will return the needed info: // cam_id, target_id, nluns, luns[]. if(ioctl(sess->fd, ISCSIGETCAM, &sess->cam) != 0) { syslog(LOG_WARNING, "ISCSIGETCAM failed: %d", errno); return; } ... while(sess->camdev == NULL) { sess->camdev = cam_open_btl(sess->cam.path_id, sess->cam.target_id, sess->cam.target_lun[i], O_RDWR, NULL); if(sess->camdev != NULL) { if(count-- == 0) { syslog(LOG_WARNING, "%s", cam_errbuf); debug(3, "%s", cam_errbuf); return; } } sleep(1); } There must be a better way. any ideas are welcomed. danny