Chapter 3 User Flash 47

User Flash User Interface Structure

The user flash user interface structure holds user parameters to commands such as
erase.

Errors

Example Programs
Example programs are provided in this section for the following actions on user
flash device:
Read
CODEEXAMPLE 3-2 User Flash Interface Structure
/*
* uflash user interface structure.
*/
typedef struct {
int blk_num;
int num_of_blks;
uflash_info_t info; /* to be filled by the
driver */
} uflash_if_t;
EINVAL Application passed one or more incorrectarguments to the system
call.
EACCESS Write or Erase operation was attempted on a locked block.
ECANCELLED A hardwaremalfunction has been detected. Normally, retrying the
command should fixthis problem.If the problempersists, power
cycling the system might be necessary.
ENXIO This errorindicates problems with the driver state. Power cycle of
the system or reinstallationof driver may be necessary.
EFAULT An error was encounteredwhen copying arguments between the
application and driver (kernel) space.
ENOMEM Systemwas low on memory when the driver attempted to acquire it.
EBUSY Awrite operation is alreadyin progresswhen more than one
write requestsare made.