[PATCH 1/2] b43: make finding the most significant bit common function

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
  drivers/net/wireless/b43/phy_common.c |   14 ++
  drivers/net/wireless/b43/phy_common.h |1 +
  drivers/net/wireless/b43/phy_lp.c |   17 ++---
  3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_common.c 
b/drivers/net/wireless/b43/phy_common.c
index 75b26e1..1389ab2 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -421,3 +421,17 @@ void b43_phyop_switch_analog_generic(struct b43_wldev 
*dev, bool on)
  {
b43_write16(dev, B43_MMIO_PHY0, on ? 0 : 0xF4);
  }
+
+/* Find the position of the most significant bit */
+u8 phy_nbits(s32 val)
+{
+   u32 tmp = abs(val);
+   u8 nbits = 0;
+
+   while (tmp != 0) {
+   nbits++;
+   tmp = 1;
+   }
+
+   return nbits;
+}
diff --git a/drivers/net/wireless/b43/phy_common.h 
b/drivers/net/wireless/b43/phy_common.h
index 9edd4e8..332ba4c 100644
--- a/drivers/net/wireless/b43/phy_common.h
+++ b/drivers/net/wireless/b43/phy_common.h
@@ -418,5 +418,6 @@ int b43_phy_shm_tssi_read(struct b43_wldev *dev, u16 
shm_offset);
   */
  void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on);

+u8 phy_nbits(s32 val);

  #endif /* LINUX_B43_PHY_COMMON_H_ */
diff --git a/drivers/net/wireless/b43/phy_lp.c 
b/drivers/net/wireless/b43/phy_lp.c
index c4e9c5c..7ad9215 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1593,19 +1593,6 @@ static const struct lpphy_rx_iq_comp 
lpphy_rev2plus_iq_comp = {
.c0 = 0,
  };

-static u8 lpphy_nbits(s32 val)
-{
-   u32 tmp = abs(val);
-   u8 nbits = 0;
-
-   while (tmp != 0) {
-   nbits++;
-   tmp = 1;
-   }
-
-   return nbits;
-}
-
  static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev, u16 samples)
  {
struct lpphy_iq_est iq_est;
@@ -1632,8 +1619,8 @@ static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev, 
u16 samples)
goto out;
}

-   prod_msb = lpphy_nbits(prod);
-   q_msb = lpphy_nbits(qpwr);
+   prod_msb = phy_nbits(prod);
+   q_msb = phy_nbits(qpwr);
tmp1 = prod_msb - 20;

if (tmp1 = 0) {
-- 
1.6.4.2

___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH 2/2] b43: N-PHY: follow kernel coding style for struct declaration

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
  drivers/net/wireless/b43/phy_common.c |   14 ++
  drivers/net/wireless/b43/phy_common.h |1 +
  drivers/net/wireless/b43/phy_lp.c |   17 ++---
  3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_common.c 
b/drivers/net/wireless/b43/phy_common.c
index 75b26e1..1389ab2 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -421,3 +421,17 @@ void b43_phyop_switch_analog_generic(struct b43_wldev 
*dev, bool on)
  {
b43_write16(dev, B43_MMIO_PHY0, on ? 0 : 0xF4);
  }
+
+/* Find the position of the most significant bit */
+u8 phy_nbits(s32 val)
+{
+   u32 tmp = abs(val);
+   u8 nbits = 0;
+
+   while (tmp != 0) {
+   nbits++;
+   tmp = 1;
+   }
+
+   return nbits;
+}
diff --git a/drivers/net/wireless/b43/phy_common.h 
b/drivers/net/wireless/b43/phy_common.h
index 9edd4e8..332ba4c 100644
--- a/drivers/net/wireless/b43/phy_common.h
+++ b/drivers/net/wireless/b43/phy_common.h
@@ -418,5 +418,6 @@ int b43_phy_shm_tssi_read(struct b43_wldev *dev, u16 
shm_offset);
   */
  void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on);

+u8 phy_nbits(s32 val);

  #endif /* LINUX_B43_PHY_COMMON_H_ */
diff --git a/drivers/net/wireless/b43/phy_lp.c 
b/drivers/net/wireless/b43/phy_lp.c
index c4e9c5c..7ad9215 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1593,19 +1593,6 @@ static const struct lpphy_rx_iq_comp 
lpphy_rev2plus_iq_comp = {
.c0 = 0,
  };

-static u8 lpphy_nbits(s32 val)
-{
-   u32 tmp = abs(val);
-   u8 nbits = 0;
-
-   while (tmp != 0) {
-   nbits++;
-   tmp = 1;
-   }
-
-   return nbits;
-}
-
  static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev, u16 samples)
  {
struct lpphy_iq_est iq_est;
@@ -1632,8 +1619,8 @@ static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev, 
u16 samples)
goto out;
}

-   prod_msb = lpphy_nbits(prod);
-   q_msb = lpphy_nbits(qpwr);
+   prod_msb = phy_nbits(prod);
+   q_msb = phy_nbits(qpwr);
tmp1 = prod_msb - 20;

if (tmp1 = 0) {
-- 
1.6.4.2

___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH 2/2 resend] b43: N-PHY: follow kernel coding style for struct declaration

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---

Whoops, wrong patch attached previously

---
  drivers/net/wireless/b43/phy_n.c |7 ++-
  1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index d0a0ce9..fbdabfe 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -30,7 +30,12 @@
  #include tables_nphy.h


-struct nphy_txgains { u16 txgm[2]; u16 pga[2]; u16 pad[2]; u16 ipa[2]; };
+struct nphy_txgains {
+   u16 txgm[2];
+   u16 pga[2];
+   u16 pad[2];
+   u16 ipa[2];
+};

  struct nphy_iqcal_params {
u16 txgm;
-- 
1.6.4.2

___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 2/2] b43: N-PHY: follow kernel coding style for struct declaration

