Revision a6a2ed3...

Go back to digest for 18th December 2011

Other in Multimedia

Raphael Kubo da Costa committed changes in [k3b/2.0] libk3bdevice/k3bscsicommand_bsd.cpp:

Refactor the FreeBSD SCSI/CAM interface.

>From the review request:
Main idea of the change is to improve the case where SCSI sense data
is not automatically provided and has to be explicitly requested.

Current code essentially duplicates main transport code for this task.

The proposed code recursively calls into the transport code with
MMC_REQUEST_SENSE command. This also fixes a problem with the existing
code where it re-uses a CCB of the original command for sense fetching
but doesn't ensure that all the previously used bytes are reset to
proper values.

This can result in a malformed MMC_REQUEST_SENSE CCB which can confuse
certain hardware (e.g. it hangs Optiarc DVD RW AD-7191S 1.02). Also the
style of the code is cleaned up.

Because of the code re-use the code is now more compact. Additionally
some historic and useless code was dropped - the code for setting errno.
errno value is not used by the calling code and this is an artifact of
the FreeBSD-specific code having been borrowed from a different project
(as attested by Heiner Eichmann).

Patch by Andriy Gapon, thanks a lot!

REVIEW: 103293
(cherry picked from commit dfe605a68406bd8830d3ab6c6e228f2c387a4122)

File Changes

Modified 1 files
  • libk3bdevice/k3bscsicommand_bsd.cpp
1 files changed in total