From owner-svn-src-head@FreeBSD.ORG Fri Jun 14 08:18:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30E2FDD4; Fri, 14 Jun 2013 08:18:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A0CD1B27; Fri, 14 Jun 2013 08:18:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5E8IHNd030018; Fri, 14 Jun 2013 08:18:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5E8IHdm030017; Fri, 14 Jun 2013 08:18:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201306140818.r5E8IHdm030017@svn.freebsd.org> From: Adrian Chadd Date: Fri, 14 Jun 2013 08:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251742 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2013 08:18:18 -0000 Author: adrian Date: Fri Jun 14 08:18:17 2013 New Revision: 251742 URL: http://svnweb.freebsd.org/changeset/base/251742 Log: Add in an initial WB225 (AR9485 + AR3012 BT) combo profile. This hasn't yet been tested as unfortunately the AR3012 I have doesn't have the "real" firmware on it; it shipped with the cut down HCI firmware that only understands enough to accept a new firmware image. * Linux ath9k (GPIO constants) Modified: head/sys/dev/ath/if_ath_btcoex.c Modified: head/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- head/sys/dev/ath/if_ath_btcoex.c Fri Jun 14 08:15:28 2013 (r251741) +++ head/sys/dev/ath/if_ath_btcoex.c Fri Jun 14 08:18:17 2013 (r251742) @@ -129,6 +129,64 @@ ath_btcoex_cfg_wb195(struct ath_softc *s return (0); } +/* + * Initial AR9485 / (WB225) bluetooth coexistence settings, + * just for experimentation. + * + * Return 0 for OK; errno for error. + */ +static int +ath_btcoex_cfg_wb225(struct ath_softc *sc) +{ + HAL_BT_COEX_INFO btinfo; + HAL_BT_COEX_CONFIG btconfig; + struct ath_hal *ah = sc->sc_ah; + + if (! ath_hal_btcoex_supported(ah)) + return (EINVAL); + + bzero(&btinfo, sizeof(btinfo)); + bzero(&btconfig, sizeof(btconfig)); + + device_printf(sc->sc_dev, "Enabling WB225 BTCOEX\n"); + + btinfo.bt_module = HAL_BT_MODULE_JANUS; /* XXX not used? */ + btinfo.bt_coex_config = HAL_BT_COEX_CFG_3WIRE; + /* + * These are the three GPIO pins hooked up between the AR9485 and + * the bluetooth module. + */ + btinfo.bt_gpio_bt_active = 4; + btinfo.bt_gpio_bt_priority = 8; + btinfo.bt_gpio_wlan_active = 5; + + btinfo.bt_active_polarity = 1; /* XXX not used */ + btinfo.bt_single_ant = 1; /* 1 antenna on ar9285 ? */ + btinfo.bt_isolation = 0; /* in dB, not used */ + + ath_hal_btcoex_set_info(ah, &btinfo); + + btconfig.bt_time_extend = 0; + btconfig.bt_txstate_extend = 1; /* true */ + btconfig.bt_txframe_extend = 1; /* true */ + btconfig.bt_mode = HAL_BT_COEX_MODE_SLOTTED; + btconfig.bt_quiet_collision = 1; /* true */ + btconfig.bt_rxclear_polarity = 1; /* true */ + btconfig.bt_priority_time = 2; + btconfig.bt_first_slot_time = 5; + btconfig.bt_hold_rxclear = 1; /* true */ + + ath_hal_btcoex_set_config(ah, &btconfig); + + /* + * Enable antenna diversity. + */ + ath_hal_btcoex_set_parameter(ah, HAL_BT_COEX_ANTENNA_DIVERSITY, 1); + + return (0); +} + + #if 0 /* * When using bluetooth coexistence, ASPM needs to be disabled @@ -183,6 +241,8 @@ ath_btcoex_attach(struct ath_softc *sc) if (strncmp(profname, "wb195", 5) == 0) { ret = ath_btcoex_cfg_wb195(sc); + } else if (strncmp(profname, "wb225", 5) == 0) { + ret = ath_btcoex_cfg_wb225(sc); } else { return (0); }