device/class/smi.h header reference
[Devices support library module]

The source code of this header can be browsed online.

Description [link] 

Purpose [link] 

The SMI class gives access to Media Independant Interface Management bus defined in IEEE802.3.

Members [link] 

Types [link] 

Functions [link] 

Constants [link] 

Macros [link] 

Members detail [link] 

#define DEV_SMI_REQUEST(n) [link] 

This macro is declared in device/class/smi.h source file, line 167.

See also dev_smi_request_t.

#define DEV_SMI_TRANSFER(n) [link] 

This macro is declared in device/class/smi.h source file, line 196.

See also dev_smi_transfer_t.

#define DEV_STATIC_RES_DEV_SMI(path_) [link] 

This macro is declared in device/class/smi.h source file, line 395.

Preprocessor condition: defined( CONFIG_DEVICE_SMI )

#define DEV_STATIC_RES_DEV_SMI(path_) [link] 

This macro is declared in device/class/smi.h source file, line 398.

Preprocessor condition: not defined( CONFIG_DEVICE_SMI )

#define DRIVER_SMI_METHODS(prefix) [link] 

This macro is declared in device/class/smi.h source file, line 185.

See also struct driver_smi_s.

#define DRIVER_SMI_OPS_DECLARE(prefix) [link] 

This macro is declared in device/class/smi.h source file, line 216.

this macro is a helper to declare a struct device_smi_ops_s structure.

#define __DEVICE_SMI_H__ [link] 

This macro is declared in device/class/smi.h source file, line 32.

void dev_smi_bc_rq_cleanup(struct dev_smi_bc_rq_s *rq) [link] 

This function is declared in device/class/smi.h source file, line 388.

void dev_smi_bc_rq_init(struct dev_smi_bc_rq_s *rq, const struct bc_descriptor_s *desc, enum dev_smi_clause_e clause, uint8_t prtad, uint8_t devad) [link] 

This function is declared in device/class/smi.h source file, line 379.

void dev_smi_bc_rq_resume(struct device_smi_s *dev, struct dev_smi_bc_rq_s *rq) [link] 

This function is declared in device/class/smi.h source file, line 386.

struct dev_smi_bc_rq_s [link] 

This struct is declared in device/class/smi.h source file, line 140.

FieldDescription
union <anonymous> {
struct dev_smi_rq_s base;
typeof(struct dev_request_s::error) error;
typeof(struct dev_request_s::pvdata) pvdata;
};
struct bc_context_s vm;bytecode virtual machine context
uint8_t yield_value;Filled when yield is reached in bytecode
uint8_t prtad;
uint8_t devad;
enum dev_smi_clause_e clause:2;

struct dev_smi_rq_s * dev_smi_bc_rq_s_base(struct dev_smi_bc_rq_s *x) [link] 

This function is declared in device/class/smi.h source file, line 161.

struct dev_smi_bc_rq_s * dev_smi_bc_rq_s_cast(struct dev_smi_rq_s *x) [link] 

This function is declared in device/class/smi.h source file, line 161.

void dev_smi_bc_rq_start(struct device_smi_s *dev, struct dev_smi_bc_rq_s *rq, const void *pc, uint16_t mask, ...) [link] 

This function is declared in device/class/smi.h source file, line 383.

const char dev_smi_clause_e[] [link] 

This constant is declared in ENUM_DESCRIPTOR function like macro expansion, line 1 in device/class/smi.h source file, line 57.

Alternate declarations with same identifier: [1], [2].

enum dev_smi_clause_e [link] 

This enum is declared in device/class/smi.h source file, line 62.

Alternate declarations with same identifier: [1], [2].

IdentifierDescription
DEV_SMI_C22Clause 22
DEV_SMI_C22XClause 22 extension to access Clause 45 (802.3ah)
DEV_SMI_C45Clause 45 (802.3ae)

struct dev_smi_data_s [link] 

