From patchwork Mon Jun 30 16:18:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 4452871 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 330F7BEEAA for ; Mon, 30 Jun 2014 16:18:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 53717202F8 for ; Mon, 30 Jun 2014 16:18:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DA57202DD for ; Mon, 30 Jun 2014 16:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756082AbaF3QSg (ORCPT ); Mon, 30 Jun 2014 12:18:36 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:51878 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754974AbaF3QSg (ORCPT ); Mon, 30 Jun 2014 12:18:36 -0400 Received: by mail-wi0-f170.google.com with SMTP id cc10so5997397wib.5 for ; Mon, 30 Jun 2014 09:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=jdQkqLwfieZEpVviBmOZOFX0lB+JedDV3a+dY4kFiMI=; b=v6D+Z69sGFoxZvIIq6bUt/LShR7aCSGhj12hhlbJ1Z7QQgVHp2E4Emqjcv1yULt9FM ZJyNbT85RLFb5PPxfp4heKyop8ILGYIncOMQjGKPV5lsYKrEyRxNhTNqbImbe1udpAOg 6l9QLtvn2phpL+xynN3v8NMwBDEU2D69IEPv9UTEHxPGiMSLKN3w9JAvXJCx/fbkH+8j Z98ccxHDnwAOgUGMQ73DyYjHVrmmlo2+SHWUv+S/Ggh5WGAN/W0X8zGCHGSoy27KOnsF PumDSOevuoV/upDsUfNVh27ThNPjl3mSt9B63ijZaRq0IUuKcoTOcx6H2WubqdSVTB9d 7O7g== X-Received: by 10.180.13.139 with SMTP id h11mr30851153wic.40.1404145114841; Mon, 30 Jun 2014 09:18:34 -0700 (PDT) Received: from localhost.localdomain (host174-123-dynamic.6-79-r.retail.telecomitalia.it. [79.6.123.174]) by mx.google.com with ESMTPSA id ha5sm32987287wib.4.2014.06.30.09.18.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Jun 2014 09:18:34 -0700 (PDT) From: Andrea Merello To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Larry.Finger@lwfinger.net, bernhard@schiffner-limbach.de, dan.carpenter@oracle.com, Andrea Merello Subject: [PATCH 2/7] rtl818x_pci: Fix rtl8185 excessive IFS after CTS-to-self Date: Mon, 30 Jun 2014 18:18:25 +0200 Message-Id: <1404145105-15954-1-git-send-email-andrea.merello@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Measuring time between _end_ of CTS-to-self and _end_ of datapacket (with a prism54 board and mac80211 hacked to let the MAC timestamp stay untouched in the radiotap header) resulted in about 300uS, while the datapacket itself should be by far shorter (less than 100uS) and IFS should be SIFS (10uS). This measure was confirmed whith a scope: about 250uS IFS has been seen between the two packets. This situation causes the CTS-to-self protection mechanism to work incorrectly due to the NAV expiring during, or even before beginning, the packet transmission, and it also causes the performances to be anyway reduced due to time waste. This problem has been seen at every packet TXed with CTS-to-self enabled on rtl8185 board. rtl8187se seems not affected (and rtl8180, being a 802.11b card, does not have CTS-to-self mechaninsm). This patch fixes this by adding a magic register write, making the board wait for correct SIFS after CTS-to-self packet. Signed-off-by: Andrea Merello --- drivers/net/wireless/rtl818x/rtl8180/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c index e2dcede..73baf26 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c @@ -879,6 +879,8 @@ static int rtl8180_init_hw(struct ieee80211_hw *dev) reg = rtl818x_ioread8(priv, &priv->map->CONFIG3); rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | (1 << 2)); rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); + /* fix eccessive IFS after CTS-to-self */ + rtl818x_iowrite8(priv, REG_ADDR1(0x1ff), 0x35); } if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) {