Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v3 08/25] staging: brcm80211: remove ht_cap field from brcms_c_info structure
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Arend van Spriel <arend@broadcom.com>

The field ht_cap was typed ieee80211_ht_cap from ieee80211.h. This
contained little endian annotated field cap_info resulting in sparse
endian warnings. It turned out the driver was setting the field, but
it was actually never used. Therefore it has been removed.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c |   23 -----------------------
 drivers/staging/brcm80211/brcmsmac/main.h |    2 --
 drivers/staging/brcm80211/brcmsmac/stf.c  |    9 ---------
 3 files changed, 0 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 3ec952c..074e16f 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -325,11 +325,6 @@ static u16 frametype(u32 rspec, u8 mimoframe)
  */
 #define SSID_FMT_BUF_LEN	((4 * IEEE80211_MAX_SSID_LEN) + 1)
 
-/* defaults for the HT (MIMO) bss */
-#define HT_CAP	(IEEE80211_HT_CAP_SM_PS |\
-	IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_GRN_FLD |\
-	IEEE80211_HT_CAP_MAX_AMSDU | IEEE80211_HT_CAP_DSSSCCK40)
-
 /*
  * The following table lists the buffer memory allocated to xmt fifos in HW.
  * the size is in units of 256bytes(one block), total size is HW dependent
@@ -4213,13 +4208,6 @@ void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val)
 
 static void brcms_c_ht_update_sgi_rx(struct brcms_c_info *wlc, int val)
 {
-	wlc->ht_cap.cap_info &= ~(IEEE80211_HT_CAP_SGI_20 |
-					IEEE80211_HT_CAP_SGI_40);
-	wlc->ht_cap.cap_info |= (val & BRCMS_N_SGI_20) ?
-					IEEE80211_HT_CAP_SGI_20 : 0;
-	wlc->ht_cap.cap_info |= (val & BRCMS_N_SGI_40) ?
-					IEEE80211_HT_CAP_SGI_40 : 0;
-
 	if (wlc->pub->up) {
 		brcms_c_update_beacon(wlc);
 		brcms_c_update_probe_resp(wlc, true);
@@ -4230,10 +4218,6 @@ static void brcms_c_ht_update_ldpc(struct brcms_c_info *wlc, s8 val)
 {
 	wlc->stf->ldpc = val;
 
-	wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_LDPC_CODING;
-	if (wlc->stf->ldpc != OFF)
-		wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_LDPC_CODING;
-
 	if (wlc->pub->up) {
 		brcms_c_update_beacon(wlc);
 		brcms_c_update_probe_resp(wlc, true);
@@ -5376,8 +5360,6 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
 	wlc->bsscfg->wlc = wlc;
 
 	wlc->mimoft = FT_HT;
-	wlc->ht_cap.cap_info = HT_CAP;
-
 	wlc->mimo_40txbw = AUTO;
 	wlc->ofdm_40txbw = AUTO;
 	wlc->cck_40txbw = AUTO;
@@ -5403,15 +5385,10 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
 	if (n_disabled & WLFEATURE_DISABLE_11N_STBC_TX) {
 		wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF;
 		wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF;
-		wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
 	}
 	if (n_disabled & WLFEATURE_DISABLE_11N_STBC_RX)
 		brcms_c_stf_stbc_rx_set(wlc, HT_CAP_RX_STBC_NO);
 
-	/* apply the GF override from nvram conf */
-	if (n_disabled & WLFEATURE_DISABLE_11N_GF)
-		wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_GRN_FLD;
-
 	/* initialize radio_mpc_disable according to wlc->mpc */
 	brcms_c_radio_mpc_upd(wlc);
 	brcms_b_antsel_set(wlc->hw, wlc->asi->antsel_avail);
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 717843a..8760d7e 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -456,7 +456,6 @@ struct brcms_txq_info {
  * cck_40txbw: 11N, cck tx b/w override when in 40MHZ mode.
  * ofdm_40txbw: 11N, ofdm tx b/w override when in 40MHZ mode.
  * mimo_40txbw: 11N, mimo tx b/w override when in 40MHZ mode.
- * ht_cap: HT CAP IE being advertised by this node.
  * default_bss: configured BSS parameters.
  * mc_fid_counter: BC/MC FIFO frame ID counter.
  * country_default: saved country for leaving 802.11d auto-country mode.
@@ -570,7 +569,6 @@ struct brcms_c_info {
 	s8 cck_40txbw;
 	s8 ofdm_40txbw;
 	s8 mimo_40txbw;
-	struct ieee80211_ht_cap ht_cap;
 
 	struct brcms_bss_info *default_bss;
 
diff --git a/drivers/staging/brcm80211/brcmsmac/stf.c b/drivers/staging/brcm80211/brcmsmac/stf.c
index 91b53a5..c77bab2 100644
--- a/drivers/staging/brcm80211/brcmsmac/stf.c
+++ b/drivers/staging/brcm80211/brcmsmac/stf.c
@@ -53,9 +53,6 @@ static void brcms_c_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val)
 			return;
 	}
 
-	wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_RX_STBC;
-	wlc->ht_cap.cap_info |= (val << IEEE80211_HT_CAP_RX_STBC_SHIFT);
-
 	if (wlc->pub->up) {
 		brcms_c_update_beacon(wlc);
 		brcms_c_update_probe_resp(wlc, true);
@@ -140,12 +137,6 @@ static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val)
 	if ((int_val == ON) && (wlc->stf->txstreams == 1))
 		return false;
 
-	if ((int_val == OFF) || (wlc->stf->txstreams == 1)
-	    || !BRCMS_STBC_CAP_PHY(wlc))
-		wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
-	else
-		wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_TX_STBC;
-
 	wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = (s8) int_val;
 	wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = (s8) int_val;
 
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 23/25] staging: brcm80211: use d11rxhdr structure in brcms_c_recover_tsf64()
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Arend van Spriel <arend@broadcom.com>

All information needed for this function is available in the d11rxhdr
structure. This is the last place where the brcms_d11rxhdr structure
so it can be removed.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/d11.h   |   17 -----------------
 drivers/staging/brcm80211/brcmsmac/main.c  |    9 +++------
 drivers/staging/brcm80211/brcmsmac/types.h |    1 -
 3 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/d11.h b/drivers/staging/brcm80211/brcmsmac/d11.h
index 1f05e8a..ed51616 100644
--- a/drivers/staging/brcm80211/brcmsmac/d11.h
+++ b/drivers/staging/brcm80211/brcmsmac/d11.h
@@ -1407,23 +1407,6 @@ struct d11rxhdr {
 	u16 RxStatus2;
 	u16 RxTSFTime;
 	u16 RxChan;
-};
-
-/*
- * rxhdr: received frame header data
- * rssi: rssi computed by PHY
- * rxpwr0: obsoleted, place holder for legacy ROM code. use rxpwr[]
- * rxpwr1: obsoleted, place holder for legacy ROM code. use rxpwr[]
- * do_rssi_ma: do per-pkt sampling for per-antenna ma in HIGH
- * rxpwr: rssi for supported antennas
- */
-struct brcms_d11rxhdr {
-	struct d11rxhdr rxh_cpu;
-	s8 rssi;
-	s8 rxpwr0;
-	s8 rxpwr1;
-	s8 do_rssi_ma;
-	s8 rxpwr[WL_RSSI_ANT_MAX];
 } __packed;
 
 /* PhyRxStatus_0: */
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index bdc0611..4f79a42 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -783,7 +783,6 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
 	struct sk_buff *tail = NULL;
 	uint n = 0;
 	uint bound_limit = bound ? RXBND : -1;
-	struct brcms_d11rxhdr *wlc_rxhdr = NULL;
 
 	BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
 	/* gather received frames */
@@ -813,7 +812,6 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
 
 		rxh_le = (struct d11rxhdr_le *)p->data;
 		rxh = (struct d11rxhdr *)p->data;
-		wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;
 
 		/* fixup rx header endianness */
 		rxh->RxFrameSize = le16_to_cpu(rxh_le->RxFrameSize);
@@ -8117,7 +8115,7 @@ brcms_b_read_tsf(struct brcms_hardware *wlc_hw, u32 *tsf_l_ptr,
  * are used. Finally, the tsf_h is read from the tsf register.
  */
 static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
-				 struct brcms_d11rxhdr *rxh)
+				 struct d11rxhdr *rxh)
 {
 	u32 tsf_h, tsf_l;
 	u16 rx_tsf_0_15, rx_tsf_16_31;
@@ -8125,7 +8123,7 @@ static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
 	brcms_b_read_tsf(wlc->hw, &tsf_l, &tsf_h);
 
 	rx_tsf_16_31 = (u16)(tsf_l >> 16);
-	rx_tsf_0_15 = rxh->rxh_cpu.RxTSFTime;
+	rx_tsf_0_15 = rxh->RxTSFTime;
 
 	/*
 	 * a greater tsf time indicates the low 16 bits of
@@ -8145,14 +8143,13 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
 		     struct sk_buff *p,
 		     struct ieee80211_rx_status *rx_status)
 {
-	struct brcms_d11rxhdr *wlc_rxh = (struct brcms_d11rxhdr *) rxh;
 	int preamble;
 	int channel;
 	u32 rspec;
 	unsigned char *plcp;
 
 	/* fill in TSF and flag its presence */
-	rx_status->mactime = brcms_c_recover_tsf64(wlc, wlc_rxh);
+	rx_status->mactime = brcms_c_recover_tsf64(wlc, rxh);
 	rx_status->flag |= RX_FLAG_MACTIME_MPDU;
 
 	channel = BRCMS_CHAN_CHANNEL(rxh->RxChan);
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 415ab8b..23969fe 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -336,7 +336,6 @@ struct dma_pub;
 struct si_pub;
 struct tx_status;
 struct d11rxhdr;
-struct brcms_d11rxhdr;
 struct txpwr_limits;
 
 /* iovar structure */
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 14/25] staging: brcm80211: removed band related global vars from softmac
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Global variables are undesirable unless they are read only. Variables are
now maintained in a device specific structure.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c |   29 +++++++++++++---------
 drivers/staging/brcm80211/brcmsmac/main.h        |    1 +
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 11ba061..d5d0d9e 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -31,6 +31,7 @@
 #include "pub.h"
 #include "ucode_loader.h"
 #include "mac80211_if.h"
+#include "main.h"
 
 #define N_TX_QUEUES	4 /* #tx queues on mac80211<->driver interface */
 
@@ -225,7 +226,7 @@ static struct ieee80211_rate legacy_ratetable[] = {
 	RATE(540, 0),
 };
 
-static struct ieee80211_supported_band brcms_band_2GHz_nphy = {
+static const struct ieee80211_supported_band brcms_band_2GHz_nphy_template = {
 	.band = IEEE80211_BAND_2GHZ,
 	.channels = brcms_2ghz_chantable,
 	.n_channels = ARRAY_SIZE(brcms_2ghz_chantable),
@@ -247,7 +248,7 @@ static struct ieee80211_supported_band brcms_band_2GHz_nphy = {
 		   }
 };
 
-static struct ieee80211_supported_band brcms_band_5GHz_nphy = {
+static const struct ieee80211_supported_band brcms_band_5GHz_nphy_template = {
 	.band = IEEE80211_BAND_5GHZ,
 	.channels = brcms_5ghz_nphy_chantable,
 	.n_channels = ARRAY_SIZE(brcms_5ghz_nphy_chantable),
@@ -981,22 +982,24 @@ static irqreturn_t brcms_isr(int irq, void *dev_id)
 static int ieee_hw_rate_init(struct ieee80211_hw *hw)
 {
 	struct brcms_info *wl = hw->priv;
-	int has_5g;
+	struct brcms_c_info *wlc = wl->wlc;
+	struct ieee80211_supported_band *band;
+	int has_5g = 0;
 	u16 phy_type;
 
-	has_5g = 0;
-
 	hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL;
 	hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
 
 	phy_type = brcms_c_get_phy_type(wl->wlc, 0);
 	if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN) {
+		band = &wlc->bandstate[BAND_2G_INDEX]->band;
+		*band = brcms_band_2GHz_nphy_template;
 		if (phy_type == PHY_TYPE_LCN) {
 			/* Single stream */
-			brcms_band_2GHz_nphy.ht_cap.mcs.rx_mask[1] = 0;
-			brcms_band_2GHz_nphy.ht_cap.mcs.rx_highest = 72;
+			band->ht_cap.mcs.rx_mask[1] = 0;
+			band->ht_cap.mcs.rx_highest = 72;
 		}
-		hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &brcms_band_2GHz_nphy;
+		hw->wiphy->bands[IEEE80211_BAND_2GHZ] = band;
 	} else {
 		return -EPERM;
 	}
@@ -1004,11 +1007,13 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
 	/* Assume all bands use the same phy.  True for 11n devices. */
 	if (wl->pub->_nbands > 1) {
 		has_5g++;
-		if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN)
-			hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
-			    &brcms_band_5GHz_nphy;
-		else
+		if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN) {
+			band = &wlc->bandstate[BAND_5G_INDEX]->band;
+			*band = brcms_band_5GHz_nphy_template;
+			hw->wiphy->bands[IEEE80211_BAND_5GHZ] = band;
+		} else {
 			return -EPERM;
+		}
 	}
 	return 0;
 }
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 8760d7e..9e12a14 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -281,6 +281,7 @@ struct brcms_band {
 
 	u16 CWmin; /* minimum size of contention window, in unit of aSlotTime */
 	u16 CWmax; /* maximum size of contention window, in unit of aSlotTime */
+	struct ieee80211_supported_band band;
 };
 
 /* module control blocks */
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 19/25] staging: brcm80211: change interface for common rssi compute function
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Arend van Spriel <arend@broadcom.com>

The function wlc_phy_rssi_compute() now uses d11rxhdr struct as
purely input parameter and returns the computed rssi value.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c        |    4 +++-
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c |    7 +++----
 drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h |    4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index e34b511..ef96358 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -806,15 +806,17 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
 
 	/* process each frame */
 	while ((p = head) != NULL) {
+		struct d11rxhdr *rxh;
 		head = head->prev;
 		p->prev = NULL;
 
 		wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;
+		rxh = (struct d11rxhdr *)p->data;
 
 		/*
 		 * compute the RSSI from d11rxhdr and record it in wlc_rxd11hr
 		 */
-		wlc_phy_rssi_compute(wlc_hw->band->pi, wlc_rxhdr);
+		wlc_rxhdr->rssi = wlc_phy_rssi_compute(wlc_hw->band->pi, rxh);
 
 		brcms_c_recv(wlc_hw->wlc, p);
 	}
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 8025247..c359a10 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -2610,10 +2610,9 @@ void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_cmplx_pwr_dB, u8 core)
 	}
 }
 
-void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
-			  struct brcms_d11rxhdr *wlc_rxhdr)
+int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
+			 struct d11rxhdr *rxh)
 {
-	struct d11rxhdr *rxh = &wlc_rxhdr->rxhdr;
 	int rssi = le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_JSSI_MASK;
 	uint radioid = pih->radioid;
 	struct brcms_phy *pi = (struct brcms_phy *) pih;
@@ -2650,7 +2649,7 @@ void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
 	}
 
 end:
-	wlc_rxhdr->rssi = (s8) rssi;
+	return rssi;
 }
 
 void wlc_phy_freqtrack_start(struct brcms_phy_pub *pih)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
index 1dbfaa3..39c3c22 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
@@ -212,8 +212,8 @@ extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi,
 extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
 extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
 
-extern void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
-				 struct brcms_d11rxhdr *wlc_rxhdr);
+extern int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
+				struct d11rxhdr *rxh);
 extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
 extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
 extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 18/25] staging: brcm80211: changing interface to n-phy rssi compute function
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Arend van Spriel <arend@broadcom.com>

The function wlc_phy_rssi_compute_nphy() was called with pointer to
brcms_d11rxhdr structure in which it filled in the received power
per antenna. However, these are not used further in the driver so
it only needs the d11rxhdr structure as input for rssi calculation.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c |    2 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_int.h |    2 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_n.c   |    7 +------
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index a26c682..8025247 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -2646,7 +2646,7 @@ void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
 			rssi -= 256;
 	} else if (radioid == BCM2055_ID || radioid == BCM2056_ID
 		   || radioid == BCM2057_ID) {
-		rssi = wlc_phy_rssi_compute_nphy(pi, wlc_rxhdr);
+		rssi = wlc_phy_rssi_compute_nphy(pi, rxh);
 	}
 
 end:
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index b94117b..8ce0159 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -1183,7 +1183,7 @@ extern void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
 extern void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
 
 extern int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi,
-				     struct brcms_d11rxhdr *wlc_rxh);
+				     struct d11rxhdr *rxh);
 
 #define NPHY_TESTPATTERN_BPHY_EVM   0
 #define NPHY_TESTPATTERN_BPHY_RFCS  1
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index 58645d2..ff8b1d8 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -23109,9 +23109,8 @@ void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi)
 }
 
 int
-wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct brcms_d11rxhdr *wlc_rxh)
+wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct d11rxhdr *rxh)
 {
-	struct d11rxhdr *rxh = &wlc_rxh->rxhdr;
 	s16 rxpwr, rxpwr0, rxpwr1;
 	s16 phyRx0_l, phyRx2_l;
 
@@ -23134,10 +23133,6 @@ wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct brcms_d11rxhdr *wlc_rxh)
 		rxpwr1 = phyRx2_l;
 	}
 
-	wlc_rxh->rxpwr[0] = (s8) rxpwr0;
-	wlc_rxh->rxpwr[1] = (s8) rxpwr1;
-	wlc_rxh->do_rssi_ma = 0;
-
 	if (pi->sh->rssi_mode == RSSI_ANT_MERGE_MAX)
 		rxpwr = (rxpwr0 > rxpwr1) ? rxpwr0 : rxpwr1;
 	else if (pi->sh->rssi_mode == RSSI_ANT_MERGE_MIN)
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 17/25] staging: brcm80211: removed global variable in softmac otp
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Placed variable on the stack instead and deleted unused functions.
Softmac was tested to function properly with multiple adapters in one
system.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/otp.c |  143 ++++--------------------------
 drivers/staging/brcm80211/brcmsmac/otp.h |    8 --
 2 files changed, 18 insertions(+), 133 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/otp.c b/drivers/staging/brcm80211/brcmsmac/otp.c
index 06cb575..f15e8be 100644
--- a/drivers/staging/brcm80211/brcmsmac/otp.c
+++ b/drivers/staging/brcm80211/brcmsmac/otp.c
@@ -67,15 +67,13 @@
 /* Fixed size subregions sizes in words */
 #define OTPGU_CI_SZ		2
 
+struct otpinfo;
+
 /* OTP function struct */
 struct otp_fn_s {
-	int (*size)(struct otpinfo *oi);
-	u16 (*read_bit)(struct otpinfo *oi, struct chipcregs *cc, uint off);
-	struct otpinfo *(*init)(struct si_pub *sih);
+	int (*init)(struct si_pub *sih, struct otpinfo *oi);
 	int (*read_region)(struct otpinfo *oi, int region, u16 *data,
 			   uint *wlen);
-	int (*nvread)(struct otpinfo *oi, char *data, uint *len);
-	int (*status)(struct otpinfo *oi);
 };
 
 struct otpinfo {
@@ -99,21 +97,6 @@ struct otpinfo {
 	int otpgu_base;		/* offset to General Use Region */
 };
 
-static struct otpinfo otpinfo;
-
-/*
- * IPX OTP Code
- *
- *   Exported functions:
- *	ipxotp_status()
- *	ipxotp_size()
- *	ipxotp_init()
- *	ipxotp_read_bit()
- *	ipxotp_read_region()
- *	ipxotp_nvread()
- *
- */
-
 /* OTP layout */
 /* CC revs 21, 24 and 27 OTP General Use Region word offset */
 #define REVA4_OTPGU_BASE	12
@@ -149,51 +132,11 @@ static struct otpinfo otpinfo;
 #define OTP4315_SWREG_SZ	178	/* 178 bytes */
 #define OTP_SZ_FU_144		(144/8)	/* 144 bits */
 
-static int ipxotp_status(struct otpinfo *oi)
-{
-	return (int)(oi->status);
-}
-
-/* Return size in bytes */
-static int ipxotp_size(struct otpinfo *oi)
-{
-	return (int)oi->wsize * 2;
-}
-
 static u16 ipxotp_otpr(struct otpinfo *oi, struct chipcregs *cc, uint wn)
 {
 	return R_REG(&cc->sromotp[wn]);
 }
 
-static u16 ipxotp_read_bit(struct otpinfo *oi, struct chipcregs *cc, uint off)
-{
-	uint k, row, col;
-	u32 otpp, st;
-
-	row = off / oi->cols;
-	col = off % oi->cols;
-
-	otpp = OTPP_START_BUSY |
-	    ((OTPPOC_READ << OTPP_OC_SHIFT) & OTPP_OC_MASK) |
-	    ((row << OTPP_ROW_SHIFT) & OTPP_ROW_MASK) |
-	    ((col << OTPP_COL_SHIFT) & OTPP_COL_MASK);
-	W_REG(&cc->otpprog, otpp);
-
-	for (k = 0;
-	     ((st = R_REG(&cc->otpprog)) & OTPP_START_BUSY)
-	     && (k < OTPP_TRIES); k++)
-		;
-	if (k >= OTPP_TRIES)
-		return 0xffff;
-
-	if (st & OTPP_READERR)
-		return 0xffff;
-
-	st = (st & OTPP_VALUE_MASK) >> OTPP_VALUE_SHIFT;
-
-	return (int)st;
-}
-
 /*
  * Calculate max HW/SW region byte size by subtracting fuse region
  * and checksum size, osizew is oi->wsize (OTP size - GU size) in words
@@ -294,28 +237,24 @@ static void _ipxotp_init(struct otpinfo *oi, struct chipcregs *cc)
 	oi->flim = oi->wsize;
 }
 
-static struct otpinfo *ipxotp_init(struct si_pub *sih)
+static int ipxotp_init(struct si_pub *sih, struct otpinfo *oi)
 {
 	uint idx;
 	struct chipcregs *cc;
-	struct otpinfo *oi;
 
 	/* Make sure we're running IPX OTP */
 	if (!OTPTYPE_IPX(sih->ccrev))
-		return NULL;
+		return -EBADE;
 
 	/* Make sure OTP is not disabled */
 	if (ai_is_otp_disabled(sih))
-		return NULL;
-
-	/* OTP is always powered */
-	oi = &otpinfo;
+		return -EBADE;
 
 	/* Check for otp size */
 	switch ((sih->cccaps & CC_CAP_OTPSIZE) >> CC_CAP_OTPSIZE_SHIFT) {
 	case 0:
 		/* Nothing there */
-		return NULL;
+		return -EBADE;
 	case 1:		/* 32x64 */
 		oi->rows = 32;
 		oi->cols = 64;
@@ -338,7 +277,7 @@ static struct otpinfo *ipxotp_init(struct si_pub *sih)
 		break;
 	default:
 		/* Don't know the geometry */
-		return NULL;
+		return -EBADE;
 	}
 
 	/* Retrieve OTP region info */
@@ -349,7 +288,7 @@ static struct otpinfo *ipxotp_init(struct si_pub *sih)
 
 	ai_setcoreidx(sih, idx);
 
-	return oi;
+	return 0;
 }
 
 static int