2010-01-14 Thread Rafał Miłecki
W dniu 14 stycznia 2010 16:39 użytkownik Stanislaw Gruszka
sgrus...@redhat.com napisał:
 Hi

 On Thu, Jan 14, 2010 at 01:21:35PM +0100, Rafał Miłecki wrote:

 Signed-off-by: Rafał Miłecki zaj...@gmail.com
 ---
  drivers/net/wireless/b43/phy_common.c |   14 ++
  drivers/net/wireless/b43/phy_common.h |    1 +
  drivers/net/wireless/b43/phy_lp.c     |   17 ++---
  3 files changed, 17 insertions(+), 15 deletions(-)

 Your second patch is the same as first one.

Whoops, thanks :)

-- 
Rafał
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH 1/6] b43: N-PHY: add b43_nphy_calc_rx_iq_comp

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
  drivers/net/wireless/b43/phy_n.c |  101 +-
  1 files changed, 100 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index fbdabfe..75eb0e6 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -533,6 +533,105 @@ static void b43_nphy_rx_iq_est(struct b43_wldev *dev, 
struct nphy_iq_est *est,
memset(est, 0, sizeof(*est));
  }

+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CalcRxIqComp */
+static void b43_nphy_calc_rx_iq_comp(struct b43_wldev *dev, u8 mask)
+{
+   int i;
+   s32 iq;
+   u32 ii;
+   u32 qq;
+   int iq_nbits, qq_nbits;
+   int arsh, brsh;
+   u16 tmp, a, b;
+
+   struct nphy_iq_est est;
+   struct b43_phy_n_iq_comp old;
+   struct b43_phy_n_iq_comp new = { };
+   bool error = false;
+
+   if (mask == 0)
+   return;
+
+   b43_nphy_rx_iq_coeffs(dev, false, old);
+   b43_nphy_rx_iq_coeffs(dev, true, new);
+   b43_nphy_rx_iq_est(dev, est, 0x4000, 32, false);
+   new = old;
+
+   for (i = 0; i  2; i++) {
+   if (i == 0  (mask  1)) {
+   iq = est.iq0_prod;
+   ii = est.i0_pwr;
+   qq = est.q0_pwr;
+   } else if (i == 1  (mask  2)) {
+   iq = est.iq1_prod;
+   ii = est.i1_pwr;
+   qq = est.q1_pwr;
+   } else {
+   B43_WARN_ON(1);
+   continue;
+   }
+
+   if (ii + qq  2) {
+   error = true;
+   break;
+   }
+
+   iq_nbits = phy_nbits(iq);
+   qq_nbits = phy_nbits(qq);
+
+   arsh = iq_nbits - 20;
+   if (arsh = 0) {
+   a = -((iq  (30 - iq_nbits)) + (ii  (1 + arsh)));
+   tmp = ii  arsh;
+   } else {
+   a = -((iq  (30 - iq_nbits)) + (ii  (-1 - arsh)));
+   tmp = ii  -arsh;
+   }
+   if (tmp == 0) {
+   error = true;
+   break;
+   }
+   a /= tmp;
+
+   brsh = qq_nbits - 11;
+   if (brsh = 0) {
+   b = (qq  (31 - qq_nbits));
+   tmp = ii  brsh;
+   } else {
+   b = (qq  (31 - qq_nbits));
+   tmp = ii  -brsh;
+   }
+   if (tmp == 0) {
+   error = true;
+   break;
+   }
+   b = int_sqrt(b / tmp - a * a) - (1  10);
+
+   if (i == 0  (mask  0x1)) {
+   if (dev-phy.rev = 3) {
+   new.a0 = a  0x3FF;
+   new.b0 = b  0x3FF;
+   } else {
+   new.a0 = b  0x3FF;
+   new.b0 = a  0x3FF;
+   }
+   } else if (i == 1  (mask  0x2)) {
+   if (dev-phy.rev = 3) {
+   new.a1 = a  0x3FF;
+   new.b1 = b  0x3FF;
+   } else {
+   new.a1 = b  0x3FF;
+   new.b1 = a  0x3FF;
+   }
+   }
+   }
+
+   if (error)
+   new = old;
+
+   b43_nphy_rx_iq_coeffs(dev, true, new);
+}
+
  /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/IqCalGainParams */
  static void b43_nphy_iq_cal_gain_params(struct b43_wldev *dev, u16 core,
struct nphy_txgains target,
@@ -734,7 +833,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
}
power[i] = ((real + imag) / 1024) + 1;
} else {
-   //TODO: Call N PHY Calc RX IQ Comp with 
(1  i) as argument
+   b43_nphy_calc_rx_iq_comp(dev, 1  i);
}
//TODO: Call N PHY Stop Playback
}
-- 
1.6.4.2

___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH 2/6] b43: N-PHY: add TX cal radio setup for rev 3

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
  drivers/net/wireless/b43/phy_n.c |   43 ++
  drivers/net/wireless/b43/phy_n.h |1 +
  2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 75eb0e6..77be96d 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -901,6 +901,49 @@ static void b43_nphy_tx_lp_fbw(struct b43_wldev *dev)
}
  }

