Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +int gb_control_get_firmware_version_operation(struct gb_interface *intf,
- + u16 *major, u16 *minor)
- +{
- + struct gb_control_interface_version_response response;
- + struct gb_connection *connection = intf->control->connection;
- + int ret;
- +
- + ret = gb_operation_sync(connection, GB_CONTROL_TYPE_INTERFACE_VERSION,
- + NULL, 0, &response, sizeof(response));
- + if (ret) {
- + dev_err(&connection->intf->dev,
- + "failed to get firmware version: %d\n", ret);
- + return ret;
- + }
- +
- + *major = le16_to_cpu(response.major);
- + *minor = le16_to_cpu(response.minor);
- + dev_info(&connection->intf->dev,"%s:%x:%x:%x:%x\n", __func__, *major,
- + *minor, le16_to_cpu(response.major),
- + le16_to_cpu(response.minor));
- +
- + return 0;
- +}
- +/* Control protocol firmware version request has no payload */
- +struct gb_control_interface_version_response {
- + __le16 major;
- + __le16 minor;
- +} __packed;
- Output of the above print is:
- [ 35.472198] greybus 1-8: gb_control_get_firmware_version_operation:0:0:1:0
Add Comment
Please, Sign In to add comment