From patchwork Thu Oct 5 03:51:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 114840 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp144427qgn; Wed, 4 Oct 2017 20:53:32 -0700 (PDT) X-Received: by 10.98.112.68 with SMTP id l65mr22166153pfc.292.1507175612370; Wed, 04 Oct 2017 20:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507175612; cv=none; d=google.com; s=arc-20160816; b=kTyB+okALktySlYR+wZPKy5Lhx4TDg0PgCSM1NLJj6QH+q7LZx5XKgDDQxspUL0Pat +bspUDM18pPSfB4VfiiGZSBgRO19cuS4ZZWMXBI2O54F/TRx4Hz+CSo75Rdy4/nS7kRN +CtGSeq1pji+zQ3iPLmGZfBHaYF5CR8hwuMdVHV9kribzOVYIclZ9oA6NZGrcPLr7mpH 2/EyGe42yWuvjMfisiCiUOOYl5N7e9Uv5wBMvRhQgLwPM5OcIedZwhtL0tHXTt+CtpBM /HbngeokCZYC6NKhvU+WQisrTWv+4EpmsLHnEN6WUdVMqBy+1qZ7/pfRuHFZufC5pX9l Bq1g== 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=uLExGBSH7Dps53dK8UxEmGQp0eRFBkQVI9UT5i0dQDA=; b=ooifN+LGFRsR7CewN8uRAbfSZSrRAXWk3/SZIeACLC3omcC+jpSJu2Ya8wbfYAC0Bu 74+zxj84FiF7cwAKq/Cdbo/J82jJy/rdxZRdHi6sbUX6CiEs3ut/g9XdmvrGO8crnKXO Eg76DJq1NOTNlD9oCihzLjsqHPXbpqK+CeV2LADsBmLOW6B1+otRAcIkoaxLil191Ucj g7BOlLdqsNC+ofSK/nMQy41tuR4hGa97NIqWJhizmPvOuNQZuwHvupy27EwxQgeinT0D cgOw0Nzw5otLmfF0MEtweER9IFQpCSfoN5fAnrOy5yDl0Ty079JUDiPnF22YV/2JxA80 1RGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KR8zGaUp; 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 b8si12789519pls.479.2017.10.04.20.53.32; Wed, 04 Oct 2017 20:53:32 -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=KR8zGaUp; 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 S1752027AbdJEDxb (ORCPT + 26 others); Wed, 4 Oct 2017 23:53:31 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:57026 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751785AbdJEDvN (ORCPT ); Wed, 4 Oct 2017 23:51:13 -0400 Received: by mail-pf0-f182.google.com with SMTP id g65so7312644pfe.13 for ; Wed, 04 Oct 2017 20:51:13 -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=uLExGBSH7Dps53dK8UxEmGQp0eRFBkQVI9UT5i0dQDA=; b=KR8zGaUp1tQc7r44inHRE286jwhyHjKRas1T7klnqJAmcyaUc/QO56Qxu4ZN1qW8Zc 9/SZGW9B9DCCzxWVaMABn5fyBYsJJvT//EwisDsFPKB34RqrKhGGyhap0hE119qPNeBC KjgPf1CuTW0cEuIZLsUmEJ86f1lFwUycduUWg= 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=uLExGBSH7Dps53dK8UxEmGQp0eRFBkQVI9UT5i0dQDA=; b=q6zpmwpBKuMCZm5YI+tjqEn7zl8dRXA8hh3CS89vIHXboeb0KTTLjKaeKyJIbPtXdW GxTTJ2khf1C5iDA8JChJTEzGj9v37p3PUGqS3ibpZ8zIt/fCbjemwiuLcCppS/Bul0Vl wideynTTrgVh12dm555+i7BI/qPouc1mitZlyZKEMvMC6Bm4rup0s5a5XYEsKju8wUFU W/QoyvKzm00MmNcmajnEfF2Vf/jJm1qGVEP+XAG1jCagR/v4QPohtfaNfKUw4YYs2vH/ uznrc7ShpujLt2WYfdk7/KHZEkpMhnwXa59ZGXwzRkGA3vbu2njvxJH5wiPMEaRsBrjK Ey0Q== X-Gm-Message-State: AMCzsaVt1ARU0GAJprO1z1lT1sCLEuF9TAkJSWmZ4JjdaGmHXPxi49bH 9cCSPTtBxO4bVs8vyT7eJq7xTg== X-Google-Smtp-Source: AOwi7QB7mG7pPhIuzIqcE6VB6pwRfUGwvKHrL4lJdHnnLGpsa5Ee9NLMMTp86449I8yH25j9JlgSCw== X-Received: by 10.84.218.200 with SMTP id g8mr12374070plm.23.1507175472999; Wed, 04 Oct 2017 20:51:12 -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 f131sm13067035pfc.27.2017.10.04.20.51.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 20:51:12 -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: [RESEND PATCH 3/7] net: qrtr: Add control packet definition to uapi Date: Wed, 4 Oct 2017 20:51:01 -0700 Message-Id: <20171005035105.14677-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171005035105.14677-1-bjorn.andersson@linaro.org> References: <20171005035105.14677-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 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