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

The source code of this header can be browsed online.

Description  

Purpose  

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

Members  

Types  

Functions  

Macros  

Members detail  

#define DEV_SMI_REQUEST(n)  

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

See also dev_smi_request_t.

#define DEV_STATIC_RES_DEV_SMI(path_)  

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

#define DEV_STATIC_RES_DEV_SMI(path_)  

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

#define DEV_STATIC_RES_SMI_BITRATE(bitrate_)  

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

#define DEV_STATIC_RES_SMI_BITRATE(bitrate_)  

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

#define DRIVER_SMI_METHODS(prefix)  

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

See also struct driver_smi_s.

#define __DEVICE_SMI_H__  

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

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

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

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 enum dev_smi_request_type_e.

enum dev_smi_request_type_e  

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

IdentifierDescription
DEV_SMI_READ
DEV_SMI_WRITE

void dev_smi_rq_done(struct dev_smi_rq_s *rq)  

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

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)  

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

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)  

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

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)  

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

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)  

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

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)  

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

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)  

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

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)  

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

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)  

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

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)  

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

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

struct dev_smi_rq_s  

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

FieldDescription
union <anonymous> {
struct dev_request_s base;
typeof(struct dev_request_s::error) error;
typeof(struct dev_request_s::pvdata) pvdata;
};
uint16_t phy:5;Destination address on bus
uint16_t reg:5;Register number in device
enum dev_smi_request_type_e type:1;Operation
uint16_t value;Value buffer.

struct dev_request_s * dev_smi_rq_s_base(struct dev_smi_rq_s *x)  

struct dev_smi_rq_s * dev_smi_rq_s_cast(struct dev_request_s *x)  

error_t dev_smi_wait_read(const struct device_smi_s *accessor, uint8_t phy, uint8_t reg, uint16_t *data)  

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

This function perform a DEVICE_SMI_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_rq(const struct device_smi_s *acc, struct dev_smi_rq_s *rq)  

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

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, uint8_t phy, uint8_t reg, uint16_t data)  

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

This function perform a DEVICE_SMI_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.

struct device_smi_s  

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

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)  

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

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)  

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

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

struct driver_smi_s  

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

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

See also DRIVER_CLASS_SMI and struct driver_class_s.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:38 2018 using MkDoc