The ioctl supported commands are listed below:
#define UIOCIBLK (uflashIOC0) | /* identify */ | |
#define UIOCQBLK (uflashIOC1) | /* query a block */ | |
#define UIOCLBLK (uflashIOC2) | /* lock a block */ | |
#define UIOCCLCK | (uflashIOC4) | /* clear all locks */ |
#define UIOCEBLK | (uflashIOC5) | /* erase a block */ |
|
|
|
Note that these ioctl commands are not supported:
#define UIOCMLCK (uflashIOC3) | /* master lock */ |
#define UIOCEALL (uflashIOC6) | /* erase all unlocked blocks */ |
#define UIOCEFUL (uflashIOC7) | /* erase full chip */ |
|
|
Structures to Use in IOCTL Arguments
PROM Information Structure
The PROM information structure holds device information returned by the driver in response to an identify command.
CODE EXAMPLE 3-1 PROM Information Structure
/* |
|
|
* PROM info structure. |
| |
*/ |
|
|
typedef struct { |
|
|
uint16_t | mfr_id; | /* manufacturer id */ |
uint16_t | dev_id; | /* device id */ |
/* allow future expansion */ |
| |
int8_t | blk_status[256]; /* blks status filled | |
by driver */ |
|
|
int32_t | blk_num; | /* total # of blocks */ |
int32_t | blk_size; | /* # of bytes per block */ |
} uflash_info_t; |
|
|
|
|
|