+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxCalRadioSetup */
+static void b43_nphy_tx_cal_radio_setup(struct b43_wldev *dev)
+{
+   struct b43_phy_n *nphy = dev-phy.n;
+   u16 *save = nphy-tx_rx_cal_radio_saveregs;
+
+   if (dev-phy.rev = 3) {
+   /* TODO */
+   } else {
+   save[0] = b43_radio_read16(dev, B2055_C1_TX_RF_IQCAL1);
+   b43_radio_write16(dev, B2055_C1_TX_RF_IQCAL1, 0x29);
+
+   save[1] = b43_radio_read16(dev, B2055_C1_TX_RF_IQCAL2);
+   b43_radio_write16(dev, B2055_C1_TX_RF_IQCAL2, 0x54);
+
+   save[2] = b43_radio_read16(dev, B2055_C2_TX_RF_IQCAL1);
+   b43_radio_write16(dev, B2055_C2_TX_RF_IQCAL1, 0x29);
+
+   save[3] = b43_radio_read16(dev, B2055_C2_TX_RF_IQCAL2);
+   b43_radio_write16(dev, B2055_C2_TX_RF_IQCAL2, 0x54);
+
+   save[3] = b43_radio_read16(dev, B2055_C1_PWRDET_RXTX);
+   save[4] = b43_radio_read16(dev, B2055_C2_PWRDET_RXTX);
+
+   if (!(b43_phy_read(dev, B43_NPHY_BANDCTL) 
+   B43_NPHY_BANDCTL_5GHZ)) {
+   b43_radio_write16(dev, B2055_C1_PWRDET_RXTX, 0x04);
+   b43_radio_write16(dev, B2055_C2_PWRDET_RXTX, 0x04);
+   } else {
+   b43_radio_write16(dev, B2055_C1_PWRDET_RXTX, 0x20);
+   b43_radio_write16(dev, B2055_C2_PWRDET_RXTX, 0x20);
+   }
+
+   if (dev-phy.rev  2) {
+   b43_radio_set(dev, B2055_C1_TX_BB_MXGM, 0x20);
+   b43_radio_set(dev, B2055_C2_TX_BB_MXGM, 0x20);
+   } else {
+   b43_radio_mask(dev, B2055_C1_TX_BB_MXGM, ~0x20);
+   b43_radio_mask(dev, B2055_C2_TX_BB_MXGM, ~0x20);
+   }
+   }
+}
+
  /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GetTxGain */
  static struct nphy_txgains b43_nphy_get_tx_gains(struct b43_wldev *dev)
  {
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
index ab54b0f..d435720 100644
--- a/drivers/net/wireless/b43/phy_n.h
+++ b/drivers/net/wireless/b43/phy_n.h
@@ -971,6 +971,7 @@ struct b43_phy_n {
u8 perical;
u8 mphase_cal_phase_id;
u8 antsel_type;
+   u16 tx_rx_cal_radio_saveregs[22];
u16 papd_epsilon_offset[2];
u32 deaf_count;
u32 rxcalparams;
-- 
1.6.4.2

___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH 3/6] b43: N-PHY: add update TX cal ladder

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
  drivers/net/wireless/b43/phy_n.c   |   23 +
  drivers/net/wireless/b43/phy_n.h   |1 +
  drivers/net/wireless/b43/tables_nphy.c |   42 
  drivers/net/wireless/b43/tables_nphy.h |6 
  4 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 77be96d..67717c1 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -686,6 +686,29 @@ static void b43_nphy_tx_iq_workaround(struct b43_wldev 
*dev)
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_NPHY_TXIQW3, array[3]);
  }

+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/UpdateTxCalLadder */
+static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core)
+{
+   struct b43_phy_n *nphy = dev-phy.n;
+   int i;
+   u16 scale, entry;
+
+   u16 tmp = nphy-txcal_bbmult;
+   if (core == 0)
+   tmp = 8;
+   tmp = 0xff;
+
+   for (i = 0; i  18; i++) {
+   scale = (ladder_lo[i].percent * tmp) / 100;
+   entry = ((scale  0xFF)  8) | ladder_lo[i].g_env;
+   //TODO: Write an N PHY Table with ID 15, length 1, offset i, 
width 16, and data entry
+
+   scale = (ladder_iq[i].percent * tmp) / 100;
+   entry = ((scale  0xFF)  8) | ladder_iq[i].g_env;
+   //TODO: Write an N PHY Table with ID 15, length 1, offset i + 
32, width 16, and data entry
+   }
+}
+
  /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CalRxIqRev2 */
  static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
struct nphy_txgains target, u8 type, bool debug)
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
index d435720..a5f3a94 100644
--- a/drivers/net/wireless/b43/phy_n.h
+++ b/drivers/net/wireless/b43/phy_n.h
@@ -972,6 +972,7 @@ struct b43_phy_n {
u8 mphase_cal_phase_id;
u8 antsel_type;
u16 tx_rx_cal_radio_saveregs[22];
+   u16 txcal_bbmult;
u16 papd_epsilon_offset[2];
u32 deaf_count;
u32 rxcalparams;
diff --git a/drivers/net/wireless/b43/tables_nphy.c 
b/drivers/net/wireless/b43/tables_nphy.c
index de8a609..4816b70 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -2746,6 +2746,48 @@ const u16 tbl_iqcal_gainparams[2][9][8] = {
}
  };

+const struct nphy_txiqcal_ladder ladder_lo[] = {
+   { 3, 0 },
+   { 4, 0 },
+   { 6, 0 },
+   { 9, 0 },
+   { 13, 0 },
+   { 18, 0 },
+   { 25, 0 },
+   { 25, 1 },
+   { 25, 2 },
+   { 25, 3 },
+   { 25, 4 },
+   { 25, 5 },
+   { 25, 6 },
+   { 25, 7 },
+   { 35, 7 },
+   { 50, 7 },
+   { 71, 7 },
+   { 100, 7 }
+};
+
+const struct nphy_txiqcal_ladder ladder_iq[] = {
+   { 3, 0 },
+   { 4, 0 },
+   { 6, 0 },
+   { 9, 0 },
+   { 13, 0 },
+   { 18, 0 },
+   { 25, 0 },
+   { 35, 0 },
+   { 50, 0 },
+   { 71, 0 },
+   { 100, 0 },
+   { 100, 1 },
+   { 100, 2 },
+   { 100, 3 },
+   { 100, 4 },
+   { 100, 5 },
+   { 100, 6 },
+   { 100, 7 }
+};
+
  static inline void assert_ntab_array_sizes(void)
  {
  #undef check
diff --git a/drivers/net/wireless/b43/tables_nphy.h 
b/drivers/net/wireless/b43/tables_nphy.h
index 86c394c..b5e0e4b 100644
--- a/drivers/net/wireless/b43/tables_nphy.h
+++ b/drivers/net/wireless/b43/tables_nphy.h
@@ -43,6 +43,10 @@ struct b43_nphy_channeltab_entry {
u16 unk2;
  };

+struct nphy_txiqcal_ladder {
+   u8 percent;
+   u8 g_env;
+};

  struct b43_wldev;

@@ -142,5 +146,7 @@ extern const u32 txpwrctrl_tx_gain_ipa_rev5[];
  extern const u32 txpwrctrl_tx_gain_ipa_rev6[];
  extern const u32 txpwrctrl_tx_gain_ipa_5g[];
  extern const u16 tbl_iqcal_gainparams[2][9][8];
+extern const struct nphy_txiqcal_ladder ladder_lo[];
+extern const struct nphy_txiqcal_ladder ladder_iq[];

  #endif /* B43_TABLES_NPHY_H_ */
-- 
1.6.4.2

___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH 4/6] b43: N-PHY: TX power control coeff setup

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
  drivers/net/wireless/b43/b43.h |3 +
  drivers/net/wireless/b43/phy_n.c   |   68 +++-
  drivers/net/wireless/b43/tables_nphy.c |   35 
  drivers/net/wireless/b43/tables_nphy.h |1 +
  4 files changed, 106 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index d5c67a6..964ddd4 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -260,6 +260,9 @@ enum {
  #define B43_SHM_SH_NPHY_TXIQW10x0702
  #define B43_SHM_SH_NPHY_TXIQW20x0704
  #define B43_SHM_SH_NPHY_TXIQW30x0706
+/* SHM_SHARED tx pwr ctrl */
+#define B43_SHM_SH_NPHY_TXPWR_INDX00x0708
+#define B43_SHM_SH_NPHY_TXPWR_INDX10x070E

  /* SHM_SCRATCH offsets */
  #define B43_SHM_SC_MINCONT0x0003  /* Minimum contention window */
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 67717c1..d5a2dc8 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -709,6 +709,72 @@ static void b43_nphy_update_tx_cal_ladder(struct b43_wldev 
*dev, u16 core)
}
  }

