/** * struct qmi_elem_info - describes how to encode a single QMI element * @data_type: Data type of this element. * @elem_len: Array length of this element, if an array. * @elem_size: Size of a single instance of this data type. * @array_type: Array type of this element. * @tlv_type: QMI message specific type to identify which element * is present in an incoming message. * @offset: Specifies the offset of the first instance of this * element in the data structure. * @ei_array: Null-terminated array of @qmi_elem_info to describe nested * structures.
*/ struct qmi_elem_info { enum qmi_elem_type data_type;
u32 elem_len;
u32 elem_size; enum qmi_array_type array_type;
u8 tlv_type;
u32 offset; conststruct qmi_elem_info *ei_array;
};
/** * struct qmi_service - context to track lookup-results * @service: service type * @version: version of the @service * @instance: instance id of the @service * @node: node of the service * @port: port of the service * @priv: handle for client's use * @list_node: list_head for house keeping
*/ struct qmi_service { unsignedint service; unsignedint version; unsignedint instance;
unsignedint node; unsignedint port;
void *priv; struct list_head list_node;
};
struct qmi_handle;
/** * struct qmi_ops - callbacks for qmi_handle * @new_server: inform client of a new_server lookup-result, returning * successfully from this call causes the library to call * @del_server as the service is removed from the * lookup-result. @priv of the qmi_service can be used by * the client * @del_server: inform client of a del_server lookup-result * @net_reset: inform client that the name service was restarted and * that and any state needs to be released * @msg_handler: invoked for incoming messages, allows a client to * override the usual QMI message handler * @bye: inform a client that all clients from a node are gone * @del_client: inform a client that a particular client is gone
*/ struct qmi_ops { int (*new_server)(struct qmi_handle *qmi, struct qmi_service *svc); void (*del_server)(struct qmi_handle *qmi, struct qmi_service *svc); void (*net_reset)(struct qmi_handle *qmi); void (*msg_handler)(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, constvoid *data, size_t count); void (*bye)(struct qmi_handle *qmi, unsignedint node); void (*del_client)(struct qmi_handle *qmi, unsignedint node, unsignedint port);
};
/** * struct qmi_txn - transaction context * @qmi: QMI handle this transaction is associated with * @id: transaction id * @lock: for synchronization between handler and waiter of messages * @completion: completion object as the transaction receives a response * @result: result code for the completed transaction * @ei: description of the QMI encoded response (optional) * @dest: destination buffer to decode message into (optional)
*/ struct qmi_txn { struct qmi_handle *qmi;
u16 id;
struct mutex lock; struct completion completion; int result;
conststruct qmi_elem_info *ei; void *dest;
};
/** * struct qmi_msg_handler - description of QMI message handler * @type: type of message * @msg_id: message id * @ei: description of the QMI encoded message * @decoded_size: size of the decoded object * @fn: function to invoke as the message is decoded
*/ struct qmi_msg_handler { unsignedint type; unsignedint msg_id;
/** * struct qmi_handle - QMI context * @sock: socket handle * @sock_lock: synchronization of @sock modifications * @sq: sockaddr of @sock * @work: work for handling incoming messages * @wq: workqueue to post @work on * @recv_buf: scratch buffer for handling incoming messages * @recv_buf_size: size of @recv_buf * @lookups: list of registered lookup requests * @lookup_results: list of lookup-results advertised to the client * @services: list of registered services (by this client) * @ops: reference to callbacks * @txns: outstanding transactions * @txn_lock: lock for modifications of @txns * @handlers: list of handlers for incoming messages
*/ struct qmi_handle { struct socket *sock; struct mutex sock_lock;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.