| 1197 | | cdb[ 0] = 0xD8; // Prolific ATA pass through? (OPERATION CODE) |
| 1198 | | cdb[ 1] = 0x15; // Magic? |
| 1199 | | cdb[ 2] = 0x0; // Always 0? |
| 1200 | | cdb[ 3] = in.in_regs.features; // SMART command |
| 1201 | | cdb[ 4] = 0x06; // VendorID magic? (Prolific VendorID: 0x067B) |
| 1202 | | cdb[ 5] = 0x7B; // VendorID magic? (Prolific VendorID: 0x067B) |
| 1203 | | cdb[ 6] = 0; // Always 0? |
| 1204 | | cdb[ 7] = 0; // Always 0? |
| 1205 | | cdb[ 8] = (unsigned char)(io_hdr.dxfer_len >> 8); // 2 when reading a sector |
| 1206 | | cdb[ 9] = (unsigned char)(io_hdr.dxfer_len ); // Always 0? - Seems ok |
| 1207 | | cdb[10] = in.in_regs.sector_count; // 0 when starting selftest |
| 1208 | | cdb[11] = in.in_regs.lba_low; // LBA(7:0) - Works for Log Address! |
| 1209 | | cdb[12] = in.in_regs.lba_mid; // LBA(15:8) - 0x4F |
| 1210 | | cdb[13] = in.in_regs.lba_high; // LBA(23:16) - 0xC2 |
| 1211 | | cdb[14] = 0xA0; // Is A0 for both drives attached |
| 1212 | | cdb[15] = in.in_regs.command; // ATA command |
| | 1201 | cdb[ 0] = 0xD8; // Operation Code (D8 = Prolific ATA pass through) |
| | 1202 | cdb[ 1] = cmd_rw|0x5; // Read(0x10)/Write(0x0) | NORMAL(0x5)/PREFIX(0x0)(?) |
| | 1203 | cdb[ 2] = 0x0; // Reserved |
| | 1204 | cdb[ 3] = in.in_regs.features; // Feature register (SMART command) |
| | 1205 | cdb[ 4] = 0x06; // Check Word (VendorID magic, Prolific: 0x067B) |
| | 1206 | cdb[ 5] = 0x7B; // Check Word (VendorID magic, Prolific: 0x067B) |
| | 1207 | cdb[ 6] = (unsigned char)(io_hdr.dxfer_len >> 24); // Length MSB |
| | 1208 | cdb[ 7] = (unsigned char)(io_hdr.dxfer_len >> 16); // Length ... |
| | 1209 | cdb[ 8] = (unsigned char)(io_hdr.dxfer_len >> 8); // Length ... |
| | 1210 | cdb[ 9] = (unsigned char)(io_hdr.dxfer_len ); // Length LSB |
| | 1211 | cdb[10] = in.in_regs.sector_count; // Sector Count |
| | 1212 | cdb[11] = in.in_regs.lba_low; // LBA Low (7:0) |
| | 1213 | cdb[12] = in.in_regs.lba_mid; // LBA Mid (15:8) |
| | 1214 | cdb[13] = in.in_regs.lba_high; // LBA High (23:16) |
| | 1215 | cdb[14] = in.in_regs.device | 0xA0; // Device/Head |
| | 1216 | cdb[15] = in.in_regs.command; // ATA Command Register (only PIO supported) |
| 1244 | | // out.out_regs.status = regbuf[0]; // Guess: Was seen go 51 to indicate error |
| 1245 | | // out.out_regs.error = regbuf[1]; // Guess: Was seen go 04 to indicate ABRT |
| 1246 | | // out.out_regs.sector_count = regbuf[X]; // Not found... |
| 1247 | | out.out_regs.lba_low = regbuf[4]; // Found by testing Log Address |
| 1248 | | out.out_regs.lba_mid = regbuf[6]; // Needed for SMART STATUS |
| 1249 | | out.out_regs.lba_high = regbuf[8]; // Needed for SMART STATUS |
| 1250 | | out.out_regs.device = regbuf[10]; // Always A0? |
| 1251 | | // = regbuf[11]; // ATA Feature |
| 1252 | | // = regbuf[13]; // ATA Command |
| | 1248 | out.out_regs.status = regbuf[0]; // Status |
| | 1249 | out.out_regs.error = regbuf[1]; // Error |
| | 1250 | out.out_regs.sector_count = regbuf[2]; // Sector Count (7:0) |
| | 1251 | out.out_regs.lba_low = regbuf[4]; // LBA Low (7:0) |
| | 1252 | out.out_regs.lba_mid = regbuf[6]; // LBA Mid (7:0) |
| | 1253 | out.out_regs.lba_high = regbuf[8]; // LBA High (7:0) |
| | 1254 | out.out_regs.device = regbuf[10]; // Device/Head |
| | 1255 | // = regbuf[11]; // ATA Feature (7:0) |
| | 1256 | // = regbuf[13]; // ATA Command |