diff options
-rw-r--r-- | ider.c | 3 | ||||
-rw-r--r-- | redir.c | 3 | ||||
-rw-r--r-- | redir.h | 2 |
3 files changed, 4 insertions, 4 deletions
@@ -88,9 +88,8 @@ static int ider_packet_sense(struct redir *r, unsigned int seqno, } int ider_handle_command(struct redir *r, unsigned int seqno, - unsigned char *cdb) + unsigned char device, unsigned char *cdb) { - unsigned char device = 0xb0; unsigned char resp[512]; uint32_t lba, sector_size; @@ -447,6 +447,7 @@ static int redir_ider_command(struct redir *r, unsigned int seqno) { struct ider_command_written_message *msg = (struct ider_command_written_message *)r->buf; + unsigned char device = msg->drive_select & 0x10 ? 0xb0 : 0xa0; int i; if (msg->command != 0xa0) { @@ -459,7 +460,7 @@ static int redir_ider_command(struct redir *r, unsigned int seqno) fprintf(stderr, "%02x ", msg->packet_data[i]); fprintf(stderr, "\n"); - return ider_handle_command(r, seqno, msg->packet_data); + return ider_handle_command(r, seqno, device, msg->packet_data); } int redir_ider_recv(struct redir *r) @@ -140,4 +140,4 @@ int redir_data(struct redir *r); ssize_t redir_write(struct redir *r, const char *buf, size_t count); int ider_handle_command(struct redir *r, unsigned int seqno, - unsigned char *cdb); + unsigned char device, unsigned char *cdb); |