Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2013 11:56:57 -0400 (EDT)
From:      Oemsource <alex@oemsourceinc.com>
To:        freebsd-wireless@freebsd.org
Subject:   OEM Source, Inc
Message-ID:  <1113699761651.1101166016578.41557.4.711555E@scheduler.constantcontact.com>

next in thread | raw e-mail | index | archive | help

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Brand new Griffin Iphone 4S Car charger
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

OEM Source, Inc
140 58th unit: 4G
Brooklyn, New York   11220
212-729-1016
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Forward this email
http://ui.constantcontact.com/sa/fwtf.jsp?llr=cc5xjrbab&m=1101166016578&ea=freebsd-wireless@freebsd.org&a=1113699761651


This email was sent to freebsd-wireless@freebsd.org by alex@oemsourceinc.com.

Update Profile/Email Address
http://visitor.constantcontact.com/do?p=oo&mse=0019NWEzvrUeHqqyiM1rFMkb_gRr_wyQ5P1lucj7ybOBvE%3D&t=001NVgtNaWFvXSaQcu_8MWrlQ%3D%3D&lang=001FCSs65SMrsI%3D&reason=001y5KaVlBn7_Y%3D&llr=cc5xjrbab


Instant removal with SafeUnsubscribe(TM)
http://visitor.constantcontact.com/do?p=un&mse=0019NWEzvrUeHqqyiM1rFMkb_gRr_wyQ5P1lucj7ybOBvE%3D&t=001NVgtNaWFvXSaQcu_8MWrlQ%3D%3D&lang=001FCSs65SMrsI%3D&reason=001y5KaVlBn7_Y%3D&llr=cc5xjrbab


Privacy Policy:
http://ui.constantcontact.com/roving/CCPrivacyPolicy.jsp


Online Marketing by
Constant Contact(R)
www.constantcontact.com


OEM Source, Inc | 140 58th unit: 4G | Brooklyn | NY | 11220
From owner-freebsd-wireless@FreeBSD.ORG  Fri Jun  7 09:08:22 2013
Return-Path: <owner-freebsd-wireless@FreeBSD.ORG>
Delivered-To: freebsd-wireless@freebsd.org
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id BEF914DB
 for <freebsd-wireless@freebsd.org>; Fri,  7 Jun 2013 09:08:22 +0000 (UTC)
 (envelope-from adrian.chadd@gmail.com)
Received: from mail-qe0-f43.google.com (mail-qe0-f43.google.com
 [209.85.128.43]) by mx1.freebsd.org (Postfix) with ESMTP id 8605B125D
 for <freebsd-wireless@freebsd.org>; Fri,  7 Jun 2013 09:08:22 +0000 (UTC)
Received: by mail-qe0-f43.google.com with SMTP id k5so2597385qej.30
 for <freebsd-wireless@freebsd.org>; Fri, 07 Jun 2013 02:08:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:content-type;
 bh=yBp/sSvYu1/lAmPD7RauBIN1js4bBM6YkD5atsSlqE0=;
 b=lTrx4YfyG1iVOYYmV0nnvwhbMKOxjYz+boZZW/chw2KM9Ytm+Q1fkciRtVCeS8bSzC
 eZammHhRKUmUosphvdcrWbN72cLoiH6XbSlCbh7zX1Da2jaKRQohd0IE22XXM+JPWgeT
 nnen3EAwwdwdLE+UTO6AwRia3qL8D1yyUrlBAQEnAvwyUQU+FFsfjzbZAwDU62vAnIet
 4MG3ECX+NQ6flYKICTfwHLmuYYxCKmSX4TJ9Kc+p6JToFD2hh8gzzO8CfGUv63Rl30r0
 i4/4KOSpEwcwYkFO1Exuc9dK9LgmgHNgz7ijQS5HXB1iPxTRKUzS1KdxOaqh2R38TtVF
 8ngA==
MIME-Version: 1.0
X-Received: by 10.49.14.132 with SMTP id p4mr16525877qec.38.1370596096122;
 Fri, 07 Jun 2013 02:08:16 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.224.5.65 with HTTP; Fri, 7 Jun 2013 02:08:16 -0700 (PDT)
