Lines Matching refs:val
570 static void xprint_ascii(uint16_t *val, int i, const char *string, int n) in xprint_ascii() argument
572 if (val[i]) { in xprint_ascii()
574 print_ascii((void*)&val[i], n); in xprint_ascii()
778 static void identify(uint16_t *val) NORETURN;
779 static void identify(uint16_t *val) in identify() argument
793 swab(val, buf, sizeof(buf)); in identify()
794 val = buf; in identify()
798 if (!(val[GEN_CONFIG] & NOT_ATA)) { in identify()
801 } else if (val[GEN_CONFIG]==CFA_SUPPORT_VAL) { in identify()
805 } else if (!(val[GEN_CONFIG] & NOT_ATAPI)) { in identify()
807 eqpt = (val[GEN_CONFIG] & EQPT_TYPE) >> SHIFT_EQPT; in identify()
814 printf("%sremovable media\n", !(val[GEN_CONFIG] & MEDIA_REMOVABLE) ? "non-" : ""); in identify()
822 if ((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==STBY_ID_VAL) in identify()
823 || (val[CONFIG]==PWRD_NID_VAL) || (val[CONFIG]==PWRD_ID_VAL) in identify()
826 if ((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==STBY_ID_VAL)) in identify()
828 …if (((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==PWRD_NID_VAL)) && (val[GEN_CONFIG] & INCOMPLETE)) in identify()
833 xprint_ascii(val, START_MODEL, "Model Number:", LENGTH_MODEL); in identify()
834 xprint_ascii(val, START_SERIAL, "Serial Number:", LENGTH_SERIAL); in identify()
835 xprint_ascii(val, START_FW_REV, "Firmware Revision:", LENGTH_FW_REV); in identify()
836 xprint_ascii(val, START_MEDIA, "Media Serial Num:", LENGTH_MEDIA); in identify()
837 xprint_ascii(val, START_MANUF, "Media Manufacturer:", LENGTH_MANUF); in identify()
843 if (val[MINOR] && (val[MINOR] <= MINOR_MAX)) { in identify()
845 std = actual_ver[val[MINOR]]; in identify()
847 printf("\n\tUsed: %s ", nth_string(minor_str, val[MINOR])); in identify()
852 if (val[MAJOR] && (val[MAJOR] != NOVAL_1)) { in identify()
854 jj = val[MAJOR] << 1; in identify()
876 ((((val[CMDS_SUPP_1] & VALID) == VALID_VAL) && in identify()
877 (( val[CMDS_SUPP_1] & CMDS_W83) > 0x00ff)) || in identify()
878 ((( val[CMDS_SUPP_2] & VALID) == VALID_VAL) && in identify()
879 ( val[CMDS_SUPP_2] & CMDS_W84) ) ) in identify()
883 ((((val[INTEGRITY] & SIG) == SIG_VAL) && !chksum) || in identify()
884 (( val[HWRST_RSLT] & VALID) == VALID_VAL) || in identify()
885 ((( val[CMDS_SUPP_1] & VALID) == VALID_VAL) && in identify()
886 (( val[CMDS_SUPP_1] & CMDS_W83) > 0x001f)) ) ) in identify()
890 ((((val[CMDS_SUPP_1] & VALID) == VALID_VAL) && in identify()
891 ((( val[CMDS_SUPP_1] & CMDS_W83) > 0x0000) || in identify()
892 (( val[CMDS_SUPP_0] & CMDS_W82) > 0x000f))) || in identify()
893 (( val[CAPAB_1] & VALID) == VALID_VAL) || in identify()
894 (( val[WHATS_VALID] & OK_W88) && val[ULTRA_DMA]) || in identify()
895 (( val[RM_STAT] & RM_STAT_BITS) == RM_STAT_SUP) ) in identify()
899 && ((val[CMDS_SUPP_1] & VALID) == VALID_VAL) in identify()
903 ((val[CAPAB_0] & (IORDY_SUP | IORDY_OFF)) || in identify()
904 (val[WHATS_VALID] & OK_W64_70)) ) in identify()
918 if (val[CDR_MINOR] == 9) { in identify()
922 if (val[CDR_MAJOR] && (val[CDR_MAJOR] !=NOVAL_1)) { in identify()
925 jj = val[CDR_MAJOR] >> 1; in identify()
942 jj = val[GEN_CONFIG] >> 1; in identify()
950 if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_3MS_VAL) in identify()
952 else if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_INTR_VAL) in identify()
954 else if ((val[GEN_CONFIG] & DRQ_RESPONSE_TIME) == DRQ_50US_VAL) in identify()
960 if ((val[GEN_CONFIG] & PKT_SIZE_SUPPORTED) == PKT_SIZE_12_VAL) in identify()
962 else if ((val[GEN_CONFIG] & PKT_SIZE_SUPPORTED) == PKT_SIZE_16_VAL) in identify()
969 ll = (uint32_t)val[LBA_SECTS_MSB] << 16 | val[LBA_SECTS_LSB]; in identify()
972 if ((ll > 0x00FBFC10) && (!val[LCYLS])) in identify()
975 jj = val[WHATS_VALID] & OK_W54_58; in identify()
981 val[LCYLS], in identify()
982 jj ? val[LCYLS_CUR] : 0, in identify()
983 val[LHEADS], in identify()
984 jj ? val[LHEADS_CUR] : 0, in identify()
985 val[LSECTS], in identify()
986 jj ? val[LSECTS_CUR] : 0); in identify()
988 if ((min_std == 1) && (val[TRACK_BYTES] || val[SECT_BYTES])) in identify()
990 val[TRACK_BYTES], val[SECT_BYTES]); in identify()
993 mm = (uint32_t)val[CAPACITY_MSB] << 16 | val[CAPACITY_LSB]; in identify()
996 nn = val[LCYLS_CUR] * val[LHEADS_CUR] * val[LSECTS_CUR]; in identify()
997 oo = (uint32_t)val[CAPACITY_LSB] << 16 | val[CAPACITY_MSB]; in identify()
1006 if (((val[CMDS_SUPP_1] & VALID) == VALID_VAL) in identify()
1007 && (val[CMDS_SUPP_1] & SUPPORT_48_BIT) in identify()
1009 bbbig = (uint64_t)val[LBA_64_MSB] << 48 | in identify()
1010 (uint64_t)val[LBA_48_MSB] << 32 | in identify()
1011 (uint64_t)val[LBA_MID] << 16 | in identify()
1012 val[LBA_LSB]; in identify()
1032 if (eqpt != CDROM && (val[CAPAB_0] & CMD_Q_SUP)) in identify()
1034 if (val[CAPAB_0] & OVLP_SUP) in identify()
1037 if (val[CAPAB_0] & LBA_SUP) printf("LBA, "); in identify()
1041 !(val[CAPAB_0] & IORDY_SUP) ? "(may be)" : "", in identify()
1042 (val[CAPAB_0] & IORDY_OFF) ? "" :"not"); in identify()
1046 if ((like_std == 1) && val[BUF_TYPE]) { in identify()
1047 printf("\tBuffer type: %04x: %s%s\n", val[BUF_TYPE], in identify()
1048 (val[BUF_TYPE] < 2) ? "single port, single-sector" : "dual port, multi-sector", in identify()
1049 (val[BUF_TYPE] > 2) ? " with read caching ability" : ""); in identify()
1052 if ((min_std == 1) && (val[BUFFER__SIZE] && (val[BUFFER__SIZE] != NOVAL_1))) { in identify()
1053 printf("\tBuffer size: %.1fkB\n", (float)val[BUFFER__SIZE]/2); in identify()
1055 if ((min_std < 4) && (val[RW_LONG])) { in identify()
1056 printf("\tbytes avail on r/w long: %u\n", val[RW_LONG]); in identify()
1059 printf("\tQueue depth: %u\n", (val[QUEUE_DEPTH] & DEPTH_BITS) + 1); in identify()
1064 printf("\tCan%s perform double-word IO\n", (!val[DWORD_IO]) ? "not" : ""); in identify()
1067 (val[CAPAB_0] & STD_STBY) ? "standard" : "vendor"); in identify()
1068 if ((like_std > 3) && ((val[CAPAB_1] & VALID) == VALID_VAL)) in identify()
1070 (val[CAPAB_1] & MIN_STANDBY_TIMER) ? "with" : "no"); in identify()
1075 if ((like_std < 3) && !(val[SECTOR_XFER_MAX] & SECTOR_XFER)) in identify()
1078 printf("Max = %u\tCurrent = ", val[SECTOR_XFER_MAX] & SECTOR_XFER); in identify()
1079 if (val[SECTOR_XFER_CUR] & MULTIPLE_SETTING_VALID) in identify()
1080 printf("%u\n", val[SECTOR_XFER_CUR] & SECTOR_XFER); in identify()
1084 if ((like_std > 3) && (val[CMDS_SUPP_1] & 0x0008)) { in identify()
1089 if ((val[ADV_PWR] & 0xFF00) == 0x4000) { in identify()
1090 uint8_t apm_level = val[ADV_PWR] & 0x00FF; in identify()
1094 printf("unknown setting (0x%04x)\n", val[ADV_PWR]); in identify()
1096 if (like_std > 5 && val[ACOUSTIC]) { in identify()
1098 (val[ACOUSTIC] >> 8) & 0x00ff, in identify()
1099 val[ACOUSTIC] & 0x00ff); in identify()
1103 if (eqpt != CDROM && (val[CAPAB_0] & SWRST_REQ)) in identify()
1106 if (val[PKT_REL] || val[SVC_NBSY]) { in identify()
1108 if (val[PKT_REL]) in identify()
1109 printf(" %uus to release bus.", val[PKT_REL]); in identify()
1110 if (val[SVC_NBSY]) in identify()
1112 val[SVC_NBSY]); in identify()
1119 if (!(val[CAPAB_0] & DMA_SUP)) in identify()
1122 if (val[DMA_MODE] && !val[SINGLE_DMA] && !val[MULTI_DMA]) in identify()
1123 printf(" sdma%u\n", (val[DMA_MODE] & MODE) >> 8); in identify()
1124 if (val[SINGLE_DMA]) { in identify()
1125 jj = val[SINGLE_DMA]; in identify()
1126 kk = val[SINGLE_DMA] >> 8; in identify()
1129 if (val[MULTI_DMA]) { in identify()
1130 jj = val[MULTI_DMA]; in identify()
1131 kk = val[MULTI_DMA] >> 8; in identify()
1134 if ((val[WHATS_VALID] & OK_W88) && val[ULTRA_DMA]) { in identify()
1135 jj = val[ULTRA_DMA]; in identify()
1136 kk = val[ULTRA_DMA] >> 8; in identify()
1142 if ((dev == ATAPI_DEV) && (eqpt != CDROM) && (val[CAPAB_0] & DMA_IL_SUP)) in identify()
1145 if ((val[WHATS_VALID] & OK_W64_70) in identify()
1146 && (val[DMA_TIME_MIN] || val[DMA_TIME_NORM]) in identify()
1149 if (val[DMA_TIME_MIN]) printf(" min=%uns", val[DMA_TIME_MIN]); in identify()
1150 if (val[DMA_TIME_NORM]) printf(" recommended=%uns", val[DMA_TIME_NORM]); in identify()
1159 if ((val[WHATS_VALID] & OK_W64_70) && (val[ADV_PIO_MODES] & PIO_SUP)) { in identify()
1160 jj = ((val[ADV_PIO_MODES] & PIO_SUP) << 3) | 0x0007; in identify()
1166 } else if (((min_std < 5) || (eqpt == CDROM)) && (val[PIO_MODE] & MODE)) { in identify()
1167 for (ii = 0; ii <= val[PIO_MODE]>>8; ii++) in identify()
1173 if (val[WHATS_VALID] & OK_W64_70) { in identify()
1174 if (val[PIO_NO_FLOW] || val[PIO_FLOW]) { in identify()
1176 if (val[PIO_NO_FLOW]) in identify()
1177 printf(" no flow control=%uns", val[PIO_NO_FLOW]); in identify()
1178 if (val[PIO_FLOW]) in identify()
1179 printf(" IORDY flow control=%uns", val[PIO_FLOW]); in identify()
1184 if ((val[CMDS_SUPP_1] & VALID) == VALID_VAL) { in identify()
1187 jj = val[CMDS_SUPP_0]; in identify()
1188 kk = val[CMDS_EN_0]; in identify()
1197 jj = val[CMDS_SUPP_0+1+(ii/16)]; in identify()
1198 kk = val[CMDS_EN_0+1+(ii/16)]; in identify()
1201 if ((val[CMDS_SUPP_2] & VALID) != VALID_VAL) in identify()
1207 if ((val[RM_STAT] & RM_STAT_BITS) == RM_STAT_SUP) in identify()
1212 && (val[SECU_STATUS] || val[ERASE_TIME] || val[ENH_ERASE_TIME]) in identify()
1215 if (val[PSWD_CODE] && (val[PSWD_CODE] != NOVAL_1)) in identify()
1216 printf("\tMaster password revision code = %u\n", val[PSWD_CODE]); in identify()
1217 jj = val[SECU_STATUS]; in identify()
1225 if (val[SECU_STATUS] & SECU_ENABLED) { in identify()
1227 (val[SECU_STATUS] & SECU_LEVEL) ? "maximum" : "high"); in identify()
1230 jj = val[ERASE_TIME] & ERASE_BITS; in identify()
1231 kk = val[ENH_ERASE_TIME] & ERASE_BITS; in identify()
1241 jj = val[HWRST_RSLT]; in identify()
1255 (val[HWRST_RSLT] & CBLID) ? "above" : "below", in identify()
1261 if (val[CFA_PWR_MODE] & VALID_W160) { in identify()
1264 (val[CFA_PWR_MODE] & PWR_MODE_OFF) ? "disabled" : "enabled", in identify()
1265 (val[CFA_PWR_MODE] & PWR_MODE_REQ) ? " and required by some commands" : ""); in identify()
1266 if (val[CFA_PWR_MODE] & MAX_AMPS) in identify()
1267 printf("\tMaximum current = %uma\n", val[CFA_PWR_MODE] & MAX_AMPS); in identify()
1269 if ((val[INTEGRITY] & SIG) == SIG_VAL) { in identify()
1614 int val; local
1623 val = bb_strtoi(name, NULL, 10);
1625 return val;