The generic controller extension layer allows extending the generic controller through a number of hook functions that are used by the generic controller, when flexibility in handling a specific operation is desirable. A generic controller extension is defined through a structure of type FS_NAND_CTRLR_GEN_EXT
, described in Listing 15-10- API structure type for generic controller extension. Note that all unused function pointers should be set to DEF_NULL
.
Code Block | ||||
---|---|---|---|---|
|
...
|
...
|
...
| ||
typedef struct fs_nand_ctrlr_gen_ext {
void (*Init) (FS_ERR *p_err); (1)
void *(*Open) (FS_NAND_CTRLR_GEN_DATA *p_ctrlr_data, (2)
void *p_ext_cfg,
FS_ERR *p_err);
void (*Close) (void *p_ext_data); (3)
FS_NAND_PG_SIZE (*Setup) (FS_NAND_CTRLR_GEN_DATA *p_ctrlr_data, (4)
void *p_ext_data,
FS_ERR *p_err);
void (*RdStatusChk) (void *p_ext_data, (5)
FS_ERR *p_err);
void (*ECC_Calc) (void *p_ext_data, (6)
void *p_sec_buf,
void *p_oos_buf,
FS_NAND_PG_SIZE oos_size,
FS_ERR *p_err);
void (*ECC_Verify) (void *p_ext_data, (7)
void *p_sec_buf,
void *p_oos_buf,
FS_NAND_PG_SIZE oos_size,
FS_ERR *p_err);
} FS_NAND_CTLRR_GEN_EXT; |
Panel |
---|
(1) The |
...
during |
...
the |
...
function will still be called only once. |
...
(2) |
...
The |
...
function is called by the generic controller’s |
...
own |
...
(3) |
...
The |
...
will typically never be called. |
...
(4) |
...
The |
...
function is called during the generic controller’s |
...
own |
...
(5) |
...
The |
...
function is called after a sector read operation, by the generic |
...
controller’s |
...
function. It should determine if a read error has occurred and return an error accordingly. |
...
(6) |
...
The |
...
function is called before a sector is written to the NAND device by the generic |
...
controller’s |
...
function, and provides an opportunity to calculate the ECC data and to append it to the OOS metadata. |
...
(7) |
...
The |