From patchwork Wed Feb 12 09:37:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 3635741 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 A4CFA9F382 for ; Wed, 12 Feb 2014 09:37:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C114920165 for ; Wed, 12 Feb 2014 09:37:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDDAD2015D for ; Wed, 12 Feb 2014 09:37:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751530AbaBLJhj (ORCPT ); Wed, 12 Feb 2014 04:37:39 -0500 Received: from mail-pb0-f53.google.com ([209.85.160.53]:33536 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbaBLJhh (ORCPT ); Wed, 12 Feb 2014 04:37:37 -0500 Received: by mail-pb0-f53.google.com with SMTP id md12so8948011pbc.26 for ; Wed, 12 Feb 2014 01:37:37 -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=oO4Sxsn7FNAFe1NhTkBfiQrGK8Go/k6iJlRMX0sW98k=; b=RMy2bwZI2gFTfvY925bIcMfqXcIiqPjRRaryUbNrBQdSwvtqkjFtn7KgRPDgbAHRT5 wEJ/76lQ8DlDv+vBfmwl4h5xj4xbLsu5vB97tjT5VLskNF4m+Pe5rL5xjGZLg20G3ULk Q0/qKTpVMjsOgHZB50dmsk8fQXqhimXo01hgf+jxSi2bi/HY0fcQsLiKze1euBwAWLB0 cPaXBiQqusSYtmfda8T/l1KJXXxE83RAcKLag+lyGwDFiHhaVAEcJY8vTqhXw9GUef+V HEsUAMy709lKRYkLmYLETBwqgnDPBZ0FIk2MkmF6SK/SPcxw4mEETDZquYs0PIGDc1Db y6QQ== X-Received: by 10.66.121.68 with SMTP id li4mr38743648pab.33.1392197857436; Wed, 12 Feb 2014 01:37:37 -0800 (PST) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id om6sm61663468pbc.43.2014.02.12.01.37.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 01:37:36 -0800 (PST) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: ath10k@lists.infradead.org, kvalo@qca.qualcomm.com, Chun-Yeow Yeoh Subject: [PATCH] ath10k: implement drv_get_tsf for ibss merging Date: Wed, 12 Feb 2014 17:37:24 +0800 Message-Id: <1392197844-1223-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.9.5 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.4 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 Implement the get TSF by simply returning 0 so that IBSS merging is happening. Otherwise, IBSS nodes that have similar SSID naming won't merge. This is simply fooling the mac80211 that the TSF in the received beacon is higher than the local TSF. Signed-off-by: Chun-Yeow Yeoh --- drivers/net/wireless/ath/ath10k/mac.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index afa1226..d62d39e 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4049,6 +4049,21 @@ static void ath10k_sta_rc_update(struct ieee80211_hw *hw, ieee80211_queue_work(hw, &arsta->update_wk); } +static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) +{ + struct ath10k *ar = hw->priv; + u64 tsf; + + mutex_lock(&ar->conf_mutex); + /* FIXME: Return 0 for time being. Need to figure out whether FW has + * the API to fetch 64-bit TSF + */ + tsf = 0; + mutex_unlock(&ar->conf_mutex); + + return tsf; +} + static const struct ieee80211_ops ath10k_ops = { .tx = ath10k_tx, .start = ath10k_start, @@ -4074,6 +4089,7 @@ static const struct ieee80211_ops ath10k_ops = { .set_bitrate_mask = ath10k_set_bitrate_mask, .channel_switch_beacon = ath10k_channel_switch_beacon, .sta_rc_update = ath10k_sta_rc_update, + .get_tsf = ath10k_get_tsf, #ifdef CONFIG_PM .suspend = ath10k_suspend, .resume = ath10k_resume,