6 #include <gpxe/sanboot.h>
11 FILE_LICENCE ( GPL2_OR_LATER
);
13 static int ib_srpboot ( const char *root_path
) {
14 struct scsi_device
*scsi
;
15 struct int13_drive
*drive
;
18 scsi
= zalloc ( sizeof ( *scsi
) );
23 drive
= zalloc ( sizeof ( *drive
) );
29 if ( ( rc
= srp_attach ( scsi
, root_path
) ) != 0 ) {
30 printf ( "Could not attach IB_SRP device: %s\n",
34 if ( ( rc
= init_scsidev ( scsi
) ) != 0 ) {
35 printf ( "Could not initialise IB_SRP device: %s\n",
40 drive
->blockdev
= &scsi
->blockdev
;
42 /* FIXME: ugly, ugly hack */
43 struct srp_device
*srp
=
44 container_of ( scsi
->backend
, struct srp_device
, refcnt
);
45 sbft_fill_data ( srp
);
47 register_int13_drive ( drive
);
48 printf ( "Registered as BIOS drive %#02x\n", drive
->drive
);
49 printf ( "Booting from BIOS drive %#02x\n", drive
->drive
);
50 rc
= int13_boot ( drive
->drive
);
51 printf ( "Boot failed\n" );
53 /* Leave drive registered, if instructed to do so */
57 printf ( "Unregistering BIOS drive %#02x\n", drive
->drive
);
58 unregister_int13_drive ( drive
);
70 struct sanboot_protocol ib_srp_sanboot_protocol __sanboot_protocol
= {