@@ -437,56 +376,16 @@ ipxotp_read_region(struct otpinfo *oi, int region, u16 *data, uint *wlen)
 	return 0;
 }
 
-static int ipxotp_nvread(struct otpinfo *oi, char *data, uint *len)
-{
-	return -ENOTSUPP;
-}
-
 static const struct otp_fn_s ipxotp_fn = {
-	(int (*)(struct otpinfo *)) ipxotp_size,
-	(u16 (*)(struct otpinfo *, struct chipcregs *, uint)) ipxotp_read_bit,
-
-	(struct otpinfo *(*)(struct si_pub *)) ipxotp_init,
+	(int (*)(struct si_pub *, struct otpinfo *)) ipxotp_init,
 	(int (*)(struct otpinfo *, int, u16 *, uint *)) ipxotp_read_region,
-	(int (*)(struct otpinfo *, char *, uint *)) ipxotp_nvread,
-
-	(int (*)(struct otpinfo *)) ipxotp_status
 };
 
-/*
- *	otp_status()
- *	otp_size()
- *	otp_read_bit()
- *	otp_init()
- *	otp_read_region()
- *	otp_nvread()
- */
-
-int otp_status(struct otpinfo *oi)
+static int otp_init(struct si_pub *sih, struct otpinfo *oi)
 {
-	return oi->fn->status(oi);
-}
-
-int otp_size(struct otpinfo *oi)
-{
-	return oi->fn->size(oi);
-}
 
-u16 otp_read_bit(struct otpinfo *oi, uint offset)
-{
-	uint idx = ai_coreidx(oi->sih);
-	struct chipcregs *cc = ai_setcoreidx(oi->sih, SI_CC_IDX);
-	u16 readBit = (u16) oi->fn->read_bit(oi, cc, offset);
-	ai_setcoreidx(oi->sih, idx);
-	return readBit;
-}
+	int ret;
 
-struct otpinfo *otp_init(struct si_pub *sih)
-{
-	struct otpinfo *oi;
-	struct otpinfo *ret = NULL;
-
-	oi = &otpinfo;
 	memset(oi, 0, sizeof(struct otpinfo));
 
 	oi->ccrev = sih->ccrev;
@@ -495,18 +394,19 @@ struct otpinfo *otp_init(struct si_pub *sih)
 		oi->fn = &ipxotp_fn;
 
 	if (oi->fn == NULL)
-		return NULL;
+		return -EBADE;
 
 	oi->sih = sih;
 
-	ret = (oi->fn->init) (sih);
+	ret = (oi->fn->init) (sih, oi);
 
 	return ret;
 }
 
 int
 otp_read_region(struct si_pub *sih, int region, u16 *data, uint *wlen) {
-	struct otpinfo *oi;
+	struct otpinfo otpinfo;
+	struct otpinfo *oi = &otpinfo;
 	int err = 0;
 
 	if (ai_is_otp_disabled(sih)) {
@@ -514,19 +414,12 @@ otp_read_region(struct si_pub *sih, int region, u16 *data, uint *wlen) {
 		goto out;
 	}
 
-	oi = otp_init(sih);
-	if (oi == NULL) {
-		err = -EBADE;
+	err = otp_init(sih, oi);
+	if (err)
 		goto out;
-	}
 
 	err = ((oi)->fn->read_region)(oi, region, data, wlen);
 
  out:
 	return err;
 }
-
-int otp_nvread(struct otpinfo *oi, char *data, uint *len)
-{
-	return oi->fn->nvread(oi, data, len);
-}
diff --git a/drivers/staging/brcm80211/brcmsmac/otp.h b/drivers/staging/brcm80211/brcmsmac/otp.h
index bf2f76f..6b6d31c 100644
--- a/drivers/staging/brcm80211/brcmsmac/otp.h
+++ b/drivers/staging/brcm80211/brcmsmac/otp.h
@@ -30,15 +30,7 @@
 /* OTP Size */
 #define OTP_SZ_MAX		(6144/8)	/* maximum bytes in one CIS */
 
-struct otpinfo;
-
-/* Exported functions */
-extern int otp_status(struct otpinfo *oi);
-extern int otp_size(struct otpinfo *oi);
-extern u16 otp_read_bit(struct otpinfo *oi, uint offset);
-extern struct otpinfo *otp_init(struct si_pub *sih);
 extern int otp_read_region(struct si_pub *sih, int region, u16 *data,
 			   uint *wlen);
-extern int otp_nvread(struct otpinfo *oi, char *data, uint *len);
 
 #endif				/* _BRCM_OTP_H_ */
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 11/25] staging: brcm80211: make device initializer table for wme constant
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Arend van Spriel <arend@broadcom.com>

For chip initialisation of the wme parameters a table is used, but
it was not marked as constant.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index dfd67de..a3c0157 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -4297,7 +4297,7 @@ void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend)
 	int i_ac;
 	struct ieee80211_tx_queue_params txq_pars;
 	struct ieee80211_tx_queue_params *params = &txq_pars;
-	static struct edcf_acparam default_edcf_acparams[] = {
+	static const struct edcf_acparam default_edcf_acparams[] = {
 		 {EDCF_AC_BE_ACI_STA, EDCF_AC_BE_ECW_STA,
 		  cpu_to_le16(EDCF_AC_BE_TXOP_STA)},
 		 {EDCF_AC_BK_ACI_STA, EDCF_AC_BK_ECW_STA,
@@ -4307,7 +4307,7 @@ void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend)
 		 {EDCF_AC_VO_ACI_STA, EDCF_AC_VO_ECW_STA,
 		  cpu_to_le16(EDCF_AC_VO_TXOP_STA)}
 	}; /* ucode needs these parameters during its initialization */
-	struct edcf_acparam *edcf_acp = &default_edcf_acparams[0];
+	const struct edcf_acparam *edcf_acp = &default_edcf_acparams[0];
 
 	for (i_ac = 0; i_ac < AC_COUNT; i_ac++, edcf_acp++) {
 		/* find out which ac this set of params applies to */
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 21/25] staging: brcm80211: use endian annotated structures in brcmsmac
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Arend van Spriel <arend@broadcom.com>

Structures interfacing with the device have a specific endianess and
structures exchanged between host and device have been annotated so
sparse checking can be done. The Makefile has been modified to add
the __CHECK_ENDIAN__ flag.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/Makefile       |    3 +-
 drivers/staging/brcm80211/brcmsmac/d11.h          |   77 +++++++++++--------
 drivers/staging/brcm80211/brcmsmac/dma.c          |   41 +++++-----
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c  |   12 ++--
 drivers/staging/brcm80211/brcmsmac/main.c         |   86 +++++++++++----------
 drivers/staging/brcm80211/brcmsmac/srom.c         |    4 +-
 drivers/staging/brcm80211/brcmsmac/ucode_loader.h |    8 +-
 7 files changed, 126 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/Makefile b/drivers/staging/brcm80211/brcmsmac/Makefile
index 8fdca2e..e44859d 100644
--- a/drivers/staging/brcm80211/brcmsmac/Makefile
+++ b/drivers/staging/brcm80211/brcmsmac/Makefile
@@ -15,7 +15,8 @@
 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-ccflags-y :=				\
+ccflags-y := \
+	-D__CHECK_ENDIAN__ \
 	-Idrivers/staging/brcm80211/brcmsmac \
 	-Idrivers/staging/brcm80211/brcmsmac/phy \
 	-Idrivers/staging/brcm80211/include
diff --git a/drivers/staging/brcm80211/brcmsmac/d11.h b/drivers/staging/brcm80211/brcmsmac/d11.h
index cbb574a..1f05e8a 100644
--- a/drivers/staging/brcm80211/brcmsmac/d11.h
+++ b/drivers/staging/brcm80211/brcmsmac/d11.h
@@ -745,37 +745,37 @@ struct cck_phy_hdr {
 
 /* TX DMA buffer header */
 struct d11txh {
-	u16 MacTxControlLow;	/* 0x0 */
-	u16 MacTxControlHigh;	/* 0x1 */
-	u16 MacFrameControl;	/* 0x2 */
-	u16 TxFesTimeNormal;	/* 0x3 */
-	u16 PhyTxControlWord;	/* 0x4 */
-	u16 PhyTxControlWord_1;	/* 0x5 */
-	u16 PhyTxControlWord_1_Fbr;	/* 0x6 */
-	u16 PhyTxControlWord_1_Rts;	/* 0x7 */
-	u16 PhyTxControlWord_1_FbrRts;	/* 0x8 */
-	u16 MainRates;	/* 0x9 */
-	u16 XtraFrameTypes;	/* 0xa */
+	__le16 MacTxControlLow;	/* 0x0 */
+	__le16 MacTxControlHigh;	/* 0x1 */
+	__le16 MacFrameControl;	/* 0x2 */
+	__le16 TxFesTimeNormal;	/* 0x3 */
+	__le16 PhyTxControlWord;	/* 0x4 */
+	__le16 PhyTxControlWord_1;	/* 0x5 */
+	__le16 PhyTxControlWord_1_Fbr;	/* 0x6 */
+	__le16 PhyTxControlWord_1_Rts;	/* 0x7 */
+	__le16 PhyTxControlWord_1_FbrRts;	/* 0x8 */
+	__le16 MainRates;	/* 0x9 */
+	__le16 XtraFrameTypes;	/* 0xa */
 	u8 IV[16];		/* 0x0b - 0x12 */
 	u8 TxFrameRA[6];	/* 0x13 - 0x15 */
-	u16 TxFesTimeFallback;	/* 0x16 */
+	__le16 TxFesTimeFallback;	/* 0x16 */
 	u8 RTSPLCPFallback[6];	/* 0x17 - 0x19 */
-	u16 RTSDurFallback;	/* 0x1a */
+	__le16 RTSDurFallback;	/* 0x1a */
 	u8 FragPLCPFallback[6];	/* 0x1b - 1d */
-	u16 FragDurFallback;	/* 0x1e */
-	u16 MModeLen;	/* 0x1f */
-	u16 MModeFbrLen;	/* 0x20 */
-	u16 TstampLow;	/* 0x21 */
-	u16 TstampHigh;	/* 0x22 */
-	u16 ABI_MimoAntSel;	/* 0x23 */
-	u16 PreloadSize;	/* 0x24 */
-	u16 AmpduSeqCtl;	/* 0x25 */
-	u16 TxFrameID;	/* 0x26 */
-	u16 TxStatus;	/* 0x27 */
-	u16 MaxNMpdus;	/* 0x28 */
-	u16 MaxABytes_MRT;	/* 0x29 */
-	u16 MaxABytes_FBR;	/* 0x2a */
-	u16 MinMBytes;	/* 0x2b */
+	__le16 FragDurFallback;	/* 0x1e */
+	__le16 MModeLen;	/* 0x1f */
+	__le16 MModeFbrLen;	/* 0x20 */
+	__le16 TstampLow;	/* 0x21 */
+	__le16 TstampHigh;	/* 0x22 */
+	__le16 ABI_MimoAntSel;	/* 0x23 */
+	__le16 PreloadSize;	/* 0x24 */
+	__le16 AmpduSeqCtl;	/* 0x25 */
+	__le16 TxFrameID;	/* 0x26 */
+	__le16 TxStatus;	/* 0x27 */
+	__le16 MaxNMpdus;	/* 0x28 */
+	__le16 MaxABytes_MRT;	/* 0x29 */
+	__le16 MaxABytes_FBR;	/* 0x2a */
+	__le16 MinMBytes;	/* 0x2b */
 	u8 RTSPhyHeader[D11_PHY_HDR_LEN];	/* 0x2c - 0x2e */
 	struct ieee80211_rts rts_frame;	/* 0x2f - 0x36 */
 	u16 PAD;		/* 0x37 */
@@ -1379,6 +1379,21 @@ struct shm_acparams {
  * RxTSFTime: RxTSFTime time of first MAC symbol + M_PHY_PLCPRX_DLY
  * RxChan: gain code, channel radio code, and phy type
  */
+struct d11rxhdr_le {
+	__le16 RxFrameSize;
+	u16 PAD;
+	__le16 PhyRxStatus_0;
+	__le16 PhyRxStatus_1;
+	__le16 PhyRxStatus_2;
+	__le16 PhyRxStatus_3;
+	__le16 PhyRxStatus_4;
+	__le16 PhyRxStatus_5;
+	__le16 RxStatus1;
+	__le16 RxStatus2;
+	__le16 RxTSFTime;
+	__le16 RxChan;
+} __packed;
+
 struct d11rxhdr {
 	u16 RxFrameSize;
 	u16 PAD;
@@ -1392,20 +1407,18 @@ struct d11rxhdr {
 	u16 RxStatus2;
 	u16 RxTSFTime;
 	u16 RxChan;
-} __packed;
+};
 
 /*
  * rxhdr: received frame header data
- * tsf_l: TSF_L reading
- * rssi: computed instanteneous rssi in BMAC
+ * rssi: rssi computed by PHY
  * rxpwr0: obsoleted, place holder for legacy ROM code. use rxpwr[]
  * rxpwr1: obsoleted, place holder for legacy ROM code. use rxpwr[]
  * do_rssi_ma: do per-pkt sampling for per-antenna ma in HIGH
  * rxpwr: rssi for supported antennas
  */
 struct brcms_d11rxhdr {
-	struct d11rxhdr rxhdr;
-	u32 tsf_l;
+	struct d11rxhdr rxh_cpu;
 	s8 rssi;
 	s8 rxpwr0;
 	s8 rxpwr1;
diff --git a/drivers/staging/brcm80211/brcmsmac/dma.c b/drivers/staging/brcm80211/brcmsmac/dma.c
index 714c74c..ef856ce 100644
--- a/drivers/staging/brcm80211/brcmsmac/dma.c
+++ b/drivers/staging/brcm80211/brcmsmac/dma.c
@@ -206,10 +206,10 @@
  * Descriptors are only read by the hardware, never written back.
  */
 struct dma64desc {
-	u32 ctrl1;	/* misc control bits & bufcount */
-	u32 ctrl2;	/* buffer count and address extension */
-	u32 addrlow;	/* memory address of the date buffer, bits 31:0 */
-	u32 addrhigh;	/* memory address of the date buffer, bits 63:32 */
+	__le32 ctrl1;	/* misc control bits & bufcount */
+	__le32 ctrl2;	/* buffer count and address extension */
+	__le32 addrlow;	/* memory address of the date buffer, bits 31:0 */
+	__le32 addrhigh; /* memory address of the date buffer, bits 63:32 */
 };
 
 /* dma engine software state */
@@ -295,15 +295,18 @@ struct dma_info {
 static uint dma_msg_level;
 
 /* Check for odd number of 1's */
-static u32 parity32(u32 data)
+static u32 parity32(__le32 data)
 {
-	data ^= data >> 16;
-	data ^= data >> 8;
-	data ^= data >> 4;
-	data ^= data >> 2;
-	data ^= data >> 1;
+	/* no swap needed for counting 1's */
+	u32 par_data = *(u32 *)&data;
 
-	return data & 1;
+	par_data ^= par_data >> 16;
+	par_data ^= par_data >> 8;
+	par_data ^= par_data >> 4;
+	par_data ^= par_data >> 2;
+	par_data ^= par_data >> 1;
+
+	return par_data & 1;
 }
 
 static bool dma64_dd_parity(struct dma64desc *dd)
@@ -873,13 +876,13 @@ static struct sk_buff *dma64_getnextrxp(struct dma_info *di, bool forceall)
 	rxp = di->rxp[i];
 	di->rxp[i] = NULL;
 
-	pa = cpu_to_le32(di->rxd64[i].addrlow) - di->dataoffsetlow;
+	pa = le32_to_cpu(di->rxd64[i].addrlow) - di->dataoffsetlow;
 
 	/* clear this packet from the descriptor ring */
 	pci_unmap_single(di->pbus, pa, di->rxbufsize, PCI_DMA_FROMDEVICE);
 
-	di->rxd64[i].addrlow = 0xdeadbeef;
-	di->rxd64[i].addrhigh = 0xdeadbeef;
+	di->rxd64[i].addrlow = cpu_to_le32(0xdeadbeef);
+	di->rxd64[i].addrhigh = cpu_to_le32(0xdeadbeef);
 
 	di->rxin = nextrxd(di, i);
 
@@ -917,7 +920,7 @@ struct sk_buff *dma_rx(struct dma_pub *pub)
 	if (head == NULL)
 		return NULL;
 
-	len = le16_to_cpu(*(u16 *) (head->data));
+	len = le16_to_cpu(*(__le16 *) (head->data));
 	DMA_TRACE(("%s: dma_rx len %d\n", di->name, len));
 	dma_spin_for_len(len, head);
 
@@ -1367,14 +1370,14 @@ struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range)
 		dma_addr_t pa;
 		uint size;
 
-		pa = cpu_to_le32(di->txd64[i].addrlow) - di->dataoffsetlow;
+		pa = le32_to_cpu(di->txd64[i].addrlow) - di->dataoffsetlow;
 
 		size =
-		    (cpu_to_le32(di->txd64[i].ctrl2) &
+		    (le32_to_cpu(di->txd64[i].ctrl2) &
 		     D64_CTRL2_BC_MASK);
 
-		di->txd64[i].addrlow = 0xdeadbeef;
-		di->txd64[i].addrhigh = 0xdeadbeef;
+		di->txd64[i].addrlow = cpu_to_le32(0xdeadbeef);
+		di->txd64[i].addrhigh = cpu_to_le32(0xdeadbeef);
 
 		txp = di->txp[i];
 		di->txp[i] = NULL;
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 1c45687..1fa95d7 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -89,9 +89,9 @@
 }
 
 struct firmware_hdr {
-	u32 offset;
-	u32 len;
-	u32 idx;
+	__le32 offset;
+	__le32 len;
+	__le32 idx;
 };
 
 static const char * const brcms_firmwares[MAX_FW_IMAGES] = {
@@ -243,7 +243,7 @@ static const struct ieee80211_supported_band brcms_band_2GHz_nphy_template = {
 		   .mcs = {
 			   /* placeholders for now */
 			   .rx_mask = {0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0},
-			   .rx_highest = 500,
+			   .rx_highest = cpu_to_le16(500),
 			   .tx_params = IEEE80211_HT_MCS_TX_DEFINED}
 		   }
 };
@@ -265,7 +265,7 @@ static const struct ieee80211_supported_band brcms_band_5GHz_nphy_template = {
 		   .mcs = {
 			   /* placeholders for now */
 			   .rx_mask = {0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0},
-			   .rx_highest = 500,
+			   .rx_highest = cpu_to_le16(500),
 			   .tx_params = IEEE80211_HT_MCS_TX_DEFINED}
 		   }
 };
@@ -1625,7 +1625,7 @@ int brcms_ucode_init_uint(struct brcms_info *wl, u32 *data, u32 idx)
 						  "ERROR: fw hdr len\n");
 					return -ENOMSG;
 				}
-				*data = le32_to_cpu(*((u32 *) pdata));
+				*data = le32_to_cpu(*((__le32 *) pdata));
 				return 0;
 			}
 		}
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 1a7d005..3e39407 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -338,9 +338,9 @@ static u16 frametype(u32 rspec, u8 mimoframe)
 #define XMTFIFOTBL_STARTREV	20
 
 struct d11init {
-	u16 addr;
-	u16 size;
-	u32 value;
+	__le16 addr;
+	__le16 size;
+	__le32 value;
 };
 
 /* currently the best mechanism for determining SIFS is the band in use */
