beautypg.com

User flash user interface structure, Errors, Example programs – Sun Microsystems Netra CP2500 User Manual

Page 61: Code example 3-2

background image

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

CODE EXAMPLE 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 incorrect arguments to the system
call.

EACCESS

Write

or Erase operation was attempted on a locked block.

ECANCELLED

A hardware malfunction has been detected. Normally, retrying the
command should fix this problem. If the problem persists, power
cycling the system might be necessary.

ENXIO

This error indicates problems with the driver state. Power cycle of
the system or reinstallation of driver may be necessary.

EFAULT

An error was encountered when copying arguments between the
application and driver (kernel) space.

ENOMEM

System was low on memory when the driver attempted to acquire it.

EBUSY

A write operation is already in progress when more than one
write

requests are made.