|
@@ -1,3 +1,21 @@
|
|
1
|
+/*
|
|
2
|
+ * Copyright (C) 2006 Michael Brown <mbrown@fensystems.co.uk>.
|
|
3
|
+ *
|
|
4
|
+ * This program is free software; you can redistribute it and/or
|
|
5
|
+ * modify it under the terms of the GNU General Public License as
|
|
6
|
+ * published by the Free Software Foundation; either version 2 of the
|
|
7
|
+ * License, or any later version.
|
|
8
|
+ *
|
|
9
|
+ * This program is distributed in the hope that it will be useful, but
|
|
10
|
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
12
|
+ * General Public License for more details.
|
|
13
|
+ *
|
|
14
|
+ * You should have received a copy of the GNU General Public License
|
|
15
|
+ * along with this program; if not, write to the Free Software
|
|
16
|
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
17
|
+ */
|
|
18
|
+
|
1
|
19
|
#include <stddef.h>
|
2
|
20
|
#include <string.h>
|
3
|
21
|
#include <vsprintf.h>
|
|
@@ -543,8 +561,8 @@ static struct tcp_operations iscsi_tcp_operations = {
|
543
|
561
|
* @v command SCSI command
|
544
|
562
|
* @ret rc Return status code
|
545
|
563
|
*/
|
546
|
|
-static int iscsi_command ( struct iscsi_session *iscsi,
|
547
|
|
- struct scsi_command *command ) {
|
|
564
|
+int iscsi_issue ( struct iscsi_session *iscsi,
|
|
565
|
+ struct scsi_command *command ) {
|
548
|
566
|
iscsi->command = command;
|
549
|
567
|
iscsi->status &= ~( ISCSI_STATUS_DONE | ISCSI_STATUS_ERR );
|
550
|
568
|
|
|
@@ -563,29 +581,3 @@ static int iscsi_command ( struct iscsi_session *iscsi,
|
563
|
581
|
|
564
|
582
|
return ( ( iscsi->status & ISCSI_STATUS_ERR ) ? -EIO : 0 );
|
565
|
583
|
}
|
566
|
|
-
|
567
|
|
-/**
|
568
|
|
- * Issue SCSI command via iSCSI device
|
569
|
|
- *
|
570
|
|
- * @v scsi SCSI device
|
571
|
|
- * @v command SCSI command
|
572
|
|
- * @ret rc Return status code
|
573
|
|
- */
|
574
|
|
-static int iscsi_scsi_command ( struct scsi_device *scsi,
|
575
|
|
- struct scsi_command *command ) {
|
576
|
|
- struct iscsi_device *iscsidev
|
577
|
|
- = container_of ( scsi, struct iscsi_device, scsi );
|
578
|
|
-
|
579
|
|
- return iscsi_command ( &iscsidev->iscsi, command );
|
580
|
|
-}
|
581
|
|
-
|
582
|
|
-/**
|
583
|
|
- * Initialise iSCSI device
|
584
|
|
- *
|
585
|
|
- * @v iscsidev iSCSI device
|
586
|
|
- */
|
587
|
|
-int init_iscsidev ( struct iscsi_device *iscsidev ) {
|
588
|
|
- iscsidev->scsi.command = iscsi_scsi_command;
|
589
|
|
- iscsidev->scsi.lun = iscsidev->iscsi.lun;
|
590
|
|
- return init_scsidev ( &iscsidev->scsi );
|
591
|
|
-}
|