@@ -666,7 +666,7 @@ static void brcms_c_write_inits(struct brcms_hardware *wlc_hw,
 
 	base = (u8 *)wlc_hw->regs;
 
-	for (i = 0; inits[i].addr != 0xffff; i++) {
+	for (i = 0; inits[i].addr != cpu_to_le16(0xffff); i++) {
 		size = le16_to_cpu(inits[i].size);
 		addr = base + le16_to_cpu(inits[i].addr);
 		value = le32_to_cpu(inits[i].value);
@@ -806,30 +806,33 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
 
 	/* process each frame */
 	while ((p = head) != NULL) {
+		struct d11rxhdr_le *rxh_le;
 		struct d11rxhdr *rxh;
 		head = head->prev;
 		p->prev = NULL;
 
-		wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;
+		rxh_le = (struct d11rxhdr_le *)p->data;
 		rxh = (struct d11rxhdr *)p->data;
+		wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;
 
 		/* fixup rx header endianness */
-		rxh->RxFrameSize = le16_to_cpu(rxh->RxFrameSize);
-		rxh->PhyRxStatus_0 = le16_to_cpu(rxh->PhyRxStatus_0);
-		rxh->PhyRxStatus_1 = le16_to_cpu(rxh->PhyRxStatus_1);
-		rxh->PhyRxStatus_2 = le16_to_cpu(rxh->PhyRxStatus_2);
-		rxh->PhyRxStatus_3 = le16_to_cpu(rxh->PhyRxStatus_3);
-		rxh->PhyRxStatus_4 = le16_to_cpu(rxh->PhyRxStatus_4);
-		rxh->PhyRxStatus_5 = le16_to_cpu(rxh->PhyRxStatus_5);
-		rxh->RxStatus1 = le16_to_cpu(rxh->RxStatus1);
-		rxh->RxStatus2 = le16_to_cpu(rxh->RxStatus2);
-		rxh->RxTSFTime = le16_to_cpu(rxh->RxTSFTime);
-		rxh->RxChan = le16_to_cpu(rxh->RxChan);
+		rxh->RxFrameSize = le16_to_cpu(rxh_le->RxFrameSize);
+		rxh->PhyRxStatus_0 = le16_to_cpu(rxh_le->PhyRxStatus_0);
+		rxh->PhyRxStatus_1 = le16_to_cpu(rxh_le->PhyRxStatus_1);
+		rxh->PhyRxStatus_2 = le16_to_cpu(rxh_le->PhyRxStatus_2);
+		rxh->PhyRxStatus_3 = le16_to_cpu(rxh_le->PhyRxStatus_3);
+		rxh->PhyRxStatus_4 = le16_to_cpu(rxh_le->PhyRxStatus_4);
+		rxh->PhyRxStatus_5 = le16_to_cpu(rxh_le->PhyRxStatus_5);
+		rxh->RxStatus1 = le16_to_cpu(rxh_le->RxStatus1);
+		rxh->RxStatus2 = le16_to_cpu(rxh_le->RxStatus2);
+		rxh->RxTSFTime = le16_to_cpu(rxh_le->RxTSFTime);
+		rxh->RxChan = le16_to_cpu(rxh_le->RxChan);
 
 		/*
 		 * compute the RSSI from d11rxhdr and record it in wlc_rxd11hr
 		 */
-		wlc_rxhdr->rssi = wlc_phy_rssi_compute(wlc_hw->band->pi, rxh);
+		wlc_rxhdr->rssi = (s8)wlc_phy_rssi_compute(wlc_hw->band->pi,
+							   rxh);
 		brcms_c_recv(wlc_hw->wlc, p);
 	}
 
@@ -888,7 +891,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
 		brcms_c_print_txstatus(txs);
 	}
 
-	if (txs->frameid != cpu_to_le16(txh->TxFrameID))
+	if (txs->frameid != le16_to_cpu(txh->TxFrameID))
 		goto fatal;
 	tx_info = IEEE80211_SKB_CB(p);
 	h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
@@ -907,7 +910,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
 		       "%s: Pkt tx suppressed, possibly channel %d\n",
 		       __func__, CHSPEC_CHANNEL(wlc->default_bss->chanspec));
 
-	tx_rts = cpu_to_le16(txh->MacTxControlLow) & TXC_SENDRTS;
+	tx_rts = le16_to_cpu(txh->MacTxControlLow) & TXC_SENDRTS;
 	tx_frame_count =
 	    (txs->status & TX_STATUS_FRM_RTX_MASK) >> TX_STATUS_FRM_RTX_SHIFT;
 	tx_rts_count =
@@ -1676,6 +1679,8 @@ brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset, int len,
 {
 	struct d11regs *regs;
 	u32 word;
+	__le32 word_le;
+	__be32 word_be;
 	bool be_bit;
 	BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
 
@@ -1691,10 +1696,13 @@ brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset, int len,
 	while (len > 0) {
 		memcpy(&word, buf, sizeof(u32));
 
-		if (be_bit)
-			word = cpu_to_be32(word);
-		else
-			word = cpu_to_le32(word);
+		if (be_bit) {
+			word_be = cpu_to_be32(word);
+			word = *(u32 *)&word_be;
+		} else {
+			word_le = cpu_to_le32(word);
+			word = *(u32 *)&word_le;
+		}
 
 		W_REG(&regs->tplatewrdata, word);
 
@@ -2437,8 +2445,9 @@ static void brcms_c_gpio_init(struct brcms_c_info *wlc)
 	ai_gpiocontrol(wlc_hw->sih, gm, gc, GPIO_DRV_PRIORITY);
 }
 
-static void brcms_ucode_write(struct brcms_hardware *wlc_hw, const u32 ucode[],
-			      const uint nbytes) {
+static void brcms_ucode_write(struct brcms_hardware *wlc_hw,
+			      const __le32 ucode[], const size_t nbytes)
+{
 	struct d11regs *regs = wlc_hw->regs;
 	uint i;
 	uint count;
@@ -4260,7 +4269,7 @@ void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
 	do {
 		memset((char *)&acp_shm, 0, sizeof(struct shm_acparams));
 		/* fill in shm ac params struct */
-		acp_shm.txop = le16_to_cpu(params->txop);
+		acp_shm.txop = params->txop;
 		/* convert from units of 32us to us for ucode */
 		wlc->edcf_txop[aci & 0x3] = acp_shm.txop =
 		    EDCF_TXOP2USEC(acp_shm.txop);
@@ -4313,16 +4322,11 @@ void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend)
 	u16 aci;
 	int i_ac;
 	struct ieee80211_tx_queue_params txq_pars;
-	struct ieee80211_tx_queue_params *params = &txq_pars;
 	static const struct edcf_acparam default_edcf_acparams[] = {
-		 {EDCF_AC_BE_ACI_STA, EDCF_AC_BE_ECW_STA,
-		  cpu_to_le16(EDCF_AC_BE_TXOP_STA)},
-		 {EDCF_AC_BK_ACI_STA, EDCF_AC_BK_ECW_STA,
-		  cpu_to_le16(EDCF_AC_BK_TXOP_STA)},
-		 {EDCF_AC_VI_ACI_STA, EDCF_AC_VI_ECW_STA,
-		  cpu_to_le16(EDCF_AC_VI_TXOP_STA)},
-		 {EDCF_AC_VO_ACI_STA, EDCF_AC_VO_ECW_STA,
-		  cpu_to_le16(EDCF_AC_VO_TXOP_STA)}
+		 {EDCF_AC_BE_ACI_STA, EDCF_AC_BE_ECW_STA, EDCF_AC_BE_TXOP_STA},
+		 {EDCF_AC_BK_ACI_STA, EDCF_AC_BK_ECW_STA, EDCF_AC_BK_TXOP_STA},
+		 {EDCF_AC_VI_ACI_STA, EDCF_AC_VI_ECW_STA, EDCF_AC_VI_TXOP_STA},
+		 {EDCF_AC_VO_ACI_STA, EDCF_AC_VO_ECW_STA, EDCF_AC_VO_TXOP_STA}
 	}; /* ucode needs these parameters during its initialization */
 	const struct edcf_acparam *edcf_acp = &default_edcf_acparams[0];
 
@@ -4331,15 +4335,15 @@ void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend)
 		aci = (edcf_acp->ACI & EDCF_ACI_MASK) >> EDCF_ACI_SHIFT;
 
 		/* fill in shm ac params struct */
-		params->txop = edcf_acp->TXOP;
-		params->aifs = edcf_acp->ACI;
+		txq_pars.txop = edcf_acp->TXOP;
+		txq_pars.aifs = edcf_acp->ACI;
 
 		/* CWmin = 2^(ECWmin) - 1 */
-		params->cw_min = EDCF_ECW2CW(edcf_acp->ECW & EDCF_ECWMIN_MASK);
+		txq_pars.cw_min = EDCF_ECW2CW(edcf_acp->ECW & EDCF_ECWMIN_MASK);
 		/* CWmax = 2^(ECWmax) - 1 */
-		params->cw_max = EDCF_ECW2CW((edcf_acp->ECW & EDCF_ECWMAX_MASK)
+		txq_pars.cw_max = EDCF_ECW2CW((edcf_acp->ECW & EDCF_ECWMAX_MASK)
 					    >> EDCF_ECWMAX_SHIFT);
-		brcms_c_wme_setparams(wlc, aci, params, suspend);
+		brcms_c_wme_setparams(wlc, aci, &txq_pars, suspend);
 	}
 
 	if (suspend)
@@ -8126,7 +8130,7 @@ static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
 	brcms_b_read_tsf(wlc->hw, &tsf_l, &tsf_h);
 
 	rx_tsf_16_31 = (u16)(tsf_l >> 16);
-	rx_tsf_0_15 = rxh->rxhdr.RxTSFTime;
+	rx_tsf_0_15 = rxh->rxh_cpu.RxTSFTime;
 
 	/*
 	 * a greater tsf time indicates the low 16 bits of
diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
index ce31959..0105306 100644
--- a/drivers/staging/brcm80211/brcmsmac/srom.c
+++ b/drivers/staging/brcm80211/brcmsmac/srom.c
@@ -822,14 +822,14 @@ static inline void ltoh16_buf(u16 *buf, unsigned int size)
 {
 	size /= 2;
 	while (size--)
-		*(buf + size) = le16_to_cpu(*(buf + size));
+		*(buf + size) = le16_to_cpu(*(__le16 *)(buf + size));
 }
 
 static inline void htol16_buf(u16 *buf, unsigned int size)
 {
 	size /= 2;
 	while (size--)
-		*(buf + size) = cpu_to_le16(*(buf + size));
+		*(__le16 *)(buf + size) = cpu_to_le16(*(buf + size));
 }
 
 /* Initialization of varbuf structure */
diff --git a/drivers/staging/brcm80211/brcmsmac/ucode_loader.h b/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
index 438675a..49d5b7e 100644
--- a/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
+++ b/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
@@ -35,10 +35,10 @@ struct brcms_ucode {
 	struct d11init *d11n0absinitvals16;
 	struct d11init *d11n0bsinitvals16;
 	struct d11init *d11n0initvals16;
-	u32 *bcm43xx_16_mimo;
-	u32 bcm43xx_16_mimosz;
-	u32 *bcm43xx_24_lcn;
-	u32 bcm43xx_24_lcnsz;
+	__le32 *bcm43xx_16_mimo;
+	size_t bcm43xx_16_mimosz;
+	__le32 *bcm43xx_24_lcn;
+	size_t bcm43xx_24_lcnsz;
 	u32 *bcm43xx_bommajor;
 	u32 *bcm43xx_bomminor;
 };
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 24/25] staging: brcm80211: simple changes to softmac phy variables
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Code cleanup resulting in less sparse warnings.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c |   14 -------------
 drivers/staging/brcm80211/brcmsmac/phy/phy_int.h |   23 ----------------------
 drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c |    2 +-
 3 files changed, 1 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index f9702c0..f31ebe2 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -111,20 +111,6 @@ static struct chan_info_basic chan_info_all[] = {
 	{216, 50800}
 };
 
-u16 ltrn_list[PHY_LTRN_LIST_LEN] = {
-	0x18f9, 0x0d01, 0x00e4, 0xdef4, 0x06f1, 0x0ffc,
-	0xfa27, 0x1dff, 0x10f0, 0x0918, 0xf20a, 0xe010,
-	0x1417, 0x1104, 0xf114, 0xf2fa, 0xf7db, 0xe2fc,
-	0xe1fb, 0x13ee, 0xff0d, 0xe91c, 0x171a, 0x0318,
-	0xda00, 0x03e8, 0x17e6, 0xe9e4, 0xfff3, 0x1312,
-	0xe105, 0xe204, 0xf725, 0xf206, 0xf1ec, 0x11fc,
-	0x14e9, 0xe0f0, 0xf2f6, 0x09e8, 0x1010, 0x1d01,
-	0xfad9, 0x0f04, 0x060f, 0xde0c, 0x001c, 0x0dff,
-	0x1807, 0xf61a, 0xe40e, 0x0f16, 0x05f9, 0x18ec,
-	0x0a1b, 0xff1e, 0x2600, 0xffe2, 0x0ae5, 0x1814,
-	0x0507, 0x0fea, 0xe4f2, 0xf6e6
-};
-
 const u8 ofdm_rate_lookup[] = {
 
 	BRCM_RATE_48M,
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index 8ce0159..1611521 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -247,9 +247,6 @@ enum phy_cal_mode {
 #define PUB_NOT_ASSOC(pi) \
 	(mboolisset(pi->measure_hold, PHY_HOLD_FOR_NOT_ASSOC))
 
-#define PHY_LTRN_LIST_LEN	64
-extern u16 ltrn_list[PHY_LTRN_LIST_LEN];
-
 struct phy_table_info {
 	uint table;
 	int q;
@@ -922,26 +919,6 @@ struct lcnphy_radio_regs {
 	u8 do_init_g;
 };
 
-extern struct lcnphy_radio_regs lcnphy_radio_regs_2064[];
-extern struct lcnphy_radio_regs lcnphy_radio_regs_2066[];
-
-extern struct radio_regs regs_2055[], regs_SYN_2056[], regs_TX_2056[],
-			 regs_RX_2056[];
-extern struct radio_regs regs_SYN_2056_A1[], regs_TX_2056_A1[],
-			 regs_RX_2056_A1[];
-extern struct radio_regs regs_SYN_2056_rev5[], regs_TX_2056_rev5[],
-			 regs_RX_2056_rev5[];
-extern struct radio_regs regs_SYN_2056_rev6[], regs_TX_2056_rev6[],
-			 regs_RX_2056_rev6[];
-extern struct radio_regs regs_SYN_2056_rev7[], regs_TX_2056_rev7[],
-			 regs_RX_2056_rev7[];
-extern struct radio_regs regs_SYN_2056_rev8[], regs_TX_2056_rev8[],
-			 regs_RX_2056_rev8[];
-
-extern struct radio_20xx_regs regs_2057_rev4[], regs_2057_rev5[],
-			      regs_2057_rev5v1[];
-extern struct radio_20xx_regs regs_2057_rev7[], regs_2057_rev8[];
-
 extern char *phy_getvar(struct brcms_phy *pi, const char *name);
 extern int phy_getintvar(struct brcms_phy *pi, const char *name);
 
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index fdcea56..bada928 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -575,7 +575,7 @@ static struct chan_info_2064_lcnphy chan_info_2064_lcnphy[] = {
 	{14, 2484, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
 };
 
-struct lcnphy_radio_regs lcnphy_radio_regs_2064[] = {
+static struct lcnphy_radio_regs lcnphy_radio_regs_2064[] = {
 	{0x00, 0, 0, 0, 0},
 	{0x01, 0x64, 0x64, 0, 0},
 	{0x02, 0x20, 0x20, 0, 0},
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 16/25] staging: brcm80211: various global var related changes in softmac
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c |   11 +----------
 drivers/staging/brcm80211/brcmsmac/main.h |    2 +-
 drivers/staging/brcm80211/brcmsmac/otp.c  |    4 ++--
 drivers/staging/brcm80211/brcmsmac/rate.h |    1 -
 drivers/staging/brcm80211/brcmsmac/srom.c |   15 +++++++++------
 5 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 7a14ab9..e34b511 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -428,8 +428,6 @@ const u8 wme_fifo2ac[] = { AC_BK, AC_BE, AC_VI, AC_VO, AC_BE, AC_BE };
 /* WME/802.1E Access Category to TX FIFO number */
 static const u8 wme_ac2fifo[] = { 1, 0, 2, 3 };
 
-static bool in_send_q;
-
 /* 802.1D Priority to precedence queue mapping */
 const u8 wlc_prio2prec_map[] = {
 	_BRCMS_PREC_BE,		/* 0 BE - Best-effort */
@@ -442,7 +440,7 @@ const u8 wlc_prio2prec_map[] = {
 	_BRCMS_PREC_NC,		/* 7 NC - Network Control */
 };
 
-static u16 xmtfifo_sz[][NFIFO] = {
+static const u16 xmtfifo_sz[][NFIFO] = {
 	/* corerev 20: 5120, 49152, 49152, 5376, 4352, 1280 */
 	{20, 192, 192, 21, 17, 5},
 	/* corerev 21: 2304, 14848, 5632, 3584, 3584, 1280 */
@@ -7716,11 +7714,6 @@ void brcms_c_send_q(struct brcms_c_info *wlc)
 	struct pktq *q = &qi->q;
 	struct ieee80211_tx_info *tx_info;
 
-	if (in_send_q)
-		return;
-	else
-		in_send_q = true;
-
 	prec_map = wlc->tx_prec_map;
 
 	/* Send all the enq'd pkts that we can.
@@ -7752,8 +7745,6 @@ void brcms_c_send_q(struct brcms_c_info *wlc)
 			prec_map = wlc->tx_prec_map;
 		}
 	}
-
-	in_send_q = false;
 }
 
 void
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 47665da..c938add 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -359,7 +359,7 @@ struct brcms_hardware {
 	u16 chanspec;	/* bmac chanspec shadow */
 
 	uint *txavail[NFIFO];	/* # tx descriptors available */
-	u16 *xmtfifo_sz;	/* fifo size in 256B for each xmt fifo */
+	const u16 *xmtfifo_sz;	/* fifo size in 256B for each xmt fifo */
 
 	u32 pllreq;		/* pll requests to keep PLL on */
 
diff --git a/drivers/staging/brcm80211/brcmsmac/otp.c b/drivers/staging/brcm80211/brcmsmac/otp.c
index 05c78c7..06cb575 100644
--- a/drivers/staging/brcm80211/brcmsmac/otp.c
+++ b/drivers/staging/brcm80211/brcmsmac/otp.c
@@ -80,7 +80,7 @@ struct otp_fn_s {
 
 struct otpinfo {
 	uint ccrev;		/* chipc revision */
-	struct otp_fn_s *fn;		/* OTP functions */
+	const struct otp_fn_s *fn;	/* OTP functions */
 	struct si_pub *sih;		/* Saved sb handle */
 
 	/* IPX OTP section */
@@ -442,7 +442,7 @@ static int ipxotp_nvread(struct otpinfo *oi, char *data, uint *len)
 	return -ENOTSUPP;
 }
 
-static struct otp_fn_s ipxotp_fn = {
+static const struct otp_fn_s ipxotp_fn = {
 	(int (*)(struct otpinfo *)) ipxotp_size,
 	(u16 (*)(struct otpinfo *, struct chipcregs *, uint)) ipxotp_read_bit,
 
diff --git a/drivers/staging/brcm80211/brcmsmac/rate.h b/drivers/staging/brcm80211/brcmsmac/rate.h
index 2cc66e0..e7b9dc2 100644
--- a/drivers/staging/brcm80211/brcmsmac/rate.h
+++ b/drivers/staging/brcm80211/brcmsmac/rate.h
@@ -27,7 +27,6 @@ extern const struct brcms_c_rateset cck_ofdm_rates;
 extern const struct brcms_c_rateset ofdm_rates;
 extern const struct brcms_c_rateset cck_rates;
 extern const struct brcms_c_rateset gphy_legacy_rates;
-extern const struct brcms_c_rateset wlc_lrs_rates;
 extern const struct brcms_c_rateset rate_limit_1_2;
 
 struct brcms_mcs_info {
diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
index 5bf0732..ce31959 100644
--- a/drivers/staging/brcm80211/brcmsmac/srom.c
+++ b/drivers/staging/brcm80211/brcmsmac/srom.c
@@ -778,7 +778,9 @@ static const struct brcms_sromvar perpath_pci_sromvars[] = {
 	{NULL, 0, 0, 0, 0}
 };
 
-static u8 srom_crc8_table[CRC8_TABLE_SIZE];
+/* crc table has the same contents for every device instance, so it can be
+ * shared between devices. */
+static u8 brcms_srom_crc8_table[CRC8_TABLE_SIZE];
 
 static u16 *srom_window_address(struct si_pub *sih, u8 *curmap)
 {
@@ -1052,8 +1054,9 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
 
 		/* fixup the endianness so crc8 will pass */
 		htol16_buf(buf, nwords * 2);
-		if (crc8(srom_crc8_table, (u8 *) buf, nwords * 2,
-			 CRC8_INIT_VALUE) != CRC8_GOOD_VALUE(srom_crc8_table))
+		if (crc8(brcms_srom_crc8_table, (u8 *) buf, nwords * 2,
+			 CRC8_INIT_VALUE) !=
+			 CRC8_GOOD_VALUE(brcms_srom_crc8_table))
 			/* DBG only pci always read srom4 first, then srom8/9 */
 			err = -EIO;
 
@@ -1089,8 +1092,8 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz)
 
 	/* fixup the endianness so crc8 will pass */
 	htol16_buf(buf, bufsz);
-	if (crc8(srom_crc8_table, (u8 *) buf, SROM4_WORDS * 2,
-		 CRC8_INIT_VALUE) != CRC8_GOOD_VALUE(srom_crc8_table))
+	if (crc8(brcms_srom_crc8_table, (u8 *) buf, SROM4_WORDS * 2,
+		 CRC8_INIT_VALUE) != CRC8_GOOD_VALUE(brcms_srom_crc8_table))
 		err = -EIO;
 
 	/* now correct the endianness of the byte array */
@@ -1147,7 +1150,7 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 
 	sromwindow = srom_window_address(sih, curmap);
 
-	crc8_populate_lsb(srom_crc8_table, SROM_CRC8_POLY);
+	crc8_populate_lsb(brcms_srom_crc8_table, SROM_CRC8_POLY);
 	if (ai_is_sprom_available(sih)) {
 		err = sprom_read_pci(sih, sromwindow, 0, srom, SROM_WORDS,
 				     true);
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 12/25] staging: brcm80211: remove dongle firmware related debug code
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Arend van Spriel <arend@broadcom.com>

When the device dies the driver could extract cpu registers on
the device to analyze the trap handling on the dongle. As the
firmware with this driver is stable this code does not belong
in the brcmfmac driver.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |  259 +------------------------
 1 files changed, 1 insertions(+), 258 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 9f8bcb3..4992d4d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -37,29 +37,7 @@
 
 #ifdef BCMDBG
 
-/* ARM trap handling */
-struct brcmf_trap {
-	u32 type;
-	u32 epc;
-	u32 cpsr;
-	u32 spsr;
-	u32 r0;
-	u32 r1;
-	u32 r2;
-	u32 r3;
-	u32 r4;
-	u32 r5;
-	u32 r6;
-	u32 r7;
-	u32 r8;
-	u32 r9;
-	u32 r10;
-	u32 r11;
-	u32 r12;
-	u32 r13;
-	u32 r14;
-	u32 pc;
-};
+#define BRCMF_TRAP_INFO_SIZE	80
 
 #define CBUF_LEN	(128)
 
@@ -2890,231 +2868,6 @@ xfer_done:
 }
 
 #ifdef BCMDBG
-static int
-brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
-{
-	u32 addr;
-	__le32 addr_le;
-	int rv;
-	struct sdpcm_shared_le sh_le;
-
-	/* Read last word in memory to determine address of
-			 sdpcm_shared structure */
-	rv = brcmf_sdbrcm_membytes(bus, false, bus->ramsize - 4, (u8 *)&addr_le,
-				   4);
-	if (rv < 0)
-		return rv;
-
-	addr = le32_to_cpu(addr_le);
-
-	brcmf_dbg(INFO, "sdpcm_shared address 0x%08X\n", addr);
-
-	/*
-	 * Check if addr is valid.
-	 * NVRAM length at the end of memory should have been overwritten.
-	 */
-	if (addr == 0 || ((~addr >> 16) & 0xffff) == (addr & 0xffff)) {
-		brcmf_dbg(ERROR, "address (0x%08x) of sdpcm_shared invalid\n",
-			  addr);
-		return -EBADE;
-	}
-
-	/* Read rte_shared structure */
-	rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *) &sh_le,
-			      sizeof(struct sdpcm_shared_le));
-	if (rv < 0)
-		return rv;
-
-	/* Endianness */
-	sh->flags = le32_to_cpu(sh_le.flags);
-	sh->trap_addr = le32_to_cpu(sh_le.trap_addr);
-	sh->assert_exp_addr = le32_to_cpu(sh_le.assert_exp_addr);
-	sh->assert_file_addr = le32_to_cpu(sh_le.assert_file_addr);
-	sh->assert_line = le32_to_cpu(sh_le.assert_line);
-	sh->console_addr = le32_to_cpu(sh_le.console_addr);
-	sh->msgtrace_addr = le32_to_cpu(sh_le.msgtrace_addr);
-	memcpy(sh->tag, sh_le.tag, sizeof(sh->tag));
-
-	if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
-		brcmf_dbg(ERROR, "sdpcm_shared version %d in brcmf is different than sdpcm_shared version %d in dongle\n",
-			  SDPCM_SHARED_VERSION,
-			  sh->flags & SDPCM_SHARED_VERSION_MASK);
-		return -EBADE;
-	}
-
-	return 0;
-}
-
-static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)
-{
-	int ret = 0;
-	int size;		/* Full mem size */
-	int start = 0;		/* Start address */
-	int read_size = 0;	/* Read size of each iteration */
-	u8 *buf = NULL, *databuf = NULL;
-
-	/* Get full mem size */
-	size = bus->ramsize;
-	buf = kmalloc(size, GFP_ATOMIC);
-	if (!buf)
-		return -1;
-
-	/* Read mem content */
-	printk(KERN_DEBUG "Dump dongle memory");
-	databuf = buf;
-	while (size) {
-		read_size = min(MEMBLOCK, size);
-		ret = brcmf_sdbrcm_membytes(bus, false, start, databuf,
-					  read_size);
-		if (ret) {
-			brcmf_dbg(ERROR, "Error membytes %d\n", ret);
-			kfree(buf);
-			return -1;
-		}
-		printk(".");
-
-		/* Decrement size and increment start address */
-		size -= read_size;
-		start += read_size;
-		databuf += read_size;
-	}
-	printk(KERN_DEBUG "Done\n");
-
-	/* free buf before return !!! */
-	if (brcmf_write_to_file(bus->drvr, buf, bus->ramsize)) {
-		brcmf_dbg(ERROR, "Error writing to files\n");
-		return -1;
-	}
-
-	/* buf free handled in brcmf_write_to_file, not here */
-	return 0;
-}
-
-static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
-{
-	int bcmerror = 0;
-	uint msize = 512;
-	char *mbuffer = NULL;
-	uint maxstrlen = 256;
-	char *str = NULL;
-	struct brcmf_trap tr;
-	struct sdpcm_shared sdpcm_shared;
-	struct brcmu_strbuf strbuf;
-
-	brcmf_dbg(TRACE, "Enter\n");
-
-	if (data == NULL) {
-		/*
-		 * Called after a rx ctrl timeout. "data" is NULL.
-		 * allocate memory to trace the trap or assert.
-		 */
-		size = msize;
-		mbuffer = data = kmalloc(msize, GFP_ATOMIC);
-		if (mbuffer == NULL) {
-			bcmerror = -ENOMEM;
-			goto done;
-		}
-	}
-
-	str = kmalloc(maxstrlen, GFP_ATOMIC);
-	if (str == NULL) {
-		bcmerror = -ENOMEM;
-		goto done;
-	}
-
-	bcmerror = brcmf_sdbrcm_readshared(bus, &sdpcm_shared);
-	if (bcmerror < 0)
-		goto done;
-
-	brcmu_binit(&strbuf, data, size);
-
-	brcmu_bprintf(&strbuf,
-		    "msgtrace address : 0x%08X\nconsole address  : 0x%08X\n",
-		    sdpcm_shared.msgtrace_addr, sdpcm_shared.console_addr);
-
-	if ((sdpcm_shared.flags & SDPCM_SHARED_ASSERT_BUILT) == 0)
-		/* NOTE: Misspelled assert is intentional - DO NOT FIX.
-		 * (Avoids conflict with real asserts for programmatic
-		 * parsing of output.)
-		 */
-		brcmu_bprintf(&strbuf, "Assrt not built in dongle\n");
-
-	if ((sdpcm_shared.flags & (SDPCM_SHARED_ASSERT | SDPCM_SHARED_TRAP)) ==
-	    0) {
-		/* NOTE: Misspelled assert is intentional - DO NOT FIX.
-		 * (Avoids conflict with real asserts for programmatic
-		 * parsing of output.)
-		 */
-		brcmu_bprintf(&strbuf, "No trap%s in dongle",
-			    (sdpcm_shared.flags & SDPCM_SHARED_ASSERT_BUILT)
-			    ? "/assrt" : "");
-	} else {
-		if (sdpcm_shared.flags & SDPCM_SHARED_ASSERT) {
-			/* Download assert */
-			brcmu_bprintf(&strbuf, "Dongle assert");
-			if (sdpcm_shared.assert_exp_addr != 0) {
-				str[0] = '\0';
-				bcmerror = brcmf_sdbrcm_membytes(bus, false,
-						sdpcm_shared.assert_exp_addr,
-						(u8 *) str, maxstrlen);
-				if (bcmerror < 0)
-					goto done;
-
-				str[maxstrlen - 1] = '\0';
-				brcmu_bprintf(&strbuf, " expr \"%s\"", str);
-			}
-
-			if (sdpcm_shared.assert_file_addr != 0) {
-				str[0] = '\0';
-				bcmerror = brcmf_sdbrcm_membytes(bus, false,
-						sdpcm_shared.assert_file_addr,
-						(u8 *) str, maxstrlen);
-				if (bcmerror < 0)
-					goto done;
-
-				str[maxstrlen - 1] = '\0';
-				brcmu_bprintf(&strbuf, " file \"%s\"", str);
-			}
-
-			brcmu_bprintf(&strbuf, " line %d ",
-				    sdpcm_shared.assert_line);
-		}
-
-		if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
-			bcmerror = brcmf_sdbrcm_membytes(bus, false,
-					sdpcm_shared.trap_addr, (u8 *)&tr,
-					sizeof(struct brcmf_trap));
-			if (bcmerror < 0)
-				goto done;
-
-			brcmu_bprintf(&strbuf,
-				    "Dongle trap type 0x%x @ epc 0x%x, cpsr 0x%x, spsr 0x%x, sp 0x%x,"
-				    "lp 0x%x, rpc 0x%x Trap offset 0x%x, "
-				    "r0 0x%x, r1 0x%x, r2 0x%x, r3 0x%x, r4 0x%x, r5 0x%x, r6 0x%x, r7 0x%x\n",
-				    tr.type, tr.epc, tr.cpsr, tr.spsr, tr.r13,
-				    tr.r14, tr.pc, sdpcm_shared.trap_addr,
-				    tr.r0, tr.r1, tr.r2, tr.r3, tr.r4, tr.r5,
-				    tr.r6, tr.r7);
-		}
-	}
-
-	if (sdpcm_shared.flags & (SDPCM_SHARED_ASSERT | SDPCM_SHARED_TRAP))
-		brcmf_dbg(ERROR, "%s\n", strbuf.origbuf);
-
-#ifdef BCMDBG
-	if (sdpcm_shared.flags & SDPCM_SHARED_TRAP)
-		/* Mem dump to a file on device */
-		brcmf_sdbrcm_mem_dump(bus);
-
-#endif				/* BCMDBG */
-
-done:
-	kfree(mbuffer);
-	kfree(str);
-
-	return bcmerror;
-}
-
 #define CONSOLE_LINE_MAX	192
 
 static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus)
@@ -3377,21 +3130,11 @@ brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
 			  rxlen, msglen);
 	} else if (timeleft == 0) {
 		brcmf_dbg(ERROR, "resumed on timeout\n");
-#ifdef BCMDBG
-		brcmf_sdbrcm_sdlock(bus);
-		brcmf_sdbrcm_checkdied(bus, NULL, 0);
-		brcmf_sdbrcm_sdunlock(bus);
-#endif				/* BCMDBG */
 	} else if (pending == true) {
 		brcmf_dbg(CTL, "cancelled\n");
 		return -ERESTARTSYS;
 	} else {
 		brcmf_dbg(CTL, "resumed for unknown reason?\n");
-#ifdef BCMDBG
-		brcmf_sdbrcm_sdlock(bus);
-		brcmf_sdbrcm_checkdied(bus, NULL, 0);
-		brcmf_sdbrcm_sdunlock(bus);
-#endif				/* BCMDBG */
 	}
 
 	if (rxlen)
-- 
1.7.1



^ permalink raw reply related

* [PATCH v3 06/25] staging: brcm80211: removed global vars in softmac ucode handling
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Moved global vars into a per-device structure.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c  |    4 +-
 drivers/staging/brcm80211/brcmsmac/mac80211_if.h  |    3 +-
 drivers/staging/brcm80211/brcmsmac/main.c         |   27 ++++--
 drivers/staging/brcm80211/brcmsmac/ucode_loader.c |  121 ++++++++++-----------
 drivers/staging/brcm80211/brcmsmac/ucode_loader.h |   46 +++++----
 5 files changed, 106 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 32d7abf..9bd4b83 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -894,7 +894,7 @@ static int brcms_request_fw(struct brcms_info *wl, struct pci_dev *pdev)
 		    wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr));
 	}
 	wl->fw.fw_cnt = i;
-	return brcms_ucode_data_init(wl);
+	return brcms_ucode_data_init(wl, &wl->ucode);
 }
 
 /*
@@ -925,7 +925,7 @@ static void brcms_free(struct brcms_info *wl)
 
 	/* free ucode data */
 	if (wl->fw.fw_cnt)
-		brcms_ucode_data_free();
+		brcms_ucode_data_free(&wl->ucode);
 	if (wl->irq)
 		free_irq(wl->irq, wl);
 
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
index 1eb36ed..2bdcd4c 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
@@ -19,7 +19,7 @@
 
 #include <linux/timer.h>
 #include <linux/interrupt.h>
-
+#include "ucode_loader.h"
 /*
  * Starting index for 5G rates in the
  * legacy rate table.
@@ -77,6 +77,7 @@ struct brcms_info {
 	bool resched;		/* dpc needs to be and is rescheduled */
 	struct brcms_firmware fw;
 	struct wiphy *wiphy;
+	struct brcms_ucode ucode;
 };
 
 /* misc callbacks */
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index ee9c322..4d5c842 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -342,6 +342,12 @@ static u16 frametype(u32 rspec, u8 mimoframe)
 /* Starting corerev for the fifo size table */
 #define XMTFIFOTBL_STARTREV	20
 
