|
@@ -181,8 +181,8 @@ static int int13_parse_eltorito ( struct san_device *sandev, void *scratch ) {
|
181
|
181
|
int rc;
|
182
|
182
|
|
183
|
183
|
/* Read boot record volume descriptor */
|
184
|
|
- if ( ( rc = sandev_rw ( sandev, ELTORITO_LBA, 1,
|
185
|
|
- virt_to_user ( boot ), block_read ) ) != 0 ) {
|
|
184
|
+ if ( ( rc = sandev_read ( sandev, ELTORITO_LBA, 1,
|
|
185
|
+ virt_to_user ( boot ) ) ) != 0 ) {
|
186
|
186
|
DBGC ( sandev, "INT13 drive %02x could not read El Torito boot "
|
187
|
187
|
"record volume descriptor: %s\n",
|
188
|
188
|
sandev->drive, strerror ( rc ) );
|
|
@@ -227,8 +227,7 @@ static int int13_guess_geometry_hdd ( struct san_device *sandev, void *scratch,
|
227
|
227
|
int rc;
|
228
|
228
|
|
229
|
229
|
/* Read partition table */
|
230
|
|
- if ( ( rc = sandev_rw ( sandev, 0, 1, virt_to_user ( mbr ),
|
231
|
|
- block_read ) ) != 0 ) {
|
|
230
|
+ if ( ( rc = sandev_read ( sandev, 0, 1, virt_to_user ( mbr ) ) ) != 0 ) {
|
232
|
231
|
DBGC ( sandev, "INT13 drive %02x could not read "
|
233
|
232
|
"partition table to guess geometry: %s\n",
|
234
|
233
|
sandev->drive, strerror ( rc ) );
|
|
@@ -506,18 +505,16 @@ static int int13_get_last_status ( struct san_device *sandev,
|
506
|
505
|
* @v cl (bits 5:0) Sector number
|
507
|
506
|
* @v dh Head number
|
508
|
507
|
* @v es:bx Data buffer
|
509
|
|
- * @v block_rw Block read/write method
|
|
508
|
+ * @v sandev_rw SAN device read/write method
|
510
|
509
|
* @ret status Status code
|
511
|
510
|
* @ret al Number of sectors read or written
|
512
|
511
|
*/
|
513
|
512
|
static int int13_rw_sectors ( struct san_device *sandev,
|
514
|
513
|
struct i386_all_regs *ix86,
|
515
|
|
- int ( * block_rw ) ( struct interface *control,
|
516
|
|
- struct interface *data,
|
517
|
|
- uint64_t lba,
|
518
|
|
- unsigned int count,
|
519
|
|
- userptr_t buffer,
|
520
|
|
- size_t len ) ) {
|
|
514
|
+ int ( * sandev_rw ) ( struct san_device *sandev,
|
|
515
|
+ uint64_t lba,
|
|
516
|
+ unsigned int count,
|
|
517
|
+ userptr_t buffer ) ) {
|
521
|
518
|
struct int13_data *int13 = sandev->priv;
|
522
|
519
|
unsigned int cylinder, head, sector;
|
523
|
520
|
unsigned long lba;
|
|
@@ -555,7 +552,7 @@ static int int13_rw_sectors ( struct san_device *sandev,
|
555
|
552
|
count );
|
556
|
553
|
|
557
|
554
|
/* Read from / write to block device */
|
558
|
|
- if ( ( rc = sandev_rw ( sandev, lba, count, buffer, block_rw ) ) != 0 ){
|
|
555
|
+ if ( ( rc = sandev_rw ( sandev, lba, count, buffer ) ) != 0 ){
|
559
|
556
|
DBGC ( sandev, "INT13 drive %02x I/O failed: %s\n",
|
560
|
557
|
sandev->drive, strerror ( rc ) );
|
561
|
558
|
return -INT13_STATUS_READ_ERROR;
|
|
@@ -581,7 +578,7 @@ static int int13_read_sectors ( struct san_device *sandev,
|
581
|
578
|
struct i386_all_regs *ix86 ) {
|
582
|
579
|
|
583
|
580
|
DBGC2 ( sandev, "Read: " );
|
584
|
|
- return int13_rw_sectors ( sandev, ix86, block_read );
|
|
581
|
+ return int13_rw_sectors ( sandev, ix86, sandev_read );
|
585
|
582
|
}
|
586
|
583
|
|
587
|
584
|
/**
|
|
@@ -601,7 +598,7 @@ static int int13_write_sectors ( struct san_device *sandev,
|
601
|
598
|
struct i386_all_regs *ix86 ) {
|
602
|
599
|
|
603
|
600
|
DBGC2 ( sandev, "Write: " );
|
604
|
|
- return int13_rw_sectors ( sandev, ix86, block_write );
|
|
601
|
+ return int13_rw_sectors ( sandev, ix86, sandev_write );
|
605
|
602
|
}
|
606
|
603
|
|
607
|
604
|
/**
|
|
@@ -701,17 +698,15 @@ static int int13_extension_check ( struct san_device *sandev __unused,
|
701
|
698
|
*
|
702
|
699
|
* @v sandev SAN device
|
703
|
700
|
* @v ds:si Disk address packet
|
704
|
|
- * @v block_rw Block read/write method
|
|
701
|
+ * @v sandev_rw SAN device read/write method
|
705
|
702
|
* @ret status Status code
|
706
|
703
|
*/
|
707
|
704
|
static int int13_extended_rw ( struct san_device *sandev,
|
708
|
705
|
struct i386_all_regs *ix86,
|
709
|
|
- int ( * block_rw ) ( struct interface *control,
|
710
|
|
- struct interface *data,
|
711
|
|
- uint64_t lba,
|
712
|
|
- unsigned int count,
|
713
|
|
- userptr_t buffer,
|
714
|
|
- size_t len ) ) {
|
|
706
|
+ int ( * sandev_rw ) ( struct san_device *sandev,
|
|
707
|
+ uint64_t lba,
|
|
708
|
+ unsigned int count,
|
|
709
|
+ userptr_t buffer ) ) {
|
715
|
710
|
struct int13_disk_address addr;
|
716
|
711
|
uint8_t bufsize;
|
717
|
712
|
uint64_t lba;
|
|
@@ -762,7 +757,7 @@ static int int13_extended_rw ( struct san_device *sandev,
|
762
|
757
|
DBGC2 ( sandev, " (count %ld)\n", count );
|
763
|
758
|
|
764
|
759
|
/* Read from / write to block device */
|
765
|
|
- if ( ( rc = sandev_rw ( sandev, lba, count, buffer, block_rw ) ) != 0 ){
|
|
760
|
+ if ( ( rc = sandev_rw ( sandev, lba, count, buffer ) ) != 0 ) {
|
766
|
761
|
DBGC ( sandev, "INT13 drive %02x extended I/O failed: %s\n",
|
767
|
762
|
sandev->drive, strerror ( rc ) );
|
768
|
763
|
/* Record that no blocks were transferred successfully */
|
|
@@ -787,7 +782,7 @@ static int int13_extended_read ( struct san_device *sandev,
|
787
|
782
|
struct i386_all_regs *ix86 ) {
|
788
|
783
|
|
789
|
784
|
DBGC2 ( sandev, "Extended read: " );
|
790
|
|
- return int13_extended_rw ( sandev, ix86, block_read );
|
|
785
|
+ return int13_extended_rw ( sandev, ix86, sandev_read );
|
791
|
786
|
}
|
792
|
787
|
|
793
|
788
|
/**
|
|
@@ -801,7 +796,7 @@ static int int13_extended_write ( struct san_device *sandev,
|
801
|
796
|
struct i386_all_regs *ix86 ) {
|
802
|
797
|
|
803
|
798
|
DBGC2 ( sandev, "Extended write: " );
|
804
|
|
- return int13_extended_rw ( sandev, ix86, block_write );
|
|
799
|
+ return int13_extended_rw ( sandev, ix86, sandev_write );
|
805
|
800
|
}
|
806
|
801
|
|
807
|
802
|
/**
|
|
@@ -1038,6 +1033,7 @@ static int int13_cdrom_read_boot_catalog ( struct san_device *sandev,
|
1038
|
1033
|
struct i386_all_regs *ix86 ) {
|
1039
|
1034
|
struct int13_data *int13 = sandev->priv;
|
1040
|
1035
|
struct int13_cdrom_boot_catalog_command command;
|
|
1036
|
+ unsigned int start;
|
1041
|
1037
|
int rc;
|
1042
|
1038
|
|
1043
|
1039
|
/* Read parameters from command packet */
|
|
@@ -1051,11 +1047,11 @@ static int int13_cdrom_read_boot_catalog ( struct san_device *sandev,
|
1051
|
1047
|
sandev->drive );
|
1052
|
1048
|
return -INT13_STATUS_INVALID;
|
1053
|
1049
|
}
|
|
1050
|
+ start = ( int13->boot_catalog + command.start );
|
1054
|
1051
|
|
1055
|
1052
|
/* Read from boot catalog */
|
1056
|
|
- if ( ( rc = sandev_rw ( sandev, ( int13->boot_catalog + command.start ),
|
1057
|
|
- command.count, phys_to_user ( command.buffer ),
|
1058
|
|
- block_read ) ) != 0 ) {
|
|
1053
|
+ if ( ( rc = sandev_read ( sandev, start, command.count,
|
|
1054
|
+ phys_to_user ( command.buffer ) ) ) != 0 ) {
|
1059
|
1055
|
DBGC ( sandev, "INT13 drive %02x could not read boot catalog: "
|
1060
|
1056
|
"%s\n", sandev->drive, strerror ( rc ) );
|
1061
|
1057
|
return -INT13_STATUS_READ_ERROR;
|