Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Apr 2011 17:10:52 +0000 (UTC)
From:      Bernhard Schmidt <bschmidt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220662 - head/sys/dev/iwn
Message-ID:  <201104151710.p3FHAq67076339@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bschmidt
Date: Fri Apr 15 17:10:52 2011
New Revision: 220662
URL: http://svn.freebsd.org/changeset/base/220662

Log:
  Split out bluetooth coexistence setup.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c	Fri Apr 15 16:59:56 2011	(r220661)
+++ head/sys/dev/iwn/if_iwn.c	Fri Apr 15 17:10:52 2011	(r220662)
@@ -196,6 +196,7 @@ static void	iwn_tune_sensitivity(struct 
 		    const struct iwn_rx_stats *);
 static int	iwn_send_sensitivity(struct iwn_softc *);
 static int	iwn_set_pslevel(struct iwn_softc *, int, int, int);
+static int	iwn_send_btcoex(struct iwn_softc *);
 static int	iwn_config(struct iwn_softc *);
 static uint8_t	*ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int);
 static int	iwn_scan(struct iwn_softc *);
@@ -4464,12 +4465,25 @@ iwn_set_pslevel(struct iwn_softc *sc, in
 }
 
 static int
+iwn_send_btcoex(struct iwn_softc *sc)
+{
+	struct iwn_bluetooth cmd;
+
+	memset(&cmd, 0, sizeof cmd);
+	cmd.flags = IWN_BT_COEX_CHAN_ANN | IWN_BT_COEX_BT_PRIO;
+	cmd.lead_time = IWN_BT_LEAD_TIME_DEF;
+	cmd.max_kill = IWN_BT_MAX_KILL_DEF;
+	DPRINTF(sc, IWN_DEBUG_RESET, "%s: configuring bluetooth coexistence\n",
+	    __func__);
+	return iwn_cmd(sc, IWN_CMD_BT_COEX, &cmd, sizeof(cmd), 0);
+}
+
+static int
 iwn_config(struct iwn_softc *sc)
 {
 	const struct iwn_hal *hal = sc->sc_hal;
 	struct ifnet *ifp = sc->sc_ifp;
 	struct ieee80211com *ic = ifp->if_l2com;
-	struct iwn_bluetooth bluetooth;
 	uint32_t txmask;
 	int error;
 	uint16_t rxchain;
@@ -4490,13 +4504,7 @@ iwn_config(struct iwn_softc *sc)
 	}
 
 	/* Configure bluetooth coexistence. */
-	memset(&bluetooth, 0, sizeof bluetooth);
-	bluetooth.flags = IWN_BT_COEX_CHAN_ANN | IWN_BT_COEX_BT_PRIO;
-	bluetooth.lead_time = IWN_BT_LEAD_TIME_DEF;
-	bluetooth.max_kill = IWN_BT_MAX_KILL_DEF;
-	DPRINTF(sc, IWN_DEBUG_RESET, "%s: config bluetooth coexistence\n",
-	    __func__);
-	error = iwn_cmd(sc, IWN_CMD_BT_COEX, &bluetooth, sizeof bluetooth, 0);
+	error = iwn_send_btcoex(sc);
 	if (error != 0) {
 		device_printf(sc->sc_dev,
 		    "%s: could not configure bluetooth coexistence, error %d\n",



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