+struct d11init {
+	u16 addr;
+	u16 size;
+	u32 value;
+};
+
 /* currently the best mechanism for determining SIFS is the band in use */
 static u16 get_sifs(struct brcms_band *band)
 {
@@ -349,6 +355,7 @@ static u16 get_sifs(struct brcms_band *band)
 				 BPHY_SIFS_TIME;
 }
 
+
 /*
  * Detect Card removed.
  * Even checking an sbconfig register read will not false trigger when the core
@@ -694,6 +701,7 @@ static void brcms_c_write_mhf(struct brcms_hardware *wlc_hw, u16 *mhfs)
 static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
 {
 	struct wiphy *wiphy = wlc_hw->wlc->wiphy;
+	struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
 
 	/* init microcode host flags */
 	brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs);
@@ -701,7 +709,7 @@ static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
 	/* do band-specific ucode IHR, SHM, and SCR inits */
 	if (D11REV_IS(wlc_hw->corerev, 23)) {
 		if (BRCMS_ISNPHY(wlc_hw->band))
-			brcms_c_write_inits(wlc_hw, d11n0bsinitvals16);
+			brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16);
 		else
 			wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
 				  " %d\n", __func__, wlc_hw->unit,
@@ -710,7 +718,7 @@ static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
 		if (D11REV_IS(wlc_hw->corerev, 24)) {
 			if (BRCMS_ISLCNPHY(wlc_hw->band))
 				brcms_c_write_inits(wlc_hw,
-						    d11lcn0bsinitvals24);
+						    ucode->d11lcn0bsinitvals24);
 			else
 				wiphy_err(wiphy, "%s: wl%d: unsupported phy in"
 					  " core rev %d\n", __func__,
@@ -2457,6 +2465,8 @@ static void brcms_ucode_write(struct brcms_hardware *wlc_hw, const u32 ucode[],
 static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
 {
 	struct brcms_c_info *wlc;
+	struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
+
 	wlc = wlc_hw->wlc;
 
 	if (wlc_hw->ucode_loaded)
@@ -2464,8 +2474,8 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
 
 	if (D11REV_IS(wlc_hw->corerev, 23)) {
 		if (BRCMS_ISNPHY(wlc_hw->band)) {
-			brcms_ucode_write(wlc_hw, bcm43xx_16_mimo,
-					bcm43xx_16_mimosz);
+			brcms_ucode_write(wlc_hw, ucode->bcm43xx_16_mimo,
+					  ucode->bcm43xx_16_mimosz);
 			wlc_hw->ucode_loaded = true;
 		} else
 			wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in "
@@ -2473,8 +2483,8 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
 				  __func__, wlc_hw->unit, wlc_hw->corerev);
 	} else if (D11REV_IS(wlc_hw->corerev, 24)) {
 		if (BRCMS_ISLCNPHY(wlc_hw->band)) {
-			brcms_ucode_write(wlc_hw, bcm43xx_24_lcn,
-					bcm43xx_24_lcnsz);
+			brcms_ucode_write(wlc_hw, ucode->bcm43xx_24_lcn,
+					  ucode->bcm43xx_24_lcnsz);
 			wlc_hw->ucode_loaded = true;
 		} else {
 			wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in "
@@ -3372,6 +3382,7 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
 	int err = 0;
 	u16 buf[NFIFO];
 	struct wiphy *wiphy = wlc->wiphy;
+	struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
 
 	regs = wlc_hw->regs;
 
@@ -3404,14 +3415,14 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
 
 	if (D11REV_IS(wlc_hw->corerev, 23)) {
 		if (BRCMS_ISNPHY(wlc_hw->band))
-			brcms_c_write_inits(wlc_hw, d11n0initvals16);
+			brcms_c_write_inits(wlc_hw, ucode->d11n0initvals16);
 		else
 			wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
 				  " %d\n", __func__, wlc_hw->unit,
 				  wlc_hw->corerev);
 	} else if (D11REV_IS(wlc_hw->corerev, 24)) {
 		if (BRCMS_ISLCNPHY(wlc_hw->band))
-			brcms_c_write_inits(wlc_hw, d11lcn0initvals24);
+			brcms_c_write_inits(wlc_hw, ucode->d11lcn0initvals24);
 		else
 			wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
 				  " %d\n", __func__, wlc_hw->unit,
diff --git a/drivers/staging/brcm80211/brcmsmac/ucode_loader.c b/drivers/staging/brcm80211/brcmsmac/ucode_loader.c
index c14bce8..80e3ccf 100644
--- a/drivers/staging/brcm80211/brcmsmac/ucode_loader.c
+++ b/drivers/staging/brcm80211/brcmsmac/ucode_loader.c
@@ -37,80 +37,73 @@ enum {
 	D11UCODE_OVERSIGHT_BOMMINOR
 };
 
-struct d11init *d11lcn0bsinitvals24;
-struct d11init *d11lcn0initvals24;
-struct d11init *d11lcn1bsinitvals24;
-struct d11init *d11lcn1initvals24;
-struct d11init *d11lcn2bsinitvals24;
-struct d11init *d11lcn2initvals24;
-struct d11init *d11n0absinitvals16;
-struct d11init *d11n0bsinitvals16;
-struct d11init *d11n0initvals16;
-u32 *bcm43xx_16_mimo;
-u32 bcm43xx_16_mimosz;
-u32 *bcm43xx_24_lcn;
-u32 bcm43xx_24_lcnsz;
-
-static u32 *bcm43xx_bommajor;
-static u32 *bcm43xx_bomminor;
-
-int brcms_ucode_data_init(struct brcms_info *wl)
+int brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode)
 {
 	int rc;
+
 	rc = brcms_check_firmwares(wl);
 
 	rc = rc < 0 ? rc :
-		brcms_ucode_init_buf(wl, (void **)&d11lcn0bsinitvals24,
+		brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn0bsinitvals24,
 				     D11LCN0BSINITVALS24);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11lcn0initvals24,
-					     D11LCN0INITVALS24);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn0initvals24,
+				       D11LCN0INITVALS24);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn1bsinitvals24,
+				       D11LCN1BSINITVALS24);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn1initvals24,
+				       D11LCN1INITVALS24);
 	rc = rc < 0 ? rc :
-		brcms_ucode_init_buf(wl, (void **)&d11lcn1bsinitvals24,
-				     D11LCN1BSINITVALS24);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11lcn1initvals24,
-					     D11LCN1INITVALS24);
-	rc = rc < 0 ? rc :
-		brcms_ucode_init_buf(wl, (void **)&d11lcn2bsinitvals24,
+		brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn2bsinitvals24,
 				     D11LCN2BSINITVALS24);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11lcn2initvals24,
-					     D11LCN2INITVALS24);
-	rc = rc < 0 ? rc :
-		brcms_ucode_init_buf(wl, (void **)&d11n0absinitvals16,
-				     D11N0ABSINITVALS16);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11n0bsinitvals16,
-					     D11N0BSINITVALS16);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11n0initvals16,
-					     D11N0INITVALS16);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&bcm43xx_16_mimo,
-					     D11UCODE_OVERSIGHT16_MIMO);
-	rc = rc < 0 ? rc : brcms_ucode_init_uint(wl, &bcm43xx_16_mimosz,
-					      D11UCODE_OVERSIGHT16_MIMOSZ);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&bcm43xx_24_lcn,
-					     D11UCODE_OVERSIGHT24_LCN);
-	rc = rc < 0 ? rc : brcms_ucode_init_uint(wl, &bcm43xx_24_lcnsz,
-					      D11UCODE_OVERSIGHT24_LCNSZ);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&bcm43xx_bommajor,
-					     D11UCODE_OVERSIGHT_BOMMAJOR);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&bcm43xx_bomminor,
-					     D11UCODE_OVERSIGHT_BOMMINOR);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn2initvals24,
+				       D11LCN2INITVALS24);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11n0absinitvals16,
+				       D11N0ABSINITVALS16);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11n0bsinitvals16,
+				       D11N0BSINITVALS16);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11n0initvals16,
+				       D11N0INITVALS16);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->bcm43xx_16_mimo,
+				       D11UCODE_OVERSIGHT16_MIMO);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_uint(wl, &ucode->bcm43xx_16_mimosz,
+					D11UCODE_OVERSIGHT16_MIMOSZ);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->bcm43xx_24_lcn,
+				       D11UCODE_OVERSIGHT24_LCN);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_uint(wl, &ucode->bcm43xx_24_lcnsz,
+					D11UCODE_OVERSIGHT24_LCNSZ);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->bcm43xx_bommajor,
+				       D11UCODE_OVERSIGHT_BOMMAJOR);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->bcm43xx_bomminor,
+				       D11UCODE_OVERSIGHT_BOMMINOR);
 	return rc;
 }
 
-void brcms_ucode_data_free(void)
+void brcms_ucode_data_free(struct brcms_ucode *ucode)
 {
-	brcms_ucode_free_buf((void *)d11lcn0bsinitvals24);
-	brcms_ucode_free_buf((void *)d11lcn0initvals24);
-	brcms_ucode_free_buf((void *)d11lcn1bsinitvals24);
-	brcms_ucode_free_buf((void *)d11lcn1initvals24);
-	brcms_ucode_free_buf((void *)d11lcn2bsinitvals24);
-	brcms_ucode_free_buf((void *)d11lcn2initvals24);
-	brcms_ucode_free_buf((void *)d11n0absinitvals16);
-	brcms_ucode_free_buf((void *)d11n0bsinitvals16);
-	brcms_ucode_free_buf((void *)d11n0initvals16);
-	brcms_ucode_free_buf((void *)bcm43xx_16_mimo);
-	brcms_ucode_free_buf((void *)bcm43xx_24_lcn);
-	brcms_ucode_free_buf((void *)bcm43xx_bommajor);
-	brcms_ucode_free_buf((void *)bcm43xx_bomminor);
-
-	return;
+	brcms_ucode_free_buf((void *)ucode->d11lcn0bsinitvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn0initvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn1bsinitvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn1initvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn2bsinitvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn2initvals24);
+	brcms_ucode_free_buf((void *)ucode->d11n0absinitvals16);
+	brcms_ucode_free_buf((void *)ucode->d11n0bsinitvals16);
+	brcms_ucode_free_buf((void *)ucode->d11n0initvals16);
+	brcms_ucode_free_buf((void *)ucode->bcm43xx_16_mimo);
+	brcms_ucode_free_buf((void *)ucode->bcm43xx_24_lcn);
+	brcms_ucode_free_buf((void *)ucode->bcm43xx_bommajor);
+	brcms_ucode_free_buf((void *)ucode->bcm43xx_bomminor);
 }
diff --git a/drivers/staging/brcm80211/brcmsmac/ucode_loader.h b/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
index ca53dec..438675a 100644
--- a/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
+++ b/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
@@ -13,6 +13,8 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+#ifndef	_BRCM_UCODE_H_
+#define	_BRCM_UCODE_H_
 
 #include "types.h"		/* forward structure declarations */
 
@@ -21,28 +23,30 @@
 
 #define UCODE_LOADER_API_VER 0
 