In-Reply-To: <201306070902.r57922vx030605@svn.freebsd.org>
References: <201306070902.r57922vx030605@svn.freebsd.org>
Date: Fri, 7 Jun 2013 02:08:16 -0700
X-Google-Sender-Auth: 5l45-OUV19mEKq9NOXutrVORmpE
Message-ID: <CAJ-VmokavWJQ0S04Of1wi6MYe41HRmF9vywLg8wAXPDbkHWveQ@mail.gmail.com>
Subject: Fwd: svn commit: r251487 - in head/sys: conf dev/ath modules/ath
From: Adrian Chadd <adrian@freebsd.org>
To: freebsd-wireless@freebsd.org
Content-Type: text/plain; charset=ISO-8859-1
X-BeenThere: freebsd-wireless@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Discussions of 802.11 stack,
 tools device driver development." <freebsd-wireless.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-wireless>, 
 <mailto:freebsd-wireless-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-wireless>;
List-Post: <mailto:freebsd-wireless@freebsd.org>
List-Help: <mailto:freebsd-wireless-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-wireless>, 
 <mailto:freebsd-wireless-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 07 Jun 2013 09:08:22 -0000

Hi,

If you have an AR9285+AR3011 combo card, this commit is for you.

It enables basic bluetooth coexistence support for this setup.

I need to figure out how to disable ASPM in this instance, but I don't
think it's going to be a big problem considering we currently don't
have support to put the MAC to sleep in station mode to conserve
power.

Please let me know if you have this module and if this improves or
breaks your bluetooth setup.

Thanks!



Adrian



---------- Forwarded message ----------
From: Adrian Chadd <adrian@freebsd.org>
Date: 7 June 2013 02:02
Subject: svn commit: r251487 - in head/sys: conf dev/ath modules/ath
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-head@freebsd.org


Author: adrian
Date: Fri Jun  7 09:02:02 2013
New Revision: 251487
URL: http://svnweb.freebsd.org/changeset/base/251487

Log:
  Bring over the initial static bluetooth coexistence configuration
  for the WB195 combo NIC - an AR9285 w/ an AR3011 USB bluetooth NIC.

  The AR3011 is wired up using a 3-wire coexistence scheme to the AR9285.

  The code in if_ath_btcoex.c sets up the initial hardware mapping
  and coexistence configuration.  There's nothing special about it -
  it's static; it doesn't try to configure bluetooth / MAC traffic priorities
  or try to figure out what's actually going on.  It's enough to stop basic
  bluetooth traffic from causing traffic stalls and diassociation from
  the wireless network.

  To use this code, you must have the above NIC.  No, it won't work
  for the AR9287+AR3012, nor the AR9485, AR9462 or AR955x combo cards.

  Then you set a kernel hint before boot or before kldload, where 'X'
  is the unit number of your AR9285 NIC:

  # kenv hint.ath.X.btcoex_profile=wb195

  This will then appear in your boot messages:

  [100482] athX: Enabling WB195 BTCOEX

  This code is going to evolve pretty quickly (well, depending upon my
  spare time) so don't assume the btcoex API is going to stay stable.

  In order to use the bluetooth side, you must also load in firmware using
  ath3kfw and the binary firmware file (ath3k-1.fw in my case.)

  Tested:

  * AR9280, no interference
  * WB195 - AR9285 + AR3011 combo; STA mode; basic bluetooth inquiries
    were enough to cause traffic stalls and disassociations.  This has
    stopped with the btcoex profile code.

  TODO:

  * Importantly - the AR9285 needs ASPM disabled if bluetooth coexistence
    is enabled.  No, I don't know why.  It's likely some kind of bug to do
    with the AR3011 sending bluetooth coexistence signals whilst the device
    is asleep.  Since we don't actually sleep the MAC just yet, it shouldn't
    be a problem.  That said, to be totally correct:

    + ASPM should be disabled - upon attach and wakeup
    + The PCIe powersave HAL code should never be called

    Look at what the ath9k driver does for inspiration.

  * Add WB197 (AR9287+AR3012) support
  * Add support for the AR9485, which is another combo like the AR9285
  * The later NICs have a different signaling mechanism between the MAC
    and the bluetooth device; I haven't even begun to experiment with
    making that HAL code work.  But it should be a lot more automatic.

  * The hardware can do much more interesting traffic weighting with
    bluetooth and wifi traffic.  None of this is currently used.
    Ideally someone would code up something to watch the bluetooth traffic
    GPIO (via an interrupt) and then watch it go high/low; then figure out
    what the bluetooth traffic is and adjust things appropriately.

  * If I get the time I may add in some code to at least track this stuff
    and expose statistics.  But it's up to someone else to experiment with
    the bluetooth coexistence support and add the interesting stuff (like
    "real" detection of bulk, audio, etc bluetooth traffic patterns and
    change wifi parameters appropriately - eg, maximum aggregate length,
    transmit power, using quiet time to control TX duty cycle, etc.)

