mirror of
https://github.com/ipxe/ipxe
synced 2025-12-14 16:01:38 +03:00
Make the "drive number" option apply to iSCSI as well as AoE
This commit is contained in:
@@ -23,6 +23,7 @@ static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
|
|||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
struct sockaddr_tcpip st;
|
struct sockaddr_tcpip st;
|
||||||
} target;
|
} target;
|
||||||
|
unsigned int drivenum;
|
||||||
|
|
||||||
memset ( &target, 0, sizeof ( target ) );
|
memset ( &target, 0, sizeof ( target ) );
|
||||||
target.sin.sin_family = AF_INET;
|
target.sin.sin_family = AF_INET;
|
||||||
@@ -40,8 +41,10 @@ static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
|
|||||||
dhcp_snprintf ( password, sizeof ( password ),
|
dhcp_snprintf ( password, sizeof ( password ),
|
||||||
find_global_dhcp_option ( DHCP_EB_PASSWORD ) );
|
find_global_dhcp_option ( DHCP_EB_PASSWORD ) );
|
||||||
|
|
||||||
|
drivenum = find_global_dhcp_num_option ( DHCP_EB_BIOS_DRIVE );
|
||||||
|
|
||||||
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn,
|
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn,
|
||||||
username, password, netdev );
|
username, password, netdev, drivenum );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int test_dhcp_hello ( char *helloname ) {
|
static int test_dhcp_hello ( char *helloname ) {
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ int test_iscsiboot ( const char *initiator_iqn,
|
|||||||
const char *target_iqn,
|
const char *target_iqn,
|
||||||
const char *username,
|
const char *username,
|
||||||
const char *password,
|
const char *password,
|
||||||
struct net_device *netdev ) {
|
struct net_device *netdev,
|
||||||
|
unsigned int drivenum ) {
|
||||||
struct int13_drive drive;
|
struct int13_drive drive;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ int test_iscsiboot ( const char *initiator_iqn,
|
|||||||
ibft_fill_data ( netdev, initiator_iqn, target, target_iqn );
|
ibft_fill_data ( netdev, initiator_iqn, target, target_iqn );
|
||||||
#endif
|
#endif
|
||||||
memset ( &drive, 0, sizeof ( drive ) );
|
memset ( &drive, 0, sizeof ( drive ) );
|
||||||
|
drive.drive = drivenum;
|
||||||
drive.blockdev = &test_iscsidev.scsi.blockdev;
|
drive.blockdev = &test_iscsidev.scsi.blockdev;
|
||||||
register_int13_drive ( &drive );
|
register_int13_drive ( &drive );
|
||||||
printf ( "Registered %s as BIOS drive %#02x\n",
|
printf ( "Registered %s as BIOS drive %#02x\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user