Changeset 178 for trunk/src/os2ahci/atapi.c
- Timestamp:
- Nov 29, 2016, 5:30:22 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/atapi.c
r155 r178 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Copyright (c) 2013-2016 David Azarewicz 6 7 * 7 8 * Authors: Christian Mueller, Markus Thielen … … 38 39 /* -------------------------- function prototypes -------------------------- */ 39 40 40 static void atapi_req_sense_pp (IORBH _far *iorb); 41 static int atapi_pad_cdb (u8 _far *cmd_in, u16 cmd_in_len, 42 u8 _far *cmd_out, u16 _far *cmd_out_len); 41 static void atapi_req_sense_pp(IORBH FAR16DATA *vIorb, IORBH *pIorb); 42 static int atapi_pad_cdb(u8 *cmd_in, u16 cmd_in_len, u8 *cmd_out, u16 *cmd_out_len); 43 43 44 44 /* ------------------------ global/static variables ------------------------ */ … … 49 49 * Get device or media geometry. This function is not expected to be called. 50 50 */ 51 int atapi_get_geometry(IORBH _far *iorb, int slot)52 { 53 dprintf("atapi_get_geometry called\n");54 iorb_seterr( iorb, IOERR_CMD_NOT_SUPPORTED);51 int atapi_get_geometry(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot) 52 { 53 DPRINTF(2,"atapi_get_geometry called\n"); 54 iorb_seterr(pIorb, IOERR_CMD_NOT_SUPPORTED); 55 55 return(-1); 56 56 } … … 59 59 * Test whether unit is ready. This function is not expected to be called. 60 60 */ 61 int atapi_unit_ready(IORBH _far *iorb, int slot)62 { 63 dprintf("atapi_unit_ready called\n");64 iorb_seterr( iorb, IOERR_CMD_NOT_SUPPORTED);61 int atapi_unit_ready(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot) 62 { 63 DPRINTF(2,"atapi_unit_ready called\n"); 64 iorb_seterr(pIorb, IOERR_CMD_NOT_SUPPORTED); 65 65 return(-1); 66 66 } … … 69 69 * Read sectors from AHCI device. 70 70 */ 71 int atapi_read(IORBH _far *iorb, int slot) 72 { 73 IORB_EXECUTEIO _far *io = (IORB_EXECUTEIO _far *) iorb; 71 int atapi_read(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot) 72 { 73 IORB_EXECUTEIO *io = (IORB_EXECUTEIO *)pIorb; 74 SCATGATENTRY *pSGList = (SCATGATENTRY*)Far16ToFlat(io->pSGList); 74 75 ATAPI_CDB_12 cdb; 75 AD_INFO *ai = ad_infos + iorb_unit_adapter( iorb);76 AD_INFO *ai = ad_infos + iorb_unit_adapter(pIorb); 76 77 USHORT count = io->BlockCount - io->BlocksXferred; 77 78 USHORT sg_indx; 78 79 USHORT sg_cnt; 79 int p = iorb_unit_port( iorb);80 int d = iorb_unit_device( iorb);80 int p = iorb_unit_port(pIorb); 81 int d = iorb_unit_device(pIorb); 81 82 int rc; 82 83 83 if (io->BlockCount == 0) { 84 if (io->BlockCount == 0) 85 { 84 86 /* NOP; return -1 without error in IORB to indicate success */ 85 87 return(-1); 86 88 } 87 89 88 if (add_workspace(iorb)->unaligned) { 90 if (add_workspace(pIorb)->unaligned) 91 { 89 92 /* unaligned S/G addresses present; need to use double buffers */ 90 return(atapi_read_unaligned( iorb, slot));93 return(atapi_read_unaligned(pIorb, slot)); 91 94 } 92 95 … … 101 104 do { 102 105 /* update sector count (might have been updated due to S/G limitations) */ 103 SET_CDB_32(cdb.trans_len, (u32)count);106 SET_CDB_32(cdb.trans_len, count); 104 107 105 108 /* update S/G count and index */ … … 109 112 /* issue command */ 110 113 rc = ata_cmd(ai, p, d, slot, ATA_CMD_PACKET, 111 AP_ATAPI_CMD, (void _far*) &cdb, sizeof(cdb),112 AP_SGLIST, io->pSGList + sg_indx, (u16)sg_cnt,114 AP_ATAPI_CMD, (void *) &cdb, sizeof(cdb), 115 AP_SGLIST, pSGList + sg_indx, sg_cnt, 113 116 AP_DEVICE, 0x40, 114 117 AP_FEATURES, ATAPI_FEAT_DMA | ATAPI_FEAT_DMA_TO_HOST, 115 118 AP_END); 116 119 117 if (rc > 0) { 120 if (rc > 0) 121 { 118 122 /* couldn't map all S/G elements */ 119 123 ata_max_sg_cnt(io, sg_indx, (USHORT) rc, &sg_cnt, &count); … … 121 125 } while (rc > 0 && sg_cnt > 0); 122 126 123 if (rc == 0) { 124 add_workspace(iorb)->blocks = count; 125 add_workspace(iorb)->ppfunc = ata_read_pp; 126 127 } else if (rc > 0) { 128 iorb_seterr(iorb, IOERR_CMD_SGLIST_BAD); 129 130 } else if (rc == ATA_CMD_UNALIGNED_ADDR) { 127 if (rc == 0) 128 { 129 add_workspace(pIorb)->blocks = count; 130 add_workspace(pIorb)->ppfunc = ata_read_pp; 131 } 132 else if (rc > 0) 133 { 134 iorb_seterr(pIorb, IOERR_CMD_SGLIST_BAD); 135 } 136 else if (rc == ATA_CMD_UNALIGNED_ADDR) 137 { 131 138 /* unaligned S/G addresses detected; need to use double buffers */ 132 add_workspace(iorb)->unaligned = 1; 133 return(atapi_read_unaligned(iorb, slot)); 134 135 } else { 136 iorb_seterr(iorb, IOERR_CMD_ADD_SOFTWARE_FAILURE); 139 add_workspace(pIorb)->unaligned = 1; 140 return(atapi_read_unaligned(pIorb, slot)); 141 } 142 else 143 { 144 iorb_seterr(pIorb, IOERR_CMD_ADD_SOFTWARE_FAILURE); 137 145 } 138 146 … … 146 154 * use a transfer buffer and copy the data manually. 147 155 */ 148 int atapi_read_unaligned(IORBH _far *iorb, int slot)149 { 150 IORB_EXECUTEIO _far *io = (IORB_EXECUTEIO _far *) iorb;151 ADD_WORKSPACE _far *aws = add_workspace(iorb);156 int atapi_read_unaligned(IORBH *pIorb, int slot) 157 { 158 IORB_EXECUTEIO *io = (IORB_EXECUTEIO *)pIorb; 159 ADD_WORKSPACE *aws = add_workspace(pIorb); 152 160 ATAPI_CDB_12 cdb; 153 AD_INFO *ai = ad_infos + iorb_unit_adapter( iorb);154 int p = iorb_unit_port( iorb);155 int d = iorb_unit_device( iorb);161 AD_INFO *ai = ad_infos + iorb_unit_adapter(pIorb); 162 int p = iorb_unit_port(pIorb); 163 int d = iorb_unit_device(pIorb); 156 164 int rc; 157 165 … … 166 174 167 175 /* allocate transfer buffer */ 168 if ((aws->buf = malloc(io->BlockSize)) == NULL) { 169 iorb_seterr(iorb, IOERR_CMD_SW_RESOURCE); 176 if ((aws->buf = MemAlloc(io->BlockSize)) == NULL) 177 { 178 iorb_seterr(pIorb, IOERR_CMD_SW_RESOURCE); 170 179 return(-1); 171 180 } 172 181 173 182 rc = ata_cmd(ai, p, d, slot, ATA_CMD_PACKET, 174 AP_ATAPI_CMD, (void _far*) &cdb, sizeof(cdb),175 AP_VADDR, (void _far *) aws->buf, (u16)io->BlockSize,183 AP_ATAPI_CMD, (void *) &cdb, sizeof(cdb), 184 AP_VADDR, (void *) aws->buf, io->BlockSize, 176 185 AP_DEVICE, 0x40, 177 186 AP_FEATURES, ATAPI_FEAT_DMA | ATAPI_FEAT_DMA_TO_HOST, 178 187 AP_END); 179 188 180 if (rc == 0) { 181 add_workspace(iorb)->blocks = 1; 182 add_workspace(iorb)->ppfunc = ata_read_pp; 183 184 } else if (rc > 0) { 185 iorb_seterr(iorb, IOERR_CMD_SGLIST_BAD); 186 187 } else { 188 iorb_seterr(iorb, IOERR_CMD_ADD_SOFTWARE_FAILURE); 189 if (rc == 0) 190 { 191 add_workspace(pIorb)->blocks = 1; 192 add_workspace(pIorb)->ppfunc = ata_read_pp; 193 194 } 195 else if (rc > 0) 196 { 197 iorb_seterr(pIorb, IOERR_CMD_SGLIST_BAD); 198 199 } 200 else 201 { 202 iorb_seterr(pIorb, IOERR_CMD_ADD_SOFTWARE_FAILURE); 189 203 } 190 204 … … 196 210 * to be called. 197 211 */ 198 int atapi_verify(IORBH _far *iorb, int slot)199 { 200 ddprintf("atapi_verify called\n");201 iorb_seterr( iorb, IOERR_CMD_NOT_SUPPORTED);212 int atapi_verify(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot) 213 { 214 DPRINTF(3,"atapi_verify called\n"); 215 iorb_seterr(pIorb, IOERR_CMD_NOT_SUPPORTED); 202 216 return(-1); 203 217 } … … 206 220 * Write sectors to AHCI device. This function is not expected to be called. 207 221 */ 208 int atapi_write(IORBH _far *iorb, int slot)209 { 210 ddprintf("atapi_write called\n");211 iorb_seterr( iorb, IOERR_CMD_NOT_SUPPORTED);222 int atapi_write(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot) 223 { 224 DPRINTF(3,"atapi_write called\n"); 225 iorb_seterr(pIorb, IOERR_CMD_NOT_SUPPORTED); 212 226 return(-1); 213 227 } … … 216 230 * Execute ATAPI command. 217 231 */ 218 int atapi_execute_cdb(IORBH _far *iorb, int slot) 219 { 220 IORB_ADAPTER_PASSTHRU _far *pt = (IORB_ADAPTER_PASSTHRU _far *) iorb; 232 int atapi_execute_cdb(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot) 233 { 234 IORB_ADAPTER_PASSTHRU *pt = (IORB_ADAPTER_PASSTHRU *)pIorb; 235 SCATGATENTRY *pSGList = (SCATGATENTRY*)Far16ToFlat(pt->pSGList); 221 236 int rc; 222 237 u8 cdb[ATAPI_MAX_CDB_LEN]; 223 238 u16 cdb_len; 224 239 225 if (pt->ControllerCmdLen > ATAPI_MAX_CDB_LEN) { 226 iorb_seterr(iorb, IOERR_CMD_SYNTAX); 240 if (pt->ControllerCmdLen > ATAPI_MAX_CDB_LEN) 241 { 242 iorb_seterr(pIorb, IOERR_CMD_SYNTAX); 227 243 return -1; 228 244 } 229 245 /* AHCI requires 12 or 16 byte commands */ 230 atapi_pad_cdb(pt->pControllerCmd, pt->ControllerCmdLen, 231 (u8 _far *) cdb, (u16 _far *) &cdb_len); 232 233 if (cdb[0] == 0x12 || cdb[0] == 0x5a) { 246 atapi_pad_cdb(Far16ToFlat(pt->pControllerCmd), pt->ControllerCmdLen, 247 (u8 *) cdb, (u16 *) &cdb_len); 248 249 if (cdb[0] == 0x12 || cdb[0] == 0x5a) 250 { 234 251 /* somebody sets the direction flag incorrectly for those commands */ 235 252 pt->Flags |= PT_DIRECTION_IN; … … 240 257 * mechanism:" -- Storage Device Driver Reference, Scatter/Gather Lists 241 258 */ 242 rc = ata_cmd(ad_infos + iorb_unit_adapter( iorb), iorb_unit_port(iorb),243 iorb_unit_device( iorb), slot, ATA_CMD_PACKET,244 AP_ATAPI_CMD, (void _far *)cdb, cdb_len,245 AP_SGLIST, p t->pSGList, pt->cSGList,259 rc = ata_cmd(ad_infos + iorb_unit_adapter(pIorb), iorb_unit_port(pIorb), 260 iorb_unit_device(pIorb), slot, ATA_CMD_PACKET, 261 AP_ATAPI_CMD, (void *)cdb, cdb_len, 262 AP_SGLIST, pSGList, pt->cSGList, 246 263 AP_WRITE, !(pt->Flags & PT_DIRECTION_IN), 247 264 AP_FEATURES, ATAPI_FEAT_DMA, … … 249 266 AP_END); 250 267 251 if (rc) { 252 iorb_seterr(iorb, IOERR_DEVICE_NONSPECIFIC); 268 if (rc) 269 { 270 iorb_seterr(pIorb, IOERR_DEVICE_NONSPECIFIC); 253 271 } 254 272 … … 266 284 * 267 285 */ 268 int atapi_req_sense(IORBH _far *iorb, int slot)269 { 270 SCSI_STATUS_BLOCK _far*ssb;271 ADD_WORKSPACE _far *aws = add_workspace(iorb);286 int atapi_req_sense(IORBH FAR16DATA *vIorb, IORBH *pIorb, int slot) 287 { 288 SCSI_STATUS_BLOCK *ssb; 289 ADD_WORKSPACE *aws = add_workspace(pIorb); 272 290 int rc; 273 291 u8 cdb[ATAPI_MIN_CDB_LEN]; 274 ATAPI_CDB_6 _far *pcdb = (ATAPI_CDB_6 _far*) cdb;292 ATAPI_CDB_6 *pcdb = (ATAPI_CDB_6 *) cdb; 275 293 size_t sense_buf_len = ATAPI_SENSE_LEN; 276 294 277 dprintf("atapi_req_sense\n"); 278 279 if ((iorb->RequestControl & IORB_REQ_STATUSBLOCK) && 280 iorb->StatusBlockLen >= sizeof(*ssb) && iorb->pStatusBlock != 0) { 295 DPRINTF(2,"atapi_req_sense\n"); 296 297 if ((pIorb->RequestControl & IORB_REQ_STATUSBLOCK) && 298 pIorb->StatusBlockLen >= sizeof(*ssb) && pIorb->pStatusBlock != 0) 299 { 300 ULONG ulTmp; 301 302 ulTmp = (CastFar16ToULONG(vIorb) & 0xffff0000) + pIorb->pStatusBlock; 303 ssb = (SCSI_STATUS_BLOCK *)Far16ToFlat(CastULONGToFar16(ulTmp)); 281 304 282 305 /* don't request sense data if caller asked us not to; the flag 283 306 * STATUS_DISABLE_REQEST_SENSE is not defined in the old DDK we've been 284 307 * using so we'll use the hard-coded value (0x0008) */ 285 ssb = (SCSI_STATUS_BLOCK _far *) (((u32) iorb & 0xffff0000U) + 286 (u16) iorb->pStatusBlock); 287 if (ssb->Flags & 0x0008U) { 288 iorb_seterr(iorb, IOERR_DEVICE_NONSPECIFIC); 308 if (ssb->Flags & 0x0008U) 309 { 310 iorb_seterr(pIorb, IOERR_DEVICE_NONSPECIFIC); 289 311 return(-1); 290 312 } … … 292 314 /* if the sense buffer requested is larger than our default, adjust 293 315 * the length accordingly to satisfy the caller's requirements. */ 294 if (ssb->SenseData != NULL && ssb->ReqSenseLen > sense_buf_len) { 316 if (ssb->SenseData != NULL && ssb->ReqSenseLen > sense_buf_len) 317 { 295 318 sense_buf_len = ssb->ReqSenseLen; 296 319 } … … 298 321 299 322 /* allocate sense buffer in ADD workspace */ 300 if ((aws->buf = malloc(sense_buf_len)) == NULL) { 301 iorb_seterr(iorb, IOERR_CMD_SW_RESOURCE); 323 if ((aws->buf = MemAlloc(sense_buf_len)) == NULL) 324 { 325 iorb_seterr(pIorb, IOERR_CMD_SW_RESOURCE); 302 326 return(-1); 303 327 } … … 310 334 311 335 aws->ppfunc = atapi_req_sense_pp; 312 rc = ata_cmd(ad_infos + iorb_unit_adapter( iorb),313 iorb_unit_port( iorb),314 iorb_unit_device( iorb),336 rc = ata_cmd(ad_infos + iorb_unit_adapter(pIorb), 337 iorb_unit_port(pIorb), 338 iorb_unit_device(pIorb), 315 339 slot, 316 340 ATA_CMD_PACKET, 317 AP_ATAPI_CMD, (void _far*)cdb, sizeof(cdb),318 AP_VADDR, (void _far *)aws->buf, sense_buf_len,341 AP_ATAPI_CMD, (void *)cdb, sizeof(cdb), 342 AP_VADDR, (void *)aws->buf, sense_buf_len, 319 343 AP_FEATURES, ATAPI_FEAT_DMA, 320 344 AP_END); 321 345 322 if (rc > 0) { 323 iorb_seterr(iorb, IOERR_CMD_SGLIST_BAD); 324 325 } else if (rc < 0) { 346 if (rc > 0) 347 { 348 iorb_seterr(pIorb, IOERR_CMD_SGLIST_BAD); 349 } 350 else if (rc < 0) 351 { 326 352 /* we failed to get info about an error -> return 327 353 * non specific device error 328 354 */ 329 iorb_seterr( iorb, IOERR_DEVICE_NONSPECIFIC);355 iorb_seterr(pIorb, IOERR_DEVICE_NONSPECIFIC); 330 356 } 331 357 … … 337 363 * data returned and maps sense info to IORB error info. 338 364 */ 339 static void atapi_req_sense_pp(IORBH _far *iorb)340 { 341 SCSI_STATUS_BLOCK _far*ssb;342 ADD_WORKSPACE _far *aws = add_workspace(iorb);365 static void atapi_req_sense_pp(IORBH FAR16DATA *vIorb, IORBH *pIorb) 366 { 367 SCSI_STATUS_BLOCK *ssb; 368 ADD_WORKSPACE *aws = add_workspace(pIorb); 343 369 ATAPI_SENSE_DATA *psd = (ATAPI_SENSE_DATA *) aws->buf; 344 370 345 dphex(psd, sizeof(*psd), "sense buffer:\n"); 346 347 if ((iorb->RequestControl & IORB_REQ_STATUSBLOCK) && 348 iorb->StatusBlockLen >= sizeof(*ssb) && iorb->pStatusBlock != 0) { 371 DHEXDUMP(0,psd, sizeof(*psd), "sense buffer:\n"); 372 373 if ((pIorb->RequestControl & IORB_REQ_STATUSBLOCK) && 374 pIorb->StatusBlockLen >= sizeof(*ssb) && pIorb->pStatusBlock != 0) 375 { 376 ULONG ulTmp; 349 377 350 378 /* copy sense data to IORB */ 351 ssb = (SCSI_STATUS_BLOCK _far *) (((u32) iorb & 0xffff0000U) +352 (u16) iorb->pStatusBlock);379 ulTmp = (CastFar16ToULONG(vIorb) & 0xffff0000) + pIorb->pStatusBlock; 380 ssb = (SCSI_STATUS_BLOCK *)Far16ToFlat(CastULONGToFar16(ulTmp)); 353 381 ssb->AdapterErrorCode = 0; 354 382 ssb->TargetStatus = SCSI_STAT_CHECKCOND; … … 356 384 memset(ssb->AdapterDiagInfo, 0x00, sizeof(ssb->AdapterDiagInfo)); 357 385 358 if (ssb->SenseData != NULL) { 386 if (ssb->SenseData != NULL) 387 { 359 388 memcpy(ssb->SenseData, psd, ssb->ReqSenseLen); 360 389 ssb->Flags |= STATUS_SENSEDATA_VALID; 361 390 } 362 iorb->Status |= IORB_STATUSBLOCK_AVAIL;391 pIorb->Status |= IORB_STATUSBLOCK_AVAIL; 363 392 } 364 393 365 394 /* map sense data to some IOERR_ value */ 366 switch (ATAPI_GET_SENSE(psd)) {367 395 switch (ATAPI_GET_SENSE(psd)) 396 { 368 397 case ASENSE_NO_SENSE: 369 398 case ASENSE_RECOVERED_ERROR: 370 399 /* no error; this shouldn't happen because we'll only call 371 400 * atapi_req_sense() if we received an error interrupt */ 372 iorb_seterr( iorb, IOERR_DEVICE_NONSPECIFIC);401 iorb_seterr(pIorb, IOERR_DEVICE_NONSPECIFIC); 373 402 break; 374 403 375 404 case ASENSE_NOT_READY: 376 iorb_seterr( iorb, IOERR_UNIT_NOT_READY);405 iorb_seterr(pIorb, IOERR_UNIT_NOT_READY); 377 406 break; 378 407 379 408 case ASENSE_UNIT_ATTENTION: 380 iorb_seterr( iorb, IOERR_MEDIA_CHANGED);409 iorb_seterr(pIorb, IOERR_MEDIA_CHANGED); 381 410 break; 382 411 383 412 case ASENSE_MEDIUM_ERROR: 384 iorb_seterr( iorb, IOERR_MEDIA);413 iorb_seterr(pIorb, IOERR_MEDIA); 385 414 break; 386 415 387 416 case ASENSE_ILLEGAL_REQUEST: 388 iorb_seterr( iorb, IOERR_CMD_SYNTAX);417 iorb_seterr(pIorb, IOERR_CMD_SYNTAX); 389 418 break; 390 419 391 420 case ASENSE_DATA_PROTECT: 392 iorb_seterr( iorb, IOERR_MEDIA_WRITE_PROTECT);421 iorb_seterr(pIorb, IOERR_MEDIA_WRITE_PROTECT); 393 422 break; 394 423 395 424 case ASENSE_BLANK_CHECK: 396 iorb_seterr( iorb, IOERR_MEDIA_NOT_FORMATTED);425 iorb_seterr(pIorb, IOERR_MEDIA_NOT_FORMATTED); 397 426 break; 398 427 399 428 case ASENSE_ABORTED_COMMAND: 400 429 case ASENSE_COPY_ABORTED: 401 iorb_seterr( iorb, IOERR_CMD_ABORTED);430 iorb_seterr(pIorb, IOERR_CMD_ABORTED); 402 431 break; 403 432 404 433 default: 405 iorb_seterr( iorb, IOERR_DEVICE_NONSPECIFIC);434 iorb_seterr(pIorb, IOERR_DEVICE_NONSPECIFIC); 406 435 break; 407 436 } … … 418 447 * returns 0 on success, != 0 if the command can't be converted. 419 448 */ 420 int atapi_pad_cdb(u8 _far *cmd_in, u16 cmd_in_len, 421 u8 _far *cmd_out, u16 _far *cmd_out_len) 422 { 423 ATAPI_CDB_12 _far *p12; 449 int atapi_pad_cdb(u8 *cmd_in, u16 cmd_in_len, u8 *cmd_out, u16 *cmd_out_len) 450 { 451 ATAPI_CDB_12 *p12; 424 452 u32 tmp; 425 453 426 if (cmd_in_len == ATAPI_MIN_CDB_LEN || cmd_in_len == ATAPI_MAX_CDB_LEN) { 454 if (cmd_in_len == ATAPI_MIN_CDB_LEN || cmd_in_len == ATAPI_MAX_CDB_LEN) 455 { 427 456 /* command does not need to be converted */ 428 457 memcpy(cmd_out, cmd_in, cmd_in_len); … … 432 461 433 462 memset(cmd_out, 0x00, ATAPI_MAX_CDB_LEN); 434 p12 = (ATAPI_CDB_12 _far*) cmd_out;463 p12 = (ATAPI_CDB_12 *) cmd_out; 435 464 /* we always convert to 12 byte CDBs */ 436 465 *cmd_out_len = ATAPI_MIN_CDB_LEN; 437 466 438 467 /* check if command can be converted */ 439 switch (cmd_in[0]) {440 468 switch (cmd_in[0]) 469 { 441 470 case ATAPI_CMD_READ_6: 442 471 case ATAPI_CMD_WRITE_6: … … 446 475 tmp = GET_CDB_24(cmd_in + 1) & 0x1fffffUL; 447 476 SET_CDB_32(p12->lba, tmp); 448 SET_CDB_32(p12->trans_len, ( u32)(cmd_in[4]));477 SET_CDB_32(p12->trans_len, (cmd_in[4])); 449 478 p12->control = cmd_in[5]; 450 479 break;
Note:
See TracChangeset
for help on using the changeset viewer.