Changeset 40840 in vbox
- Timestamp:
- Apr 10, 2012 8:19:34 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/scsi.h
r40543 r40840 271 271 int SCSILogModePage(char *pszBuf, size_t cchBuffer, uint8_t *pbModePage, 272 272 size_t cbModePage); 273 int SCSILogCueSheet(char *pszBuf, size_t cchBuffer, uint8_t *pbCueSheet, 274 size_t cbCueSheet); 273 275 #endif 274 276 -
trunk/src/VBox/Devices/Storage/Debug.cpp
r40543 r40840 1043 1043 1044 1044 /** 1045 * Log a mode page toa human readable form.1045 * Log a mode page in a human readable form. 1046 1046 * 1047 1047 * @returns VBox status code. … … 1093 1093 return rc; 1094 1094 } 1095 1096 /** 1097 * Log a cue sheet in a human readable form. 1098 * 1099 * @returns VBox status code. 1100 * @retval VERR_BUFFER_OVERFLOW if the given buffer is not large enough. 1101 * The buffer might contain valid data though. 1102 * @param pszBuffer The buffer to log into. 1103 * @param cchBuffer Size of the buffer in characters. 1104 * @param pbCueSheet The cue sheet buffer. 1105 * @param cbCueSheet Size of the cue sheet buffer in bytes. 1106 */ 1107 int SCSILogCueSheet(char *pszBuffer, size_t cchBuffer, uint8_t *pbCueSheet, 1108 size_t cbCueSheet) 1109 { 1110 int rc = VINF_SUCCESS; 1111 size_t cch = 0; 1112 unsigned cCueSheetEntries = cbCueSheet / 8; 1113 1114 AssertReturn(cbCueSheet % 8 == 0, VERR_INVALID_PARAMETER); 1115 1116 for (unsigned i = 0; i < cCueSheetEntries; i++) 1117 { 1118 cch = RTStrPrintf(pszBuffer, cchBuffer, 1119 "CTL/ADR=%#x TNO=%#x INDEX=%#x DATA=%#x SCMS=%#x TIME=%u:%u:%u\n", 1120 pbCueSheet[0], pbCueSheet[1], pbCueSheet[2], pbCueSheet[3], 1121 pbCueSheet[4], pbCueSheet[5], pbCueSheet[6], pbCueSheet[7]); 1122 pszBuffer += cch; 1123 cchBuffer -= cch; 1124 if (!cchBuffer) 1125 { 1126 rc = VERR_BUFFER_OVERFLOW; 1127 break; 1128 } 1129 1130 pbCueSheet += 8; 1131 cbCueSheet -= 8; 1132 } 1133 1134 return rc; 1135 } 1136
Note:
See TracChangeset
for help on using the changeset viewer.