Browse Source

Added iBFT construction to iSCSI boot test

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
7e95980858
2 changed files with 8 additions and 5 deletions
  1. 3
    3
      src/tests/dhcptest.c
  2. 5
    2
      src/tests/iscsiboot.c

+ 3
- 3
src/tests/dhcptest.c View File

@@ -14,7 +14,7 @@ static int test_dhcp_aoe_boot ( struct net_device *netdev,
14 14
 	return test_aoeboot ( netdev, aoename, drivenum );
15 15
 }
16 16
 
17
-static int test_dhcp_iscsi_boot ( char *iscsiname ) {
17
+static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
18 18
 	char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
19 19
 	char *target_iqn;
20 20
 	union {
@@ -33,7 +33,7 @@ static int test_dhcp_iscsi_boot ( char *iscsiname ) {
33 33
 	}
34 34
 	inet_aton ( iscsiname, &target.sin.sin_addr );
35 35
 
36
-	return test_iscsiboot ( initiator_iqn, &target.st, target_iqn );
36
+	return test_iscsiboot ( initiator_iqn, &target.st, target_iqn, netdev );
37 37
 }
38 38
 
39 39
 static int test_dhcp_hello ( char *helloname ) {
@@ -97,7 +97,7 @@ static int test_dhcp_boot ( struct net_device *netdev, char *filename ) {
97 97
 	if ( strncmp ( filename, "aoe:", 4 ) == 0 ) {
98 98
 		return test_dhcp_aoe_boot ( netdev, &filename[4] );
99 99
 	} else if ( strncmp ( filename, "iscsi:", 6 ) == 0 ) {
100
-		return test_dhcp_iscsi_boot ( &filename[6] );
100
+		return test_dhcp_iscsi_boot ( netdev, &filename[6] );
101 101
 	} else if ( strncmp ( filename, "hello:", 6 ) == 0 ) {
102 102
 		return test_dhcp_hello ( &filename[6] );
103 103
 	} else if ( strncmp ( filename, "http:", 5 ) == 0 ) {

+ 5
- 2
src/tests/iscsiboot.c View File

@@ -3,14 +3,15 @@
3 3
 #include <vsprintf.h>
4 4
 #include <gpxe/netdevice.h>
5 5
 #include <gpxe/iscsi.h>
6
+#include <gpxe/ibft.h>
6 7
 #include <int13.h>
7 8
 
8 9
 static struct iscsi_device test_iscsidev;
9 10
 
10 11
 int test_iscsiboot ( const char *initiator_iqn,
11 12
 		     struct sockaddr_tcpip *target,
12
-		     const char *target_iqn ) {
13
-	struct sockaddr_in *sin;
13
+		     const char *target_iqn,
14
+		     struct net_device *netdev ) {
14 15
 	struct int13_drive drive;
15 16
 	int rc;
16 17
 
@@ -26,6 +27,8 @@ int test_iscsiboot ( const char *initiator_iqn,
26 27
 		return rc;
27 28
 	}
28 29
 
30
+	ibft_fill_data ( netdev, initiator_iqn, target, target_iqn );
31
+
29 32
 	memset ( &drive, 0, sizeof ( drive ) );
30 33
 	drive.blockdev = &test_iscsidev.scsi.blockdev;
31 34
 	register_int13_drive ( &drive );

Loading…
Cancel
Save