Changeset 14848
- Timestamp:
- Sep 18, 2000, 9:27:10 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tags/trunk/src/wnaspi32/winaspi32.cpp ¶
r14833 r14848 1 /* $Id: winaspi32.cpp,v 1. 9 2000-09-15 13:25:50 sandervl Exp $ */1 /* $Id: winaspi32.cpp,v 1.10 2000-09-18 19:27:10 sandervl Exp $ */ 2 2 /* 3 3 * WNASPI routines … … 128 128 129 129 130 static WORD ASPI_ExecScsiCmd( scsiObj *aspi, SRB_ExecSCSICmd *lpPRB )130 static WORD ASPI_ExecScsiCmd( scsiObj *aspi, SRB_ExecSCSICmd *lpPRB, USHORT sel) 131 131 { 132 132 int status; 133 133 int error_code = 0; 134 134 LONG rc; 135 136 /* FIXME: hackmode */ 137 #define MAKE_TARGET_TO_HOST(lpPRB) \ 138 if (!TARGET_TO_HOST(lpPRB)) { \ 139 WARN("program was not sending target_to_host for cmd %x (flags=%x),correcting.\n",lpPRB->CDBByte[0],lpPRB->SRB_Flags); \ 140 lpPRB->SRB_Flags |= 8; \ 141 } 142 #define MAKE_HOST_TO_TARGET(lpPRB) \ 143 if (!HOST_TO_TARGET(lpPRB)) { \ 144 WARN("program was not sending host_to_target for cmd %x (flags=%x),correcting.\n",lpPRB->CDBByte[0],lpPRB->SRB_Flags); \ 145 lpPRB->SRB_Flags |= 0x10; \ 146 } 147 switch (lpPRB->CDBByte[0]) { 148 case 0x12: /* INQUIRY */ 149 case 0x5a: /* MODE_SENSE_10 */ 150 case 0xa4: /* REPORT_KEY (DVD) MMC-2 */ 151 case 0xad: /* READ DVD STRUCTURE MMC-2 */ 152 MAKE_TARGET_TO_HOST(lpPRB) 153 break; 154 case 0xa3: /* SEND KEY (DVD) MMC-2 */ 155 MAKE_HOST_TO_TARGET(lpPRB) 156 break; 157 default: 158 if ((((lpPRB->SRB_Flags & 0x18) == 0x00) || 159 ((lpPRB->SRB_Flags & 0x18) == 0x18) 160 ) && lpPRB->SRB_BufLen 161 ) { 162 FIXME("command 0x%02x, no data transfer specified, but buflen is %ld!!!\n",lpPRB->CDBByte[0],lpPRB->SRB_BufLen); 163 } 164 break; 165 } 135 166 136 167 ASPI_DebugPrintCmd(lpPRB); … … 209 240 lpPRB->SRB_BufLen); 210 241 #ifdef DEBUG_BUFFER 211 char *cdb = (char *)lpPRB->SRB_BufPointer;212 dprintfNoEOL(("Read SRB buffer["));213 for (int i = 0; i < lpPRB->SRB_BufLen; i++) {214 if (i != 0) dprintfNoEOL((",0x%02x", *cdb++));215 216 }217 dprintfNoEOL(("]\n"));242 char *cdb = (char *)lpPRB->SRB_BufPointer; 243 dprintfNoEOL(("Read SRB buffer[")); 244 for (int i = 0; i < lpPRB->SRB_BufLen; i++) { 245 if (i != 0) dprintfNoEOL((",0x%02x", *cdb++)); 246 else dprintfNoEOL(("0x%02x", *cdb++)); 247 } 248 dprintfNoEOL(("]\n")); 218 249 #endif 219 220 250 } 221 251 } … … 231 261 } 232 262 263 #if 0 264 /* FIXME: Should this be != 0 maybe? */ 265 if(aspi->SRBlock.u.cmd.target_status == 2 ) { 266 aspi->SRBlock.status = SS_ERR; 267 switch (lpPRB->CDBByte[0]) { 268 case 0xa4: /* REPORT_KEY (DVD) MMC-2 */ 269 case 0xa3: /* SEND KEY (DVD) MMC-2 */ 270 aspi->SRBlock.status = SS_COMP; 271 aspi->SRBlock.u.cmd.target_status = 0; 272 FIXME("Program wants to do DVD Region switching, but fails (non compliant DVD drive). Ignoring....\n"); 273 break; 274 } 275 } 276 #endif 233 277 /* now do posting */ 234 235 278 if (lpPRB->SRB_PostProc) 236 279 { 237 if 280 if(ASPI_POSTING(lpPRB)) 238 281 { 239 282 dprintf(("Post Routine (%lx) called\n", (DWORD) lpPRB->SRB_PostProc)); 283 //SvL: Restore win32 FS selector 284 SetFS(sel); 240 285 (*lpPRB->SRB_PostProc)(); 286 RestoreOS2FS(); 241 287 } 242 288 else … … 248 294 } 249 295 } 250 lpPRB->SRB_Status = aspi->SRBlock.status;251 lpPRB->SRB_HaStat = aspi->SRBlock.u.cmd.ha_status;252 lpPRB->SRB_TargStat = aspi->SRBlock.u.cmd.target_status;253 296 } 254 297 else 255 298 lpPRB->SRB_Status = SS_ERR; 256 299 300 //SvL: Shouldn't this be set before posting? 301 lpPRB->SRB_Status = aspi->SRBlock.status; 302 lpPRB->SRB_HaStat = aspi->SRBlock.u.cmd.ha_status; 303 lpPRB->SRB_TargStat = aspi->SRBlock.u.cmd.target_status; 257 304 258 305 ASPI_DebugPrintResult(lpPRB); … … 341 388 * SendASPI32Command32 (WNASPI32.1) 342 389 */ 343 DWORD SendASPICommand(LPSRB lpSRB )390 DWORD SendASPICommand(LPSRB lpSRB, USHORT sel) 344 391 { 345 392 DWORD dwRC; … … 391 438 392 439 case SC_EXEC_SCSI_CMD: 393 dwRC = ASPI_ExecScsiCmd( aspi, 394 &lpSRB->cmd); 440 dwRC = ASPI_ExecScsiCmd( aspi, &lpSRB->cmd, sel); 395 441 break; 396 442 … … 434 480 USHORT sel = RestoreOS2FS(); 435 481 436 yyrc = SendASPICommand(lpSRB );482 yyrc = SendASPICommand(lpSRB, sel); 437 483 SetFS(sel); 438 484
Note:
See TracChangeset
for help on using the changeset viewer.