Hi, > There should be an additional parameter > which is basically a driver_return_code_t that indicates whether the answer > is valid or not, and if not gives some idea of what went wrong.
Good idea. > The caller > of this can also query SCSI sense data if this "valid" parameter says > something went wrong. There is a little problem with obtaining sense reply in higher function levels: The caller of mmc_get_disc_erasable() would have to make the assumption that the function performed only a single MMC command resp. that the failed command was the last command performed in that function. This would hamper to implement complex MMC gestures inside mmc_get_disc_erasable(). So if the sense reply is of meaning for callers of callers of mmc_run_cmd(), then the immediate caller of mmc_run_cmd() has to take care of the sense reply. Further: the sense is really meaningful only if one knows from what MMC command it stems. So i advise to convert the sense reply into a libcdio error reply already inside the function that directly calls mmc_run_cmd(). I admit mmc_get_disc_erasable() is not much of a candidate for complexity. But in the general case one should try to achieve good encapsulation of the function entrails. Have a nice day :) Thomas
