From patchwork Wed Mar 26 20:03:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 3895101 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 25C679F2E8 for ; Wed, 26 Mar 2014 20:01:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5894920221 for ; Wed, 26 Mar 2014 20:01:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82D762021F for ; Wed, 26 Mar 2014 20:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756300AbaCZUBy (ORCPT ); Wed, 26 Mar 2014 16:01:54 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:60939 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756244AbaCZUBx (ORCPT ); Wed, 26 Mar 2014 16:01:53 -0400 Received: by mail-ee0-f46.google.com with SMTP id t10so2073179eei.19 for ; Wed, 26 Mar 2014 13:01:52 -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=pCo7cTkHi9/FLDYQkAUesD53v8hl1bssVOOGvk22iDw=; b=bxNQAHGTFmDgeVG06ZqLmJLeSzxzpkRlTlrFVRYoKgHQzFq5vG0BtNzsCpxp6vQik+ /Irb+sgEU64wsQKSCXxbR/72dzoZBOPS8JXfZKDpUI7fzKY9T0gzd+Fb9vQVQ6IaRbm6 AVcAZ45Xy5Wy982lwWAkkbjKHOFPO4q9g9QwDX0AL+eK4sPRIP96ehoYZRzaNawm29Hi XNCucHqiQrs+DQkKOL5GRIDV2pfPAsq03nOUsGRbopSSWxKf7Re+wCwJNXUuV+0H0EEK 2ga3d7gga3yo4iNeMDSA6SvqqemJVPuxXfSpB0RlA89zgmK6YiDFPAIJV4CknfpQFiKE iBJw== X-Received: by 10.14.203.5 with SMTP id e5mr185995eeo.105.1395864112875; Wed, 26 Mar 2014 13:01:52 -0700 (PDT) Received: from localhost.localdomain (host179-124-dynamic.6-79-r.retail.telecomitalia.it. [79.6.124.179]) by mx.google.com with ESMTPSA id u46sm49249814eel.1.2014.03.26.13.01.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 13:01:52 -0700 (PDT) From: Andrea Merello To: linville@tuxdriver.com Cc: andrea.merello@gmail.com, linux-wireless@vger.kernel.org, Larry.Finger@lwfinger.net, bernhard@schiffner-limbach.de, dan.carpenter@oracle.com Subject: [PATCH 15/20] rtl8180: add ERP configuration for rtl8187se Date: Wed, 26 Mar 2014 21:03:03 +0100 Message-Id: <1395864183-4988-1-git-send-email-andrea.merello@gmail.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This patch adds ERP configuration support for rtl8187se to the existing ERP configuration function. It needs a different register offset and it must not apply rtl8185 workaround. Signed-off-by: Andrea Merello --- drivers/net/wireless/rtl818x/rtl8180/dev.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c index 8061852..6f9da01 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c @@ -1336,13 +1336,17 @@ static void rtl8180_conf_erp(struct ieee80211_hw *dev, /* from reference code. set ack timeout reg = eifs reg */ rtl818x_iowrite8(priv, &priv->map->CARRIER_SENSE_COUNTER, hw_eifs); - /* rtl8187/rtl8185 HW bug. After EIFS is elapsed, - * the HW still wait for DIFS. - * HW uses 4uS units for EIFS. - */ - hw_eifs = DIV_ROUND_UP(eifs - difs, 4); + if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) + rtl818x_iowrite8(priv, &priv->map->EIFS_8187SE, hw_eifs); + else if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8185) { + /* rtl8187/rtl8185 HW bug. After EIFS is elapsed, + * the HW still wait for DIFS. + * HW uses 4uS units for EIFS. + */ + hw_eifs = DIV_ROUND_UP(eifs - difs, 4); - rtl818x_iowrite8(priv, &priv->map->EIFS, hw_eifs); + rtl818x_iowrite8(priv, &priv->map->EIFS, hw_eifs); + } } static void rtl8180_bss_info_changed(struct ieee80211_hw *dev,