libata-eh.c (9d9acda9ba956a5d37e61e0ce6c579a67610bd05) | libata-eh.c (cbba5b0ee4c6c2fc8b78a21d0900099d480cf2e9) |
---|---|
1/* 2 * libata-eh.c - libata error handling 3 * 4 * Maintained by: Tejun Heo <tj@kernel.org> 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 * on emails. 7 * 8 * Copyright 2006 Tejun Heo <htejun@gmail.com> --- 1621 unchanged lines hidden (view full) --- 1630{ 1631 u8 cdb[ATAPI_CDB_LEN] = 1632 { REQUEST_SENSE, 0, 0, 0, SCSI_SENSE_BUFFERSIZE, 0 }; 1633 struct ata_port *ap = dev->link->ap; 1634 struct ata_taskfile tf; 1635 1636 DPRINTK("ATAPI request sense\n"); 1637 | 1/* 2 * libata-eh.c - libata error handling 3 * 4 * Maintained by: Tejun Heo <tj@kernel.org> 5 * Please ALWAYS copy linux-ide@vger.kernel.org 6 * on emails. 7 * 8 * Copyright 2006 Tejun Heo <htejun@gmail.com> --- 1621 unchanged lines hidden (view full) --- 1630{ 1631 u8 cdb[ATAPI_CDB_LEN] = 1632 { REQUEST_SENSE, 0, 0, 0, SCSI_SENSE_BUFFERSIZE, 0 }; 1633 struct ata_port *ap = dev->link->ap; 1634 struct ata_taskfile tf; 1635 1636 DPRINTK("ATAPI request sense\n"); 1637 |
1638 /* FIXME: is this needed? */ |
|
1638 memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); 1639 1640 /* initialize sense_buf with the error register, 1641 * for the case where they are -not- overwritten 1642 */ 1643 sense_buf[0] = 0x70; 1644 sense_buf[2] = dfl_sense_key; 1645 --- 737 unchanged lines hidden (view full) --- 2383 unsigned int i; 2384 for (i = 0; cmd_descr[i].text; i++) 2385 if (cmd_descr[i].command == command) 2386 return cmd_descr[i].text; 2387#endif 2388 2389 return NULL; 2390} | 1639 memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); 1640 1641 /* initialize sense_buf with the error register, 1642 * for the case where they are -not- overwritten 1643 */ 1644 sense_buf[0] = 0x70; 1645 sense_buf[2] = dfl_sense_key; 1646 --- 737 unchanged lines hidden (view full) --- 2384 unsigned int i; 2385 for (i = 0; cmd_descr[i].text; i++) 2386 if (cmd_descr[i].command == command) 2387 return cmd_descr[i].text; 2388#endif 2389 2390 return NULL; 2391} |
2391EXPORT_SYMBOL_GPL(ata_get_cmd_descript); | |
2392 2393/** 2394 * ata_eh_link_report - report error handling to user 2395 * @link: ATA link EH is going on 2396 * 2397 * Report EH to user. 2398 * 2399 * LOCKING: --- 77 unchanged lines hidden (view full) --- 2477 ehc->i.serror & SERR_UNRECOG_FIS ? "UnrecFIS " : "", 2478 ehc->i.serror & SERR_DEV_XCHG ? "DevExch " : ""); 2479#endif 2480 2481 for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { 2482 struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); 2483 struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf; 2484 const u8 *cdb = qc->cdb; | 2392 2393/** 2394 * ata_eh_link_report - report error handling to user 2395 * @link: ATA link EH is going on 2396 * 2397 * Report EH to user. 2398 * 2399 * LOCKING: --- 77 unchanged lines hidden (view full) --- 2477 ehc->i.serror & SERR_UNRECOG_FIS ? "UnrecFIS " : "", 2478 ehc->i.serror & SERR_DEV_XCHG ? "DevExch " : ""); 2479#endif 2480 2481 for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { 2482 struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); 2483 struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf; 2484 const u8 *cdb = qc->cdb; |
2485 size_t cdb_len = qc->dev->cdb_len; |
|
2485 char data_buf[20] = ""; 2486 char cdb_buf[70] = ""; 2487 2488 if (!(qc->flags & ATA_QCFLAG_FAILED) || 2489 ata_dev_phys_link(qc->dev) != link || !qc->err_mask) 2490 continue; 2491 2492 if (qc->dma_dir != DMA_NONE) { --- 11 unchanged lines hidden (view full) --- 2504 }; 2505 2506 snprintf(data_buf, sizeof(data_buf), " %s %u %s", 2507 prot_str[qc->tf.protocol], qc->nbytes, 2508 dma_str[qc->dma_dir]); 2509 } 2510 2511 if (ata_is_atapi(qc->tf.protocol)) { | 2486 char data_buf[20] = ""; 2487 char cdb_buf[70] = ""; 2488 2489 if (!(qc->flags & ATA_QCFLAG_FAILED) || 2490 ata_dev_phys_link(qc->dev) != link || !qc->err_mask) 2491 continue; 2492 2493 if (qc->dma_dir != DMA_NONE) { --- 11 unchanged lines hidden (view full) --- 2505 }; 2506 2507 snprintf(data_buf, sizeof(data_buf), " %s %u %s", 2508 prot_str[qc->tf.protocol], qc->nbytes, 2509 dma_str[qc->dma_dir]); 2510 } 2511 2512 if (ata_is_atapi(qc->tf.protocol)) { |
2512 if (qc->scsicmd) 2513 scsi_print_command(qc->scsicmd); 2514 else 2515 snprintf(cdb_buf, sizeof(cdb_buf), 2516 "cdb %02x %02x %02x %02x %02x %02x %02x %02x " 2517 "%02x %02x %02x %02x %02x %02x %02x %02x\n ", 2518 cdb[0], cdb[1], cdb[2], cdb[3], 2519 cdb[4], cdb[5], cdb[6], cdb[7], 2520 cdb[8], cdb[9], cdb[10], cdb[11], 2521 cdb[12], cdb[13], cdb[14], cdb[15]); | 2513 if (qc->scsicmd) { 2514 cdb = qc->scsicmd->cmnd; 2515 cdb_len = qc->scsicmd->cmd_len; 2516 } 2517 __scsi_format_command(cdb_buf, sizeof(cdb_buf), 2518 cdb, cdb_len); |
2522 } else { 2523 const char *descr = ata_get_cmd_descript(cmd->command); 2524 if (descr) 2525 ata_dev_err(qc->dev, "failed command: %s\n", 2526 descr); 2527 } 2528 2529 ata_dev_err(qc->dev, --- 1613 unchanged lines hidden --- | 2519 } else { 2520 const char *descr = ata_get_cmd_descript(cmd->command); 2521 if (descr) 2522 ata_dev_err(qc->dev, "failed command: %s\n", 2523 descr); 2524 } 2525 2526 ata_dev_err(qc->dev, --- 1613 unchanged lines hidden --- |