This struct is declared in device/class/smi.h source file, line 88.

FieldDescription
enum dev_smi_clause_e clause:2;IEEE 802 Clause
enum dev_smi_op_e op:1;Operation type
uint8_t prtad;Destination port on bus (clause 22 "PHYAD" or 45 "PRTAD"), 5 bits
uint8_t devad;Destination device on port, 5 bits, clause 45 only
uint16_t address;Register number in device (only 5 bits "REGAD" for clause 22)
uint16_t value;Value

error_t dev_smi_drv_cleanup(struct dev_smi_drv_ctx_s *ctx) [link] 

This function is declared in device/class/smi.h source file, line 255.

struct dev_smi_drv_ctx_s [link] 

This struct is declared in device/class/smi.h source file, line 234.

error_t dev_smi_drv_init(struct device_s *dev, struct dev_smi_drv_ctx_s *ctx, const struct device_smi_ops_s *ops) [link] 

This function is declared in device/class/smi.h source file, line 247.

void dev_smi_drv_request_push(struct dev_smi_drv_ctx_s *ctx, struct dev_smi_rq_s *rq) [link] 

This function is declared in device/class/smi.h source file, line 250.

void dev_smi_drv_transfer_done(struct dev_smi_drv_ctx_s *ctx, error_t err) [link] 

This function is declared in device/class/smi.h source file, line 253.

const char dev_smi_op_e[] [link] 

This constant is declared in ENUM_DESCRIPTOR function like macro expansion, line 1 in device/class/smi.h source file, line 58.

Alternate declarations with same identifier: [1], [2].

enum dev_smi_op_e [link] 

This enum is declared in device/class/smi.h source file, line 72.

Alternate declarations with same identifier: [1], [2].

IdentifierDescription
DEV_SMI_READRegister read
DEV_SMI_WRITERegister write

typedef void (dev_smi_request_t)(const struct device_smi_s *accessor, struct dev_smi_rq_s *rq) [link] 

This typedef is declared in device/class/smi.h source file, line 179.

This typedef enqueues a request.

The kroutine of the request may be executed from within this function. Please read Nested device request completion.

This declaration involves expansion of the DEV_SMI_REQUEST macro.

See also Purpose and dev_smi_request_type_e.

void dev_smi_rq_done(struct dev_smi_rq_s *rq) [link] 

This function is declared in device/class/smi.h source file, line 123.

This function invokes or schedules execution of the smi request callback associated to the request. For use in device drivers.

struct dev_smi_rq_s * dev_smi_rq_from_kr(struct kroutine_s *kr) [link] 

This function is declared in device/class/smi.h source file, line 123.

This function retrieves a pointer to the request when in the request completion callback routine.

struct dev_smi_rq_s * dev_smi_rq_head(dev_request_queue_root_t *q) [link] 

This function is declared in device/class/smi.h source file, line 124.

This function returns the oldest smi request in the given queue. A NULL pointer is returned if the queue is empty. For use in device drivers.

void dev_smi_rq_init(struct dev_smi_rq_s *rq, kroutine_exec_t *exec) [link] 

This function is declared in device/class/smi.h source file, line 123.

This function initializes the given smi request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_SCHED is defined.

void dev_smi_rq_init_immediate(struct dev_smi_rq_s *rq, kroutine_exec_t *exec) [link] 

This function is declared in device/class/smi.h source file, line 123.

This function initializes the given smi request callback. This must be used before submitting the request to a driver.

void dev_smi_rq_init_queue(struct dev_smi_rq_s *rq, kroutine_exec_t *exec, struct kroutine_queue_s *queue) [link] 

This function is declared in device/class/smi.h source file, line 123.

This function initializes the given smi request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_QUEUE is defined.

void dev_smi_rq_init_seq(struct dev_smi_rq_s *rq, kroutine_exec_t *exec, struct kroutine_sequence_s *seq) [link] 

This function is declared in device/class/smi.h source file, line 123.

