From patchwork Wed Sep 16 10:20:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Schurig X-Patchwork-Id: 47920 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8GANFRS015919 for ; Wed, 16 Sep 2009 10:23:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757623AbZIPKUy (ORCPT ); Wed, 16 Sep 2009 06:20:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757622AbZIPKUx (ORCPT ); Wed, 16 Sep 2009 06:20:53 -0400 Received: from mx51.mymxserver.com ([85.199.173.110]:20463 "EHLO mx51.mymxserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757486AbZIPKUv (ORCPT ); Wed, 16 Sep 2009 06:20:51 -0400 Received: from localhost (localhost [127.0.0.1]) by localhost.mx51.mymxserver.com (Postfix) with ESMTP id 7D2A750009 for ; Wed, 16 Sep 2009 12:20:53 +0200 (CEST) X-Virus-Scanned: by Mittwald Mailscanner Received: from mx51.mymxserver.com ([127.0.0.1]) by localhost (mx51.mymxserver.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B-mCwPc5rOKP for ; Wed, 16 Sep 2009 12:20:53 +0200 (CEST) Received: from lin01.mn-solutions.de (pD95F9B84.dip0.t-ipconnect.de [217.95.155.132]) by mx51.mymxserver.com (Postfix) with ESMTP id 207BA50008 for ; Wed, 16 Sep 2009 12:20:52 +0200 (CEST) Received: by lin01.mn-solutions.de (Postfix, from userid 116) id D4BC21E0050; Wed, 16 Sep 2009 12:20:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.7-deb3 (2006-10-05) on lin01.mn-logistik.de X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.7-deb3 Received: from mnz66.mn-solutions.de (mnz66.mn-solutions.de [192.168.233.66]) by lin01.mn-solutions.de (Postfix) with ESMTP id DE70A1E0036 for ; Wed, 16 Sep 2009 12:20:42 +0200 (CEST) From: Holger Schurig To: Linux Wireless List Subject: question: ATH5K, antenna-mode and fall-throught in ath5k_hw_set_fast_div() Date: Wed, 16 Sep 2009 12:20:11 +0200 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200909161220.11538.hs4233@mail.mn-solutions.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi ! I have a device (fork-lift-terminal) where there is a PCCARD with an Atheros chip inside it. The PCCARD has an built-in antenna and a socket, where a cable goes to the external antenna. Using madwifi, I always did: echo 2 >/proc/sys/dev/wifi0/rxantenna echo 2 >/proc/sys/dev/wifi0/txantenna echo 0 >/proc/sys/dev/wifi0/diversity Now, with ath5k I'm planning to do this: ... as long as there is no offical interface for setting antenna mode. A bit crude, but ... :-) However, when looking for the antenna-related code-paths, I found this: ath5k_hw_set_fast_div(struct ath5k_hw *ah, u8 ee_mode, bool enable) { switch (ee_mode) { case AR5K_EEPROM_MODE_11G: /* XXX: This is set to * disabled on initvals !!! */ case AR5K_EEPROM_MODE_11A: ... In my case, ee_mode happens to be AR5K_EEPROM_MODE_11G, but I don't understand the implication of this comment. Is the XXX something to worry? My card is a B/G only card, so I wonder if the fall-through into the MODE_11A case is ok ?!? --- linux-wl.orig/drivers/net/wireless/ath/ath5k/base.c 2009-09-16 10:43:45.000000000 +0200 +++ linux-wl/drivers/net/wireless/ath/ath5k/base.c 2009-09-16 10:44:10.000000000 +0200 @@ -2850,5 +2850,5 @@ ath5k_config(struct ieee80211_hw *hw, u3 * then we must allow the user to set how many tx antennas we * have available */ - ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT); + ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_B);