+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrCtrlCoefSetup */
+static void b43_nphy_tx_pwr_ctrl_coef_setup(struct b43_wldev *dev)
+{
+   struct b43_phy_n *nphy = dev-phy.n;
+   int i, j;
+   u32 tmp;
+   u32 cur_real, cur_imag, real_part, imag_part;
+
+   u16 buffer[7];
+
+   if (nphy-hang_avoid)
+   b43_nphy_stay_in_carrier_search(dev, true);
+
+   //TODO: Read an N PHY Table with ID 15, length 7, offset 80, width 16, 
and data pointer buffer
+   
+   for (i = 0; i  2; i++) {
+   tmp = ((buffer[i * 2]  0x3FF)  10) |
+   (buffer[i * 2 + 1]  0x3FF);
+   b43_phy_write(dev, B43_NPHY_TABLE_ADDR,
+   (((i + 26)  10) | 320));
+   for (j = 0; j  128; j++) {
+   b43_phy_write(dev, B43_NPHY_TABLE_DATAHI,
+   ((tmp  16)  0x));
+   b43_phy_write(dev, B43_NPHY_TABLE_DATALO,
+   (tmp  0x));
+   }
+   }
+
+   for (i = 0; i  2; i++) {
+   tmp = buffer[5 + i];
+   real_part = (tmp  8)  0xFF;
+   imag_part = (tmp  0xFF);
+   b43_phy_write(dev, B43_NPHY_TABLE_ADDR,
+   (((i + 26)  10) | 448));
+
+   if (dev-phy.rev = 3) {
+   cur_real = real_part;
+   cur_imag = imag_part;
+   tmp = ((cur_real  0xFF)  8) | (cur_imag  0xFF);
+   }
+
+   for (j = 0; j  128; j++) {
+   if (dev-phy.rev  3) {
+   cur_real = (real_part * loscale[j] + 128)  8;
+   cur_imag = (imag_part * loscale[j] + 128)  8;
+   tmp = ((cur_real  0xFF)  8) |
+   (cur_imag  0xFF);
+   }
+   b43_phy_write(dev, B43_NPHY_TABLE_DATAHI,
+   ((tmp  16)  0x));
+   b43_phy_write(dev, B43_NPHY_TABLE_DATALO,
+   (tmp  0x));
+   }
+   }
+
+   if (dev-phy.rev = 3) {
+   b43_shm_write16(dev, B43_SHM_SHARED,
+   B43_SHM_SH_NPHY_TXPWR_INDX0, 0x);
+   b43_shm_write16(dev, B43_SHM_SHARED,
+   B43_SHM_SH_NPHY_TXPWR_INDX1, 0x);
+   }
+
+   if (nphy-hang_avoid)
+   b43_nphy_stay_in_carrier_search(dev, false);
+}
+
  /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CalRxIqRev2 */
  static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
struct nphy_txgains target, u8 type, bool debug)
@@ -1787,7 +1853,7 @@ int b43_phy_initn(struct b43_wldev *dev)
}
}

-   //TODO N PHY TX Power Control Coef Setup
+   b43_nphy_tx_pwr_ctrl_coef_setup(dev);
//TODO N PHY TX Power Control Enable with argument tx_pwr_state
b43_phy_write(dev, B43_NPHY_TXMACIF_HOLDOFF, 0x0015);
b43_phy_write(dev, B43_NPHY_TXMACDELAY, 0x0320);
diff --git a/drivers/net/wireless/b43/tables_nphy.c 
b/drivers/net/wireless/b43/tables_nphy.c
index 4816b70..d9291cf 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -2788,6 +2788,41 @@ const struct nphy_txiqcal_ladder ladder_iq[] = {
{ 100, 7 }
  };

+const u16 loscale[] = {
+   256, 256, 271, 271,
+   287, 256, 256, 271,
+   271, 287, 287, 304,
+   304, 256, 256, 271,
+   271, 287, 287, 304,
+   304, 322, 322, 341,
+   341, 362, 362, 383,
+  

[PATCH 5/6] b43: N-PHY: correct condition blocks in init

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
  drivers/net/wireless/b43/phy_n.c |   16 +---
  1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index d5a2dc8..356b89f 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1842,17 +1842,19 @@ int b43_phy_initn(struct b43_wldev *dev)
//TODO N PHY Pre Calibrate TX Gain
target = b43_nphy_get_tx_gains(dev);
}
-   /* TODO: If the output of N PHY Cal TX Iqlo 
with target, 1 0 as arguments is 0
-   if (b43_nphy_cal_rx_iq(dev, target, 2, 
0) == 0)
-   Call N PHY Save Cal */
-   } else if (nphy-mphase_cal_phase_id == 0) {
-   //TODO N PHY Periodic Calibration with argument 
3
}
-   } else {
-   b43_nphy_restore_cal(dev);
}
}

