Viresh Kumar | cdee4f7 | 2015-06-22 16:42:26 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Greybus CPort control protocol |
| 3 | * |
| 4 | * Copyright 2015 Google Inc. |
| 5 | * Copyright 2015 Linaro Ltd. |
| 6 | * |
| 7 | * Released under the GPLv2 only. |
| 8 | */ |
| 9 | |
| 10 | #ifndef __CONTROL_H |
| 11 | #define __CONTROL_H |
| 12 | |
| 13 | struct gb_control { |
| 14 | struct gb_connection *connection; |
Johan Hovold | e217ae7 | 2016-01-19 12:51:14 +0100 | [diff] [blame] | 15 | |
| 16 | u8 protocol_major; |
| 17 | u8 protocol_minor; |
Johan Hovold | b807aa7 | 2016-01-19 12:51:21 +0100 | [diff] [blame] | 18 | |
| 19 | bool has_bundle_version; |
Viresh Kumar | cdee4f7 | 2015-06-22 16:42:26 +0530 | [diff] [blame] | 20 | }; |
| 21 | |
Johan Hovold | c634650 | 2015-12-15 15:28:56 +0100 | [diff] [blame] | 22 | struct gb_control *gb_control_create(struct gb_interface *intf); |
| 23 | int gb_control_enable(struct gb_control *control); |
| 24 | void gb_control_disable(struct gb_control *control); |
| 25 | void gb_control_destroy(struct gb_control *control); |
| 26 | |
Johan Hovold | b807aa7 | 2016-01-19 12:51:21 +0100 | [diff] [blame] | 27 | int gb_control_get_bundle_versions(struct gb_control *control); |
Viresh Kumar | cdee4f7 | 2015-06-22 16:42:26 +0530 | [diff] [blame] | 28 | int gb_control_connected_operation(struct gb_control *control, u16 cport_id); |
| 29 | int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id); |
| 30 | int gb_control_get_manifest_size_operation(struct gb_interface *intf); |
| 31 | int gb_control_get_manifest_operation(struct gb_interface *intf, void *manifest, |
| 32 | size_t size); |
Viresh Kumar | d39bf70 | 2015-12-28 11:59:01 +0530 | [diff] [blame] | 33 | int gb_control_get_interface_version_operation(struct gb_interface *intf); |
Viresh Kumar | cdee4f7 | 2015-06-22 16:42:26 +0530 | [diff] [blame] | 34 | |
Viresh Kumar | cdee4f7 | 2015-06-22 16:42:26 +0530 | [diff] [blame] | 35 | #endif /* __CONTROL_H */ |