Lines Matching +full:0 +full:x30000
42 for(i = 0; i < buf_size; i++) { in padstr8()
53 buf[0] = (lba / 75) / 60; in lba_to_msf()
60 return !s->tray_open && s->nb_sectors > 0; in media_present()
77 buf[0] = 0x00; in cd_data_to_raw()
78 memset(buf + 1, 0xff, 10); in cd_data_to_raw()
79 buf[11] = 0x00; in cd_data_to_raw()
83 buf[3] = 0x01; /* mode 1 data */ in cd_data_to_raw()
88 memset(buf, 0, 288); in cd_data_to_raw()
103 ATAPI_SECTOR_SIZE, s->io_buffer, 0); in cd_read_sector_sync()
107 ATAPI_SECTOR_SIZE, s->io_buffer + 16, 0); in cd_read_sector_sync()
108 if (ret >= 0) { in cd_read_sector_sync()
117 if (ret < 0) { in cd_read_sector_sync()
122 s->io_buffer_index = 0; in cd_read_sector_sync()
134 if (ret < 0) { in cd_read_sector_cb()
147 s->io_buffer_index = 0; in cd_read_sector_cb()
174 return 0; in cd_read_sector()
179 s->error = 0; in ide_atapi_cmd_ok()
215 if (bcl == 0xffff) { in atapi_byte_count_limit()
216 return 0xfffe; in atapi_byte_count_limit()
225 while (s->packet_transfer_size > 0) { in ide_atapi_cmd_reply_end()
234 if (ret < 0) { in ide_atapi_cmd_reply_end()
243 if (ret < 0) { in ide_atapi_cmd_reply_end()
249 if (s->elementary_transfer_size > 0) { in ide_atapi_cmd_reply_end()
268 s->lcyl = size & 0xff; in ide_atapi_cmd_reply_end()
309 s->elementary_transfer_size = 0; in ide_atapi_cmd_reply()
318 s->io_buffer_index = 0; in ide_atapi_cmd_reply()
327 assert(0 <= lba && lba < (s->nb_sectors >> 2)); in ide_atapi_cmd_read_pio()
331 s->elementary_transfer_size = 0; in ide_atapi_cmd_read_pio()
343 s->nsector = 0; in ide_atapi_cmd_check_status()
353 if (ret < 0) { in ide_atapi_cmd_read_dma_cb()
363 if (s->io_buffer_size > 0) { in ide_atapi_cmd_read_dma_cb()
381 if (s->bus->dma->ops->rw_buf(s->bus->dma, 1) == 0) in ide_atapi_cmd_read_dma_cb()
385 if (s->packet_transfer_size <= 0) { in ide_atapi_cmd_read_dma_cb()
392 s->io_buffer_index = 0; in ide_atapi_cmd_read_dma_cb()
402 data_offset = 0; in ide_atapi_cmd_read_dma_cb()
414 if (ret < 0) { in ide_atapi_cmd_read_dma_cb()
427 assert(0 <= lba && lba < (s->nb_sectors >> 2)); in ide_atapi_cmd_read_dma()
431 s->io_buffer_size = 0; in ide_atapi_cmd_read_dma()
473 buf_profile[2] = ((buf_profile[0] == buf[6]) && (buf_profile[1] == buf[7])); in ide_atapi_set_profile()
486 case 0x0: /* Physical format information */ in ide_dvd_read_structure()
491 if (layer != 0) in ide_dvd_read_structure()
495 if (total_sectors == 0) { in ide_dvd_read_structure()
500 buf[5] = 0xf; /* 120mm disc, minimum rate unspecified */ in ide_dvd_read_structure()
502 buf[7] = 0; /* default densities */ in ide_dvd_read_structure()
504 /* FIXME: 0x30000 per spec? */ in ide_dvd_read_structure()
505 stl_be_p(buf + 8, 0); /* start sector */ in ide_dvd_read_structure()
516 case 0x01: /* DVD copyright information */ in ide_dvd_read_structure()
517 buf[4] = 0; /* no copyright data */ in ide_dvd_read_structure()
518 buf[5] = 0; /* no region restrictions */ in ide_dvd_read_structure()
526 case 0x03: /* BCA information - invalid field for no BCA info */ in ide_dvd_read_structure()
529 case 0x04: /* DVD disc manufacturing information */ in ide_dvd_read_structure()
536 case 0xff: in ide_dvd_read_structure()
542 buf[4] = 0x00; /* Physical format */ in ide_dvd_read_structure()
543 buf[5] = 0x40; /* Not writable, is readable */ in ide_dvd_read_structure()
546 buf[8] = 0x01; /* Copyright info */ in ide_dvd_read_structure()
547 buf[9] = 0x40; /* Not writable, is readable */ in ide_dvd_read_structure()
550 buf[12] = 0x03; /* BCA info */ in ide_dvd_read_structure()
551 buf[13] = 0x40; /* Not writable, is readable */ in ide_dvd_read_structure()
554 buf[16] = 0x04; /* Manufacturing info */ in ide_dvd_read_structure()
555 buf[17] = 0x40; /* Not writable, is readable */ in ide_dvd_read_structure()
574 media_status = 0; in event_status_media()
597 buf[6] = 0; in event_status_media()
598 buf[7] = 0; in event_status_media()
609 /* TODO: Check IDENTIFY data word 125 for defacult BCL (currently 0) */ in validate_bcl()
648 if (!(gesn_cdb->polled & 0x01)) { /* asynchronous mode */ in cmd_get_event_status_notification()
672 gesn_event_header->notification_class = 0; in cmd_get_event_status_notification()
683 gesn_event_header->notification_class = 0x80; /* No event available */ in cmd_get_event_status_notification()
695 memset(buf, 0, 18); in cmd_request_sense()
696 buf[0] = 0x70 | (1 << 7); in cmd_request_sense()
713 unsigned idx = 0; in cmd_inquiry()
719 if (buf[1] & 0x01) { in cmd_inquiry()
723 buf[idx++] = 0x05; /* CD-ROM */ in cmd_inquiry()
725 buf[idx++] = 0x00; /* reserved */ in cmd_inquiry()
729 case 0x00: in cmd_inquiry()
731 buf[idx++] = 0x00; /* 0x00: Supported Pages, and: */ in cmd_inquiry()
732 buf[idx++] = 0x83; /* 0x83: Device Identification. */ in cmd_inquiry()
735 case 0x83: in cmd_inquiry()
748 buf[idx++] = 0x02; /* Ascii */ in cmd_inquiry()
749 buf[idx++] = 0x00; /* Vendor Specific */ in cmd_inquiry()
750 buf[idx++] = 0x00; in cmd_inquiry()
760 buf[idx++] = 0x02; /* Ascii */ in cmd_inquiry()
761 buf[idx++] = 0x01; /* T10 Vendor */ in cmd_inquiry()
762 buf[idx++] = 0x00; in cmd_inquiry()
774 buf[idx++] = 0x01; /* Binary */ in cmd_inquiry()
775 buf[idx++] = 0x03; /* NAA */ in cmd_inquiry()
776 buf[idx++] = 0x00; in cmd_inquiry()
777 buf[idx++] = 0x08; in cmd_inquiry()
793 buf[0] = 0x05; /* CD-ROM */ in cmd_inquiry()
794 buf[1] = 0x80; /* removable */ in cmd_inquiry()
795 buf[2] = 0x00; /* ISO */ in cmd_inquiry()
796 buf[3] = 0x21; /* ATAPI-2 (XXX: put ATAPI-4 ?) */ in cmd_inquiry()
798 buf[5] = 0; /* reserved */ in cmd_inquiry()
799 buf[6] = 0; /* reserved */ in cmd_inquiry()
800 buf[7] = 0; /* reserved */ in cmd_inquiry()
815 uint8_t index = 0; in cmd_get_configuration()
818 /* only feature 0 is supported */ in cmd_get_configuration()
819 if (buf[2] != 0 || buf[3] != 0) { in cmd_get_configuration()
840 memset(buf, 0, max_len); in cmd_get_configuration()
843 * to use as current. 0 means there is no media in cmd_get_configuration()
851 buf[10] = 0x02 | 0x01; /* persistent and current */ in cmd_get_configuration()
867 code = buf[2] & 0x3f; in cmd_mode_sense()
870 case 0: /* current values */ in cmd_mode_sense()
873 stw_be_p(&buf[0], 16 - 2); in cmd_mode_sense()
874 buf[2] = 0x70; in cmd_mode_sense()
875 buf[3] = 0; in cmd_mode_sense()
876 buf[4] = 0; in cmd_mode_sense()
877 buf[5] = 0; in cmd_mode_sense()
878 buf[6] = 0; in cmd_mode_sense()
879 buf[7] = 0; in cmd_mode_sense()
883 buf[10] = 0x00; in cmd_mode_sense()
884 buf[11] = 0x05; in cmd_mode_sense()
885 buf[12] = 0x00; in cmd_mode_sense()
886 buf[13] = 0x00; in cmd_mode_sense()
887 buf[14] = 0x00; in cmd_mode_sense()
888 buf[15] = 0x00; in cmd_mode_sense()
892 stw_be_p(&buf[0], 24 - 2); in cmd_mode_sense()
893 buf[2] = 0x70; in cmd_mode_sense()
894 buf[3] = 0; in cmd_mode_sense()
895 buf[4] = 0; in cmd_mode_sense()
896 buf[5] = 0; in cmd_mode_sense()
897 buf[6] = 0; in cmd_mode_sense()
898 buf[7] = 0; in cmd_mode_sense()
903 buf[17] = 0; in cmd_mode_sense()
904 buf[19] = 0; in cmd_mode_sense()
905 buf[21] = 0; in cmd_mode_sense()
906 buf[23] = 0; in cmd_mode_sense()
911 stw_be_p(&buf[0], 30 - 2); in cmd_mode_sense()
912 buf[2] = 0x70; in cmd_mode_sense()
913 buf[3] = 0; in cmd_mode_sense()
914 buf[4] = 0; in cmd_mode_sense()
915 buf[5] = 0; in cmd_mode_sense()
916 buf[6] = 0; in cmd_mode_sense()
917 buf[7] = 0; in cmd_mode_sense()
921 buf[10] = 0x3b; /* read CDR/CDRW/DVDROM/DVDR/DVDRAM */ in cmd_mode_sense()
922 buf[11] = 0x00; in cmd_mode_sense()
924 /* Claim PLAY_AUDIO capability (0x01) since some Linux in cmd_mode_sense()
926 buf[12] = 0x71; in cmd_mode_sense()
928 buf[14] = (1 << 0) | (1 << 3) | (1 << 5); in cmd_mode_sense()
932 buf[15] = 0x00; /* No volume & mute control, no changer */ in cmd_mode_sense()
934 buf[18] = 0; /* Two volume levels */ in cmd_mode_sense()
938 buf[24] = 0; in cmd_mode_sense()
939 buf[25] = 0; in cmd_mode_sense()
940 buf[26] = 0; in cmd_mode_sense()
941 buf[27] = 0; in cmd_mode_sense()
942 buf[28] = 0; in cmd_mode_sense()
943 buf[29] = 0; in cmd_mode_sense()
987 if (buf[0] == GPCMD_READ_10) { in cmd_read()
992 if (nb_sectors == 0) { in cmd_read()
1014 if (nb_sectors == 0) { in cmd_read_cd()
1025 transfer_request = buf[9] & 0xf8; in cmd_read_cd()
1026 if (transfer_request == 0x00) { in cmd_read_cd()
1038 case 0x10: in cmd_read_cd()
1042 case 0xf8: in cmd_read_cd()
1072 int pwrcnd = buf[4] & 0xf0; in cmd_start_stop_unit()
1075 /* eject/load only happens for power condition == 0 */ in cmd_start_stop_unit()
1101 stw_be_p(buf, 0); in cmd_mechanism_status()
1103 buf[2] = 0; in cmd_mechanism_status()
1104 buf[3] = 0; in cmd_mechanism_status()
1105 buf[4] = 0; in cmd_mechanism_status()
1107 stw_be_p(buf + 6, 0); in cmd_mechanism_status()
1123 case 0: in cmd_read_toc_pma_atip()
1125 if (len < 0) in cmd_read_toc_pma_atip()
1131 memset(buf, 0, 12); in cmd_read_toc_pma_atip()
1132 buf[1] = 0x0a; in cmd_read_toc_pma_atip()
1133 buf[2] = 0x01; in cmd_read_toc_pma_atip()
1134 buf[3] = 0x01; in cmd_read_toc_pma_atip()
1139 if (len < 0) in cmd_read_toc_pma_atip()
1166 if (type != 0) { in cmd_read_disc_information()
1172 memset(buf, 0, 34); in cmd_read_disc_information()
1174 buf[2] = 0xe; /* last session complete, disc finalized */ in cmd_read_disc_information()
1179 buf[7] = 0x20; /* unrestricted use */ in cmd_read_disc_information()
1180 buf[8] = 0x00; /* CD-ROM or DVD-ROM */ in cmd_read_disc_information()
1199 if (format < 0xff) { in cmd_read_dvd_structure()
1211 memset(buf, 0, max_len > IDE_DMA_BUF_SECTORS * BDRV_SECTOR_SIZE + 4 ? in cmd_read_dvd_structure()
1215 case 0x00 ... 0x7f: in cmd_read_dvd_structure()
1216 case 0xff: in cmd_read_dvd_structure()
1217 if (media == 0) { in cmd_read_dvd_structure()
1220 if (ret < 0) { in cmd_read_dvd_structure()
1231 case 0x80: /* TODO: AACS volume identifier */ in cmd_read_dvd_structure()
1232 case 0x81: /* TODO: AACS media serial number */ in cmd_read_dvd_structure()
1233 case 0x82: /* TODO: AACS media identifier */ in cmd_read_dvd_structure()
1234 case 0x83: /* TODO: AACS media key block */ in cmd_read_dvd_structure()
1235 case 0x90: /* TODO: List of recognized format layers */ in cmd_read_dvd_structure()
1236 case 0xc0: /* TODO: Write protection status */ in cmd_read_dvd_structure()
1254 ALLOW_UA = 0x01,
1261 CHECK_READY = 0x02,
1269 NONDATA = 0x04,
1277 CONDDATA = 0x08,
1283 } atapi_cmd_table[0x100] = {
1284 [ 0x00 ] = { cmd_test_unit_ready, CHECK_READY | NONDATA },
1285 [ 0x03 ] = { cmd_request_sense, ALLOW_UA },
1286 [ 0x12 ] = { cmd_inquiry, ALLOW_UA },
1287 [ 0x1b ] = { cmd_start_stop_unit, NONDATA }, /* [1] */
1288 [ 0x1e ] = { cmd_prevent_allow_medium_removal, NONDATA },
1289 [ 0x25 ] = { cmd_read_cdvd_capacity, CHECK_READY },
1290 [ 0x28 ] = { cmd_read, /* (10) */ CHECK_READY },
1291 [ 0x2b ] = { cmd_seek, CHECK_READY | NONDATA },
1292 [ 0x43 ] = { cmd_read_toc_pma_atip, CHECK_READY },
1293 [ 0x46 ] = { cmd_get_configuration, ALLOW_UA },
1294 [ 0x4a ] = { cmd_get_event_status_notification, ALLOW_UA },
1295 [ 0x51 ] = { cmd_read_disc_information, CHECK_READY },
1296 [ 0x5a ] = { cmd_mode_sense, /* (10) */ 0 },
1297 [ 0xa8 ] = { cmd_read, /* (12) */ CHECK_READY },
1298 [ 0xad ] = { cmd_read_dvd_structure, CHECK_READY },
1299 [ 0xbb ] = { cmd_set_speed, NONDATA },
1300 [ 0xbd ] = { cmd_mechanism_status, 0 },
1301 [ 0xbe ] = { cmd_read_cd, CHECK_READY | CONDDATA },
1308 const struct AtapiCmd *cmd = &atapi_cmd_table[s->io_buffer[0]]; in ide_atapi_cmd()
1310 trace_ide_atapi_cmd(s, s->io_buffer[0]); in ide_atapi_cmd()
1314 qemu_hexdump_line(NULL, buf, ATAPI_PACKET_SIZE, 1, 0); in ide_atapi_cmd()
1343 s->cdrom_changed = 0; in ide_atapi_cmd()
1357 /* Commands that don't transfer DATA permit the byte_count_limit to be 0. in ide_atapi_cmd()
1358 * If this is a data-transferring PIO command and BCL is 0, in ide_atapi_cmd()