+   /* TODO: If the output of N PHY Cal TX Iqlo with target, 1 0 as 
arguments is 0 {
+   if (b43_nphy_cal_rx_iq(dev, target, 2, 0) == 0)
+   Call N PHY Save Cal
+   else if (nphy-mphase_cal_phase_id == 0)
+   //TODO: N PHY Periodic Calibration with argument 3
+   } else {
+   b43_nphy_restore_cal(dev);
+   } */
+
b43_nphy_tx_pwr_ctrl_coef_setup(dev);
//TODO N PHY TX Power Control Enable with argument tx_pwr_state
b43_phy_write(dev, B43_NPHY_TXMACIF_HOLDOFF, 0x0015);
-- 
1.6.4.2

___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH 6/6] b43: N-PHY: add huge cal TX IQ LO

2010-01-14 Thread Rafał Miłecki

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
  drivers/net/wireless/b43/phy_n.c   |  214 +++-
  drivers/net/wireless/b43/phy_n.h   |9 ++
  drivers/net/wireless/b43/tables_nphy.c |   60 +
  drivers/net/wireless/b43/tables_nphy.h |   24 
  4 files changed, 301 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 356b89f..d7eeed0 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1033,6 +1033,207 @@ static void b43_nphy_tx_cal_radio_setup(struct 
b43_wldev *dev)
}
  }

+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CalTxIqlo */
+static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
+   struct nphy_txgains target,
+   bool full, bool mphase)
+{
+   struct b43_phy_n *nphy = dev-phy.n;
+   int i;
+   int error = 0;
+   int freq;
+   bool avoid = false;
+   u8 length;
+   u16 tmp, core, type, count, max, numb, last, cmd;
+   const u16 *table;
+   bool phy6or5x;
+
+   u16 buffer[11];
+   u16 diq_start = 0;
+   u16 save[2];
+   u16 gain[2];
+   struct nphy_iqcal_params params[2];
+   bool updated[2] = { };
+
+   b43_nphy_stay_in_carrier_search(dev, true);
+
+   if (dev-phy.rev = 4) {
+   avoid = nphy-hang_avoid;
+   nphy-hang_avoid = 0;
+   }
+
+   //TODO: Read an N PHY Table with ID 7, length 2, offset 0x110, width 
16, and data pointer save
+
+   for (i = 0; i  2; i++) {
+   b43_nphy_iq_cal_gain_params(dev, i, target, params[i]);
+   gain[i] = params[i].cal_gain;
+   }
+   //TODO: Write an N PHY Table with ID 7, length 2, offset 0x110, width 
16, and data pointer gain
+
+   b43_nphy_tx_cal_radio_setup(dev);
+   //TODO: Call N PHY TX Cal PHY Setup
+
+   phy6or5x = dev-phy.rev = 6 ||
+   (dev-phy.rev == 5  nphy-ipa2g_on 
+   b43_current_band(dev-wl) == IEEE80211_BAND_2GHZ);
+   if (phy6or5x) {
+   /* TODO */
+   }
+
+   b43_phy_write(dev, B43_NPHY_IQLOCAL_CMDGCTL, 0x8AA9);
+
+   if (1 /*FIXME: the band width is 20 MHz*/)
+   freq = 2500;
+   else
+   freq = 5000;
+
+   if (nphy-mphase_cal_phase_id  2)
+   ;//TODO: Call N PHY Run Samples with (band width * 8), 0x, 
0, 1, 0 as arguments
+   else
+   ;//TODO: Call N PHY TX Tone with freq, 250, 1, 0 as arguments 
and save result as error
+
+   if (error == 0) {
+   if (nphy-mphase_cal_phase_id  2) {
+   table = nphy-mphase_txcal_bestcoeffs;
+   length = 11;
+   if (dev-phy.rev  3)
+   length -= 2;
+   } else {
+   if (!full  nphy-txiqlocal_coeffsvalid) {
+   table = nphy-txiqlocal_bestc;
+   length = 11;
+   if (dev-phy.rev  3)
+   length -= 2;
+   } else {
+   full = true;
+   if (dev-phy.rev = 3) {
+   table = 
tbl_tx_iqlo_cal_startcoefs_nphyrev3;
+   length = 
B43_NTAB_TX_IQLO_CAL_STARTCOEFS_REV3;
+   } else {
+   table = tbl_tx_iqlo_cal_startcoefs;
+   length = 
B43_NTAB_TX_IQLO_CAL_STARTCOEFS;
+   }
+   }
+   }
+
+   //TODO: Write an N PHY Table with ID 15, length from above, 
offset 64, width 16, and the data pointer from above
+
+   if (full) {
+   if (dev-phy.rev = 3)
+   max = B43_NTAB_TX_IQLO_CAL_CMDS_FULLCAL_REV3;
+   else
+   max = B43_NTAB_TX_IQLO_CAL_CMDS_FULLCAL;
+   } else {
+   if (dev-phy.rev = 3)
+   max = B43_NTAB_TX_IQLO_CAL_CMDS_RECAL_REV3;
+   else
+   max = B43_NTAB_TX_IQLO_CAL_CMDS_RECAL;
+   }
+
+   if (mphase) {
+   count = nphy-mphase_txcal_cmdidx;
+   numb = min(max,
+   (u16)(count + nphy-mphase_txcal_numcmds));
+   } else {
+   count = 0;
+   numb = max;
+   }
+
+   for (; count  numb; count++) {
+   if (full) {
+   if (dev-phy.rev = 3)
+   cmd = 
tbl_tx_iqlo_cal_cmds_fullcal_nphyrev3[count];
+   else
+  

Re: b43 patches sets

2010-01-14 Thread Rafał Miłecki
W dniu 10 stycznia 2010 23:19 użytkownik Rafał Miłecki
zaj...@gmail.com napisał:
 In case you've lost in my patches submission, I've generated following
 (bigger) sets:

 http://estudent.put.poznan.pl/rafal.milecki/b43-1/
 http://estudent.put.poznan.pl/rafal.milecki/b43-2/

Well, I added following:

http://estudent.put.poznan.pl/rafal.milecki/b43-3/
http://estudent.put.poznan.pl/rafal.milecki/b43-4/

and I hope that all dirs contain updated patches. It's easy to get
lost with such amount.

John let me ping you also there (tried IRC). Could you try to grab all
my patches to wireless-testing? It slowly gets messy.

-- 
Rafał
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 1/2] b43: make finding the most significant bit common function

2010-01-14 Thread Michael Buesch
On Thursday 14 January 2010 13:21:27 Rafał Miłecki wrote:
 
 Signed-off-by: Rafał Miłecki zaj...@gmail.com
 ---
   drivers/net/wireless/b43/phy_common.c |   14 ++
   drivers/net/wireless/b43/phy_common.h |1 +
   drivers/net/wireless/b43/phy_lp.c |   17 ++---
   3 files changed, 17 insertions(+), 15 deletions(-)
 
 diff --git a/drivers/net/wireless/b43/phy_common.c 
 b/drivers/net/wireless/b43/phy_common.c
 index 75b26e1..1389ab2 100644
 --- a/drivers/net/wireless/b43/phy_common.c
 +++ b/drivers/net/wireless/b43/phy_common.c
 @@ -421,3 +421,17 @@ void b43_phyop_switch_analog_generic(struct b43_wldev 
 *dev, bool on)
   {
   b43_write16(dev, B43_MMIO_PHY0, on ? 0 : 0xF4);
   }
 +
 +/* Find the position of the most significant bit */
 +u8 phy_nbits(s32 val)
 +{
 + u32 tmp = abs(val);
 + u8 nbits = 0;
 +
 + while (tmp != 0) {
 + nbits++;
 + tmp = 1;
 + }
 +
 + return nbits;
 +}

We already have fls() in bitops.h
I think the following call would be equivalent:

x = fls(abs(val));

So we don't need our own implementation in phy_common.c.
Just use the standard funcs.

-- 
Greetings, Michael.
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 3/6] b43: N-PHY: add update TX cal ladder

2010-01-14 Thread Rafał Miłecki
W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez
mcg...@gmail.com napisał:
 It'd be nice if your patches had a good description of what this is, I
 see most of these patches are one-liners with no description at all.

That's right, because I just implement function by function using
specs. I guess that's how implementing driver from RE specs look like.

Maybe I could use descriptions instead of function names so we would get
calculate TX IQ LO
instead of
b43_nphy_cal_tx_iq_lo
but not sure if that makes much more sense.

Do you have some better suggestion? I'm open for comments, changes :)

-- 
Rafał
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH 3/6] b43: N-PHY: add update TX cal ladder

2010-01-14 Thread Luis R. Rodriguez
2010/1/14 Rafał Miłecki zaj...@gmail.com:
 W dniu 15 stycznia 2010 00:08 użytkownik Luis R. Rodriguez
 mcg...@gmail.com napisał:
 It'd be nice if your patches had a good description of what this is, I
 see most of these patches are one-liners with no description at all.

 That's right, because I just implement function by function using
 specs. I guess that's how implementing driver from RE specs look like.

 Maybe I could use descriptions instead of function names so we would get
 calculate TX IQ LO
 instead of
 b43_nphy_cal_tx_iq_lo
 but not sure if that makes much more sense.

 Do you have some better suggestion? I'm open for comments, changes :)

I'm talking about the text on the commit log after the Subject, the
subject in this case being:

b43: N-PHY: add update TX cal ladder

Doesn't the spec talk or even speculate to some degree what this thing is?

  Luis
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[RFR][PATCH] b43: N-PHY: TX cal PHY code for setup and cleanup

2010-01-14 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
John: as we decided, I'll prepare patch bomb with everything posted so far. So 
this one is posted
for review rather than real including to wireless-testing/kernel.
---
  drivers/net/wireless/b43/phy_n.c |   81 ++
  drivers/net/wireless/b43/phy_n.h |2 +
  2 files changed, 83 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index d7eeed0..bdf1355 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -632,6 +632,87 @@ static void b43_nphy_calc_rx_iq_comp(struct b43_wldev 
*dev, u8 mask)
b43_nphy_rx_iq_coeffs(dev, true, new);
  }

