Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3400524ybb; Sun, 22 Mar 2020 23:46:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuRzRfYEh1C6/bQWe1oIWfYJ75ja4TmToVm3DBjMmx1xXDwGw7R80aJ5qh7nNxCympfQUGs X-Received: by 2002:aca:da8b:: with SMTP id r133mr16162714oig.81.1584946004808; Sun, 22 Mar 2020 23:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584946004; cv=none; d=google.com; s=arc-20160816; b=ns8j+tGijO9SfvWPp9Br8tHOuxxtV8d2N00QeZv3eXhaBdC5t6eLiknIr9Ybe3kwat npO+LP8ZzyPY0glEzHPev0P7BeJ6grW2VDjKoZjLcMZmcPkLx2P15L+eH0FOAA++A16l C1QT7Dp0IgVTzUH8sXaUXeB0RD24VcZfaBLSMaoSnS6C/EoN5K8JI+gzdrEZmcDYDRoO FdJK6Z+CyKwoDs5ewdeM59S+cQVfQzfduWbPPSk8EL2ilUoad3D2SNWrC3OZh0q4yyk+ HXDd0uIvvhjLiv/xOKkTnXDvrZp6Y3BuQ6YzF/KPpw+IrewPcNdl1CiuM1/P4K+IOnul N0Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9OBoSDggA48NMc/jbHEa3shMikiUSCoxmhmNt2dBOeE=; b=NjOGmBKn07z/eQZ1fAgJKRQnmPnCPBdQEX7rHPG8YxMbrTpXQrDEna4D70PA178ntB tdDN+MBG5LD+7Urpq+TY7NiOxP0LW1EwqGvVIpGYKSiweNTEsjLcg2luU68xZ/CrZNbM rvf9/EcFOQnvhWfBLdHHNLrf2En727srynMXU78COCKY1j9MKLvZ8IH4r61i5AmgbbXS 7ikCECf1Cj1APDwkZbUHHHjBmZ9DXmegduWUNeqdnZzKeifMwfPMtD1k+I6zi3y3eLot 10KaZnHaytCfK7CzcfcTCeke+GhT0JXJAi+979mSA9rrOGGM3Nwu7dAWm4jmCEfNzu74 /PTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 53si7066079otd.15.2020.03.22.23.46.22; Sun, 22 Mar 2020 23:46:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727253AbgCWGqK (ORCPT + 99 others); Mon, 23 Mar 2020 02:46:10 -0400 Received: from mx.sdf.org ([205.166.94.20]:49847 "EHLO mx.sdf.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727164AbgCWGqK (ORCPT ); Mon, 23 Mar 2020 02:46:10 -0400 Received: from sdf.org (IDENT:lkml@sdf.lonestar.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 02N6jxUu014451 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 23 Mar 2020 06:46:01 GMT Received: (from lkml@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 02N6jxjX008409; Mon, 23 Mar 2020 06:45:59 GMT Date: Mon, 23 Mar 2020 06:45:58 +0000 From: George Spelvin To: Ajay.Kathat@microchip.com Cc: Adham.Abozaeid@microchip.com, linux-wireless@vger.kernel.org, lkml@sdf.org Subject: Re: [PATCH] wilc1000: Use crc7 in lib/ rather than a private copy Message-ID: <20200323064558.GC19411@SDF.ORG> References: <20200322120408.GA19411@SDF.ORG> <2315a030-75ad-0383-3aa3-25528d2cd29a@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2315a030-75ad-0383-3aa3-25528d2cd29a@microchip.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Mar 23, 2020 at 05:03:02AM +0000, Ajay.Kathat@microchip.com wrote: > On 22/03/20 5:34 pm, George Spelvin wrote: >> The code in lib/ is the desired polynomial, and even includes >> the 1-bit left shift in the table rather than needing to code >> it explicitly. > > These changes will break functionality. The crc7 used in 'wilc' is based > on the previous revision(commit# ad241528c491). The new changes can not > be adopted from 'wilc' device side because the crc calculation is done > on hardware IP and it expects the value based the older implementation. I'm confused. Both crc7 functions compute the exact same value. I put them in a test harness and checked that they produce identical output before submitting. The only difference is that the implementation I deleted does crc = 0x7f; while (len--) crc = crc_cyndrome_table[(crc << 1) ^ *byte++]; return crc << 1; while the lib/crc7.c code maintains its "crc" state value already shifted left 1 bit, so it can use the simpler loop: crc = 0xfe; /* 0x7f << 1 */ while (len--) crc = crc_cyndrome_table2[crc ^ *byte++]; return crc; It's not a different CRC-7, it's the *exact same* CRC-7. You can see that the syndrome tables are identical, just shifted one bit over. > It seems you are using an old version of 'wilc' driver. This logic is > already changed in the latest code. We have remove custom behavior to > decide p2p role (P2P_Go/P2P_Client) between 2 wilc devices based on > 'local_random' value and now relies on 'intent' value received from 'wpa_s'. > To submit changes for wilc, please use 'staging-next' branch of > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git repo. Ah, thanks. Sorry for the noise, then. The rcr7 patch still applies, however.