static void atapi_req_sense(struct ide_internal * ide, struct ide_channel * channel) {
struct ide_drive * drive = get_selected_drive(channel);
+ drive->cd_state.sense.read_len=0xa;
+
memcpy(drive->data_buf, drive->cd_state.sense.buf, sizeof(drive->cd_state.sense.buf));
- atapi_setup_cmd_resp(ide, channel, 18);
+ atapi_setup_cmd_resp(ide, channel, sizeof(drive->cd_state.sense.buf));
}
drive->transfer_index, drive->transfer_length,
drive->hd_state.cur_sector_num);
- if (drive->transfer_index >= drive->transfer_length) {
+ if (drive->transfer_index >= drive->transfer_length && drive->transfer_index>=DATA_BUFFER_SIZE) {
PrintError(VM_NONE, VCORE_NONE, "Buffer overrun... (xfer_len=%llu) (cur_idx=%llu) (post_idx=%llu)\n",
drive->transfer_length, drive->transfer_index,
drive->transfer_index + length);
- if (drive->transfer_index >= drive->transfer_length) {
+ if (drive->transfer_index >= drive->transfer_length && drive->transfer_index>=DATA_BUFFER_SIZE) {
PrintError(VM_NONE, VCORE_NONE, "Buffer Overrun... (xfer_len=%llu) (cur_idx=%llu) (post_idx=%llu)\n",
drive->transfer_length, drive->transfer_index,
drive->transfer_index + length);