From patchwork Wed Oct 11 06:45:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 115505 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp408787qgn; Tue, 10 Oct 2017 23:45:41 -0700 (PDT) X-Received: by 10.84.177.195 with SMTP id x61mr14158233plb.286.1507704341253; Tue, 10 Oct 2017 23:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507704341; cv=none; d=google.com; s=arc-20160816; b=nhlHjGkm0xU1oT2c+wQJIK8GsyYn24E6GWz74AE8rejHuCmTxb35GDhhmjNbtU1jwB gZMQPGdnsG+4OpGfBFaP/d57dyuK+OZeB7az85Af7DxEWNK5ImqPRo1fF/Vahfre+K9d LYvItlKsvdYd9aGKTEafTfPSy5PQ0Y7xYqdyJg+UC9xvpTEH4dBcbod0EIjseYBBWMMj IJrOvcmulhGltpclkZ66Zj/phkk5ud12O/r677jl5emTgFCEIVspBbgzbIPLSNd7NpQF 6ZLzLu3xULps9N7UfdinVGq+yxz05kdQ0OoXISUqWzMnh9J/aBscVQYHzp2HO4khf/TJ n6JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=RijD6igbTEBvJnMMJXStHeiIgf820aIMkYoEuuRjLdE=; b=EOJdVcCyGVB5eL+JgnjP2YugtX4l+AUqhUS+CCteDreENj345aw6L15upzxxfNv7hz sTuSxsxrWgPeaWdF9s6zkl1sodnsrefo59Ufq9ZF6LxmIdpucoT3Iegv46yrgnlkHId8 WMmPeElyYzjUQyE7qwrGidLbAoWs6cda1g36mmMIDzc05Rh8uG9TN7aCM+4IJ2yuFpG4 wuG5VzaBnf9Afbazdgq7TgvG6nKSd3QZ3Rga9IMD7t4UnIZ2gENpnZGsGDyldKRKkhM+ hTWbaICuVpJif71iT4BE0fkg9TZGvVPOjh9NGxIT0Icdo442n2yltGhyUBXVE6MeHQ+O RZeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gS6Sd2mU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l61si10227402plb.490.2017.10.10.23.45.40; Tue, 10 Oct 2017 23:45:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gS6Sd2mU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756971AbdJKGpf (ORCPT + 26 others); Wed, 11 Oct 2017 02:45:35 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:55385 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756584AbdJKGpb (ORCPT ); Wed, 11 Oct 2017 02:45:31 -0400 Received: by mail-pf0-f179.google.com with SMTP id 17so634544pfn.12 for ; Tue, 10 Oct 2017 23:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RijD6igbTEBvJnMMJXStHeiIgf820aIMkYoEuuRjLdE=; b=gS6Sd2mUwDCvit9wrcGdHkxDSuugTybW1msmXmNI4yja3+or0w14jJhPQimTnaMeNJ U2TRDRTrkD9lD7fUy8LnmN6GsyzhUVjOBS/bBCuJwolVnRds4ySiDEpC3C1U+ziWw8So 38zCPWKwe9z7CIS2xux+F1tZqvTvrvOfsfmV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RijD6igbTEBvJnMMJXStHeiIgf820aIMkYoEuuRjLdE=; b=uW2Sym8ze/ecW36xPzOLitBlS+5g9Fw6okEHW1TuU03dFwdTrKljYPtAjlaqryu6cc BF6e38ZSeYtQaq0l+kud2RO1ZzQB4SjQWqXVs+jqlaQX10Y/zXBCyfNd2a4GCHL8Pl2p FINNLnOe30ki1QfM4JtUJfawyqjlhXijeh2lYGj4z8WaxzGVk1aTMmhxVzT72t5hbSqY Xq3dGlHcNdvZLluv//ZwTfqSCI+kv8AAcj5gITHUvYYTD5O8F/cAyq2KWfd9eS8F2xzs LKXpHBP6gKWn/NG0xYkn00LIlnadXozK7fxJWIYnw2yAOh+pbfxAAt3h4W9HlQlFSHHk /mSw== X-Gm-Message-State: AMCzsaW53jXnvELbme5F3+nT4JPd7eQx62dTlzZ5cZd3OsXIdBlYQqMA 2gb96Wx4tkqJ0nZ15Ep5S+2MnQ== X-Google-Smtp-Source: AOwi7QDqfHWBnVRUUYVOj6/H7/JTxtnAg15Sx4aaOTquolPgAgdMRY3i1ssRgO4XSfbAfrMYvQeRlQ== X-Received: by 10.99.99.65 with SMTP id x62mr14627376pgb.221.1507704330544; Tue, 10 Oct 2017 23:45:30 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id l79sm411779pfb.33.2017.10.10.23.45.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Oct 2017 23:45:29 -0700 (PDT) From: Bjorn Andersson To: "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Chris Lew Subject: [PATCH v2 3/7] net: qrtr: Add control packet definition to uapi Date: Tue, 10 Oct 2017 23:45:19 -0700 Message-Id: <20171011064523.7902-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171011064523.7902-1-bjorn.andersson@linaro.org> References: <20171011064523.7902-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The QMUX protocol specification defines structure of the special control packet messages being sent between handlers of the control port. Add these to the uapi header, as this structure and the associated types are shared between the kernel and all userspace handlers of control messages. Signed-off-by: Bjorn Andersson --- Changes since v1: - None include/uapi/linux/qrtr.h | 32 ++++++++++++++++++++++++++++++++ net/qrtr/qrtr.c | 12 ------------ 2 files changed, 32 insertions(+), 12 deletions(-) -- 2.12.0 diff --git a/include/uapi/linux/qrtr.h b/include/uapi/linux/qrtr.h index 63e8803e4d90..179af64846e0 100644 --- a/include/uapi/linux/qrtr.h +++ b/include/uapi/linux/qrtr.h @@ -13,4 +13,36 @@ struct sockaddr_qrtr { __u32 sq_port; }; +enum qrtr_pkt_type { + QRTR_TYPE_DATA = 1, + QRTR_TYPE_HELLO = 2, + QRTR_TYPE_BYE = 3, + QRTR_TYPE_NEW_SERVER = 4, + QRTR_TYPE_DEL_SERVER = 5, + QRTR_TYPE_DEL_CLIENT = 6, + QRTR_TYPE_RESUME_TX = 7, + QRTR_TYPE_EXIT = 8, + QRTR_TYPE_PING = 9, + QRTR_TYPE_NEW_LOOKUP = 10, + QRTR_TYPE_DEL_LOOKUP = 11, +}; + +struct qrtr_ctrl_pkt { + __le32 cmd; + + union { + struct { + __le32 service; + __le32 instance; + __le32 node; + __le32 port; + } server; + + struct { + __le32 node; + __le32 port; + } client; + }; +} __packed; + #endif /* _LINUX_QRTR_H */ diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 15981abc042c..d85ca7170b8f 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -26,18 +26,6 @@ #define QRTR_MIN_EPH_SOCKET 0x4000 #define QRTR_MAX_EPH_SOCKET 0x7fff -enum qrtr_pkt_type { - QRTR_TYPE_DATA = 1, - QRTR_TYPE_HELLO = 2, - QRTR_TYPE_BYE = 3, - QRTR_TYPE_NEW_SERVER = 4, - QRTR_TYPE_DEL_SERVER = 5, - QRTR_TYPE_DEL_CLIENT = 6, - QRTR_TYPE_RESUME_TX = 7, - QRTR_TYPE_EXIT = 8, - QRTR_TYPE_PING = 9, -}; - /** * struct qrtr_hdr - (I|R)PCrouter packet header * @version: protocol version