Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3082961pxb; Fri, 5 Nov 2021 09:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXdYu+RtvNjOKrc5LARr6zoj3MKrlu1FGrZG72VK1Zd2NlV5B5+ciHBq2x1ObPrOzd4XbU X-Received: by 2002:a92:c0cb:: with SMTP id t11mr32238611ilf.154.1636129670717; Fri, 05 Nov 2021 09:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636129670; cv=none; d=google.com; s=arc-20160816; b=Gb5EbzD9R5qwOBGAYWLTJ5gAKLCr3VDL8iR4A5PAVvZ3saQPgC54AGR9sndXPp8R9V u/mZ+HGlpoBP25ghdUGJTBMPTODI7/GtpwN+Ej6mZ7b//ll7NfaF/DT+7B1lsdTPfcer 4FfuKwJEdQTKkonGhFBU8c3ntB+dWqBcbIcCjaNzI9HSOx/4B8tTqr/XKURm/T2ACbZF AV1qjccqwZs/5DKLuy2D2g+GBlrp2E7pn6Ohd2LjQYOV+DKQCxlZ01lLc0/LsVk/ZvWA 5RE/Gy4o2VNgRilyY+xZmkPAQPi0J3JEFIdJrLGhnpGBlsO/IXxanWOEX5XKo6GT4dDf ewmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:dkim-signature:message-id; bh=sZQB9w3+9FKZwmi/cO2+1n0La9tvCBuaJ9sTpnPYv4g=; b=JI2bfrHRhmtxenJ/XB5JvA85PQAyzUGVTiY7+Nz3AXXnWPXTLEl6gmxXwcK4WW81HE AsukCUIZHMetBvM8J2WnlO5P+E30kvXYh6F15aBxJCN9fRpY5QgGshVXDH8h494KmoJl im2pOUUd+6PeSq7D9otEAqkrryiVtR/wijj7REKIlloyztePJubtQdGwFL8SqWAVqsPy abft1z1Z2b3tZ0DUAF5QqlCAz6NWoUKcaO7+3OJ1UvqdCp2DxVzPotAhDkpTvav/sjG4 Sdkeu/tirCjxdKRhJkScu2CSZ0GFRK+OPiKWgd9X8RCJQ2H338VS8LXtwBhoYbo8BHT9 MPDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RDGwff50; dkim=neutral (no key) header.i=@linutronix.de; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si15623284jav.10.2021.11.05.09.27.35; Fri, 05 Nov 2021 09:27:50 -0700 (PDT) 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=@linutronix.de header.s=2020 header.b=RDGwff50; dkim=neutral (no key) header.i=@linutronix.de; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232369AbhKENkn (ORCPT + 99 others); Fri, 5 Nov 2021 09:40:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232052AbhKENkm (ORCPT ); Fri, 5 Nov 2021 09:40:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25742C061714; Fri, 5 Nov 2021 06:38:03 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1636119481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sZQB9w3+9FKZwmi/cO2+1n0La9tvCBuaJ9sTpnPYv4g=; b=RDGwff50BUZRF67gegFKaDbSUG2omly1gxVB7XUa7+2giu6sckDggxlWMSEymeNSexidQJ n52bGsUc+kvAi+8St8UKVFnhfsUjUndyXpt7/+yE6X5++ygqhUkoId7OMOOd0qtMAUiV0d jcbglE6CKlk+IDQGUmaWzoJ8bVZHpGe0nzVDelfL+c5dER0T6aj9wEyS/L8iYm4aHFOfOQ 4l2O/WShm2GtY+OTnLH3DTIgRsjWhcfdmwOeYVp48Uc8wk/4FBulArFHwyxvrYCRtOBie1 1JzxcDFgpUfTN5bkCfMx39iZg/C/Eq2Jps6rSON6RDUFrj0B7lUpgQoRImc5QQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1636119481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sZQB9w3+9FKZwmi/cO2+1n0La9tvCBuaJ9sTpnPYv4g=; b=A2Y1ws64rELJfRZc3Z2qFqdyymiBgpjNKzpO0NBUgCEqaSVkfx8E7/0MZgP0tETMJ+Jbn8 Jxm5+pGQ5gYoVjBw== Date: Fri, 5 Nov 2021 14:38:01 +0100 MIME-Version: 1.0 Subject: Re: [PATCH 7/7] net: dsa: b53: Expose PTP timestamping ioctls to userspace Content-Language: de-DE To: Richard Cochran Cc: Florian Fainelli , Andrew Lunn , Vivien Didelot , Kurt Kanzenbach , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , John Stultz , Thomas Gleixner , Stephen Boyd , Russell King , Marc Kleine-Budde , linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20211104133204.19757-1-martin.kaistra@linutronix.de> <20211104133204.19757-8-martin.kaistra@linutronix.de> <20211104174251.GB32548@hoboy.vegasvil.org> From: Martin Kaistra In-Reply-To: <20211104174251.GB32548@hoboy.vegasvil.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 04.11.21 um 18:42 schrieb Richard Cochran: > On Thu, Nov 04, 2021 at 02:32:01PM +0100, Martin Kaistra wrote: >> +static int b53_set_hwtstamp_config(struct b53_device *dev, int port, >> + struct hwtstamp_config *config) >> +{ >> + struct b53_port_hwtstamp *ps = &dev->ports[port].port_hwtstamp; >> + bool tstamp_enable = false; >> + >> + clear_bit_unlock(B53_HWTSTAMP_ENABLED, &ps->state); >> + >> + /* Reserved for future extensions */ >> + if (config->flags) >> + return -EINVAL; >> + >> + switch (config->tx_type) { >> + case HWTSTAMP_TX_ON: >> + tstamp_enable = true; >> + break; >> + case HWTSTAMP_TX_OFF: >> + tstamp_enable = false; >> + break; >> + default: >> + return -ERANGE; >> + } >> + >> + switch (config->rx_filter) { >> + case HWTSTAMP_FILTER_NONE: >> + tstamp_enable = false; >> + break; >> + case HWTSTAMP_FILTER_PTP_V2_L2_EVENT: >> + case HWTSTAMP_FILTER_PTP_V2_L2_SYNC: >> + case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: >> + case HWTSTAMP_FILTER_PTP_V2_EVENT: >> + case HWTSTAMP_FILTER_PTP_V2_SYNC: >> + case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: > > This is incorrect. HWTSTAMP_FILTER_PTP_V2_EVENT includes support for > UDP/IPv4 and UDP/IPv6. Driver should return error here. Ok, then I will remove HWTSTAMP_FILTER_PTP_V2_(EVENT|SYNC|DELAY_REQ) from this list, what about HWTSTAMP_FILTER_ALL? > >> + case HWTSTAMP_FILTER_ALL: >> + config->rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT; >> + break; >> + default: >> + return -ERANGE; >> + } > > Thanks, > Richard >