+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxCalPhyCleanup */
+static void b43_nphy_tx_cal_phy_cleanup(struct b43_wldev *dev, u8 core)
+{
+   u16 *regs = dev-nphy.tx_rx_cal_phy_saveregs;
+
+   b43_phy_write(dev, B43_NPHY_RFSEQCA, regs[0]);
+   if (core == 0) {
+   b43_phy_write(dev, B43_NPHY_AFECTL_C1, regs[1]);
+   b43_phy_write(dev, B43_NPHY_AFECTL_OVER1, regs[2]);
+   } else {
+   b43_phy_write(dev, B43_NPHY_AFECTL_C2, regs[1]);
+   b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[2]);
+   }
+   b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[3]);
+   b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[4]);
+   b43_phy_write(dev, B43_NPHY_RFCTL_RSSIO1, regs[5]);
+   b43_phy_write(dev, B43_NPHY_RFCTL_RSSIO2, regs[6]);
+   b43_phy_write(dev, B43_NPHY_TXF_40CO_B1S1, regs[7]);
+   b43_phy_write(dev, B43_NPHY_RFCTL_OVER, regs[8]);
+   b43_phy_write(dev, B43_NPHY_PAPD_EN0, regs[9]);
+   b43_phy_write(dev, B43_NPHY_PAPD_EN1, regs[10]);
+}
+
+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxCalPhySetup */
+static void b43_nphy_tx_cal_phy_setup(struct b43_wldev *dev, u8 core)
+{
+   u16 *regs = dev-nphy.tx_rx_cal_phy_saveregs;
+
+   regs[0] = b43_phy_read(dev, B43_NPHY_RFSEQCA);
+   if (core == 0) {
+   regs[1] = b43_phy_read(dev, B43_NPHY_AFECTL_C1);
+   regs[2] = b43_phy_read(dev, B43_NPHY_AFECTL_OVER1);
+   } else {
+   regs[1] = b43_phy_read(dev, B43_NPHY_AFECTL_C2);
+   regs[2] = b43_phy_read(dev, B43_NPHY_AFECTL_OVER);
+   }
+   regs[3] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1);
+   regs[4] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2);
+   regs[5] = b43_phy_read(dev, B43_NPHY_RFCTL_RSSIO1);
+   regs[6] = b43_phy_read(dev, B43_NPHY_RFCTL_RSSIO2);
+   regs[7] = b43_phy_read(dev, B43_NPHY_TXF_40CO_B1S1);
+   regs[8] = b43_phy_read(dev, B43_NPHY_RFCTL_OVER);
+   regs[9] = b43_phy_read(dev, B43_NPHY_PAPD_EN0);
+   regs[10] = b43_phy_read(dev, B43_NPHY_PAPD_EN1);
+
+   b43_phy_mask(dev, B43_NPHY_PAPD_EN0, ~0x0001);
+   b43_phy_mask(dev, B43_NPHY_PAPD_EN1, ~0x0001);
+
+   b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_RXDIS,
+   ((1 - core)  B43_NPHY_RFSEQCA_RXDIS_SHIFT));
+   b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_TXEN,
+   ((1 - core)  B43_NPHY_RFSEQCA_TXEN_SHIFT));
+   b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_RXEN,
+   (core  B43_NPHY_RFSEQCA_RXEN_SHIFT));
+   b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_TXDIS,
+   (core  B43_NPHY_RFSEQCA_TXDIS_SHIFT));
+
+   if (core == 0) {
+   b43_phy_mask(dev, B43_NPHY_AFECTL_C1, ~0x0007);
+   b43_phy_set(dev, B43_NPHY_AFECTL_OVER1, 0x0007);
+   } else {
+   b43_phy_mask(dev, B43_NPHY_AFECTL_C2, ~0x0007);
+   b43_phy_set(dev, B43_NPHY_AFECTL_OVER, 0x0007);
+   }
+
+   /* TODO: Call N PHY RF Ctrl Intc Override with 2, 0, 3 as arguments */
+   /* TODO: Call N PHY RF Intc Override with 8, 0, 3, 0 as arguments */
+   /* TODO: Call N PHY RF Seq with 0 as argument */
+
+   if (core == 0) {
+   rxval = 1;
+   txval = 8;
+   } else {
+   rxval = 4;
+   txval = 2;
+   }
+
+   /* TODO: Call N PHY RF Ctrl Intc Override with 1, rxval, (core + 1) as 
arguments */
+   /* TODO: Call N PHY RF Ctrl Intc Override with 1, txval, (2 - core) as 
arguments */
+}
+
  /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/IqCalGainParams */
  static void b43_nphy_iq_cal_gain_params(struct b43_wldev *dev, u16 core,
struct nphy_txgains target,
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
index 121050b..9ef5aaf 100644
--- a/drivers/net/wireless/b43/phy_n.h
+++ b/drivers/net/wireless/b43/phy_n.h
@@ -977,7 +977,9 @@ struct b43_phy_n {

u8 antsel_type;

+   u16 tx_rx_cal_phy_saveregs[11];
u16 tx_rx_cal_radio_saveregs[22];
+
u16 txcal_bbmult;
u16 txiqlocal_bestc[11];
bool txiqlocal_coeffsvalid;

No probe response from AP address after 500ms, disconnecting.

2010-01-14 Thread Miklos Vajna
Hi,

I tried asking on #bcm-users, then found the wiki where it's suggested
to report to this list, so I'm doing so. Sorry for the noise on IRC.

A description of the problem at hand:

My card works fine when I use it with WPA, however when I try to use it
without any encryption (actually the provider uses MAC-based filtering,
but that's not important), then after the iwconfig eth0 essid essid,
iwconfig shows the MAC of the AP, and after about 5 secs iwconfig
says it's Not-Associated. If I run iwconfig eth0 essid again, then
it's usable again for ~5 secs and so on. When the AP goes unassociated,
I see this in dmesg:

No probe response from AP 00:12:17:d3:87:f5 after 500ms, disconnecting.

When it happens:

It happens only in case not using encryption. An other laptop with
ipw2200 driver works fine, so I guess this will be a b43 or firmware
problem. The same card works under Windows XP as well, so I guess it's
not a hardware problem.

How to reproduce:

Run iwconfig eth0 essid essid, wait ~5 secs and run iwconfig
again. Result: it's unassociated. Expected: to show the MAC of the AP,
etc.

$ uname -a
Linux s12 2.6.32-fw2 #1 SMP PREEMPT Sat Dec 19 13:56:14 CET 2009 x86_64
GNU/Linux

$ sudo lspci -vvn|grep 43 -A7
00:00.4 0600: 1106:4353
Subsystem: 17aa:3889
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium TAbort- 
TAbort- MAbort- SERR- PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes

00:00.5 0800: 1106:5353 (prog-if 20 [IO(X)-APIC])
Subsystem: 17aa:388a
--
02:00.0 0280: 14e4:4315 (rev 01)
Subsystem: 14e4:04b5
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast TAbort- TAbort- 
MAbort- SERR- PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 28
Region 0: Memory at f520 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
--
Kernel driver in use: b43-pci-bridge
Kernel modules: ssb

dmesg: http://frugalware.org/~vmiklos/files/dmesg-s12

Wlan configuration, authentication/encryption type:

b43 from vanilla kernel, no encryption. Firmware is installed as
described at http://linuxwireless.org/en/users/Drivers/b43#fw-b43-lp

kernel is a distro-packaged vanilla 2.6.32.1.

Any ideas?

Thanks!


pgpkGdUyIEjyK.pgp
Description: PGP signature
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: No probe response from AP address after 500ms, disconnecting.

2010-01-14 Thread Peter Stuge
Interesting!

Miklos Vajna wrote:
 Hi,
 
 I tried asking on #bcm-users, then found the wiki where it's suggested
 to report to this list, so I'm doing so. Sorry for the noise on IRC.
 
 A description of the problem at hand:
 
 My card works fine when I use it with WPA, however when I try to use it
 without any encryption

Do you have wpa_supplicant running also when not using encryption?


 (actually the provider uses MAC-based filtering, but that's not
 important), then after the iwconfig eth0 essid essid,
 iwconfig shows the MAC of the AP, and after about 5 secs iwconfig
 says it's Not-Associated. If I run iwconfig eth0 essid again, then
 it's usable again for ~5 secs and so on. When the AP goes unassociated,
 I see this in dmesg:
 
 No probe response from AP 00:12:17:d3:87:f5 after 500ms, disconnecting.

I also get this issue, but with ath9k.

I have made some noise on the ath9k list about it, and currently have
a reboot pending to try the latest wireless-testing, which has gotten
some more fixes.


 When it happens:
 
 It happens only in case not using encryption. An other laptop with
 ipw2200 driver works fine, so I guess this will be a b43 or firmware
 problem. The same card works under Windows XP as well, so I guess
 it's not a hardware problem.

I upgraded from ipw2200 to ath9k in my laptop and the old card never
had trouble. Both ath9k and b43 use mac80211 but ipw2200 does not.
With mac80211 you're apparently supposed to always have wpa_supplicant
running - even if not using encryption. The supplicant is responsible
for reconnecting if the interface is disconnected for any reason.

I'm not satisfied with this as the final answer yet. I find it
suspicious that my card disconnects in the first place.

I am normally in a moderately silent RF environment, with not many
APs. With power management enabled (iwconfig eth1 power on) I
experience this issue within minutes. With PM disabled, it happens
only every couple of days. This is on wireless-testing as of Dec 14.
In a very tough RF environment such as a hacker conference the
problem is much more pronounced and disconnects happen many times per
day also with PM off.


 Any ideas?

Does iwconfig power off make a difference for you?


//Peter


pgpWZFKIquKbK.pgp
Description: PGP signature
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: No probe response from AP address after 500ms, disconnecting.

2010-01-14 Thread Gábor Stefanik
On Fri, Jan 15, 2010 at 2:12 AM, Miklos Vajna vmik...@frugalware.org wrote:
 Hi,

 I tried asking on #bcm-users, then found the wiki where it's suggested
 to report to this list, so I'm doing so. Sorry for the noise on IRC.

 A description of the problem at hand:

 My card works fine when I use it with WPA, however when I try to use it
 without any encryption (actually the provider uses MAC-based filtering,
 but that's not important), then after the iwconfig eth0 essid essid,
 iwconfig shows the MAC of the AP, and after about 5 secs iwconfig
 says it's Not-Associated. If I run iwconfig eth0 essid again, then
 it's usable again for ~5 secs and so on. When the AP goes unassociated,
 I see this in dmesg:

 No probe response from AP 00:12:17:d3:87:f5 after 500ms, disconnecting.

 When it happens:

 It happens only in case not using encryption. An other laptop with
 ipw2200 driver works fine, so I guess this will be a b43 or firmware
 problem. The same card works under Windows XP as well, so I guess it's
 not a hardware problem.

 How to reproduce:

 Run iwconfig eth0 essid essid, wait ~5 secs and run iwconfig
 again. Result: it's unassociated. Expected: to show the MAC of the AP,
 etc.

 $ uname -a
 Linux s12 2.6.32-fw2 #1 SMP PREEMPT Sat Dec 19 13:56:14 CET 2009 x86_64
 GNU/Linux

 $ sudo lspci -vvn|grep 43 -A7
 00:00.4 0600: 1106:4353
        Subsystem: 17aa:3889
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
 Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium TAbort- 
 TAbort- MAbort- SERR- PERR- INTx-
        Latency: 0, Cache Line Size: 32 bytes

 00:00.5 0800: 1106:5353 (prog-if 20 [IO(X)-APIC])
        Subsystem: 17aa:388a
 --
 02:00.0 0280: 14e4:4315 (rev 01)
        Subsystem: 14e4:04b5
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
 Stepping- SERR+ FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast TAbort- 
 TAbort- MAbort- SERR- PERR- INTx-
        Latency: 0, Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 28
        Region 0: Memory at f520 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [40] Power Management version 3
 --
        Kernel driver in use: b43-pci-bridge
        Kernel modules: ssb

 dmesg: http://frugalware.org/~vmiklos/files/dmesg-s12

 Wlan configuration, authentication/encryption type:

 b43 from vanilla kernel, no encryption. Firmware is installed as
 described at http://linuxwireless.org/en/users/Drivers/b43#fw-b43-lp

 kernel is a distro-packaged vanilla 2.6.32.1.

 Any ideas?

 Thanks!

 ___
 Bcm43xx-dev mailing list
 Bcm43xx-dev@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/bcm43xx-dev



14E4:4315 is an LP-PHY (specifically, for most people,, it is the
LP-PHY), for which 2.6.32 contains no calibration support, so
performance/range problems can be expected. 2.6.33 should have
improvements (part of calibration done), and 2.6.34 will (if I have
time to do it) have full calibration support.

-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: No probe response from AP address after 500ms, disconnecting.

2010-01-14 Thread Miklos Vajna
On Fri, Jan 15, 2010 at 03:36:54AM +0100, Gábor Stefanik 
netrolller...@gmail.com wrote:
 14E4:4315 is an LP-PHY (specifically, for most people,, it is the
 LP-PHY), for which 2.6.32 contains no calibration support, so
 performance/range problems can be expected. 2.6.33 should have
 improvements (part of calibration done), and 2.6.34 will (if I have
 time to do it) have full calibration support.

What does calibration support mean?

By performance problem I mean that after iwconfig eth0 essid it's
working for ~5sec, and then it's down till the next iwconfig eth0
essid, so it's basically unusable. :/


By 2.6.33, you mean that I should give 2.6.33-rc4 a try?

Thanks!


pgpe7JV4HJ7ay.pgp
Description: PGP signature
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: No probe response from AP address after 500ms, disconnecting.

2010-01-14 Thread Peter Stuge
Miklos Vajna wrote:
  I have made some noise on the ath9k list about it, and currently have
  a reboot pending to try the latest wireless-testing, which has gotten
  some more fixes.
 
 Please let me know if that helped (which git repo, which branch?).

Will do.


 Should I include a section for the linksys (which has no encryption)
 AP as well? if yes, what should it look like?

Yes, otherwise I don't think wpa_supplicant will do anything.

network={
  ssid=linksys
  key_mgmt=NONE
}

It could help to run it in foreground - you should see disconnect and
reauth then.


  Does iwconfig power off make a difference for you?
 
 It seems to be already off,

Ok.


//Peter
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev