mirror of https://github.com/ipxe/ipxe.git
Added iBFT construction to iSCSI boot test
parent
22511400c7
commit
7e95980858
|
@ -14,7 +14,7 @@ static int test_dhcp_aoe_boot ( struct net_device *netdev,
|
||||||
return test_aoeboot ( netdev, aoename, drivenum );
|
return test_aoeboot ( netdev, aoename, drivenum );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int test_dhcp_iscsi_boot ( char *iscsiname ) {
|
static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
|
||||||
char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
|
char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
|
||||||
char *target_iqn;
|
char *target_iqn;
|
||||||
union {
|
union {
|
||||||
|
@ -33,7 +33,7 @@ static int test_dhcp_iscsi_boot ( char *iscsiname ) {
|
||||||
}
|
}
|
||||||
inet_aton ( iscsiname, &target.sin.sin_addr );
|
inet_aton ( iscsiname, &target.sin.sin_addr );
|
||||||
|
|
||||||
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn );
|
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn, netdev );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int test_dhcp_hello ( char *helloname ) {
|
static int test_dhcp_hello ( char *helloname ) {
|
||||||
|
@ -97,7 +97,7 @@ static int test_dhcp_boot ( struct net_device *netdev, char *filename ) {
|
||||||
if ( strncmp ( filename, "aoe:", 4 ) == 0 ) {
|
if ( strncmp ( filename, "aoe:", 4 ) == 0 ) {
|
||||||
return test_dhcp_aoe_boot ( netdev, &filename[4] );
|
return test_dhcp_aoe_boot ( netdev, &filename[4] );
|
||||||
} else if ( strncmp ( filename, "iscsi:", 6 ) == 0 ) {
|
} else if ( strncmp ( filename, "iscsi:", 6 ) == 0 ) {
|
||||||
return test_dhcp_iscsi_boot ( &filename[6] );
|
return test_dhcp_iscsi_boot ( netdev, &filename[6] );
|
||||||
} else if ( strncmp ( filename, "hello:", 6 ) == 0 ) {
|
} else if ( strncmp ( filename, "hello:", 6 ) == 0 ) {
|
||||||
return test_dhcp_hello ( &filename[6] );
|
return test_dhcp_hello ( &filename[6] );
|
||||||
} else if ( strncmp ( filename, "http:", 5 ) == 0 ) {
|
} else if ( strncmp ( filename, "http:", 5 ) == 0 ) {
|
||||||
|
|
|
@ -3,14 +3,15 @@
|
||||||
#include <vsprintf.h>
|
#include <vsprintf.h>
|
||||||
#include <gpxe/netdevice.h>
|
#include <gpxe/netdevice.h>
|
||||||
#include <gpxe/iscsi.h>
|
#include <gpxe/iscsi.h>
|
||||||
|
#include <gpxe/ibft.h>
|
||||||
#include <int13.h>
|
#include <int13.h>
|
||||||
|
|
||||||
static struct iscsi_device test_iscsidev;
|
static struct iscsi_device test_iscsidev;
|
||||||
|
|
||||||
int test_iscsiboot ( const char *initiator_iqn,
|
int test_iscsiboot ( const char *initiator_iqn,
|
||||||
struct sockaddr_tcpip *target,
|
struct sockaddr_tcpip *target,
|
||||||
const char *target_iqn ) {
|
const char *target_iqn,
|
||||||
struct sockaddr_in *sin;
|
struct net_device *netdev ) {
|
||||||
struct int13_drive drive;
|
struct int13_drive drive;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -26,6 +27,8 @@ int test_iscsiboot ( const char *initiator_iqn,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ibft_fill_data ( netdev, initiator_iqn, target, target_iqn );
|
||||||
|
|
||||||
memset ( &drive, 0, sizeof ( drive ) );
|
memset ( &drive, 0, sizeof ( drive ) );
|
||||||
drive.blockdev = &test_iscsidev.scsi.blockdev;
|
drive.blockdev = &test_iscsidev.scsi.blockdev;
|
||||||
register_int13_drive ( &drive );
|
register_int13_drive ( &drive );
|
||||||
|
|
Loading…
Reference in New Issue