Added:
  head/sys/dev/ath/if_ath_btcoex.c   (contents, props changed)
  head/sys/dev/ath/if_ath_btcoex.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/ath/if_ath.c
  head/sys/modules/ath/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files Fri Jun  7 08:06:48 2013        (r251486)
+++ head/sys/conf/files Fri Jun  7 09:02:02 2013        (r251487)
@@ -725,6 +725,8 @@ dev/ath/if_ath.c            optional ath \
        compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_beacon.c                optional ath \
        compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/if_ath_btcoex.c                optional ath \
+       compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_debug.c         optional ath \
        compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_keycache.c      optional ath \

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c   Fri Jun  7 08:06:48 2013        (r251486)
+++ head/sys/dev/ath/if_ath.c   Fri Jun  7 09:02:02 2013        (r251487)
@@ -111,6 +111,7 @@ __FBSDID("$FreeBSD$");
 #include <dev/ath/if_ath_rx_edma.h>
 #include <dev/ath/if_ath_tx_edma.h>
 #include <dev/ath/if_ath_beacon.h>
+#include <dev/ath/if_ath_btcoex.h>
 #include <dev/ath/if_ath_spectral.h>
 #include <dev/ath/if_athdfs.h>

@@ -521,6 +522,14 @@ ath_attach(u_int16_t devid, struct ath_s
                goto bad2;
        }

+       /* Attach bluetooth coexistence module */
+       if (ath_btcoex_attach(sc) < 0) {
+               device_printf(sc->sc_dev,
+                   "%s: unable to attach bluetooth coexistence\n", __func__);
+               error = EIO;
+               goto bad2;
+       }
+
        /* Start DFS processing tasklet */
        TASK_INIT(&sc->sc_dfstask, 0, ath_dfs_tasklet, sc);

@@ -1029,6 +1038,7 @@ ath_detach(struct ath_softc *sc)
 #ifdef ATH_DEBUG_ALQ
        if_ath_alq_tidyup(&sc->sc_alq);
 #endif
+       ath_btcoex_detach(sc);
        ath_spectral_detach(sc);
        ath_dfs_detach(sc);
        ath_desc_free(sc);
@@ -1589,6 +1599,11 @@ ath_resume(struct ath_softc *sc)
        ath_spectral_enable(sc, ic->ic_curchan);

        /*
+        * Let bluetooth coexistence at in case it's needed for this channel
+        */
+       ath_btcoex_enable(sc, ic->ic_curchan);
+
+       /*
         * If we're doing TDMA, enforce the TXOP limitation for chips that
         * support it.
         */
@@ -2045,6 +2060,11 @@ ath_init(void *arg)
        ath_spectral_enable(sc, ic->ic_curchan);

        /*
+        * Let bluetooth coexistence at in case it's needed for this channel
+        */
+       ath_btcoex_enable(sc, ic->ic_curchan);
+
+       /*
         * If we're doing TDMA, enforce the TXOP limitation for chips that
         * support it.
         */
