vireshk

Untitled

Dec 16th, 2015
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. +int gb_control_get_firmware_version_operation(struct gb_interface *intf,
  2. + u16 *major, u16 *minor)
  3. +{
  4. + struct gb_control_interface_version_response response;
  5. + struct gb_connection *connection = intf->control->connection;
  6. + int ret;
  7. +
  8. + ret = gb_operation_sync(connection, GB_CONTROL_TYPE_INTERFACE_VERSION,
  9. + NULL, 0, &response, sizeof(response));
  10. + if (ret) {
  11. + dev_err(&connection->intf->dev,
  12. + "failed to get firmware version: %d\n", ret);
  13. + return ret;
  14. + }
  15. +
  16. + *major = le16_to_cpu(response.major);
  17. + *minor = le16_to_cpu(response.minor);
  18. + dev_info(&connection->intf->dev,"%s:%x:%x:%x:%x\n", __func__, *major,
  19. + *minor, le16_to_cpu(response.major),
  20. + le16_to_cpu(response.minor));
  21. +
  22. + return 0;
  23. +}
  24.  
  25. +/* Control protocol firmware version request has no payload */
  26. +struct gb_control_interface_version_response {
  27. + __le16 major;
  28. + __le16 minor;
  29. +} __packed;
  30.  
  31.  
  32. Output of the above print is:
  33. [ 35.472198] greybus 1-8: gb_control_get_firmware_version_operation:0:0:1:0
Add Comment
Please, Sign In to add comment