From patchwork Wed Feb 18 19:51:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 5847551 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 67E449F269 for ; Wed, 18 Feb 2015 19:51:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87A4120219 for ; Wed, 18 Feb 2015 19:51:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB700201FE for ; Wed, 18 Feb 2015 19:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755000AbbBRTvd (ORCPT ); Wed, 18 Feb 2015 14:51:33 -0500 Received: from mail-we0-f181.google.com ([74.125.82.181]:43893 "EHLO mail-we0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754961AbbBRTvb (ORCPT ); Wed, 18 Feb 2015 14:51:31 -0500 Received: by wesu56 with SMTP id u56so3231714wes.10 for ; Wed, 18 Feb 2015 11:51:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=7OSdNnuxzqJmEw+OoqMwrHHb6U8nSpyjZOaCM7UE0Ss=; b=up4lTSS2r7oyXwUtJMjxAXUy2NhqqxIBc/XB4I9CSkU6d5dP+8jRyL2HaS5F6lwG+Q 0Jk5zob53yTquS9jrhD/dStYwwtKECBf5NdUV7HwNPlOWG053S/mrIWxDydxzBD/Znf4 m3CvAGLV/odINM8lD8NHaI2w+NgkO7Cp+957rVp6uZKI54xiLthCj8XsrWn98SFN9Qfr QFVpblM1sX8MjUtxkbMPSHzFZXzgrTCYzDWlC3Y+qJwVSdwEoRdhK8EYf1RfazqDCGl3 eKTszZgvstSR6JaCLi9OVh7thDtOw7VInFhhL9Os2eW6qiXsSTM2NhxocQ3H2YW0dnE5 YzJQ== X-Received: by 10.180.88.165 with SMTP id bh5mr8089665wib.35.1424289090572; Wed, 18 Feb 2015 11:51:30 -0800 (PST) Received: from deadbeef.Home (2e4034b5.skybroadband.com. [46.64.52.181]) by mx.google.com with ESMTPSA id mb20sm26218991wic.18.2015.02.18.11.51.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Feb 2015 11:51:30 -0800 (PST) From: Jon Hunter To: Cc: Jon Hunter , Larry Finger , Chaoming Li , coekbe@gmail.com Subject: [RFC PATCH] rtl8192cu: Fix beacon support in AP mode Date: Wed, 18 Feb 2015 19:51:14 +0000 Message-Id: <1424289074-27489-1-git-send-email-jgchunter@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 When using the rtl8192cu in AP mode a few devices (an android phone, iphone and ipad) were unable to associate, where as the laptops I tried could. Using wireshark to sniff the wlan traffic, it appears that the rtl8192cu is not beaconing, however, it is responding to broadcast probe requests and so devices are able to detect the AP. Searching the archives the same issue was reported for this WLAN device and a fix to send an initial beacon frame was proposed [1]. This was rejected as it was modifying the rtlwifi core. This change does the same but from within the rtl8192cu driver and appears to fix the problem. Please note that although this does fix the problem, I don't know if this is the best way or correct way to fix the problem, hence the request for comment. [1] http://permalink.gmane.org/gmane.linux.kernel.wireless.general/96770 Signed-off-by: Jon Hunter Cc: Larry Finger Cc: Chaoming Li Cc: coekbe@gmail.com --- drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c index fe4b699..4fbca80 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c @@ -1520,6 +1520,22 @@ void rtl92cu_set_beacon_related_registers(struct ieee80211_hw *hw) _beacon_function_enable(hw, true, true); } +static void _beacon_send_frame(struct ieee80211_hw *hw) +{ + struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); + struct ieee80211_sta *sta; + struct rtl_tcb_desc tcb_desc; + struct sk_buff *skb; + memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); + + skb = ieee80211_beacon_get(hw, mac->vif); + sta = rtl_find_sta(hw, mac->bssid); + + if (!rtlpriv->intf_ops->waitq_insert(hw, sta, skb)) + rtlpriv->intf_ops->adapter_tx(hw, sta, skb, &tcb_desc); +} + void rtl92cu_set_beacon_interval(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); @@ -1529,6 +1545,9 @@ void rtl92cu_set_beacon_interval(struct ieee80211_hw *hw) RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, "beacon_interval:%d\n", bcn_interval); rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval); + + /* Send initial beacon frame to start beaconing */ + _beacon_send_frame(hw); } void rtl92cu_update_interrupt_mask(struct ieee80211_hw *hw,