-struct d11init {
-	u16 addr;
-	u16 size;
-	u32 value;
+struct d11init;
+
+struct brcms_ucode {
+	struct d11init *d11lcn0bsinitvals24;
+	struct d11init *d11lcn0initvals24;
+	struct d11init *d11lcn1bsinitvals24;
+	struct d11init *d11lcn1initvals24;
+	struct d11init *d11lcn2bsinitvals24;
+	struct d11init *d11lcn2initvals24;
+	struct d11init *d11n0absinitvals16;
+	struct d11init *d11n0bsinitvals16;
+	struct d11init *d11n0initvals16;
+	u32 *bcm43xx_16_mimo;
+	u32 bcm43xx_16_mimosz;
+	u32 *bcm43xx_24_lcn;
+	u32 bcm43xx_24_lcnsz;
+	u32 *bcm43xx_bommajor;
+	u32 *bcm43xx_bomminor;
 };
 
-extern struct d11init *d11lcn0bsinitvals24;
-extern struct d11init *d11lcn0initvals24;
-extern struct d11init *d11lcn1bsinitvals24;
-extern struct d11init *d11lcn1initvals24;
-extern struct d11init *d11lcn2bsinitvals24;
-extern struct d11init *d11lcn2initvals24;
-extern struct d11init *d11n0absinitvals16;
-extern struct d11init *d11n0bsinitvals16;
-extern struct d11init *d11n0initvals16;
-extern u32 *bcm43xx_16_mimo;
-extern u32 bcm43xx_16_mimosz;
-extern u32 *bcm43xx_24_lcn;
-extern u32 bcm43xx_24_lcnsz;
-
-extern int brcms_ucode_data_init(struct brcms_info *wl);
-extern void brcms_ucode_data_free(void);
+extern int
+brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
+
+extern void brcms_ucode_data_free(struct brcms_ucode *ucode);
 
 extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf,
 				unsigned int idx);
@@ -50,3 +54,5 @@ extern int brcms_ucode_init_uint(struct brcms_info *wl, unsigned *data,
 			      unsigned int idx);
 extern void brcms_ucode_free_buf(void *);
 extern int  brcms_check_firmwares(struct brcms_info *wl);
+
+#endif	/* _BRCM_UCODE_H_ */
-- 
1.7.1



^ permalink raw reply related

* Re: 答复: 答复: 答复: 答复: RTL8192SE and 802.11n problem
From: Stefan Zwanenburg @ 2011-09-29 23:15 UTC (permalink / raw)
  To: 李朝明; +Cc: 'Larry Finger', linux-wireless
In-Reply-To: <0EF5E594196F41B48B0B4D168B714838@realsil.com.cn>

On 09/29/2011 10:55 AM, 李朝明 wrote:
> Dear Larry:
>
> 	I don't kown why this efuse is wrong, did Zwanenburg use the same
> driver with yours ?
Hi!
I may be no Larry, but I just diffed the latest version of the
drivers/net/wireless/rtlwifi directory (obtained from the github mirror
of linus' repository) with the one from the kernel I'm currently
running, and I don't notice a whole lot of changes (besides code
cleanups and differences in the debugging macro "calls"), but there is
something going on in efuse.c with no more "hoffset" variable in
efuse_get_current size, but that shouldn't matter, as the variable was
assigned but never used again.
I also see there was a whole lot of work put into pci.c, as it looks
it's had a revamp. I'm not sure it will fix my problems, but I'm going
to try to run 3.1-rc4 and see if I can get an 802.11n link going.

I'll get back to you on how that went later!

Stefan Zwanenburg

^ permalink raw reply

* Re: 答复: 答复: 答复: 答复: RTL8192SE and 802.11n problem
From: Stefan Zwanenburg @ 2011-09-29 23:58 UTC (permalink / raw)
  To: 李朝明; +Cc: 'Larry Finger', linux-wireless
In-Reply-To: <4E84FBF6.2020609@gmail.com>

On 09/30/2011 01:15 AM, Stefan Zwanenburg wrote:
> On 09/29/2011 10:55 AM, 李朝明 wrote:
>> Dear Larry:
>>
>> 	I don't kown why this efuse is wrong, did Zwanenburg use the same
>> driver with yours ?
> Hi!
> I may be no Larry, but I just diffed the latest version of the
> drivers/net/wireless/rtlwifi directory (obtained from the github mirror
> of linus' repository) with the one from the kernel I'm currently
> running, and I don't notice a whole lot of changes (besides code
> cleanups and differences in the debugging macro "calls"), but there is
> something going on in efuse.c with no more "hoffset" variable in
> efuse_get_current size, but that shouldn't matter, as the variable was
> assigned but never used again.
> I also see there was a whole lot of work put into pci.c, as it looks
> it's had a revamp. I'm not sure it will fix my problems, but I'm going
> to try to run 3.1-rc4 and see if I can get an 802.11n link going.
>
> I'll get back to you on how that went later!
>
> Stefan Zwanenburg
Well, I just compiled 3.0-rc4, and I'm now running it, but alas, still
no 802.11n link to my AP, and (perhaps unsurprisingly) the EEPROM that
gets dumped upon detecting the PCI NIC is exactly the same as it was
before, so there couldn't be some problem with the EFUSE reading code.
I guess that leaves us with the possibility my AP is not sending some
packets (see Larry's message about that) during the association, which
makes the driver not work as it should...
Is there anything else I can try to help you guys figure out what may be
wrong?

Stefan Zwanenburg

PS: I'll keep running this kernel for a few days to see if I get the
same problem as in mentioned in the discussion "3.1-rc6 + rtl8192se
issue", even though I apparently don't have the very latest kernel source.

^ permalink raw reply

* Re: The Problem of RTL8188ce in Ubuntu 11.04
From: Larry Finger @ 2011-09-30  3:15 UTC (permalink / raw)
  To: Cao, Chongxiao; +Cc: wlanfae@realtek.com, chaoming_li@realsil.com.cn, wireless
In-Reply-To: <38894CC285ECBF438599CFCE9811CAB109CFA1FB@CH1PRD0202MB136.namprd02.prod.outlook.com>

On 09/29/2011 09:19 PM, Cao, Chongxiao wrote:
> Dear Sir,
>
> I'm a graduate student in University of Tennessee. I just bought the Thinkpad
> T420 laptop that uses the RTL8188CE chipset.
>
> I installed the Ubuntu 11.04. However, my wireless networking is very unstable
> in Ubuntu 11.04. The speed of wireless networking is very slow and it always get
> disconnected in every 2 minutes.
>
> I always do my research projects in Ubuntu so the wireless networking in Ubuntu
> is very important to me.
>
> I have searched on Google to solve this problem and found that lots of people
> have the same problem. I have tried installed the newest driver of RTL8188ce
> from the website of Realtek, but it doesn't work.
>
> Would you please help me deal with this problem? I would appreciate your help.

First of all, not everyone has trouble with rtl8192ce. Neither I nor the Realtek 
group can reproduce the troubles that you describe. Because of that we are not 
able to figure out what people are seeing.

The driver in the standard kernel used in Ubuntu 11.04 has been revised. If 
possible, you should obtain the compat-wireless package built for Ubuntu. If it 
does not exist, then get the compat-wireless source and build the package. That 
will get you the latest set of fixes.

One thing you might try is loading the module with the parameter "ips=0".

Larry

^ permalink raw reply

* [PATCH 1/2] mwifiex: correct AMSDU aggregation check
From: Bing Zhao @ 2011-09-30  3:43 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

The commit "mwifiex: remove list traversal.."(fcf2176c87..)
wrongly modifies AMSDU aggregation check. Due to this even though
packet size for iperf traffic is already large, we unnecessarily
try to aggregate them which adds some delay. If Tx iperf is started
on UUT for 30 seconds, UUT keeps sending Tx packets for few more
seconds.

That commit is reverted to fix the problem.
Also, MIN_NUM_AMSDU check is moved inside the loop to optimize the
loop.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/11n_aggr.c |    2 -
 drivers/net/wireless/mwifiex/11n_aggr.h |    1 +
 drivers/net/wireless/mwifiex/main.h     |    1 -
 drivers/net/wireless/mwifiex/wmm.c      |   32 +++++++++++++++++++++++-------
 4 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index 1a453a6..9e63d16 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -193,7 +193,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
 		skb_src = skb_dequeue(&pra_list->skb_head);
 
 		pra_list->total_pkts_size -= skb_src->len;
-		pra_list->total_pkts--;
 
 		atomic_dec(&priv->wmm.tx_pkts_queued);
 
@@ -269,7 +268,6 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
 		skb_queue_tail(&pra_list->skb_head, skb_aggr);
 
 		pra_list->total_pkts_size += skb_aggr->len;
-		pra_list->total_pkts++;
 
 		atomic_inc(&priv->wmm.tx_pkts_queued);
 
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.h b/drivers/net/wireless/mwifiex/11n_aggr.h
index 9c6dca7..900e1c6 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.h
+++ b/drivers/net/wireless/mwifiex/11n_aggr.h
@@ -21,6 +21,7 @@
 #define _MWIFIEX_11N_AGGR_H_
 
 #define PKT_TYPE_AMSDU	0xE6
+#define MIN_NUM_AMSDU 2
 
 int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv,
 				struct sk_buff *skb);
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 4f40428..907ab74 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -173,7 +173,6 @@ struct mwifiex_ra_list_tbl {
 	struct sk_buff_head skb_head;
 	u8 ra[ETH_ALEN];
 	u32 total_pkts_size;
-	u32 total_pkts;
 	u32 is_11n_enabled;
 };
 
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 69e260b..eda2447 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -121,7 +121,6 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, u8 *ra)
 	memcpy(ra_list->ra, ra, ETH_ALEN);
 
 	ra_list->total_pkts_size = 0;
-	ra_list->total_pkts = 0;
 
 	dev_dbg(adapter->dev, "info: allocated ra_list %p\n", ra_list);
 
@@ -648,7 +647,6 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
 	skb_queue_tail(&ra_list->skb_head, skb);
 
 	ra_list->total_pkts_size += skb->len;
-	ra_list->total_pkts++;
 
 	atomic_inc(&priv->wmm.tx_pkts_queued);
 
@@ -975,6 +973,28 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter,
 }
 
 /*
+ * This function checks if 11n aggregation is possible.
+ */
+static int
+mwifiex_is_11n_aggragation_possible(struct mwifiex_private *priv,
+				    struct mwifiex_ra_list_tbl *ptr,
+				    int max_buf_size)
+{
+	int count = 0, total_size = 0;
+	struct sk_buff *skb, *tmp;
+
+	skb_queue_walk_safe(&ptr->skb_head, skb, tmp) {
+		total_size += skb->len;
+		if (total_size >= max_buf_size)
+			break;
+		if (++count >= MIN_NUM_AMSDU)
+			return true;
+	}
+
+	return false;
+}
+
+/*
  * This function sends a single packet to firmware for transmission.
  */
 static void
@@ -1001,7 +1021,6 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
 	dev_dbg(adapter->dev, "data: dequeuing the packet %p %p\n", ptr, skb);
 
 	ptr->total_pkts_size -= skb->len;
-	ptr->total_pkts--;
 
 	if (!skb_queue_empty(&ptr->skb_head))
 		skb_next = skb_peek(&ptr->skb_head);
@@ -1027,7 +1046,6 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
 		skb_queue_tail(&ptr->skb_head, skb);
 
 		ptr->total_pkts_size += skb->len;
-		ptr->total_pkts++;
 		tx_info->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT;
 		spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
 				       ra_list_flags);
@@ -1213,11 +1231,9 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
 				mwifiex_send_delba(priv, tid_del, ra, 1);
 			}
 		}