This function initializes the given smi request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_SCHED is defined.

struct dev_smi_rq_s * dev_smi_rq_pop(dev_request_queue_root_t *q) [link] 

This function is declared in device/class/smi.h source file, line 124.

This function removes and return the oldest smi request in the queue. A NULL pointer is returned if the queue is empty. For use in device drivers.

void dev_smi_rq_pushback(dev_request_queue_root_t *q, struct dev_smi_rq_s *rq) [link] 

This function is declared in device/class/smi.h source file, line 124.

This function insert a new smi request at the end of the given queue. For use in device drivers.

void dev_smi_rq_remove(dev_request_queue_root_t *q, struct dev_smi_rq_s *rq) [link] 

This function is declared in device/class/smi.h source file, line 124.

This function removes the specified smi request from the queue. For use in device drivers.

struct dev_smi_rq_s [link] 

This struct is declared in device/class/smi.h source file, line 106.

FieldDescription
union <anonymous> {
struct dev_request_s base;
typeof(struct dev_request_s::error) error;
typeof(struct dev_request_s::pvdata) pvdata;
};
struct device_smi_s * smi;
bool_t active:1;
enum dev_smi_rq_type_e type:1;Request type

struct dev_request_s * dev_smi_rq_s_base(struct dev_smi_rq_s *x) [link] 

This function is declared in device/class/smi.h source file, line 123.

struct dev_smi_rq_s * dev_smi_rq_s_cast(struct dev_request_s *x) [link] 

This function is declared in device/class/smi.h source file, line 123.

const char dev_smi_rq_type_e[] [link] 

This constant is declared in ENUM_DESCRIPTOR function like macro expansion, line 1 in device/class/smi.h source file, line 59.

Alternate declarations with same identifier: [1], [2].

enum dev_smi_rq_type_e [link] 

This enum is declared in device/class/smi.h source file, line 80.

Alternate declarations with same identifier: [1], [2].

IdentifierDescription
DEV_SMI_TRANSFERStandalone transfer
DEV_SMI_BCBytecode

enum dev_smi_runner_state_e [link] 

This enum is declared in device/class/smi.h source file, line 227.

IdentifierDescription
DEV_SMI_IDLE
DEV_SMI_RUNNING
DEV_SMI_WAIT_IO

struct dev_smi_transfer_rq_s [link] 

This struct is declared in device/class/smi.h source file, line 127.

FieldDescription
union <anonymous> {
struct dev_smi_rq_s base;
typeof(struct dev_request_s::error) error;
typeof(struct dev_request_s::pvdata) pvdata;
};
struct dev_smi_data_s data;

struct dev_smi_rq_s * dev_smi_transfer_rq_s_base(struct dev_smi_transfer_rq_s *x) [link] 

This function is declared in device/class/smi.h source file, line 137.

struct dev_smi_transfer_rq_s * dev_smi_transfer_rq_s_cast(struct dev_smi_rq_s *x) [link] 

This function is declared in device/class/smi.h source file, line 137.

error_t dev_smi_wait_c22_read(const struct device_smi_s *accessor, uint8_t phy, uint8_t reg, uint16_t *value) [link] 

This function is declared in device/class/smi.h source file, line 319.

This function perform a Clause 22 read operation and stop the scheduler context during the request.

This is available when CONFIG_DEVICE_SMI and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_smi_wait_c22_write(const struct device_smi_s *accessor, uint8_t phy, uint8_t reg, uint16_t value) [link] 

This function is declared in device/class/smi.h source file, line 330.

This function perform a Clause 22 write operation and stop the scheduler context during the request.

This is available when CONFIG_DEVICE_SMI and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_smi_wait_c22x_read(const struct device_smi_s *accessor, uint8_t prtad, uint8_t devad, uint16_t address, uint16_t *value) [link] 

This function is declared in device/class/smi.h source file, line 363.

This function perform a Clause 22X read operation and stop the scheduler context during the request.

This is available when CONFIG_DEVICE_SMI and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_smi_wait_c22x_write(const struct device_smi_s *accessor, uint8_t prtad, uint8_t devad, uint16_t address, uint16_t value) [link] 

This function is declared in device/class/smi.h source file, line 374.

This function perform a Clause 22 write operation and stop the scheduler context during the request.

This is available when CONFIG_DEVICE_SMI and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_smi_wait_c45_read(const struct device_smi_s *accessor, uint8_t prtad, uint8_t devad, uint16_t address, uint16_t *value) [link] 

This function is declared in device/class/smi.h source file, line 341.

This function perform a Clause 45 read operation and stop the scheduler context during the request.

This is available when CONFIG_DEVICE_SMI and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_smi_wait_c45_write(const struct device_smi_s *accessor, uint8_t prtad, uint8_t devad, uint16_t address, uint16_t value) [link] 

This function is declared in device/class/smi.h source file, line 352.

This function perform a Clause 45 write operation and stop the scheduler context during the request.

This is available when CONFIG_DEVICE_SMI and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_smi_wait_read(const struct device_smi_s *accessor, enum dev_smi_clause_e clause, uint8_t prtad, uint8_t devad, uint16_t address, uint16_t *value) [link] 

This function is declared in device/class/smi.h source file, line 286.

This function perform a read operation with given clause and stop the scheduler context during the request.

This is available when CONFIG_DEVICE_SMI and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_smi_wait_rq(const struct device_smi_s *acc, struct dev_smi_rq_s *rq) [link] 

This function is declared in device/class/smi.h source file, line 261.

This function use the scheduler api to put current context in wait state during the request. This can only be called from a scheduler context.

This is available when CONFIG_MUTEK_CONTEXT_SCHED is defined.

error_t dev_smi_wait_write(const struct device_smi_s *accessor, enum dev_smi_clause_e clause, uint8_t prtad, uint8_t devad, uint16_t address, uint16_t value) [link] 

This function is declared in device/class/smi.h source file, line 308.

This function perform a read operation with given clause and stop the scheduler context during the request.

This is available when CONFIG_DEVICE_SMI and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

struct device_smi_s [link] 

This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 18 in device/class/smi.h source file, line 183.

This struct is the device accessor object type for the smi device class. This accessor must be initialized by calling the device_get_accessor function.

See also DRIVER_CLASS_SMI, struct device_accessor_s and Device accessor.

FieldDescription
union <anonymous> {
struct device_accessor_s base;
struct <anonymous> {
struct device_s * dev;
struct driver_smi_s * api;
uint_fast8_t number;
};
};

struct device_accessor_s * device_smi_s_base(struct device_smi_s *x) [link] 

This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 39 in device/class/smi.h source file, line 183.

This function casts a smi device accessor to a generic device accessor

struct device_smi_s * device_smi_s_cast(struct device_accessor_s *x) [link] 

This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 32 in device/class/smi.h source file, line 183.

This function casts a generic device accessor to a smi device accessor

struct driver_smi_s [link] 

This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 5 in device/class/smi.h source file, line 183.

This struct is the driver API descriptor for the smi device class.

See also DRIVER_CLASS_SMI and struct driver_class_s.

typedef error_t (dev_smi_transfer_t)(struct dev_smi_drv_ctx_s *ctx, struct dev_smi_data_s *data) [link] 

This typedef is declared in device/class/smi.h source file, line 202.

This typedef is for internal use only.

This declaration involves expansion of the DEV_SMI_TRANSFER macro.

struct device_smi_ops_s [link] 

This struct is declared in device/class/smi.h source file, line 209.

this struct defines an API for a SMI driver. It must be passed to libdevice helpers to accomplish various management tasks.

This struct is for internal use only.

FieldDescription
dev_smi_transfer_t * transfer;
Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:05 2022 using MkDoc