blob: d31e7c6d866a653b501f18f353084c10baa5d5fb [file] [log] [blame]
Viresh Kumarcdee4f72015-06-22 16:42:26 +05301/*
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
13struct gb_control {
14 struct gb_connection *connection;
Johan Hovolde217ae72016-01-19 12:51:14 +010015
16 u8 protocol_major;
17 u8 protocol_minor;
Johan Hovoldb807aa72016-01-19 12:51:21 +010018
19 bool has_bundle_version;
Viresh Kumarcdee4f72015-06-22 16:42:26 +053020};
21
Johan Hovoldc6346502015-12-15 15:28:56 +010022struct gb_control *gb_control_create(struct gb_interface *intf);
23int gb_control_enable(struct gb_control *control);
24void gb_control_disable(struct gb_control *control);
25void gb_control_destroy(struct gb_control *control);
26
Johan Hovoldb807aa72016-01-19 12:51:21 +010027int gb_control_get_bundle_versions(struct gb_control *control);
Viresh Kumarcdee4f72015-06-22 16:42:26 +053028int gb_control_connected_operation(struct gb_control *control, u16 cport_id);
29int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id);
30int gb_control_get_manifest_size_operation(struct gb_interface *intf);
31int gb_control_get_manifest_operation(struct gb_interface *intf, void *manifest,
32 size_t size);
Viresh Kumard39bf702015-12-28 11:59:01 +053033int gb_control_get_interface_version_operation(struct gb_interface *intf);
Viresh Kumarcdee4f72015-06-22 16:42:26 +053034
Viresh Kumarcdee4f72015-06-22 16:42:26 +053035#endif /* __CONTROL_H */