@@ -2384,6 +2404,11 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T
        ath_spectral_enable(sc, ic->ic_curchan);

        /*
+        * Let bluetooth coexistence at in case it's needed for this channel
+        */
+       ath_btcoex_enable(sc, ic->ic_curchan);
+
+       /*
         * If we're doing TDMA, enforce the TXOP limitation for chips that
         * support it.
         */
@@ -4946,6 +4971,12 @@ ath_chan_set(struct ath_softc *sc, struc
                ath_spectral_enable(sc, chan);

                /*
+                * Let bluetooth coexistence at in case it's needed for this
+                * channel
+                */
+               ath_btcoex_enable(sc, ic->ic_curchan);
+
+               /*
                 * If we're doing TDMA, enforce the TXOP limitation for chips
                 * that support it.
                 */

Added: head/sys/dev/ath/if_ath_btcoex.c
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/ath/if_ath_btcoex.c    Fri Jun  7 09:02:02 2013
 (r251487)
@@ -0,0 +1,281 @@
+/*-
+ * Copyright (c) 2013 Adrian Chadd <adrian@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ *    redistribution must be conditioned upon including a substantially
+ *    similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * $FreeBSD$
+ */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This implements some very basic bluetooth coexistence methods for
+ * the ath(4) hardware.
+ */
+#include "opt_ath.h"
+#include "opt_inet.h"
+#include "opt_wlan.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/errno.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_arp.h>
+#include <net/ethernet.h>              /* XXX for ether_sprintf */
+
+#include <net80211/ieee80211_var.h>
+
+#include <net/bpf.h>
+
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#endif
+
+#include <dev/ath/if_athvar.h>
+#include <dev/ath/if_ath_btcoex.h>
+
+/*
+ * Initial AR9285 / (WB195) bluetooth coexistence settings,
+ * just for experimentation.
+ *
+ * Return 0 for OK; errno for error.
+ *
+ * XXX TODO: There needs to be a PCIe workaround to disable ASPM if
+ * bluetooth coexistence is enabled.
+ */
+static int
+ath_btcoex_cfg_wb195(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 WB195 BTCOEX\n");
+
+       btinfo.bt_module = HAL_BT_MODULE_JANUS;
+       btinfo.bt_coex_config = HAL_BT_COEX_CFG_3WIRE;
+       /*
+        * These are the three GPIO pins hooked up between the AR9285 and
+        * the AR3011.
+        */
+       btinfo.bt_gpio_bt_active = 6;
+       btinfo.bt_gpio_bt_priority = 7;
+       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
+ * otherwise the sleeping interferes with the bluetooth (USB)
+ * operation and the MAC sleep/wakeup hardware.
+ */
+static int
+ath_btcoex_aspm_wb195(struct ath_softc *sc)
+{
+
+       /* XXX TODO: clear device ASPM L0S and L1 */
+       /* XXX TODO: clear _parent_ ASPM L0S and L1 */
+}
+#endif
+
+/*
+ * Methods which are required
+ */
+
+/*
+ * Attach btcoex to the given interface
+ */
+int
+ath_btcoex_attach(struct ath_softc *sc)
+{
+       int ret;
+       struct ath_hal *ah = sc->sc_ah;
+       const char *profname;
+
+       /*
+        * No chipset bluetooth coexistence? Then do nothing.
+        */
+       if (! ath_hal_btcoex_supported(ah))
+               return (0);
+
+       /*
+        * Look at the hints to determine which bluetooth
+        * profile to configure.
+        */
+       ret = resource_string_value(device_get_name(sc->sc_dev),
+           device_get_unit(sc->sc_dev),
+           "btcoex_profile",
+           &profname);
+       if (ret != 0) {
+               /* nothing to do */
+               return (0);
+       }
+
+       if (strncmp(profname, "wb195", 5) == 0) {
+               ret = ath_btcoex_cfg_wb195(sc);
+       } else {
+               return (0);
+       }
+
+       /*
+        * Propagate up failure from the actual attach phase.
+        */
+       if (ret != 0)
+               return (ret);
+
+       return (0);
+}
+
+/*
+ * Detach btcoex from the given interface
+ */
+int
+ath_btcoex_detach(struct ath_softc *sc)
+{
+
+       return (0);
+}
+
+/*
+ * Configure or disable bluetooth coexistence on the given channel.
+ *
+ * For AR9285/AR9287/AR9485, we'll never see a 5GHz channel, so we just
+ * assume bluetooth coexistence is always on.
+ *
+ * For AR9462, we may see a 5GHz channel; bluetooth coexistence should
+ * not be enabled on those channels.
+ */
+int
+ath_btcoex_enable(struct ath_softc *sc, const struct ieee80211_channel *chan)
+{
+
+       return (0);
+}
+
+/*
+ * Handle ioctl requests from the diagnostic interface.
+ *
+ * The initial part of this code resembles ath_ioctl_diag();
+ * it's likely a good idea to reduce duplication between
+ * these two routines.
+ */
+int
+ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag *ad)
+{
+       unsigned int id = ad->ad_id & ATH_DIAG_ID;
+       void *indata = NULL;
+       void *outdata = NULL;
+       u_int32_t insize = ad->ad_in_size;
+       u_int32_t outsize = ad->ad_out_size;
+       int error = 0;
+//     int val;
+
+       if (ad->ad_id & ATH_DIAG_IN) {
+               /*
+                * Copy in data.
+                */
+               indata = malloc(insize, M_TEMP, M_NOWAIT);
+               if (indata == NULL) {
+                       error = ENOMEM;
+                       goto bad;
+               }
+               error = copyin(ad->ad_in_data, indata, insize);
+               if (error)
+                       goto bad;
+       }
+       if (ad->ad_id & ATH_DIAG_DYN) {
+               /*
+                * Allocate a buffer for the results (otherwise the HAL
+                * returns a pointer to a buffer where we can read the
+                * results).  Note that we depend on the HAL leaving this
+                * pointer for us to use below in reclaiming the buffer;
+                * may want to be more defensive.
+                */
+               outdata = malloc(outsize, M_TEMP, M_NOWAIT);
+               if (outdata == NULL) {
+                       error = ENOMEM;
+                       goto bad;
+               }
+       }
+       switch (id) {
+               default:
+                       error = EINVAL;
+       }
+       if (outsize < ad->ad_out_size)
+               ad->ad_out_size = outsize;
+       if (outdata && copyout(outdata, ad->ad_out_data, ad->ad_out_size))
+               error = EFAULT;
+bad:
+       if ((ad->ad_id & ATH_DIAG_IN) && indata != NULL)
+               free(indata, M_TEMP);
+       if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL)
+               free(outdata, M_TEMP);
+       return (error);
+}
+

Added: head/sys/dev/ath/if_ath_btcoex.h
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/ath/if_ath_btcoex.h    Fri Jun  7 09:02:02 2013
 (r251487)
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 2013 Adrian Chadd <adrian@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ *    redistribution must be conditioned upon including a substantially
+ *    similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * $FreeBSD$
+ */
+#ifndef        __IF_ATH_BTCOEX_H__
+#define        __IF_ATH_BTCOEX_H__
+
+extern int ath_btcoex_attach(struct ath_softc *sc);
+extern int ath_btcoex_detach(struct ath_softc *sc);
+extern int ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag *ad);
+extern int ath_btcoex_enable(struct ath_softc *sc,
+           const struct ieee80211_channel *ch);
+
+#endif /* __IF_ATH_BTCOEX_H__ */

Modified: head/sys/modules/ath/Makefile
==============================================================================
--- head/sys/modules/ath/Makefile       Fri Jun  7 08:06:48 2013
 (r251486)
+++ head/sys/modules/ath/Makefile       Fri Jun  7 09:02:02 2013
 (r251487)
@@ -38,6 +38,7 @@ KMOD= if_ath
 SRCS=  if_ath.c if_ath_alq.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c
 SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c if_ath_tdma.c
 SRCS+= if_ath_beacon.c if_ath_rx_edma.c if_ath_tx_edma.c if_ath_spectral.c
+SRCS+= if_ath_btcoex.c
 # NB: v3 eeprom support used by both AR5211 and AR5212; just include it
 SRCS+= ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c
 SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1113699761651.1101166016578.41557.4.711555E>