summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/svc.c
diff options
context:
space:
mode:
authorJeffrey Carlyle <jcarlyle@google.com>2016-06-07 08:22:22 -0700
committerGreg Kroah-Hartman <gregkh@google.com>2016-06-07 21:10:13 -0700
commit109fbdfd6a23c122c564a6cd6671b9911e0a24b5 (patch)
tree06c529b5dce67204ef9eb5a9fa8c0fcf99f93395 /drivers/staging/greybus/svc.c
parent423042f4b2dc763f16c27b18a19611fa1773ac30 (diff)
greybus: svc: implement connection_quiescing call
Implement Greybus remote call to connection_quiescing operation. This operation disables flow contorl for the connection and resets associated attributes. Testing done: tested along with required NuttX firmware changes, booted EVT2, inserted module, removed module, inserted module. Verified module was functioning as expected. Signed-off-by: Jeffrey Carlyle <jcarlyle@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/svc.c')
-rw-r--r--drivers/staging/greybus/svc.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
index d7458c53b889..bfdd0ce37623 100644
--- a/drivers/staging/greybus/svc.c
+++ b/drivers/staging/greybus/svc.c
@@ -441,10 +441,31 @@ EXPORT_SYMBOL_GPL(gb_svc_connection_create);
void gb_svc_connection_quiescing(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
u8 intf2_id, u16 cport2_id)
{
- /* FIXME: implement */
+ struct gb_svc_conn_quiescing_request request;
+ struct gb_svc_conn_quiescing_response response;
+ int ret;
dev_dbg(&svc->dev, "%s - (%u:%u %u:%u)\n", __func__,
intf1_id, cport1_id, intf2_id, cport2_id);
+
+ request.intf1_id = intf1_id;
+ request.cport1_id = cpu_to_le16(cport1_id);
+ request.intf2_id = intf2_id;
+ request.cport2_id = cpu_to_le16(cport2_id);
+
+ ret = gb_operation_sync(svc->connection, GB_SVC_TYPE_CONN_QUIESCING,
+ &request, sizeof(request),
+ &response, sizeof(response));
+ if (ret < 0)
+ return;
+ if (response.status != GB_SVC_OP_SUCCESS) {
+ dev_err(&svc->dev, "quiescing connection failed (%u:%u %u:%u): %u\n",
+ intf1_id, cport1_id, intf2_id, cport2_id,
+ response.status);
+ return;
+ }
+
+ return;
}
EXPORT_SYMBOL_GPL(gb_svc_connection_quiescing);