diff options
author | Michael Brown | 2007-07-29 03:31:14 +0200 |
---|---|---|
committer | Michael Brown | 2007-07-29 03:31:14 +0200 |
commit | 43013da9bf02439b4726d8afef15f7ce97d1c469 (patch) | |
tree | b9cacbe294de8d0b06e04799746fc9377010ccb5 /src/tests | |
parent | Applied a modified version of holger's regparm patches. (diff) | |
download | ipxe-43013da9bf02439b4726d8afef15f7ce97d1c469.tar.gz ipxe-43013da9bf02439b4726d8afef15f7ce97d1c469.tar.xz ipxe-43013da9bf02439b4726d8afef15f7ce97d1c469.zip |
Quick hack to get AoE back in to the tree, on a par with the current
iSCSI hack.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/aoeboot.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/tests/aoeboot.c b/src/tests/aoeboot.c deleted file mode 100644 index 17fda2c6..00000000 --- a/src/tests/aoeboot.c +++ /dev/null @@ -1,71 +0,0 @@ -#include <stdint.h> -#include <stdlib.h> -#include <stdio.h> -#include <errno.h> -#include <console.h> -#include <gpxe/netdevice.h> -#include <gpxe/aoe.h> -#include <int13.h> - -static struct aoe_device test_aoedev = { - .aoe = { - .major = 0, - .minor = 0, - }, -}; - -static int aoe_parse ( const char *aoename, struct aoe_session *aoe ) { - char *ptr = ( ( char * ) aoename ); - - if ( *ptr++ != 'e' ) - return -EINVAL; - - aoe->major = strtoul ( ptr, &ptr, 10 ); - if ( *ptr++ != '.' ) - return -EINVAL; - - aoe->minor = strtoul ( ptr, &ptr, 10 ); - if ( *ptr ) - return -EINVAL; - - return 0; -} - -int test_aoeboot ( struct net_device *netdev, const char *aoename, - unsigned int drivenum ) { - struct int13_drive drive; - int rc; - - printf ( "Attempting to boot from AoE device %s via %s\n", - aoename, netdev->name ); - - if ( ( rc = aoe_parse ( aoename, &test_aoedev.aoe ) ) != 0 ) { - printf ( "Invalid AoE device name \"%s\"\n", aoename ); - return rc; - } - - printf ( "Initialising AoE device e%d.%d\n", - test_aoedev.aoe.major, test_aoedev.aoe.minor ); - test_aoedev.aoe.netdev = netdev; - if ( ( rc = init_aoedev ( &test_aoedev ) ) != 0 ) { - printf ( "Could not reach AoE device e%d.%d\n", - test_aoedev.aoe.major, test_aoedev.aoe.minor ); - return rc; - } - - memset ( &drive, 0, sizeof ( drive ) ); - drive.drive = drivenum; - drive.blockdev = &test_aoedev.ata.blockdev; - register_int13_drive ( &drive ); - printf ( "Registered AoE device e%d.%d as BIOS drive %#02x\n", - test_aoedev.aoe.major, test_aoedev.aoe.minor, drive.drive ); - - printf ( "Booting from BIOS drive %#02x\n", drive.drive ); - rc = int13_boot ( drive.drive ); - printf ( "Boot failed\n" ); - - printf ( "Unregistering BIOS drive %#02x\n", drive.drive ); - unregister_int13_drive ( &drive ); - - return rc; -} |