|
@@ -8,10 +8,11 @@
|
8
|
8
|
*/
|
9
|
9
|
|
10
|
10
|
#include <stdint.h>
|
11
|
|
-#include <gpxe/stream.h>
|
12
|
|
-#include <gpxe/async.h>
|
13
|
11
|
#include <gpxe/scsi.h>
|
14
|
12
|
#include <gpxe/chap.h>
|
|
13
|
+#include <gpxe/refcnt.h>
|
|
14
|
+#include <gpxe/xfer.h>
|
|
15
|
+#include <gpxe/process.h>
|
15
|
16
|
|
16
|
17
|
/** Default iSCSI port */
|
17
|
18
|
#define ISCSI_PORT 3260
|
|
@@ -486,21 +487,25 @@ enum iscsi_rx_state {
|
486
|
487
|
|
487
|
488
|
/** An iSCSI session */
|
488
|
489
|
struct iscsi_session {
|
|
490
|
+ /** Reference counter */
|
|
491
|
+ struct refcnt refcnt;
|
|
492
|
+
|
|
493
|
+ /** Transport-layer socket */
|
|
494
|
+ struct xfer_interface socket;
|
|
495
|
+
|
489
|
496
|
/** Initiator IQN */
|
490
|
|
- const char *initiator_iqn;
|
|
497
|
+ char *initiator_iqn;
|
491
|
498
|
/** Target address */
|
492
|
|
- struct sockaddr target;
|
|
499
|
+ char *target_address;
|
493
|
500
|
/** Target IQN */
|
494
|
|
- const char *target_iqn;
|
|
501
|
+ char *target_iqn;
|
495
|
502
|
/** Logical Unit Number (LUN) */
|
496
|
503
|
uint64_t lun;
|
497
|
504
|
/** Username */
|
498
|
|
- const char *username;
|
|
505
|
+ char *username;
|
499
|
506
|
/** Password */
|
500
|
|
- const char *password;
|
|
507
|
+ char *password;
|
501
|
508
|
|
502
|
|
- /** Stream application for this session */
|
503
|
|
- struct stream_application stream;
|
504
|
509
|
/** Session status
|
505
|
510
|
*
|
506
|
511
|
* This is the bitwise-OR of zero or more ISCSI_STATUS_XXX
|
|
@@ -569,10 +574,8 @@ struct iscsi_session {
|
569
|
574
|
union iscsi_bhs tx_bhs;
|
570
|
575
|
/** State of the TX engine */
|
571
|
576
|
enum iscsi_tx_state tx_state;
|
572
|
|
- /** Byte offset within the current TX state */
|
573
|
|
- size_t tx_offset;
|
574
|
|
- /** Length of the current TX state */
|
575
|
|
- size_t tx_len;
|
|
577
|
+ /** TX process */
|
|
578
|
+ struct process process;
|
576
|
579
|
|
577
|
580
|
/** Basic header segment for current RX PDU */
|
578
|
581
|
union iscsi_bhs rx_bhs;
|
|
@@ -590,8 +593,6 @@ struct iscsi_session {
|
590
|
593
|
* Set to NULL when command is complete.
|
591
|
594
|
*/
|
592
|
595
|
struct scsi_command *command;
|
593
|
|
- /** Asynchronous operation for the current iSCSI operation */
|
594
|
|
- struct async async;
|
595
|
596
|
/** Instant return code
|
596
|
597
|
*
|
597
|
598
|
* Set to a non-zero value if all requests should return
|
|
@@ -637,20 +638,4 @@ struct iscsi_session {
|
637
|
638
|
/** Maximum number of retries at connecting */
|
638
|
639
|
#define ISCSI_MAX_RETRIES 2
|
639
|
640
|
|
640
|
|
-extern int iscsi_issue ( struct iscsi_session *iscsi,
|
641
|
|
- struct scsi_command *command,
|
642
|
|
- struct async *parent );
|
643
|
|
-extern void iscsi_shutdown ( struct iscsi_session *iscsi );
|
644
|
|
-
|
645
|
|
-/** An iSCSI device */
|
646
|
|
-struct iscsi_device {
|
647
|
|
- /** SCSI device interface */
|
648
|
|
- struct scsi_device scsi;
|
649
|
|
- /** iSCSI protocol instance */
|
650
|
|
- struct iscsi_session iscsi;
|
651
|
|
-};
|
652
|
|
-
|
653
|
|
-extern int init_iscsidev ( struct iscsi_device *iscsidev );
|
654
|
|
-extern void fini_iscsidev ( struct iscsi_device *iscsidev );
|
655
|
|
-
|
656
|
641
|
#endif /* _GPXE_ISCSI_H */
|