From patchwork Wed Oct 31 11:23:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zefir Kurtisi X-Patchwork-Id: 1678531 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5D346DF264 for ; Wed, 31 Oct 2012 11:23:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965518Ab2JaLXN (ORCPT ); Wed, 31 Oct 2012 07:23:13 -0400 Received: from mail.neratec.com ([80.75.119.105]:54750 "EHLO mail.neratec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965467Ab2JaLXJ (ORCPT ); Wed, 31 Oct 2012 07:23:09 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.neratec.com (Postfix) with ESMTP id A11418B5FAF; Wed, 31 Oct 2012 12:23:02 +0100 (CET) X-Virus-Scanned: amavisd-new at neratec.com Received: from mail.neratec.com ([127.0.0.1]) by localhost (mail.neratec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3GnLAvfmahQ6; Wed, 31 Oct 2012 12:23:02 +0100 (CET) Received: from CHL500308.neratec.local (CHL500308.neratec.local [192.168.11.104]) by mail.neratec.com (Postfix) with ESMTPSA id 55AF98B5FAD; Wed, 31 Oct 2012 12:23:02 +0100 (CET) From: Zefir Kurtisi To: linville@tuxdriver.com Cc: ath9k-devel@lists.ath9k.org, linux-wireless@vger.kernel.org, rodrigue@qca.qualcomm.com, Zefir Kurtisi Subject: [PATCH] ath9k: [DFS] add pulse width tolerance for ETSI Date: Wed, 31 Oct 2012 12:23:01 +0100 Message-Id: <1351682581-30683-1-git-send-email-zefir.kurtisi@neratec.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add 5% width tolerance for radar patterns defined by ETSI. Signed-off-by: Zefir Kurtisi --- .../net/wireless/ath/ath9k/dfs_pattern_detector.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c index 3b12914..24877b0 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c +++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c @@ -42,10 +42,15 @@ struct radar_types { #define MIN_PPB_THRESH 50 #define PPB_THRESH(PPB) ((PPB * MIN_PPB_THRESH + 50) / 100) #define PRF2PRI(PRF) ((1000000 + PRF / 2) / PRF) +/* percentage of pulse width tolerance */ +#define WIDTH_TOLERANCE 5 +#define WIDTH_LOWER(X) ((X*(100-WIDTH_TOLERANCE)+50)/100) +#define WIDTH_UPPER(X) ((X*(100+WIDTH_TOLERANCE)+50)/100) #define ETSI_PATTERN(ID, WMIN, WMAX, PMIN, PMAX, PRF, PPB) \ { \ - ID, WMIN, WMAX, (PRF2PRI(PMAX) - PRI_TOLERANCE), \ + ID, WIDTH_LOWER(WMIN), WIDTH_UPPER(WMAX), \ + (PRF2PRI(PMAX) - PRI_TOLERANCE), \ (PRF2PRI(PMIN) * PRF + PRI_TOLERANCE), PRF, PPB * PRF, \ PPB_THRESH(PPB), PRI_TOLERANCE, \ }