From patchwork Fri Aug 4 14:59:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 109423 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp2265837qge; Fri, 4 Aug 2017 07:59:56 -0700 (PDT) X-Received: by 10.84.215.132 with SMTP id l4mr3079607pli.476.1501858796078; Fri, 04 Aug 2017 07:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501858796; cv=none; d=google.com; s=arc-20160816; b=YP0Jj95G/tj02xcP/Dg6cCZTm47YBnzdH8D+NOjlb+36EoqH4idUAKTrwL6l+IbLex xzgkpqI1sFs0c3jJF7kreA6cXNH3D1rDF8393d4c8fheVCjYPwr3zdq85W9XqcbyYWyH CQyeCtZU5NsS1601pZ4U8QrVSBMKzUWpz13TjTSN3SdFAAR6Z1wjoH/mNbPDtLHV7Trk oOA047pY4Nt2kX/N1+71dzPGciNBAXAaRRMjFV1AG4M8zCJjF3R+grY92I+eBXM9nV6u Y6qSC2hpiWmcO4NOI+vQLmUnkeIHsSbu9SSzBQ4EgIflAVso7tSho9371bGEFbOMEv5k SUJQ== 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=Ao85+WvXshKJdz1ShpFblPR3SPuwyblUXhsXJgp55nM=; b=iZT+FwMMf3CyuRc3CMdWLwLMQD9txGSI5x9TL5gsSwi2w8VjRrdBugB2VJ7IvneHdF eBAQo98uFBs8duLr5bgfFvUTl0XXj/WKBo+BFUBWsYTuflQGC1KIubelkd/sa/6RGghV SrEF2ZVleUHP6i+KrN7trjvb4c03FHvPYKIGNf6mIn1yv2kYgzauhUqJE9VGFrTOe9rE N7/LdsP+L39gRY69YnvrZgCM2qcl8vraX/0SwssH57C6bF/taP960RMbZufYIMGEn9Yy ZkY56Dc2KCzb+pXpivsuvXeL2LRNNJGyHXFMc3Hd/wEzaNJA0r9+pdPyXYrMBCBwA1We fwOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=XaKdWN9L; 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 63si1335004pld.380.2017.08.04.07.59.55; Fri, 04 Aug 2017 07:59:56 -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.b=XaKdWN9L; 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 S1752871AbdHDO7w (ORCPT + 25 others); Fri, 4 Aug 2017 10:59:52 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:32891 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbdHDO7r (ORCPT ); Fri, 4 Aug 2017 10:59:47 -0400 Received: by mail-pg0-f48.google.com with SMTP id u5so9054283pgn.0 for ; Fri, 04 Aug 2017 07:59:47 -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=Ao85+WvXshKJdz1ShpFblPR3SPuwyblUXhsXJgp55nM=; b=XaKdWN9L/BIjMbNCaP5QT1vDtBOyHGUU0gdJsVtvYq1UPZ0C7NqcoyNjDu1iW/j5dH WcE5Ko6/h1eis2RARzSTPi6io48QyqySVWxyJM5kBh95qzq9YCdEH2Ijw0HOlLU53jrj Q/sp2ZS4pgh4MT8/xwbTCStmuUMccvSZFJlDo= 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=Ao85+WvXshKJdz1ShpFblPR3SPuwyblUXhsXJgp55nM=; b=ok4Mggd5btbeZ86l3xiRswUgf72BEAbsYe4baxzVOiTAl9izCmOiaxR/z3ViWcAMxC 6TW704DD/YATOUGzmkRpImOfGnuHfeV3hL2WNGfJL8+VqlkCKscQT42aVG2nbIuuYs5m uGbUh+tjjgZ09tmklvQQraTDZpVFzQme3004KwXrDtYowlCBKoqaFKNziq/NPtJcPXBh LpNG6P7i/Vnlc9TIMIKp6UFReGhARC+ExkjibNCwShPzGmMr98rx8TIk0SvQjw3QvVAW qpQuj2Z3zNlzjqzDWJ6CT6ZZeUUErSJk3QoNLLVdzFChqs4zUPGs/jffpXj81NbmkxZd ovoQ== X-Gm-Message-State: AIVw111nGMJ1qXJiU3fsJBSJw53iYytegTsCCiy2JoWarjAleYkQogbB oWuEhphDOEjh5UGu X-Received: by 10.99.157.198 with SMTP id i189mr2653459pgd.85.1501858786765; Fri, 04 Aug 2017 07:59:46 -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 q24sm3584283pgc.61.2017.08.04.07.59.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Aug 2017 07:59:46 -0700 (PDT) From: Bjorn Andersson To: "David S. Miller" , Andy Gross , David Brown Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] net: qrtr: Add control packet definition to uapi Date: Fri, 4 Aug 2017 07:59:35 -0700 Message-Id: <20170804145938.25427-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170804145938.25427-1-bjorn.andersson@linaro.org> References: <20170804145938.25427-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 --- 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 0d7d3968414e..fac7cd6ea445 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