Don't pass segment to ata_cmd_packet.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 4 Mar 2008 02:56:20 +0000 (21:56 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 4 Mar 2008 02:56:20 +0000 (21:56 -0500)
The segment is always the stack - so no reason to pass it.

src/ata.c
src/ata.h

index 440feab..a84e83b 100644 (file)
--- a/src/ata.c
+++ b/src/ata.c
@@ -425,7 +425,7 @@ ata_cmd_data_out(u16 device, u16 command, u16 count, u16 cylinder
       // 3 : error
       // 4 : not ready
 u16
-ata_cmd_packet(u16 device, u8 cmdlen, u16 cmdseg, u16 cmdoff, u16 header
+ata_cmd_packet(u16 device, u16 cmdbuf, u8 cmdlen, u16 header
                , u32 length, u8 inout, u16 bufseg, u16 bufoff)
 {
     u16 iobase1, iobase2;
@@ -490,14 +490,10 @@ ata_cmd_packet(u16 device, u8 cmdlen, u16 cmdseg, u16 cmdoff, u16 header
         return 4;
     }
 
-    // Normalize address
-    cmdseg += (cmdoff / 16);
-    cmdoff %= 16;
-
     // Send command to device
     irq_enable();
 
-    outsw(iobase1, cmdseg, cmdoff, cmdlen);
+    outsw(iobase1, GET_SEG(SS), cmdbuf, cmdlen);
 
     if (inout == ATA_DATA_NO) {
         await_ide(NOT_BSY, iobase1, IDE_TIMEOUT);
index ba2667c..83c48cc 100644 (file)
--- a/src/ata.h
+++ b/src/ata.h
@@ -16,7 +16,7 @@ u16 ata_cmd_data_in(u16 device, u16 command, u16 count, u16 cylinder
                     , u16 head, u16 sector, u32 lba, u16 segment, u16 offset);
 u16 ata_cmd_data_out(u16 device, u16 command, u16 count, u16 cylinder
                      , u16 head, u16 sector, u32 lba, u16 segment, u16 offset);
-u16 ata_cmd_packet(u16 device, u8 cmdlen, u16 cmdseg, u16 cmdoff, u16 header
+u16 ata_cmd_packet(u16 device, u16 cmdbuf, u8 cmdlen, u16 header
                    , u32 length, u8 inout, u16 bufseg, u16 bufoff);
 void ata_detect();