-/* Minimum number of AMSDU */
-#define MIN_NUM_AMSDU 2
-
 		if (mwifiex_is_amsdu_allowed(priv, tid) &&
-				(ptr->total_pkts >= MIN_NUM_AMSDU))
+		    mwifiex_is_11n_aggragation_possible(priv, ptr,
+							adapter->tx_buf_size))
 			mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN,
 						  ptr_index, flags);
 			/* ra_list_spinlock has been freed in
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 2/2] mwifiex: handle an error path correctly
From: Bing Zhao @ 2011-09-30  3:43 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1317354221-13688-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

In failure case locks are not allocated in mwifiex_register().
So mwifiex_free_lock_list() routine call becomes redundant.
Also we don't need to check return type for mwifiex_init_lock_list()
routine. It never fails.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/main.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 8b05b4f..8486451 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -75,8 +75,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
 	adapter->priv_num++;
 
 	adapter->priv[0]->adapter = adapter;
-	if (mwifiex_init_lock_list(adapter))
-		goto error;
+	mwifiex_init_lock_list(adapter);
 
 	init_timer(&adapter->cmd_timer);
 	adapter->cmd_timer.function = mwifiex_cmd_timeout_func;
@@ -87,8 +86,6 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
 error:
 	dev_dbg(adapter->dev, "info: leave mwifiex_register with error\n");
 
-	mwifiex_free_lock_list(adapter);
-
 	for (i = 0; i < adapter->priv_num; i++)
 		kfree(adapter->priv[i]);
 
-- 
1.7.0.2


^ permalink raw reply related

* Re: Bluetooth regression with headphones
From: Jeremy Fitzhardinge @ 2011-09-30  4:52 UTC (permalink / raw)
  To: Linux Kernel Mailing List, linux-bluetooth, linux-wireless,
	Keith Packard, Waldemar Rymarkiewicz, Luiz Augusto von Dentz,
	Ilia Kolomisnky
In-Reply-To: <20110929200122.GF2605@joana>

[-- Attachment #1: Type: text/plain, Size: 25335 bytes --]

On 09/29/2011 01:01 PM, Gustavo Padovan wrote:
> Hi Jeremy,
>
> * Jeremy Fitzhardinge <jeremy@goop.org> [2011-09-29 10:47:37 -0700]:
>
>> On 09/16/2011 03:38 PM, Jeremy Fitzhardinge wrote:
>>> On 09/16/2011 03:33 PM, Jeremy Fitzhardinge wrote:
>>>> On 09/12/2011 06:33 PM, Jeremy Fitzhardinge wrote:
>>>>> Hi all,
>>>>>
>>>>> I reported a regression in connecting my Nokia BH-905i headphones in
>>>>> June this year (https://lkml.org/lkml/2011/6/23/770), which was the same
>>>>> problem Keith Packard reported in https://lkml.org/lkml/2011/6/9/63.  
>>>>> It was briefly fixed in
>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-2.6.git.
>>>>>
>>>>> Unfortunately it regressed again by the time of the linux-3.0 release,
>>>>> to something with similar symptoms: the headphones won't reliably
>>>>> connect to my laptop unless I freshly re-pair them.  However, unlike the
>>>>> original bug, they will very occasionally connect normally, though I
>>>>> don't know why.
>>>>>
>>>>> This behaviour has been consistent since 3.0 up until the current
>>>>> 3.1-rc6 kernel.
>>>>>
>>>>> What further information can I provide?  How can I help debug this?
>>>> I turned on debugging by running "bluetoothd -n -d", and got the
>>>> following when trying to connect my headphones:
>>>>
>>>> Sep 16 15:30:47 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: HEADSET_STATE_DISCONNECTED -> HEADSET_STATE_CONNECTING
>>>> Sep 16 15:30:47 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>>> Sep 16 15:30:47 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:remote_features_information() hci0 status 0
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:remote_name_information() hci0 status 0
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_channel() Discovered Handsfree service on channel 1
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:rfcomm_connect() /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: Connecting to 00:0B:E4:A6:6C:0D channel 1
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() hci0 dba 00:0B:E4:A6:6C:0D
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() kernel auth requirements = 0x04
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() Matching key found
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() link key type 0x04
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:auth_complete() hci0 status 0
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_bonding_process_complete() status=00
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_bonding_process_complete() no pending auth request
>>>> Sep 16 15:30:50 saboo bluetoothd[22025]: bluetoothd[22025]: Permission denied (13)
>>>> Sep 16 15:30:50 saboo bluetoothd[22025]: Permission denied (13)
>>>> Sep 16 15:30:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: HEADSET_STATE_CONNECTING -> HEADSET_STATE_DISCONNECTED
>>>> Sep 16 15:30:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>>>
>>> And I get this when I successfully re-pair and connect the headphones:
>>>
>>> Sep 16 15:36:30 saboo bluetoothd[22025]: Discovery session 0x7f1059478630 with :1.326 activated
>>> Sep 16 15:36:30 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_start_inquiry() hci0 length 8 periodic 1
>>> Sep 16 15:36:30 saboo bluetoothd[22025]: bluetoothd[22025]: Discovery session 0x7f1059478630 with :1.326 activated
>>> Sep 16 15:36:30 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:session_ref() 0x7f1059478630: ref=1
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:session_unref() 0x7f1059478630: ref=0
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:session_remove() Discovery session 0x7f1059478630 with :1.326 deactivated
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:session_remove() Stopping discovery
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_stop_inquiry() hci0
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: Stopping discovery
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: Stopping discovery
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: Inquiry Failed with status 0x12
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: Inquiry Failed with status 0x12
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_create_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:device_create() Creating device /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_ref() 0x7f105947ef70: ref=1
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:bonding_request_new() Requesting bonding for 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:bonding_request_new() Temporary agent registered for 00:0B:E4:A6:6C:0D at :1.326:/org/bluez/agent/wizard
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:remote_features_information() hci0 status 0
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:remote_name_information() hci0 status 0
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() hci0 dba 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() kernel auth requirements = 0x03
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() Matching key not found
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:io_capa_request() hci0 IO capability request for 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_get_auth_info() hci0 dba 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_get_io_cap() initial authentication requirement is 0x03
>>> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_get_io_cap() final authentication requirement is 0x03
>>> Sep 16 15:36:44 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:io_capa_response() hci0 IO capability response from 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:44 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:user_confirm_request() hci0
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_get_auth_info() hci0 dba 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() confirm IO capabilities are 0x01
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() confirm authentication requirement is 0x03
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() remote IO capabilities are 0x03
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() remote authentication requirement is 0x02
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() auto accept of confirmation
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_confirm_reply() hci0 dba 00:0B:E4:A6:6C:0D success 1
>>> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:device_request_authentication() Requesting agent authentication for 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:simple_pairing_complete() hci0 status 0
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_simple_pairing_complete() status=00
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_notify() hci0 dba 00:0B:E4:A6:6C:0D type 4
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_get_auth_info() hci0 dba 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_link_key_notify() key type 0x04 old key type 0xff new key type 0x04
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_link_key_notify() local auth 0x03 and remote auth 0x02
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_link_key_notify() storing link key of type 0x04
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:auth_complete() hci0 status 0
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_bonding_process_complete() status=00
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_ref() 0x7f105947ef70: ref=2
>>> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/agent.c:agent_release() Releasing agent :1.326, /org/bluez/agent/wizard
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:device_probe_drivers() Probing drivers for 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: serial/manager.c:serial_probe() path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: 0000111e-0000-1000-8000-00805f9b34fb
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: serial/port.c:create_serial_device() Registered interface org.bluez.Serial on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: serial/manager.c:serial_probe() path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: 00001108-0000-1000-8000-00805f9b34fb
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: input/manager.c:headset_probe() path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_ref() 0x7f105947ef70: ref=3
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: input/device.c:input_device_new() Registered interface org.bluez.Input on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_ref() 0x7f105947ef70: ref=4
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/device.c:audio_device_register() Registered interface org.bluez.Audio on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found Headset record
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_init() Registered interface org.bluez.Headset on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found Handsfree record
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found Audio Sink
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:sink_init() Registered interface org.bluez.AudioSink on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found AV Target
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:control_init() Registered interface org.bluez.Control on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found AV Remote
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_unref() 0x7f105947ef70: ref=3
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: HEADSET_STATE_DISCONNECTED -> HEADSET_STATE_CONNECTING
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_channel() Discovered Handsfree service on channel 1
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:rfcomm_connect() /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: Connecting to 00:0B:E4:A6:6C:0D channel 1
>>> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_connect_cb() /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: Connected to 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+BRSF=25
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:print_hf_features() HFP HF features: "EC and/or NR function" "Voice recognition activation" "Remote volume control"
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+CIND=?
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+CIND?
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+CMER=3, 0, 0, 1
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:event_reporting() Event reporting (CMER): mode=3, ind=1
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:hfp_slc_complete() HFP Service Level Connection established
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/telephony.c:telephony_device_connected() telephony-dummy: device 0x7f1059492390 connected
>>> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: HEADSET_STATE_CONNECTING -> HEADSET_STATE_CONNECTED
>>> Sep 16 15:36:52 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+VGS=10
>>> Sep 16 15:36:52 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+VGM=10
>>> Sep 16 15:36:52 saboo bluetoothd[22025]: Badly formated or unrecognized command: AT+CSRSF=1,1,1,1,1,7
>>> Sep 16 15:36:52 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+CSRSF=1,1,1,1,1,7
>>> Sep 16 15:36:52 saboo bluetoothd[22025]: bluetoothd[22025]: Badly formated or unrecognized command: AT+CSRSF=1,1,1,1,1,7
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_ref() 0x7f105947b330: ref=2
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_ref() 0x7f105947b330: ref=3
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:sink_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: SINK_STATE_DISCONNECTED -> SINK_STATE_CONNECTING
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_unref() 0x7f105947b330: ref=2
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_connect_cb() AVDTP: connected signaling channel to 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_connect_cb() AVDTP imtu=672, omtu=895
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:avctp_set_state() AVCTP Connecting
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() DISCOVER request succeeded
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_discover_resp() seid 1 type 1 media 0 in use 0
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_discover_resp() seid 2 type 1 media 0 in use 0
>>> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_discover_resp() seid 4 type 1 media 0 in use 0
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() GET_CAPABILITIES request succeeded
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_get_capabilities_resp() seid 1 type 1 media 0
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() GET_CAPABILITIES request succeeded
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_get_capabilities_resp() seid 2 type 1 media 0
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() GET_CAPABILITIES request succeeded
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_get_capabilities_resp() seid 4 type 1 media 0
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:discovery_complete() Discovery complete
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_ref() 0x7f105947b330: ref=3
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_ref() 0x7f105947e3f0: ref=1
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:a2dp_config() a2dp_config: selected SEP 0x7f1059476ad0
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_ref() 0x7f105947e3f0: ref=2
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_set_configuration() 0x7f105947b330: int_seid=1, acp_seid=1
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_unref() 0x7f105947e3f0: ref=1
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() SET_CONFIGURATION request succeeded
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setconf_cfm() Source 0x7f1059476ad0: Set_Configuration_Cfm
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_sep_set_state() stream state changed: IDLE -> CONFIGURED
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:avctp_connect_cb() AVCTP: connected to 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:54 saboo kernel: [93473.952314] input: 00:0B:E4:A6:6C:0D as /devices/virtual/input/input31
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:init_uinput() AVRCP: uinput initialized for 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:avctp_set_state() AVCTP Connected
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() OPEN request succeeded
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_connect_cb() AVDTP: connected transport channel to 00:0B:E4:A6:6C:0D
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:handle_transport_connect() sk 29, omtu 895, send buffer size 63488
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:open_cfm() Source 0x7f1059476ad0: Open_Cfm
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:stream_setup_complete() Stream successfully created
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_unref() 0x7f105947e3f0: ref=0
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_free() 0x7f105947e3f0
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_unref() 0x7f105947b330: ref=2
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_sep_set_state() stream state changed: CONFIGURED -> OPEN
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:sink_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: SINK_STATE_CONNECTING -> SINK_STATE_CONNECTED
>>> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/unix.c:server_cb() Accepted new client connection on unix socket (fd=30)
>>> Sep 16 15:36:54 saboo rsyslogd-2177: imuxsock begins to drop messages from pid 22025 due to rate-limiting
>>> Sep 16 22:36:54 saboo rtkit-daemon[1543]: Successfully made thread 22178 of process 1866 (/usr/bin/pulseaudio) owned by '500' RT at priority 5.
>>> Sep 16 15:36:55 saboo rsyslogd-2177: imuxsock lost 52 messages from pid 22025 due to rate-limiting
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() START request succeeded
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:start_cfm() Source 0x7f1059476ad0: Start_Cfm
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/unix.c:unix_ipc_sendmsg() Audio API: BT_RESPONSE -> BT_START_STREAM
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/unix.c:unix_ipc_sendmsg() Audio API: BT_RESPONSE -> BT_NEW_STREAM
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_unref() 0x7f105947e3f0: ref=0
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_free() 0x7f105947e3f0
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_unref() 0x7f105947b330: ref=3
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_sep_set_state() stream state changed: OPEN -> STREAMING
>>> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:sink_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: SINK_STATE_CONNECTED -> SINK_STATE_PLAYING
>>>
>>> Thanks,
>>> 	J
>>
>> I tried to bisect this with inconclusive results.
>>
>> Firstly, it was all working fine up until 13d39315 "Bluetooth: Map
>> sec_level to link key requirements".  This had a couple of known bugs
>> fixed with 6fdf658c "Bluetooth: Fix L2CAP security check" and 33060542
>> "Bluetooth: Fix L2CAP connection establishment".  When I cherry-picked
>> just those onto 13d39315 it all seems to work well again.
>>
>> However, after that, it regresses again, and reconnection gets pretty
>> unreliable.  From bisection of a linearized history of the net/bluetooth
>> changes, it appears that 60b83f57 "Bluetooth: Ignore key unauthenticated
>> for high security" is at least part of the problem, and when I revert it
>> from the bluetooth branch it seems to help; but when I revert it from an
>> overall v3.1 linux.git head, it doesn't, so perhaps something else in
>> there is also causing a problem.
>>
>> It seems clear that all the new stricter enforcement of security stuff
>> is upsetting my headphone's reconnection, but I've reached the limit of
>> how much I can diagnose this without some pointers, because I don't
>> really know anything about bluetooth.
>>
>> How can I help fix this?
> Can you send me the hcidump logs of both the working and not working
> scenarios? It helps a lot find issues.
>

OK, here's some traces.

These were all with a current linux.git tip of tree without rebooting. I
got it to connect several times successfully, which is unusually
frequent (perhaps its timing related and hcidump helped?).

The two failures are once when initiating the connection from the
headphones, and the other from within the gnome3 bluetooth gui.

Thanks,
    J

[-- Attachment #2: v3.1-successful-disconnect.txt --]
[-- Type: text/plain, Size: 3201 bytes --]

HCI sniffer - Bluetooth packet analyzer ver 2.0
device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
2011-09-29 14:00:19.029654 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2011-09-29 14:00:24.734091 > ACL data: handle 12 flags 0x02 dlen 7
    L2CAP(d): cid 0x0042 len 3 [psm 0]
      0000: 10 0a 04                                          ...
2011-09-29 14:00:24.734835 < ACL data: handle 12 flags 0x00 dlen 6
    0000: 02 00 43 00 12 0a                                 ..C...
2011-09-29 14:00:24.734858 < HCI Command: Exit Sniff Mode (0x02|0x0004) plen 2
    handle 12
2011-09-29 14:00:24.739573 > HCI Event: Max Slots Change (0x1b) plen 3
    handle 12 slots 5
2011-09-29 14:00:24.740478 > HCI Event: Mode Change (0x14) plen 6
    status 0x00 handle 12 mode 0x00 interval 0
    Mode: Active
2011-09-29 14:00:24.741473 > HCI Event: Command Status (0x0f) plen 4
    Exit Sniff Mode (0x02|0x0004) status 0x0c ncmd 1
    Error: Command Disallowed
2011-09-29 14:00:24.875229 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0041 scid 0x0044
2011-09-29 14:00:24.875533 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 07 0d 04 00  41 00 44 00              ........A.D.
2011-09-29 14:00:24.876466 > ACL data: handle 12 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 6b 53 01 06                                       kS..
2011-09-29 14:00:24.876654 < ACL data: handle 12 flags 0x00 dlen 8
    0000: 04 00 41 00 6b 73 01 2c                           ..A.ks.,
2011-09-29 14:00:24.879561 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 14:00:24.984086 > ACL data: handle 12 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 03 53 01 fd                                       .S..
2011-09-29 14:00:24.984484 < ACL data: handle 12 flags 0x00 dlen 8
    0000: 04 00 41 00 03 73 01 d7                           ..A..s..
2011-09-29 14:00:24.988485 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 14:00:25.016467 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0043 scid 0x0045
2011-09-29 14:00:25.016675 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 07 0e 04 00  43 00 45 00              ........C.E.
2011-09-29 14:00:25.017711 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0041
2011-09-29 14:00:25.017783 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 07 0f 04 00  40 00 41 00              ........@.A.
2011-09-29 14:00:25.022558 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 14:00:26.031508 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0042 scid 0x0043
2011-09-29 14:00:26.032171 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 07 10 04 00  42 00 43 00              ........B.C.
2011-09-29 14:00:26.164538 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 1
2011-09-29 14:00:26.464548 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 12 reason 0x13
    Reason: Remote User Terminated Connection

[-- Attachment #3: v3.1-failed-device-connect.txt --]
[-- Type: text/plain, Size: 10625 bytes --]

HCI sniffer - Bluetooth packet analyzer ver 2.0
device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
2011-09-29 14:00:42.067241 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2011-09-29 14:00:48.223231 > HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:0B:E4:A6:6C:0D class 0x240404 type ACL
2011-09-29 14:00:48.223380 < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:0B:E4:A6:6C:0D role 0x00
    Role: Master
2011-09-29 14:00:48.225134 > HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
2011-09-29 14:00:48.388140 > HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D role 0x00
    Role: Master
2011-09-29 14:00:48.555229 > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 11 bdaddr 00:0B:E4:A6:6C:0D type ACL encrypt 0x00
2011-09-29 14:00:48.555476 < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 11
2011-09-29 14:00:48.557128 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
2011-09-29 14:00:48.558126 > HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 11
    Features: 0xff 0xfe 0x0f 0xc6 0x9b 0xff 0x59 0x83
2011-09-29 14:00:48.558234 < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 11 page 1
2011-09-29 14:00:48.560131 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
2011-09-29 14:00:48.566136 > HCI Event: Max Slots Change (0x1b) plen 3
    handle 11 slots 5
2011-09-29 14:00:48.597222 > HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 11 page 1 max 1
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
2011-09-29 14:00:48.597451 < HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:0B:E4:A6:6C:0D mode 2 clkoffset 0x0000
2011-09-29 14:00:48.599227 > HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2011-09-29 14:00:48.641497 > ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 1 scid 0x0040
2011-09-29 14:00:48.641628 < ACL data: handle 11 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 02 08 00  40 00 40 00 01 00 00 00  ........@.@.....
2011-09-29 14:00:48.641640 < ACL data: handle 11 flags 0x00 dlen 10
    0000: 06 00 01 00 0a 01 02 00  02 00                    ..........
2011-09-29 14:00:48.652867 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0000
2011-09-29 14:00:48.652952 < ACL data: handle 11 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 02 08 00  40 00 40 00 00 00 00 00  ........@.@.....
2011-09-29 14:00:48.652962 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 01 00 04 02 04 00  40 00 00 00              ........@...
2011-09-29 14:00:48.657117 > HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D name 'Nokia BH-905i'
2011-09-29 14:00:48.658129 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:00:48.659123 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:00:48.666690 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 48 
2011-09-29 14:00:48.666912 < ACL data: handle 11 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 03 0a 00  40 00 00 00 00 00 01 02  ........@.......
    0010: 30 00                                             0.
2011-09-29 14:00:48.667871 > ACL data: handle 11 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
      Success
2011-09-29 14:00:48.701625 > ACL data: handle 11 flags 0x02 dlen 24
    L2CAP(d): cid 0x0040 len 20 [psm 0]
      0000: 06 00 01 00 0f 35 05 1a  00 00 11 1f 00 26 35 03  .....5.......&5.
      0010: 09 00 04 00                                       ....
2011-09-29 14:00:48.701968 < ACL data: handle 11 flags 0x00 dlen 33
    0000: 1d 00 40 00 07 00 01 00  18 00 15 35 13 35 11 09  ..@........5.5..
    0010: 00 04 35 0c 35 03 19 01  00 35 05 19 00 03 08 0d  ..5.5....5......
    0020: 00                                                .
2011-09-29 14:00:48.706148 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:00:48.736495 > ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
2011-09-29 14:00:48.736574 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 01 00 07 04 04 00  40 00 40 00              ........@.@.
2011-09-29 14:00:48.879221 > HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 14:00:48.879895 < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr 00:0B:E4:A6:6C:0D key 08AB2E2A1319F534321C46393A25B42D
2011-09-29 14:00:48.887206 > HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 14:00:48.914122 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 1
2011-09-29 14:00:48.981219 > HCI Event: Encrypt Change (0x08) plen 4
    status 0x00 handle 11 encrypt 0x01
2011-09-29 14:00:48.984117 > ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 3 scid 0x0041
2011-09-29 14:00:48.984277 < ACL data: handle 11 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 05 08 00  40 00 41 00 00 00 00 00  ........@.A.....
2011-09-29 14:00:48.984286 < ACL data: handle 11 flags 0x00 dlen 16
    0000: 0c 00 01 00 04 03 08 00  41 00 00 00 01 02 f5 03  ........A.......
2011-09-29 14:00:48.990122 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:00:49.020425 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 895 
2011-09-29 14:00:49.020601 < ACL data: handle 11 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 06 0a 00  41 00 00 00 00 00 01 02  ........A.......
    0010: 7f 03                                             ..
2011-09-29 14:00:49.021667 > ACL data: handle 11 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 1013 
2011-09-29 14:00:49.055368 > ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 03 3f 01 1c                                       .?..
2011-09-29 14:00:49.055578 < ACL data: handle 11 flags 0x00 dlen 8
    0000: 04 00 41 00 03 73 01 d7                           ..A..s..
2011-09-29 14:00:49.060224 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:00:49.165464 > ACL data: handle 11 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 0]
      0000: 03 ef 15 83 11 1a f0 00  00 7e 00 00 00 70        .........~...p
2011-09-29 14:00:49.165779 < ACL data: handle 11 flags 0x00 dlen 18
    0000: 0e 00 41 00 01 ef 15 81  11 1a e0 00 00 7e 00 00  ..A..........~..
    0010: 07 aa                                             ..
2011-09-29 14:00:49.200392 > ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 6b 3f 01 e7                                       k?..
2011-09-29 14:00:49.200555 < HCI Command: Authentication Requested (0x01|0x0011) plen 2
    handle 11
2011-09-29 14:00:49.202130 > HCI Event: Command Status (0x0f) plen 4
    Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
2011-09-29 14:00:49.203117 > HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 14:00:49.203516 < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr 00:0B:E4:A6:6C:0D key 08AB2E2A1319F534321C46393A25B42D
2011-09-29 14:00:49.215121 > HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 14:00:49.241116 > HCI Event: Auth Complete (0x06) plen 3
    status 0x00 handle 11
2011-09-29 14:00:49.241478 < ACL data: handle 11 flags 0x00 dlen 8
    0000: 04 00 41 00 6b 73 01 2c                           ..A.ks.,
2011-09-29 14:00:49.241508 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 41 00 01 ef 09 e3  05 6b 8d aa              ..A......k..
2011-09-29 14:00:49.310216 > HCI Event: Encryption Key Refresh Complete (0x30) plen 3
    status 0x00 handle 11
2011-09-29 14:00:49.415139 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 1
2011-09-29 14:01:07.669939 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2011-09-29 14:01:28.153554 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2011-09-29 14:01:48.894509 > ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 6b 53 01 06                                       kS..
2011-09-29 14:01:48.894991 < ACL data: handle 11 flags 0x00 dlen 8
    0000: 04 00 41 00 6b 73 01 2c                           ..A.ks.,
2011-09-29 14:01:48.964261 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:01:49.029557 > ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 69 1f 01 ac                                       i...
2011-09-29 14:01:49.030753 > ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 03 53 01 fd                                       .S..
2011-09-29 14:01:49.031083 < ACL data: handle 11 flags 0x00 dlen 8
    0000: 04 00 41 00 03 73 01 d7                           ..A..s..
2011-09-29 14:01:49.099600 > ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 69 1f 01 ac                                       i...
2011-09-29 14:01:49.101304 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:01:49.170876 > ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0041
2011-09-29 14:01:49.171015 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 01 00 07 07 04 00  40 00 41 00              ........@.A.
2011-09-29 14:01:49.415302 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 1
2011-09-29 14:01:49.654252 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 11 reason 0x13
    Reason: Remote User Terminated Connection
2011-09-29 14:01:49.917247 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2011-09-29 14:02:18.068927 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2011-09-29 14:02:44.944550 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00

[-- Attachment #4: v3.1-failed-host-connect.txt --]
[-- Type: text/plain, Size: 6757 bytes --]

HCI sniffer - Bluetooth packet analyzer ver 2.0
device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
2011-09-29 14:03:09.257112 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2011-09-29 14:03:11.442616 < HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr 00:0B:E4:A6:6C:0D ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 
2011-09-29 14:03:11.444074 > HCI Event: Command Status (0x0f) plen 4
    Create Connection (0x01|0x0005) status 0x00 ncmd 1
2011-09-29 14:03:11.742155 > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 11 bdaddr 00:0B:E4:A6:6C:0D type ACL encrypt 0x00
2011-09-29 14:03:11.742425 < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 11
2011-09-29 14:03:11.744064 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
2011-09-29 14:03:11.745064 > HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 11
    Features: 0xff 0xfe 0x0f 0xc6 0x9b 0xff 0x59 0x83
2011-09-29 14:03:11.745252 < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 11 page 1
2011-09-29 14:03:11.747069 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
2011-09-29 14:03:11.755067 > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 00:0B:E4:A6:6C:0D mode 1
2011-09-29 14:03:11.756061 > HCI Event: Max Slots Change (0x1b) plen 3
    handle 11 slots 5
2011-09-29 14:03:11.803075 > HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 11 page 1 max 1
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
2011-09-29 14:03:11.803217 < HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:0B:E4:A6:6C:0D mode 2 clkoffset 0x0000
2011-09-29 14:03:11.803232 < ACL data: handle 11 flags 0x00 dlen 10
    0000: 06 00 01 00 0a 01 02 00  02 00                    ..........
2011-09-29 14:03:11.805141 > HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2011-09-29 14:03:11.840072 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0000
2011-09-29 14:03:11.840261 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 01 00 02 02 04 00  01 00 40 00              ..........@.
2011-09-29 14:03:11.849932 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0042 scid 0x0040 result 1 status 2
      Connection pending - Authorization pending
2011-09-29 14:03:11.852481 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0042 scid 0x0040 result 0 status 0
      Connection successful
2011-09-29 14:03:11.852645 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 01 00 04 03 04 00  42 00 00 00              ........B...
2011-09-29 14:03:11.856142 > HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D name 'Nokia BH-905i'
2011-09-29 14:03:11.857059 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:03:11.887445 > ACL data: handle 11 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
      Success
2011-09-29 14:03:11.888677 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 48 
2011-09-29 14:03:11.888916 < ACL data: handle 11 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 02 0a 00  42 00 00 00 00 00 01 02  ........B.......
    0010: 30 00                                             0.
2011-09-29 14:03:11.888997 < ACL data: handle 11 flags 0x00 dlen 24
    0000: 14 00 42 00 06 00 00 00  0f 35 03 19 11 1e ff ff  ..B......5......
    0010: 35 05 0a 00 00 ff ff 00                           5.......
2011-09-29 14:03:11.893061 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:03:11.918808 > ACL data: handle 11 flags 0x02 dlen 52
    L2CAP(d): cid 0x0040 len 48 [psm 0]
      0000: 07 00 00 00 2b 00 26 36  00 5c 36 00 59 09 00 00  ....+.&6.\6.Y...
      0010: 0a 00 01 00 00 09 00 01  35 06 19 11 1e 19 12 03  ........5.......
      0020: 09 00 04 35 0c 35 03 19  01 00 35 05 19 02 00 39  ...5.5....5....9
2011-09-29 14:03:11.918996 < ACL data: handle 11 flags 0x00 dlen 26
    0000: 16 00 42 00 06 00 01 00  11 35 03 19 11 1e ff ff  ..B......5......
    0010: 35 05 0a 00 00 ff ff 02  00 39                    5........9
2011-09-29 14:03:11.923083 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:03:11.930055 > ACL data: handle 11 flags 0x02 dlen 52
    L2CAP(d): cid 0x0040 len 48 [psm 0]
      0000: 07 00 01 00 2b 00 26 00  03 08 01 09 00 06 35 09  ....+.&.......5.
      0010: 09 65 6e 09 00 6a 09 01  00 09 00 09 35 08 35 06  .en..j......5.5.
      0020: 19 11 1e 09 01 05 09 01  00 25 0f 48 61 02 00 13  .........%.Ha...
2011-09-29 14:03:11.930228 < ACL data: handle 11 flags 0x00 dlen 26
    0000: 16 00 42 00 06 00 02 00  11 35 03 19 11 1e ff ff  ..B......5......
    0010: 35 05 0a 00 00 ff ff 02  00 13                    5.........
2011-09-29 14:03:11.964933 > ACL data: handle 11 flags 0x02 dlen 31
    L2CAP(d): cid 0x0040 len 27 [psm 0]
      0000: 07 00 02 00 16 00 13 6e  64 73 2d 46 72 65 65 20  .......nds-Free 
      0010: 75 6e 69 74 09 03 11 09  00 19 00                 unit.......
2011-09-29 14:03:11.965287 < HCI Command: Authentication Requested (0x01|0x0011) plen 2
    handle 11
2011-09-29 14:03:11.967056 > HCI Event: Command Status (0x0f) plen 4
    Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
2011-09-29 14:03:11.968080 > HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 14:03:11.968322 < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr 00:0B:E4:A6:6C:0D key 08AB2E2A1319F534321C46393A25B42D
2011-09-29 14:03:11.979080 > HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 14:03:12.006084 > HCI Event: Auth Complete (0x06) plen 3
    status 0x00 handle 11
2011-09-29 14:03:12.006161 < ACL data: handle 11 flags 0x00 dlen 12
    0000: 08 00 01 00 02 04 04 00  03 00 41 00              ..........A.
2011-09-29 14:03:12.009052 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
2011-09-29 14:03:12.015065 > ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0043 scid 0x0041 result 1 status 2
      Connection pending - Authorization pending
2011-09-29 14:03:14.167024 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 11 reason 0x05
    Reason: Authentication Failure

[-- Attachment #5: v3.1-successful.txt --]
[-- Type: text/plain, Size: 30928 bytes --]

HCI sniffer - Bluetooth packet analyzer ver 2.0
device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
2011-09-29 13:59:22.971462 > HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:0B:E4:A6:6C:0D class 0x240404 type ACL
2011-09-29 13:59:22.971639 < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:0B:E4:A6:6C:0D role 0x00
    Role: Master
2011-09-29 13:59:22.973362 > HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
2011-09-29 13:59:23.515454 > HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D role 0x00
    Role: Master
2011-09-29 13:59:23.783362 > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 12 bdaddr 00:0B:E4:A6:6C:0D type ACL encrypt 0x00
2011-09-29 13:59:23.783681 < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 12
2011-09-29 13:59:23.785359 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
2011-09-29 13:59:23.786352 > HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 12
    Features: 0xff 0xfe 0x0f 0xc6 0x9b 0xff 0x59 0x83
2011-09-29 13:59:23.786467 < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 12 page 1
2011-09-29 13:59:23.788355 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
2011-09-29 13:59:23.853398 > HCI Event: Max Slots Change (0x1b) plen 3
    handle 12 slots 5
2011-09-29 13:59:24.192436 > HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 12 page 1 max 1
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
2011-09-29 13:59:24.192834 < HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:0B:E4:A6:6C:0D mode 2 clkoffset 0x0000
2011-09-29 13:59:24.194388 > HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2011-09-29 13:59:24.261146 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 1 scid 0x0040
2011-09-29 13:59:24.261453 < ACL data: handle 12 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 02 08 00  40 00 40 00 01 00 00 00  ........@.@.....
2011-09-29 13:59:24.261463 < ACL data: handle 12 flags 0x00 dlen 10
    0000: 06 00 01 00 0a 01 02 00  02 00                    ..........
2011-09-29 13:59:24.345420 > HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D name 'Nokia BH-905i'
2011-09-29 13:59:24.346338 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:24.396251 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0000
2011-09-29 13:59:24.396390 < ACL data: handle 12 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 02 08 00  40 00 40 00 00 00 00 00  ........@.@.....
2011-09-29 13:59:24.396406 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 04 02 04 00  40 00 00 00              ........@...
2011-09-29 13:59:24.465349 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:24.531314 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 48 
2011-09-29 13:59:24.531621 < ACL data: handle 12 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 03 0a 00  40 00 00 00 00 00 01 02  ........@.......
    0010: 30 00                                             0.
2011-09-29 13:59:24.532511 > ACL data: handle 12 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
      Success
2011-09-29 13:59:24.668686 > ACL data: handle 12 flags 0x02 dlen 24
    L2CAP(d): cid 0x0040 len 20 [psm 0]
      0000: 06 00 01 00 0f 35 05 1a  00 00 11 1f 00 26 35 03  .....5.......&5.
      0010: 09 00 04 00                                       ....
2011-09-29 13:59:24.669362 < ACL data: handle 12 flags 0x00 dlen 33
    0000: 1d 00 40 00 07 00 01 00  18 00 15 35 13 35 11 09  ..@........5.5..
    0010: 00 04 35 0c 35 03 19 01  00 35 05 19 00 03 08 0d  ..5.5....5......
    0020: 00                                                .
2011-09-29 13:59:24.737436 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:24.804964 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
2011-09-29 13:59:24.805133 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 07 04 04 00  40 00 40 00              ........@.@.
2011-09-29 13:59:25.009388 > HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 13:59:25.009956 < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr 00:0B:E4:A6:6C:0D key 08AB2E2A1319F534321C46393A25B42D
2011-09-29 13:59:25.018340 > HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 13:59:25.038329 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 1
2011-09-29 13:59:25.493371 > HCI Event: Encrypt Change (0x08) plen 4
    status 0x00 handle 12 encrypt 0x01
2011-09-29 13:59:25.494822 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 3 scid 0x0041
2011-09-29 13:59:25.494924 < ACL data: handle 12 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 05 08 00  40 00 41 00 00 00 00 00  ........@.A.....
2011-09-29 13:59:25.494933 < ACL data: handle 12 flags 0x00 dlen 16
    0000: 0c 00 01 00 04 03 08 00  41 00 00 00 01 02 f5 03  ........A.......
2011-09-29 13:59:25.565375 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:25.631295 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 895 
2011-09-29 13:59:25.631486 < ACL data: handle 12 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 06 0a 00  41 00 00 00 00 00 01 02  ........A.......
    0010: 7f 03                                             ..
2011-09-29 13:59:25.632494 > ACL data: handle 12 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 1013 
2011-09-29 13:59:25.768792 > ACL data: handle 12 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 03 3f 01 1c                                       .?..
2011-09-29 13:59:25.769182 < ACL data: handle 12 flags 0x00 dlen 8
    0000: 04 00 41 00 03 73 01 d7                           ..A..s..
2011-09-29 13:59:25.837378 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:25.903662 > ACL data: handle 12 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 0]
      0000: 03 ef 15 83 11 1a f0 00  00 7e 00 00 00 70        .........~...p
2011-09-29 13:59:25.903961 < ACL data: handle 12 flags 0x00 dlen 18
    0000: 0e 00 41 00 01 ef 15 81  11 1a e0 00 00 7e 00 00  ..A..........~..
    0010: 07 aa                                             ..
2011-09-29 13:59:26.038581 > ACL data: handle 12 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 0]
      0000: 6b 3f 01 e7                                       k?..
2011-09-29 13:59:26.038954 < HCI Command: Authentication Requested (0x01|0x0011) plen 2
    handle 12
2011-09-29 13:59:26.041418 > HCI Event: Command Status (0x0f) plen 4
    Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
2011-09-29 13:59:26.042316 > HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 13:59:26.042725 < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr 00:0B:E4:A6:6C:0D key 08AB2E2A1319F534321C46393A25B42D
2011-09-29 13:59:26.053328 > HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr 00:0B:E4:A6:6C:0D
2011-09-29 13:59:26.163412 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 1
2011-09-29 13:59:26.174328 > HCI Event: Auth Complete (0x06) plen 3
    status 0x00 handle 12
2011-09-29 13:59:26.175519 < ACL data: handle 12 flags 0x00 dlen 8
    0000: 04 00 41 00 6b 73 01 2c                           ..A.ks.,
2011-09-29 13:59:26.175550 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 41 00 01 ef 09 e3  05 6b 8d aa              ..A......k..
2011-09-29 13:59:26.646333 > HCI Event: Encryption Key Refresh Complete (0x30) plen 3
    status 0x00 handle 12
2011-09-29 13:59:26.715408 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:26.782530 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 0]
      0000: 03 ef 09 e1 05 6b 8d 70                           .....k.p
2011-09-29 13:59:26.783631 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 0]
      0000: 03 ef 09 e3 05 6b 0d 70                           .....k.p
2011-09-29 13:59:26.783766 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 41 00 01 ef 09 e1  05 6b 0d aa              ..A......k..
2011-09-29 13:59:26.783792 < ACL data: handle 12 flags 0x00 dlen 9
    0000: 05 00 41 00 69 ff 01 21  22                       ..A.i..!"
2011-09-29 13:59:26.785479 > ACL data: handle 12 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 0]
      0000: 6b ff 01 0f f8                                    k....
2011-09-29 13:59:26.851236 > ACL data: handle 12 flags 0x02 dlen 19
    L2CAP(d): cid 0x0040 len 15 [psm 0]
      0000: 6b ef 17 41 54 2b 42 52  53 46 3d 32 35 0d e4     k..AT+BRSF=25..
2011-09-29 13:59:26.851652 < ACL data: handle 12 flags 0x00 dlen 22
    0000: 12 00 41 00 69 ef 1d 0d  0a 2b 42 52 53 46 3a 20  ..A.i....+BRSF: 
    0010: 33 35 32 0d 0a 3e                                 352..>
2011-09-29 13:59:26.851682 < ACL data: handle 12 flags 0x00 dlen 14
    0000: 0a 00 41 00 69 ef 0d 0d  0a 4f 4b 0d 0a 3e        ..A.i....OK..>
2011-09-29 13:59:26.854408 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:26.920406 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:27.053798 > ACL data: handle 12 flags 0x02 dlen 19
    L2CAP(d): cid 0x0040 len 15 [psm 0]
      0000: 6b ff 15 02 41 54 2b 43  49 4e 44 3d 3f 0d f8     k...AT+CIND=?..
2011-09-29 13:59:27.054372 < ACL data: handle 12 flags 0x00 dlen 134
    0000: 82 00 41 00 69 ef fd 0d  0a 2b 43 49 4e 44 3a 20  ..A.i....+CIND: 
    0010: 28 22 62 61 74 74 63 68  67 22 2c 28 30 2d 35 29  ("battchg",(0-5)
    0020: 29 2c 28 22 73 69 67 6e  61 6c 22 2c 28 30 2d 35  ),("signal",(0-5
    0030: 29 29 2c 28 22 73 65 72  76 69 63 65 22 2c 28 30  )),("service",(0
    0040: 2c 31 29 29 2c 28 22 63  61 6c 6c 22 2c 28 30 2c  ,1)),("call",(0,
    0050: 31 29 29 2c 28 22 63 61  6c 6c 73 65 74 75 70 22  1)),("callsetup"
    0060: 2c 28 30 2d 33 29 29 2c  28 22 63 61 6c 6c 68 65  ,(0-3)),("callhe
    0070: 6c 64 22 2c 28 30 2d 32  29 29 2c 28 22 72 6f 61  ld",(0-2)),("roa
    0080: 6d 22 2c 28 30 3e                                 m",(0>
2011-09-29 13:59:27.054406 < ACL data: handle 12 flags 0x00 dlen 14
    0000: 0a 00 41 00 69 ef 0d 2c  31 29 29 0d 0a 3e        ..A.i..,1))..>
2011-09-29 13:59:27.054422 < ACL data: handle 12 flags 0x00 dlen 14
    0000: 0a 00 41 00 69 ef 0d 0d  0a 4f 4b 0d 0a 3e        ..A.i....OK..>
2011-09-29 13:59:27.124316 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:27.392520 > ACL data: handle 12 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 0]
      0000: 6b ff 13 03 41 54 2b 43  49 4e 44 3f 0d f8        k...AT+CIND?..
2011-09-29 13:59:27.393100 < ACL data: handle 12 flags 0x00 dlen 32
    0000: 1c 00 41 00 69 ef 31 0d  0a 2b 43 49 4e 44 3a 20  ..A.i.1..+CIND: 
    0010: 35 2c 35 2c 31 2c 30 2c  30 2c 30 2c 30 0d 0a 3e  5,5,1,0,0,0,0..>
2011-09-29 13:59:27.393167 < ACL data: handle 12 flags 0x00 dlen 14
    0000: 0a 00 41 00 69 ef 0d 0d  0a 4f 4b 0d 0a 3e        ..A.i....OK..>
2011-09-29 13:59:27.462316 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:27.729928 > ACL data: handle 12 flags 0x02 dlen 28
    L2CAP(d): cid 0x0040 len 24 [psm 0]
      0000: 6b ff 27 02 41 54 2b 43  4d 45 52 3d 33 2c 20 30  k.'.AT+CMER=3, 0
      0010: 2c 20 30 2c 20 31 0d f8                           , 0, 1..
2011-09-29 13:59:27.731058 < ACL data: handle 12 flags 0x00 dlen 14
    0000: 0a 00 41 00 69 ef 0d 0d  0a 4f 4b 0d 0a 3e        ..A.i....OK..>
2011-09-29 13:59:27.798318 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:28.066289 > ACL data: handle 12 flags 0x02 dlen 19
    L2CAP(d): cid 0x0040 len 15 [psm 0]
      0000: 6b ff 15 01 41 54 2b 56  47 53 3d 31 30 0d f8     k...AT+VGS=10..
2011-09-29 13:59:28.067001 < ACL data: handle 12 flags 0x00 dlen 14
    0000: 0a 00 41 00 69 ef 0d 0d  0a 4f 4b 0d 0a 3e        ..A.i....OK..>
2011-09-29 13:59:28.288307 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 1
2011-09-29 13:59:28.470030 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 1 scid 0x0042
2011-09-29 13:59:28.470274 < ACL data: handle 12 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 07 08 00  41 00 42 00 00 00 00 00  ........A.B.....
2011-09-29 13:59:28.470283 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 04 04 04 00  42 00 00 00              ........B...
2011-09-29 13:59:28.471531 > ACL data: handle 12 flags 0x02 dlen 19
    L2CAP(d): cid 0x0040 len 15 [psm 0]
      0000: 6b ff 15 01 41 54 2b 56  47 4d 3d 31 30 0d f8     k...AT+VGM=10..
2011-09-29 13:59:28.472222 < ACL data: handle 12 flags 0x00 dlen 14
    0000: 0a 00 41 00 69 ef 0d 0d  0a 4f 4b 0d 0a 3e        ..A.i....OK..>
2011-09-29 13:59:28.540407 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:28.607586 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 4
      MTU 48 
2011-09-29 13:59:28.607779 < ACL data: handle 12 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 08 0a 00  42 00 00 00 00 00 01 02  ........B.......
    0010: 30 00                                             0.
2011-09-29 13:59:28.608697 > ACL data: handle 12 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
      Success
2011-09-29 13:59:28.660505 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 02 05 04 00  19 00 42 00              ..........B.
2011-09-29 13:59:28.667286 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:28.736246 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0043 scid 0x0042 result 1 status 2
      Connection pending - Authorization pending
2011-09-29 13:59:28.737442 > ACL data: handle 12 flags 0x02 dlen 24
    L2CAP(d): cid 0x0041 len 20 [psm 0]
      0000: 06 00 01 00 0f 35 05 1a  00 00 11 1f 00 26 35 03  .....5.......&5.
      0010: 09 00 09 00                                       ....
2011-09-29 13:59:28.737889 < ACL data: handle 12 flags 0x00 dlen 29
    0000: 19 00 42 00 07 00 01 00  14 00 11 35 0f 35 0d 09  ..B........5.5..
    0010: 00 09 35 08 35 06 19 11  1e 09 01 05 00           ..5.5........
2011-09-29 13:59:28.738773 > ACL data: handle 12 flags 0x02 dlen 30
    L2CAP(d): cid 0x0040 len 26 [psm 0]
      0000: 6b ff 2b 01 41 54 2b 43  53 52 53 46 3d 31 2c 31  k.+.AT+CSRSF=1,1
      0010: 2c 31 2c 31 2c 31 2c 37  0d f8                    ,1,1,1,7..
2011-09-29 13:59:28.739223 < ACL data: handle 12 flags 0x00 dlen 17
    0000: 0d 00 41 00 69 ef 13 0d  0a 45 52 52 4f 52 0d 0a  ..A.i....ERROR..
    0010: 3e                                                >
2011-09-29 13:59:28.742380 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:28.811276 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0041 scid 0x0042
2011-09-29 13:59:28.811414 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 07 09 04 00  41 00 42 00              ........A.B.
2011-09-29 13:59:28.815306 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:28.883675 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0043 scid 0x0042 result 0 status 0
      Connection successful
2011-09-29 13:59:28.883787 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 04 06 04 00  43 00 00 00              ........C...
2011-09-29 13:59:28.884907 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0042 flags 0x00 clen 4
      MTU 895 
2011-09-29 13:59:28.885107 < ACL data: handle 12 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 0a 0a 00  43 00 00 00 00 00 01 02  ........C.......
    0010: 7f 03                                             ..
2011-09-29 13:59:28.889299 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:28.956158 > ACL data: handle 12 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0042 flags 0x00 result 0 clen 0
      Success
2011-09-29 13:59:28.956657 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 02 07 04 00  17 00 41 00              ..........A.
2011-09-29 13:59:28.956714 < ACL data: handle 12 flags 0x00 dlen 6
    0000: 02 00 43 00 e0 01                                 ..C...
2011-09-29 13:59:28.962336 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:29.028705 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0044 scid 0x0041 result 1 status 2
      Connection pending - Authorization pending
2011-09-29 13:59:29.098774 > ACL data: handle 12 flags 0x02 dlen 12
    L2CAP(d): cid 0x0042 len 8 [psm 0]
      0000: e2 01 04 08 08 08 10 08                           ........
2011-09-29 13:59:29.099421 < ACL data: handle 12 flags 0x00 dlen 7
    0000: 03 00 43 00 f0 02 04                              ..C....
2011-09-29 13:59:29.114286 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2011-09-29 13:59:29.180018 > ACL data: handle 12 flags 0x02 dlen 20
    L2CAP(d): cid 0x0042 len 16 [psm 0]
      0000: f2 02 01 00 07 06 00 00  bf ff 02 35 04 02 02 00  ...........5....
2011-09-29 13:59:29.180625 < ACL data: handle 12 flags 0x00 dlen 7
    0000: 03 00 43 00 00 02 08                              ..C....
2011-09-29 13:59:29.184275 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:29.287590 > ACL data: handle 12 flags 0x02 dlen 20
    L2CAP(d): cid 0x0042 len 16 [psm 0]
      0000: 02 02 01 00 07 06 00 01  3f 07 ff fe 04 02 02 00  ........?.......
2011-09-29 13:59:29.288101 < ACL data: handle 12 flags 0x00 dlen 7
    0000: 03 00 43 00 10 02 10                              ..C....
2011-09-29 13:59:29.369900 > ACL data: handle 12 flags 0x02 dlen 22
    L2CAP(d): cid 0x0042 len 18 [psm 0]
      0000: 12 02 01 00 07 08 00 02  c0 ff fc 90 00 00 04 02  ................
      0010: 02 00                                             ..
2011-09-29 13:59:29.370894 < ACL data: handle 12 flags 0x00 dlen 18
    0000: 0e 00 43 00 20 03 04 04  01 00 07 06 00 00 21 15  ..C. .........!.
    0010: 02 35                                             .5
2011-09-29 13:59:29.374270 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:29.452405 > ACL data: handle 12 flags 0x02 dlen 6
    L2CAP(d): cid 0x0042 len 2 [psm 0]
      0000: 22 03                                             ".
2011-09-29 13:59:29.453101 < ACL data: handle 12 flags 0x00 dlen 7
    0000: 03 00 43 00 30 06 04                              ..C.0..
2011-09-29 13:59:29.510014 > ACL data: handle 12 flags 0x02 dlen 6
    L2CAP(d): cid 0x0042 len 2 [psm 0]
      0000: 32 06                                             2.
2011-09-29 13:59:29.510683 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 02 08 04 00  19 00 43 00              ..........C.
2011-09-29 13:59:29.514283 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:29.542489 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0045 scid 0x0043 result 1 status 2
      Connection pending - Authorization pending
2011-09-29 13:59:29.543659 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0044 scid 0x0041 result 0 status 0
      Connection successful
2011-09-29 13:59:29.543875 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 04 09 04 00  44 00 00 00              ........D...
2011-09-29 13:59:29.544885 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 4
      MTU 895 
2011-09-29 13:59:29.545008 < ACL data: handle 12 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 0b 0a 00  44 00 00 00 00 00 01 02  ........D.......
    0010: 7f 03                                             ..
2011-09-29 13:59:29.549268 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:29.602516 > ACL data: handle 12 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
      Success
2011-09-29 13:59:30.067464 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0045 scid 0x0043 result 0 status 0
      Connection successful
2011-09-29 13:59:30.067868 < ACL data: handle 12 flags 0x00 dlen 12
    0000: 08 00 01 00 04 0a 04 00  45 00 00 00              ........E...
2011-09-29 13:59:30.068804 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0043 flags 0x00 clen 4
      MTU 895 
2011-09-29 13:59:30.068992 < ACL data: handle 12 flags 0x00 dlen 18
    0000: 0e 00 01 00 05 0c 0a 00  45 00 00 00 00 00 01 02  ........E.......
    0010: 7f 03                                             ..
2011-09-29 13:59:30.073327 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:30.112480 > ACL data: handle 12 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0043 flags 0x00 result 0 clen 0
      Success
2011-09-29 13:59:30.139095 < ACL data: handle 12 flags 0x00 dlen 7
    0000: 03 00 43 00 40 07 04                              ..C.@..
2011-09-29 13:59:30.218650 > ACL data: handle 12 flags 0x02 dlen 6
    L2CAP(d): cid 0x0042 len 2 [psm 0]
      0000: 42 07                                             B.
2011-09-29 13:59:30.220117 < ACL data: handle 12 flags 0x00 dlen 850
    0000: 4e 03 45 00 80 01 00 00  00 00 00 00 00 00 00 01  N.E.............
    0010: 07 9c bd 35 7d 00 00 00  00 00 00 00 00 00 77 76  ...5}.........wv
    0020: db 6e ed b6 db bb b6 db  77 6d b6 dd dd b6 db bb  .n......wm......
    0030: 6d b6 ee ed b6 dd db 6d  b7 77 6d b6 ee db 6d bb  m......m.wm...m.
    0040: bb 6d b7 76 db 6d dd db  6d bb b6 db 6e ee db 6d  .m.v.m..m...n..m
    0050: dd b6 db 77 76 db 6e ed  b6 db bb b6 db 77 6d b6  ...wv.n......wm.
    0060: dd dd b6 db bb 6d b6 ee  ed b6 dd db 6d b7 77 6d  .....m......m.wm
    0070: b6 ee db 6d bb bb 6d b7  76 db 6d dd db 6d bb b6  ...m..m.v.m..m..
    0080: db 6e ee db 6d dd b6 db  9c bd 35 7d 00 00 00 00  .n..m.....5}....
    0090: 00 00 00 00 00 77 76 db  6e ed b6 db bb b6 db 77  .....wv.n......w
    00a0: 6d b6 dd dd b6 db bb 6d  b6 ee ed b6 dd db 6d b7  m......m......m.
    00b0: 77 6d b6 ee db 6d bb bb  6d b7 76 db 6d dd db 6d  wm...m..m.v.m..m
    00c0: bb b6 db 6e ee db 6d dd  b6 db 77 76 db 6e ed b6  ...n..m...wv.n..
    00d0: db bb b6 db 77 6d b6 dd  dd b6 db bb 6d b6 ee ed  ....wm......m...
    00e0: b6 dd db 6d b7 77 6d b6  ee db 6d bb bb 6d b7 76  ...m.wm...m..m.v
    00f0: db 6d dd db 6d bb b6 db  6e ee db 6d dd b6 db 9c  .m..m...n..m....
    0100: bd 35 7d 00 00 00 00 00  00 00 00 00 77 76 db 6e  .5}.........wv.n
    0110: ed b6 db bb b6 db 77 6d  b6 dd dd b6 db bb 6d b6  ......wm......m.
    0120: ee ed b6 dd db 6d b7 77  6d b6 ee db 6d bb bb 6d  .....m.wm...m..m
    0130: b7 76 db 6d dd db 6d bb  b6 db 6e ee db 6d dd b6  .v.m..m...n..m..
    0140: db 77 76 db 6e ed b6 db  bb b6 db 77 6d b6 dd dd  .wv.n......wm...
    0150: b6 db bb 6d b6 ee ed b6  dd db 6d b7 77 6d b6 ee  ...m......m.wm..
    0160: db 6d bb bb 6d b7 76 db  6d dd db 6d bb b6 db 6e  .m..m.v.m..m...n
    0170: ee db 6d dd b6 db 9c bd  35 7d 00 00 00 00 00 00  ..m.....5}......
    0180: 00 00 00 77 76 db 6e ed  b6 db bb b6 db 77 6d b6  ...wv.n......wm.
    0190: dd dd b6 db bb 6d b6 ee  ed b6 dd db 6d b7 77 6d  .....m......m.wm
    01a0: b6 ee db 6d bb bb 6d b7  76 db 6d dd db 6d bb b6  ...m..m.v.m..m..
    01b0: db 6e ee db 6d dd b6 db  77 76 db 6e ed b6 db bb  .n..m...wv.n....
    01c0: b6 db 77 6d b6 dd dd b6  db bb 6d b6 ee ed b6 dd  ..wm......m.....
    01d0: db 6d b7 77 6d b6 ee db  6d bb bb 6d b7 76 db 6d  .m.wm...m..m.v.m
    01e0: dd db 6d bb b6 db 6e ee  db 6d dd b6 db 9c bd 35  ..m...n..m.....5
    01f0: 7d 00 00 00 00 00 00 00  00 00 77 76 db 6e ed b6  }.........wv.n..
    0200: db bb b6 db 77 6d b6 dd  dd b6 db bb 6d b6 ee ed  ....wm......m...
    0210: b6 dd db 6d b7 77 6d b6  ee db 6d bb bb 6d b7 76  ...m.wm...m..m.v
    0220: db 6d dd db 6d bb b6 db  6e ee db 6d dd b6 db 77  .m..m...n..m...w
    0230: 76 db 6e ed b6 db bb b6  db 77 6d b6 dd dd b6 db  v.n......wm.....
    0240: bb 6d b6 ee ed b6 dd db  6d b7 77 6d b6 ee db 6d  .m......m.wm...m
    0250: bb bb 6d b7 76 db 6d dd  db 6d bb b6 db 6e ee db  ..m.v.m..m...n..
    0260: 6d dd b6 db 9c bd 35 7d  00 00 00 00 00 00 00 00  m.....5}........
    0270: 00 77 76 db 6e ed b6 db  bb b6 db 77 6d b6 dd dd  .wv.n......wm...
    0280: b6 db bb 6d b6 ee ed b6  dd db 6d b7 77 6d b6 ee  ...m......m.wm..
    0290: db 6d bb bb 6d b7 76 db  6d dd db 6d bb b6 db 6e  .m..m.v.m..m...n
    02a0: ee db 6d dd b6 db 77 76  db 6e ed b6 db bb b6 db  ..m...wv.n......
    02b0: 77 6d b6 dd dd b6 db bb  6d b6 ee ed b6 dd db 6d  wm......m......m
    02c0: b7 77 6d b6 ee db 6d bb  bb 6d b7 76 db 6d dd db  .wm...m..m.v.m..
    02d0: 6d bb b6 db 6e ee db 6d  dd b6 db 9c bd 35 7d 00  m...n..m.....5}.
    02e0: 00 00 00 00 00 00 00 00  77 76 db 6e ed b6 db bb  ........wv.n....
    02f0: b6 db 77 6d b6 dd dd b6  db bb 6d b6 ee ed b6 dd  ..wm......m.....
    0300: db 6d b7 77 6d b6 ee db  6d bb bb 6d b7 76 db 6d  .m.wm...m..m.v.m
    0310: dd db 6d bb b6 db 6e ee  db 6d dd b6 db 77 76 db  ..m...n..m...wv.
    0320: 6e ed b6 db bb b6 db 77  6d b6 dd dd b6 db bb 6d  n......wm......m
    0330: b6 ee ed b6 dd db 6d b7  77 6d b6 ee db 6d bb bb  ......m.wm...m..
    0340: 6d b7 76 db 6d dd db 6d  bb b6 db 6e ee db 6d dd  m.v.m..m...n..m.
    0350: b6 db                                             ..
2011-09-29 13:59:30.227250 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2
2011-09-29 13:59:30.240384 < ACL data: handle 12 flags 0x00 dlen 850
    0000: 4e 03 45 00 80 01 00 01  00 00 03 80 00 00 00 01  N.E.............
    0010: 07 9c bd 35 7d 00 00 00  00 00 00 00 00 00 77 76  ...5}.........wv
    0020: db 6e ed b6 db bb b6 db  77 6d b6 dd dd b6 db bb  .n......wm......
    0030: 6d b6 ee ed b6 dd db 6d  b7 77 6d b6 ee db 6d bb  m......m.wm...m.
    0040: bb 6d b7 76 db 6d dd db  6d bb b6 db 6e ee db 6d  .m.v.m..m...n..m
    0050: dd b6 db 77 76 db 6e ed  b6 db bb b6 db 77 6d b6  ...wv.n......wm.
    0060: dd dd b6 db bb 6d b6 ee  ed b6 dd db 6d b7 77 6d  .....m......m.wm
    0070: b6 ee db 6d bb bb 6d b7  76 db 6d dd db 6d bb b6  ...m..m.v.m..m..
    0080: db 6e ee db 6d dd b6 db  9c bd 35 7d 00 00 00 00  .n..m.....5}....
    0090: 00 00 00 00 00 77 76 db  6e ed b6 db bb b6 db 77  .....wv.n......w
    00a0: 6d b6 dd dd b6 db bb 6d  b6 ee ed b6 dd db 6d b7  m......m......m.
    00b0: 77 6d b6 ee db 6d bb bb  6d b7 76 db 6d dd db 6d  wm...m..m.v.m..m
    00c0: bb b6 db 6e ee db 6d dd  b6 db 77 76 db 6e ed b6  ...n..m...wv.n..
    00d0: db bb b6 db 77 6d b6 dd  dd b6 db bb 6d b6 ee ed  ....wm......m...
    00e0: b6 dd db 6d b7 77 6d b6  ee db 6d bb bb 6d b7 76  ...m.wm...m..m.v
    00f0: db 6d dd db 6d bb b6 db  6e ee db 6d dd b6 db 9c  .m..m...n..m....
    0100: bd 35 7d 00 00 00 00 00  00 00 00 00 77 76 db 6e  .5}.........wv.n
    0110: ed b6 db bb b6 db 77 6d  b6 dd dd b6 db bb 6d b6  ......wm......m.
    0120: ee ed b6 dd db 6d b7 77  6d b6 ee db 6d bb bb 6d  .....m.wm...m..m
    0130: b7 76 db 6d dd db 6d bb  b6 db 6e ee db 6d dd b6  .v.m..m...n..m..
    0140: db 77 76 db 6e ed b6 db  bb b6 db 77 6d b6 dd dd  .wv.n......wm...
    0150: b6 db bb 6d b6 ee ed b6  dd db 6d b7 77 6d b6 ee  ...m......m.wm..
    0160: db 6d bb bb 6d b7 76 db  6d dd db 6d bb b6 db 6e  .m..m.v.m..m...n
    0170: ee db 6d dd b6 db 9c bd  35 7d 00 00 00 00 00 00  ..m.....5}......
    0180: 00 00 00 77 76 db 6e ed  b6 db bb b6 db 77 6d b6  ...wv.n......wm.
    0190: dd dd b6 db bb 6d b6 ee  ed b6 dd db 6d b7 77 6d  .....m......m.wm
    01a0: b6 ee db 6d bb bb 6d b7  76 db 6d dd db 6d bb b6  ...m..m.v.m..m..
    01b0: db 6e ee db 6d dd b6 db  77 76 db 6e ed b6 db bb  .n..m...wv.n....
    01c0: b6 db 77 6d b6 dd dd b6  db bb 6d b6 ee ed b6 dd  ..wm......m.....
    01d0: db 6d b7 77 6d b6 ee db  6d bb bb 6d b7 76 db 6d  .m.wm...m..m.v.m
    01e0: dd db 6d bb b6 db 6e ee  db 6d dd b6 db 9c bd 35  ..m...n..m.....5
    01f0: 7d 00 00 00 00 00 00 00  00 00 77 76 db 6e ed b6  }.........wv.n..
    0200: db bb b6 db 77 6d b6 dd  dd b6 db bb 6d b6 ee ed  ....wm......m...
    0210: b6 dd db 6d b7 77 6d b6  ee db 6d bb bb 6d b7 76  ...m.wm...m..m.v
    0220: db 6d dd db 6d bb b6 db  6e ee db 6d dd b6 db 77  .m..m...n..m...w
    0230: 76 db 6e ed b6 db bb b6  db 77 6d b6 dd dd b6 db  v.n......wm.....
    0240: bb 6d b6 ee ed b6 dd db  6d b7 77 6d b6 ee db 6d  .m......m.wm...m
    0250: bb bb 6d b7 76 db 6d dd  db 6d bb b6 db 6e ee db  ..m.v.m..m...n..
    0260: 6d dd b6 db 9c bd 35 7d  00 00 00 00 00 00 00 00  m.....5}........
    0270: 00 77 76 db 6e ed b6 db  bb b6 db 77 6d b6 dd dd  .wv.n......wm...
    0280: b6 db bb 6d b6 ee ed b6  dd db 6d b7 77 6d b6 ee  ...m......m.wm..
    0290: db 6d bb bb 6d b7 76 db  6d dd db 6d bb b6 db 6e  .m..m.v.m..m...n
    02a0: ee db 6d dd b6 db 77 76  db 6e ed b6 db bb b6 db  ..m...wv.n......
    02b0: 77 6d b6 dd dd b6 db bb  6d b6 ee ed b6 dd db 6d  wm......m......m
    02c0: b7 77 6d b6 ee db 6d bb  bb 6d b7 76 db 6d dd db  .wm...m..m.v.m..
    02d0: 6d bb b6 db 6e ee db 6d  dd b6 db 9c bd 35 7d 00  m...n..m.....5}.
    02e0: 00 00 00 00 00 00 00 00  77 76 db 6e ed b6 db bb  ........wv.n....
    02f0: b6 db 77 6d b6 dd dd b6  db bb 6d b6 ee ed b6 dd  ..wm......m.....
    0300: db 6d b7 77 6d b6 ee db  6d bb bb 6d b7 76 db 6d  .m.wm...m..m.v.m
    0310: dd db 6d bb b6 db 6e ee  db 6d dd b6 db 77 76 db  ..m...n..m...wv.
    0320: 6e ed b6 db bb b6 db 77  6d b6 dd dd b6 db bb 6d  n......wm......m
    0330: b6 ee ed b6 dd db 6d b7  77 6d b6 ee db 6d bb bb  ......m.wm...m..
    0340: 6d b7 76 db 6d dd db 6d  bb b6 db 6e ee db 6d dd  m.v.m..m...n..m.
    0350: b6 db                                             ..
[...]

^ permalink raw reply

* [PATCH v2] ath9k_hw: extend GPIO pin select mask for rfkill
From: Mohammed Shafi Shajakhan @ 2011-09-30  6:01 UTC (permalink / raw)
  To: John W. Linville, Rodriguez Luis
  Cc: Jouni Malinen, linux-wireless, Balasubramanian senthilkumar,
	Vasanthakumar Thiagarajan, Rajkumar Manoharan, Vivek Natarajan,
	ath9k-devel, Mohammed Shafi Shajakhan, Wilson Tsao, Hu, Russell

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

this extends the bits for rf kill GPIO selection to [7:2] from [4:2] as
we use GPIO pin 11 as rfkill for AR9480 and also remove few unused
macros

Cc: Wilson Tsao <wtsao@qca.qualcomm.com>
Cc: "Hu, Russell" <rhu@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/eeprom.h |    8 +++-----
 drivers/net/wireless/ath/ath9k/hw.c     |   10 ++++++++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index a3c7d0c..70fe75c 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -104,11 +104,6 @@
 #define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \
 				 ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
 
-#define AR_EEPROM_RFSILENT_GPIO_SEL     0x001c
-#define AR_EEPROM_RFSILENT_GPIO_SEL_S   2
-#define AR_EEPROM_RFSILENT_POLARITY     0x0002
-#define AR_EEPROM_RFSILENT_POLARITY_S   1
-
 #define EEP_RFSILENT_ENABLED        0x0001
 #define EEP_RFSILENT_ENABLED_S      0
 #define EEP_RFSILENT_POLARITY       0x0002
@@ -116,6 +111,9 @@
 #define EEP_RFSILENT_GPIO_SEL       0x001c
 #define EEP_RFSILENT_GPIO_SEL_S     2
 
+#define AR9480_EEP_RFSILENT_GPIO_SEL       0x00fc
+#define AR9480_EEP_RFSILENT_GPIO_SEL_S     2
+
 #define AR5416_OPFLAGS_11A           0x01
 #define AR5416_OPFLAGS_11G           0x02
 #define AR5416_OPFLAGS_N_5G_HT40     0x04
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index f2de7ee..521bb79 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2170,8 +2170,14 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
 #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
 	ah->rfsilent = ah->eep_ops->get_eeprom(ah, EEP_RF_SILENT);
 	if (ah->rfsilent & EEP_RFSILENT_ENABLED) {
-		ah->rfkill_gpio =
-			MS(ah->rfsilent, EEP_RFSILENT_GPIO_SEL);
+
+		if (AR_SREV_9480(ah))
+			ah->rfkill_gpio =
+				MS(ah->rfsilent, AR9480_EEP_RFSILENT_GPIO_SEL);
+		else
+			ah->rfkill_gpio =
+				MS(ah->rfsilent, EEP_RFSILENT_GPIO_SEL);
+
 		ah->rfkill_polarity =
 			MS(ah->rfsilent, EEP_RFSILENT_POLARITY);
 
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH] ath9k_hw: Fix number of GPIO pins for AR9287/9300
From: Mohammed Shafi Shajakhan @ 2011-09-30  6:01 UTC (permalink / raw)
  To: John W. Linville, Rodriguez Luis
  Cc: Jouni Malinen, linux-wireless, Balasubramanian senthilkumar,
	Vasanthakumar Thiagarajan, Rajkumar Manoharan, Vivek Natarajan,
	ath9k-devel, Mohammed Shafi Shajakhan, stable
In-Reply-To: <1317362488-4816-1-git-send-email-mohammed@qca.qualcomm.com>

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

this patch fixes the assumption of maximum number of GPIO pins present
in AR9287/AR9300. this fix is essential as we might encounter some
functionality issues involved in accessing the status of GPIO pins which
are all incorrectly assumed to be not within the range of max_num_gpio
of AR9300/AR9287 chipsets

Cc: stable@kernel.org
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/hw.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index f2de7ee..e2c62ea 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2153,6 +2153,10 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
 		pCap->num_gpio_pins = AR9271_NUM_GPIO;
 	else if (AR_DEVID_7010(ah))
 		pCap->num_gpio_pins = AR7010_NUM_GPIO;
+	else if (AR_SREV_9300_20_OR_LATER(ah))
+		pCap->num_gpio_pins = AR9300_NUM_GPIO;
+	else if (AR_SREV_9287_11_OR_LATER(ah))
+		pCap->num_gpio_pins = AR9287_NUM_GPIO;
 	else if (AR_SREV_9285_12_OR_LATER(ah))
 		pCap->num_gpio_pins = AR9285_NUM_GPIO;
 	else if (AR_SREV_9280_20_OR_LATER(ah))
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH] ath9k_hw: set pci_express capability true for AR9480
From: Mohammed Shafi Shajakhan @ 2011-09-30  6:01 UTC (permalink / raw)
  To: John W. Linville, Rodriguez Luis
  Cc: Jouni Malinen, linux-wireless, Balasubramanian senthilkumar,
	Vasanthakumar Thiagarajan, Rajkumar Manoharan, Vivek Natarajan,
	ath9k-devel, Mohammed Shafi Shajakhan
In-Reply-To: <1317362488-4816-1-git-send-email-mohammed@qca.qualcomm.com>

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

the AR_SREV register does not seems to indicate whether AR9480 is
pci_express capable or not though the other information like macVersion
etc can be obtained properly. this fix is essential as ASPM won't be intialized
and its related driver functionality ath9k_hw_configpcipowersave won't be
called

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/hw.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index f2de7ee..56ba6a8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -284,7 +284,12 @@ static void ath9k_hw_read_revisions(struct ath_hw *ah)
 		ah->hw_version.macVersion =
 			(val & AR_SREV_VERSION2) >> AR_SREV_TYPE2_S;
 		ah->hw_version.macRev = MS(val, AR_SREV_REVISION2);
-		ah->is_pciexpress = (val & AR_SREV_TYPE2_HOST_MODE) ? 0 : 1;
+
+		if (AR_SREV_9480(ah))
+			ah->is_pciexpress = true;
+		else
+			ah->is_pciexpress = (val &
+					     AR_SREV_TYPE2_HOST_MODE) ? 0 : 1;
 	} else {
 		if (!AR_SREV_9100(ah))
 			ah->hw_version.macVersion = MS(val, AR_SREV_VERSION);
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v3] ath9k_hw: extend GPIO pin select mask for rfkill
From: Mohammed Shafi Shajakhan @ 2011-09-30  6:47 UTC (permalink / raw)
  To: John W. Linville
  Cc: Jouni Malinen, linux-wireless, Rodriguez Luis,
	Balasubramanian senthilkumar, Vasanthakumar Thiagarajan,
	Rajkumar Manoharan, Vivek Natarajan, ath9k-devel,
	Mohammed Shafi Shajakhan, Wilson Tsao, Hu, Russell

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

this extends the bits for rf kill GPIO selection to [7:2] from [4:2] as
we use GPIO pin 11 as rfkill for AR9480 and also remove few unused
macros

Cc: Wilson Tsao <wtsao@qca.qualcomm.com>
Cc: "Hu, Russell" <rhu@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/eeprom.h |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index a3c7d0c..5d92f96 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -104,16 +104,11 @@
 #define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \
 				 ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
 
-#define AR_EEPROM_RFSILENT_GPIO_SEL     0x001c
-#define AR_EEPROM_RFSILENT_GPIO_SEL_S   2
-#define AR_EEPROM_RFSILENT_POLARITY     0x0002
-#define AR_EEPROM_RFSILENT_POLARITY_S   1
-
 #define EEP_RFSILENT_ENABLED        0x0001
 #define EEP_RFSILENT_ENABLED_S      0
 #define EEP_RFSILENT_POLARITY       0x0002
 #define EEP_RFSILENT_POLARITY_S     1
-#define EEP_RFSILENT_GPIO_SEL       0x001c
+#define EEP_RFSILENT_GPIO_SEL       (AR_SREV_9480(ah) ? 0x00fc : 0x001c)
 #define EEP_RFSILENT_GPIO_SEL_S     2
 
 #define AR5416_OPFLAGS_11A           0x01
-- 
1.7.0.4


^ permalink raw reply related

* Re: Regulatory revamp status
From: Zefir Kurtisi @ 2011-09-30 11:11 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Adrian Chadd, linux-wireless, Boris Presman, Assaf Azulay,
	Michael Green, David Quan, Kevin Hayes, Arun Venkataraman
In-Reply-To: <CAB=NE6UQpv1bvsni=rDP=3OKM=oN14g0xJtVN+evvm=47nZu_Q@mail.gmail.com>

On 09/29/2011 07:47 PM, Luis R. Rodriguez wrote:
> On Thu, Sep 29, 2011 at 5:46 AM, Zefir Kurtisi
> <zefir.kurtisi@neratec.com> wrote:
>> On 09/29/2011 01:45 PM, Adrian Chadd wrote:
>>> On 29 September 2011 16:37, Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:
>>>> Thanks for the update.
>>>>
>>>> To me it looks not reasonable to mix in between the two approaches: either we assume countrycodes use the same DFS region for all channels, or each channel/band needs to have its own. Otherwise I feel that a DFS region bitmap would give a semi-flexible compromise that might end up being insufficient to represent some fancy countrycodes.
>>>
>>> There's some funny stuff in there.
>>>
>>> For example, some of the DFS bands have different CAC/NOL timing. :-)
>>>
>>>
>>>
>>> Adrian
>>
>> Really? Where would be 'there' countrycode-wise?
>>
>> That would definitely break today's CRDA capabilities :-\
> 
> Well, CRDA has no DFS support yet ;) and hence the regulatory revamp
Yes, I meant the proposed approach with a regulaltory domain per countrycode won't work with those fancy ones.
> work, to accommodate as much as possible for both future technologies
> and capture all these gotchas on existing technologies. If DFS varies
> so much then using one u8 for a country may not be enough, and we may
> want to add a whole section for DFS with the u8 being an optional
> minimum and with a DFS section for overrides on values. Thoughts?
> 
That sounds like a doable way to start with the per countrycode domain and traverse to the optional refinement values on demand.

BTW, would this render the countrycode to CTL mappings in regd_common.h redundant, or do DFS and CTL domains differ?
> That is -- if your country varies per band or CAC / NOL timings we can
> address these countries only with the future revamp work. This would
> allow us to move forward with DFS support only for those countries
> where a unified DFS mapping applies.
> 
To start with support for unified DFS domain CCs, was there ever some v2 for the related patch set you posted?
>   Luis

Zefir

^ permalink raw reply

* Re: Regulatory revamp status
From: Adrian Chadd @ 2011-09-30 11:21 UTC (permalink / raw)
  To: Zefir Kurtisi
  Cc: Luis R. Rodriguez, linux-wireless, Boris Presman, Assaf Azulay,
	Michael Green, David Quan, Kevin Hayes, Arun Venkataraman
In-Reply-To: <4E8468AF.8000006@neratec.com>

On 29 September 2011 20:46, Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:

> Really? Where would be 'there' countrycode-wise?
>
> That would definitely break today's CRDA capabilities :-\

I -think- one or both of ETSI/FCC have different CAC/NOL requirements
for the channels which overlap the weather radars.
At least when someone took FreeBSD to get DFS certified a while ago,
the weather radar ranges were checked against a 30 minute CAC. :)

I think it's worth defining specific DFS parameters for each frequency
range. That's what I'll be doing for FreeBSD when I revamp its
net80211 regulatory database code.


Adrian

^ permalink raw reply

* Re: Regulatory revamp status
From: Zefir Kurtisi @ 2011-09-30 12:52 UTC (permalink / raw)
  To: Adrian Chadd
  Cc: Luis R. Rodriguez, linux-wireless, Boris Presman, Assaf Azulay,
	Michael Green, David Quan, Kevin Hayes, Arun Venkataraman
In-Reply-To: <CAJ-VmokXUectieeOBJSMfuzzT94g7U=dqbPf-S1Oay292ur9yg@mail.gmail.com>

On 09/30/2011 01:21 PM, Adrian Chadd wrote:
> On 29 September 2011 20:46, Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:
> 
>> Really? Where would be 'there' countrycode-wise?
>>
>> That would definitely break today's CRDA capabilities :-\
> 
> I -think- one or both of ETSI/FCC have different CAC/NOL requirements
> for the channels which overlap the weather radars.
> At least when someone took FreeBSD to get DFS certified a while ago,
> the weather radar ranges were checked against a 30 minute CAC. :)
> 
> I think it's worth defining specific DFS parameters for each frequency
> range. That's what I'll be doing for FreeBSD when I revamp its
> net80211 regulatory database code.
> 
> 
> Adrian

I was assuming that weather radars will not be supported at all but the related channels be just disabled. It is practically impossible to assure a 99.99% detection probability (as required for ETSI 1.5.1), or? E.g. to detect ETSI radar pattern 1 (10 pulses), you basically need to treat any single detected pulse as radar event. Doable, but not very useful ;)


Zefir


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox