Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1652647pxb; Fri, 20 Nov 2020 15:29:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyg/cHceytuRCmEWC9gWfdBxAHtTpJWjjBDRwic6AUqBhmCrCgDK76gULwUWw1qUwAH4t9X X-Received: by 2002:a17:906:4712:: with SMTP id y18mr33860382ejq.51.1605914971728; Fri, 20 Nov 2020 15:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605914971; cv=none; d=google.com; s=arc-20160816; b=LtAV0qoSD74UbBjPCJJHBN/lpO9+NbNwIV76F9hRbq/h+2ZUe/+xw+uJ7kxSVLQ7jV PJjMR2b5X6AGWVKxUTYPT+hpfrzXdqbH67Md+wiwS/69B0c++TZhNH1sA/TGB143wJ7R DrVDhCDen4m6l7FnZ0TwAko692gRrPMI0I4P40ZQD0OzR6+rQDMPkdSgyRQQEE1pZ14o NlqABReNqvQfdpB9I3tk+Qz6d8rQ+cr7Gx4WTkKnCJazSfIeqSob5CYqIg17LoVfoQwd 2OWV9TAdWZXonUEQHHWvEollRw44CU09zTuXXwNDS389ryZoaWrbv/TFcs45ONZH8rB6 bKgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZWHu6K6eIbfVz7o/Qn5M1Z0BkYZs45FikhVIVbaDmHg=; b=dkU1/PGyTZfwyhTNvD/epXx3eQrtO8vZTSvLeYBvcPEmmNJlEeh1LJlkPPRepQ9pui lDmYJYHFRSXwhQEW354PgOExy0+n5Zpmguksi2BPZ84zGYnKu9jxlXTv9Z69fco6Ipkv iAU5Zdvo9r0JcuJwbCWguW7rQzHXHtbOhfRqPyDO9YtJybEMXPnyugdclg3AG7OxJVFa SUPL7Xd+OjOIhh213UkgPwE/CDvm4Dny8caqz28ZjUnzcz/U451gNzGHizZT0aL93mPT IwtTf3opesYszZcjhNe29lZIGE98LjBgvecycp4+HCLwunMqBY8yreJZcw8X5vKNlEJ+ lXvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=toL7e2+f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si2400669ejo.423.2020.11.20.15.29.07; Fri, 20 Nov 2020 15:29:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=toL7e2+f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727859AbgKTX1r (ORCPT + 99 others); Fri, 20 Nov 2020 18:27:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbgKTX1r (ORCPT ); Fri, 20 Nov 2020 18:27:47 -0500 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE485C0613CF; Fri, 20 Nov 2020 15:27:46 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id cf17so7641807edb.2; Fri, 20 Nov 2020 15:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZWHu6K6eIbfVz7o/Qn5M1Z0BkYZs45FikhVIVbaDmHg=; b=toL7e2+fVyjtUOxZJBZkrYjtaJ8WLxenvWyFWxMMdNRcmvBMxvX1CSHg7A6mylfZzE akJwYFU4Ghmpsd43X+ov7RAHupUl5VltafGs4FpD13MMTkkVnPIDfARuQq9CKnWk/TWk cB0KBJHTbTS+CEsTxs4Q8nV9dJb0AyFWWQsdqG7LRjV590ObVkDPLNXN8hldGSiIzedo KpK6tY0VVdcaSvIBBTJZzMzfNEPa0YF3rW98PC4yUB28iQxbvZLj9RH7J6d8xNq7vuzZ /XOjmERczQXlXRSF0n3n08eNzZrq2UgA5zmM8wwmM9RFgGH963KS97eGdci5wk9lOhs5 v34g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZWHu6K6eIbfVz7o/Qn5M1Z0BkYZs45FikhVIVbaDmHg=; b=HJ4A8F94j7imS+ZU15RRPMX0lThXOQe55Njx18eGYCjZsb2rXAcFD0xksyoKcJjH3E vdqTCl2WleuQvSj4uHr2GTWWZa4U5mOs05V+OXWzFIRBSO2Pxnwj0Tg5hJ3cYQq6UGVq E5pdZ1QOmFOnWPGZ/GGrhu/ZcN3smgaPz0GeRvX1zmHm1KkCMoXjlmH9nUp05Qdn95fI lQhMzD8TdEsQbC/srRzAgdh6AdFXDfo3aEkzZuRv7yPDWwSzlQLwBm9PCCuLmww0Oc2C ixfmhdVLxZRzlpatDgl3g9vq6wB5OH0x7h6/rNI0RtcM8f0CMM9mvfrBr1leNVElVnQx JX5w== X-Gm-Message-State: AOAM53139j75tAxz7PF3JzqvgGxxVYOHHLCOBJXT5zOCnF2FMN/wTvst w0SqifauP9/Sul8X8bSIEZ8= X-Received: by 2002:aa7:ca57:: with SMTP id j23mr14107834edt.292.1605914865588; Fri, 20 Nov 2020 15:27:45 -0800 (PST) Received: from skbuf ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id f19sm1646746ejk.116.2020.11.20.15.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 15:27:44 -0800 (PST) Date: Sat, 21 Nov 2020 01:27:42 +0200 From: Vladimir Oltean To: Christian Eggers Cc: Jakub Kicinski , Andrew Lunn , Richard Cochran , Rob Herring , Vivien Didelot , "David S . Miller" , Kurt Kanzenbach , George McCollister , Marek Vasut , Helmut Grohne , Paul Barker , Codrin Ciubotariu , Tristram Ha , Woojung Huh , Microchip Linux Driver Support , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v3 09/12] net: dsa: microchip: ksz9477: initial hardware time stamping support Message-ID: <20201120232742.hhmmf3ok6a7xnoqw@skbuf> References: <20201118203013.5077-1-ceggers@arri.de> <20201118203013.5077-10-ceggers@arri.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201118203013.5077-10-ceggers@arri.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 18, 2020 at 09:30:10PM +0100, Christian Eggers wrote: > Add control routines required for TX hardware time stamping. > > The KSZ9563 only supports one step time stamping > (HWTSTAMP_TX_ONESTEP_P2P), which requires linuxptp-2.0 or later. > > Currently, only P2P delay measurement is supported. See patchwork > discussion and comments in ksz9477_ptp_init() for details: > https://patchwork.ozlabs.org/project/netdev/patch/20201019172435.4416-8-ceggers@arri.de/ > > Signed-off-by: Christian Eggers > --- Reviewed-by: Vladimir Oltean > +static int ksz9477_set_hwtstamp_config(struct ksz_device *dev, int port, > + struct hwtstamp_config *config) > +{ > + struct ksz_port *prt = &dev->ports[port]; > + > + /* reserved for future extensions */ > + if (config->flags) > + return -EINVAL; > + > + switch (config->tx_type) { > + case HWTSTAMP_TX_OFF: > + prt->hwts_tx_en = false; > + break; > + case HWTSTAMP_TX_ONESTEP_P2P: > + prt->hwts_tx_en = true; > + break; > + default: > + return -ERANGE; > + } > + > + switch (config->rx_filter) { > + case HWTSTAMP_FILTER_NONE: > + break; > + case HWTSTAMP_FILTER_PTP_V2_L4_EVENT: > + case HWTSTAMP_FILTER_PTP_V2_L4_SYNC: > + config->rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT; > + break; > + case HWTSTAMP_FILTER_PTP_V2_L2_EVENT: > + case HWTSTAMP_FILTER_PTP_V2_L2_SYNC: > + config->rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT; > + break; > + case HWTSTAMP_FILTER_PTP_V2_EVENT: > + case HWTSTAMP_FILTER_PTP_V2_SYNC: > + config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; > + break; > + case HWTSTAMP_FILTER_ALL: Putting anything in the same "case" statement as "default" is useless. > + default: > + config->rx_filter = HWTSTAMP_FILTER_NONE; > + return -ERANGE; > + } > + > + return 0; > +}