Browse Source

Added iBFT construction to iSCSI boot test

tags/v0.9.3
Michael Brown 18 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
 	return test_aoeboot ( netdev, aoename, drivenum );
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
 	char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
18
 	char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
19
 	char *target_iqn;
19
 	char *target_iqn;
20
 	union {
20
 	union {
33
 	}
33
 	}
34
 	inet_aton ( iscsiname, &target.sin.sin_addr );
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
 static int test_dhcp_hello ( char *helloname ) {
39
 static int test_dhcp_hello ( char *helloname ) {
97
 	if ( strncmp ( filename, "aoe:", 4 ) == 0 ) {
97
 	if ( strncmp ( filename, "aoe:", 4 ) == 0 ) {
98
 		return test_dhcp_aoe_boot ( netdev, &filename[4] );
98
 		return test_dhcp_aoe_boot ( netdev, &filename[4] );
99
 	} else if ( strncmp ( filename, "iscsi:", 6 ) == 0 ) {
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
 	} else if ( strncmp ( filename, "hello:", 6 ) == 0 ) {
101
 	} else if ( strncmp ( filename, "hello:", 6 ) == 0 ) {
102
 		return test_dhcp_hello ( &filename[6] );
102
 		return test_dhcp_hello ( &filename[6] );
103
 	} else if ( strncmp ( filename, "http:", 5 ) == 0 ) {
103
 	} else if ( strncmp ( filename, "http:", 5 ) == 0 ) {

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

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

Loading…
Cancel
Save