From patchwork Mon Apr 20 22:39:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 47375 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 701F72121F for ; Mon, 20 Apr 2015 22:39:27 +0000 (UTC) Received: by wiun10 with SMTP id n10sf258270wiu.1 for ; Mon, 20 Apr 2015 15:39:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=wFt29kS7I7j2jVwqVut1kbfOjkQQpEKEj2e1RSAxH3Q=; b=HzXWy/9KbwX7SsZlk26I2d+WaCfm5r79rM8ydU9ZgjvrSk5k6poStEVaTIDYCNBhf7 7/jxbyITwReJdfQFDJKZ8LhWtGXz2Df4u9zFri4DU1cqdxQ8t9uBDBDC1nwE/euMfU3U P1ih1Ce6/m+K2aLecYk8ARYT6My2EnJ4lVMtikfQWkXq3I+TY45igde6/MMygoyo4JIp bn+7g5nZbFkFjwuUm+xUzVOWmmWh9P7KdBgGDvwaOvMAGSirqoTtopQzdANmBEef3zgB RySIzHvilvVy0qIFfgSctOoGrd2USY0tgZrnquNTQGmBFDu3ZjrJuIwVZ+LEQHE1u/Mf 9zBg== X-Gm-Message-State: ALoCoQk3N0cKXzDCD8AZ2VODFIXJBQ3gkVvpvV8lAsFjbpjxYtLBIHV/GgG399S5KatRRq09YtHG X-Received: by 10.180.85.129 with SMTP id h1mr46035wiz.6.1429569566767; Mon, 20 Apr 2015 15:39:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.42 with SMTP id j10ls743650laf.27.gmail; Mon, 20 Apr 2015 15:39:26 -0700 (PDT) X-Received: by 10.112.138.195 with SMTP id qs3mr16968450lbb.47.1429569566612; Mon, 20 Apr 2015 15:39:26 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id ju10si5966740lab.155.2015.04.20.15.39.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2015 15:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by layy10 with SMTP id y10so138067478lay.0 for ; Mon, 20 Apr 2015 15:39:26 -0700 (PDT) X-Received: by 10.152.5.72 with SMTP id q8mr17334627laq.73.1429569566496; Mon, 20 Apr 2015 15:39:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.67.65 with SMTP id l1csp284917lbt; Mon, 20 Apr 2015 15:39:25 -0700 (PDT) X-Received: by 10.70.37.69 with SMTP id w5mr19174771pdj.123.1429569564894; Mon, 20 Apr 2015 15:39:24 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com. [209.85.220.46]) by mx.google.com with ESMTPS id t3si29944763pbs.230.2015.04.20.15.39.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2015 15:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.46 as permitted sender) client-ip=209.85.220.46; Received: by pabtp1 with SMTP id tp1so220427505pab.2 for ; Mon, 20 Apr 2015 15:39:24 -0700 (PDT) X-Received: by 10.68.203.66 with SMTP id ko2mr31673073pbc.156.1429569563987; Mon, 20 Apr 2015 15:39:23 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id r7sm14995pdm.16.2015.04.20.15.39.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Apr 2015 15:39:23 -0700 (PDT) From: John Stultz To: projectara-software-dev Cc: Alex Elder , Greg Kroah-Hartman , Johan Hovold , mark greer , John Stultz Subject: [PATCH] gbsim: i2s: Add PROTOCOL_VERSION request support Date: Mon, 20 Apr 2015 15:39:19 -0700 Message-Id: <1429569559-25860-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add support for PROTOCOL_VERSION queries. Cc: Alex Elder Cc: Greg Kroah-Hartman CC: Johan Hovold Cc: mark greer Signed-off-by: John Stultz --- i2s.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/i2s.c b/i2s.c index 78bf756..ee9b809 100644 --- a/i2s.c +++ b/i2s.c @@ -41,6 +41,13 @@ int i2s_mgmt_handler(uint16_t cport_id, void *rbuf, size_t rsize, oph = (struct op_header *)&op_req->header; switch (oph->type) { + case GB_I2S_MGMT_TYPE_PROTOCOL_VERSION: + payload_size = sizeof(struct protocol_version_rsp); + op_rsp->pv_rsp.version_major = GREYBUS_VERSION_MAJOR; + op_rsp->pv_rsp.version_minor = GREYBUS_VERSION_MINOR; + gbsim_debug("Module %hhu -> AP CPort %hu I2S protocol version response\n ", + module_id, cport_id); + break; case GB_I2S_MGMT_TYPE_GET_SUPPORTED_CONFIGURATIONS: payload_size = sizeof(struct gb_i2s_mgmt_get_supported_configurations_response) + sizeof(struct gb_i2s_mgmt_configuration) * CONFIG_COUNT_MAX; @@ -132,6 +139,13 @@ int i2s_data_handler(uint16_t cport_id, void *rbuf, size_t rsize, oph = (struct op_header *)&op_req->header; switch (oph->type) { + case GB_I2S_DATA_TYPE_PROTOCOL_VERSION: + payload_size = sizeof(struct protocol_version_rsp); + op_rsp->pv_rsp.version_major = GREYBUS_VERSION_MAJOR; + op_rsp->pv_rsp.version_minor = GREYBUS_VERSION_MINOR; + gbsim_debug("Module %hhu -> AP CPort %hu I2S protocol version response\n ", + module_id, cport_id); + break; case GB_I2S_DATA_TYPE_SEND_DATA: payload_size = 0; gbsim_debug("Module %hhu -> AP CPort %hu I2S SEND_DATA response\n ",