[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libcdio-devel] Read Sub-channel changes
From: |
Thomas Schmitt |
Subject: |
Re: [Libcdio-devel] Read Sub-channel changes |
Date: |
Thu, 09 Jun 2016 18:56:03 +0200 |
Hi,
Rocky Bernstein wrote:
> mmc_get_mcn_isrc_private() I guess needs something better than the existing
> mmc_read_subchannel(). No problem. Create something new that has the right
> interface, i guess it would pass back a cdb.
There is already such a back interface which is extensible without
changing the prototypes of existing functions. It currently stores only
the sense data, but could well store the CDB, too.
lib/driver/generic.h has without my modifications:
typedef struct {
...
/* Memorized sense reply of the most recent SCSI command.
Recorded by driver implementations of cdio_funcs_t.run_mmc_cmd().
Read by API function mmc_get_cmd_scsi_sense().
*/
unsigned char scsi_mmc_sense[263]; /* See SPC-3 4.5.3 : 252 bytes legal
but 263 bytes possible */
int scsi_mmc_sense_valid; /* Number of valid sense bytes */
...
} generic_img_private_t;
Instead of letting all lowest-level mmc functions hand back the CDB
by a function parameter, one can simply stuff the CDB into
generic_img_private_t where one would add:
mmc_cdb_t scsi_mmc_cmd;
int scsi_mmc_cmd_len;
This has the additional advantage that there are much fewer implementations
of p_cdio->op.run_mmc_cmd() than there are callers of this function pointer.
So if we let the implementations record the CDB, we have much less effort
than if we let all callers tell the CDB to their callers up to a layer where
it is finally used.
The prototype of new function mmc_evaluate_last_sense() could then
omit the parameter mmc_cdb_t *cdb because it could be retrieved via
CdIo_t *p_cdio.
This means the callers would not need to know the exact CDB but only
the intention of the MMC command. E.g. whether failure is fatal or
just a small inconvenience.
Have a nice day :)
Thomas
- Re: [Libcdio-devel] Read Sub-channel changes, (continued)
- Re: [Libcdio-devel] Read Sub-channel changes, Rocky Bernstein, 2016/06/07
- Re: [Libcdio-devel] Read Sub-channel changes, Thomas Schmitt, 2016/06/07
- Re: [Libcdio-devel] Read Sub-channel changes, Rocky Bernstein, 2016/06/07
- Re: [Libcdio-devel] Read Sub-channel changes, Thomas Schmitt, 2016/06/08
- Re: [Libcdio-devel] Read Sub-channel changes, Rocky Bernstein, 2016/06/08
- Re: [Libcdio-devel] Read Sub-channel changes, Thomas Schmitt, 2016/06/08
- Re: [Libcdio-devel] Read Sub-channel changes, Rocky Bernstein, 2016/06/08
- Re: [Libcdio-devel] Read Sub-channel changes, Thomas Schmitt, 2016/06/09
- Re: [Libcdio-devel] Read Sub-channel changes, Rocky Bernstein, 2016/06/09
- Re: [Libcdio-devel] Read Sub-channel changes, Rocky Bernstein, 2016/06/09
- Re: [Libcdio-devel] Read Sub-channel changes,
Thomas Schmitt <=
- Re: [Libcdio-devel] Read Sub-channel changes, Rocky Bernstein, 2016/06/09
- Re: [Libcdio-devel] Read Sub-channel changes, Thomas Schmitt, 2016/06/11
- Re: [Libcdio-devel] Read Sub-channel changes, Thomas Schmitt, 2016/06/11