diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2015-11-25 15:59:08 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-11-25 15:30:03 -0800 |
commit | 88f7b96da75f816ba022190d6076720562cac050 (patch) | |
tree | 380477fdbe1cd0abd3c6f3d77ace7784f5e3e178 /drivers/staging/greybus/svc.h | |
parent | 6106e51b742b32954351e6020cdb789bc33bf120 (diff) | |
download | linux-88f7b96da75f816ba022190d6076720562cac050.tar.bz2 |
greybus: svc: register svc device at hello
Register the svc device upon reception of the HELLO request.
The SVC HELLO request contains the endo id and AP interface id, which
will be exposed from the svc device rather than the endo.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/svc.h')
-rw-r--r-- | drivers/staging/greybus/svc.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/staging/greybus/svc.h b/drivers/staging/greybus/svc.h index d2f406fa798a..c9d8866f8f29 100644 --- a/drivers/staging/greybus/svc.h +++ b/drivers/staging/greybus/svc.h @@ -10,7 +10,20 @@ #ifndef __SVC_H #define __SVC_H -struct gb_svc; +enum gb_svc_state { + GB_SVC_STATE_RESET, + GB_SVC_STATE_PROTOCOL_VERSION, + GB_SVC_STATE_SVC_HELLO, +}; + +struct gb_svc { + struct device dev; + + struct gb_connection *connection; + enum gb_svc_state state; + struct ida device_id_map; +}; +#define to_gb_svc(d) container_of(d, struct gb_svc, d) int gb_svc_intf_reset(struct gb_svc *svc, u8 intf_id); int gb_svc_connection_create(struct gb_svc *svc, u8 intf1_id, u16 cport1_id, |