Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] b43: silense most sparse warnings
From: John W. Linville @ 2010-07-21 15:45 UTC (permalink / raw)
  To: linux-wireless
  Cc: Michael Buesch, Larry Finger, Gábor Stefanik,
	Rafał Miłecki, John W. Linville

  CHECK   drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/main.c:111:5: warning: symbol 'b43_modparam_pio' was not declared. Should it be static?
  CHECK   drivers/net/wireless/b43/phy_g.c
drivers/net/wireless/b43/phy_g.c:975:56: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
  CHECK   drivers/net/wireless/b43/phy_lp.c
drivers/net/wireless/b43/phy_lp.c:2701:6: warning: symbol 'b43_lpphy_op_switch_analog' was not declared. Should it be static?
drivers/net/wireless/b43/phy_lp.c:1148:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
drivers/net/wireless/b43/phy_lp.c:1525:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
drivers/net/wireless/b43/phy_lp.c:1529:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
  CHECK   drivers/net/wireless/b43/wa.c
drivers/net/wireless/b43/wa.c:385:60: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:403:55: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:405:55: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:415:71: warning: cast truncates bits from constant value (ffff0fff becomes fff)

AFAICT, none of these amount to real bugs.  But this reduces warning
spam from sparse w/o significantly affecting readability of the code (IMHO).

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/b43/main.c   |    2 +-
 drivers/net/wireless/b43/phy_g.c  |    2 +-
 drivers/net/wireless/b43/phy_lp.c |    8 ++++----
 drivers/net/wireless/b43/wa.c     |    8 ++++----
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 8e24379..20631ae 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -108,7 +108,7 @@ int b43_modparam_verbose = B43_VERBOSITY_DEFAULT;
 module_param_named(verbose, b43_modparam_verbose, int, 0644);
 MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug");
 
-int b43_modparam_pio = B43_PIO_DEFAULT;
+static int b43_modparam_pio = B43_PIO_DEFAULT;
 module_param_named(pio, b43_modparam_pio, int, 0644);
 MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
 
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
index 29bf34c..0dc33b6 100644
--- a/drivers/net/wireless/b43/phy_g.c
+++ b/drivers/net/wireless/b43/phy_g.c
@@ -972,7 +972,7 @@ b43_radio_interference_mitigation_enable(struct b43_wldev *dev, int mode)
 		b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B);
 
 		if (phy->rev >= 3) {
-			b43_phy_mask(dev, 0x048A, (u16)~0x8000);
+			b43_phy_mask(dev, 0x048A, 0x7FFF);
 			b43_phy_maskset(dev, 0x0415, 0x8000, 0x36D8);
 			b43_phy_maskset(dev, 0x0416, 0x8000, 0x36D8);
 			b43_phy_maskset(dev, 0x0417, 0xFE00, 0x016D);
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index c6afe9d..fd50eb1 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1145,7 +1145,7 @@ static void lpphy_write_tx_pctl_mode_to_hardware(struct b43_wldev *dev)
 		B43_WARN_ON(1);
 	}
 	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
-			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE, ctl);
+			~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF, ctl);
 }
 
 static void lpphy_set_tx_power_control(struct b43_wldev *dev,
@@ -1522,11 +1522,11 @@ static void lpphy_tx_pctl_init_hw(struct b43_wldev *dev)
 	b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xFF);
 	b43_phy_write(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xA);
 	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
-			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
+			~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF,
 			B43_LPPHY_TX_PWR_CTL_CMD_MODE_OFF);
 	b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xF8FF);
 	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
-			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
+			~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF,
 			B43_LPPHY_TX_PWR_CTL_CMD_MODE_SW);
 
 	if (dev->phy.rev < 2) {
@@ -2698,7 +2698,7 @@ static enum b43_txpwr_result b43_lpphy_op_recalc_txpower(struct b43_wldev *dev,
 	return B43_TXPWR_RES_DONE;
 }
 
-void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
+static void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
 {
        if (on) {
                b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xfff8);
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c
index 97c7916..9a335da 100644
--- a/drivers/net/wireless/b43/wa.c
+++ b/drivers/net/wireless/b43/wa.c
@@ -382,7 +382,7 @@ static void b43_wa_altagc(struct b43_wldev *dev)
 		b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 3, 25);
 	}
 
-	b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, (u16)~0xFF00, 0x5700);
+	b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, 0x00FF, 0x5700);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x007F, 0x000F);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x3F80, 0x2B80);
 	b43_phy_maskset(dev, B43_PHY_ANTWRSETT, 0xF0FF, 0x0300);
@@ -400,9 +400,9 @@ static void b43_wa_altagc(struct b43_wldev *dev)
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x00FF, 0x0020);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x3F00, 0x0200);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x82), ~0x00FF, 0x002E);
-	b43_phy_maskset(dev, B43_PHY_OFDM(0x96), (u16)~0xFF00, 0x1A00);
+	b43_phy_maskset(dev, B43_PHY_OFDM(0x96), 0x00FF, 0x1A00);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), ~0x00FF, 0x0028);
-	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), (u16)~0xFF00, 0x2C00);
+	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), 0x00FF, 0x2C00);
 	if (phy->rev == 1) {
 		b43_phy_write(dev, B43_PHY_PEAK_COUNT, 0x092B);
 		b43_phy_maskset(dev, B43_PHY_OFDM(0x1B), ~0x001E, 0x0002);
@@ -412,7 +412,7 @@ static void b43_wa_altagc(struct b43_wldev *dev)
 		b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, ~0x000F, 0x0004);
 		if (phy->rev >= 6) {
 			b43_phy_write(dev, B43_PHY_OFDM(0x22), 0x287A);
-			b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, (u16)~0xF000, 0x3000);
+			b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, 0x0FFF, 0x3000);
 		}
 	}
 	b43_phy_maskset(dev, B43_PHY_DIVSRCHIDX, 0x8080, 0x7874);
-- 
1.7.1.1


^ permalink raw reply related

* Re: [PATCH] b43: silense most sparse warnings
From: Michael Büsch @ 2010-07-21 16:05 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless, Larry Finger, Gábor Stefanik,
	Rafał Miłecki
In-Reply-To: <1279727142-25234-1-git-send-email-linville@tuxdriver.com>

On 07/21/2010 05:45 PM, John W. Linville wrote:
> diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
> index 29bf34c..0dc33b6 100644
> --- a/drivers/net/wireless/b43/phy_g.c
> +++ b/drivers/net/wireless/b43/phy_g.c
> @@ -972,7 +972,7 @@ b43_radio_interference_mitigation_enable(struct b43_wldev *dev, int mode)
>   		b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B);
>
>   		if (phy->rev>= 3) {
> -			b43_phy_mask(dev, 0x048A, (u16)~0x8000);
> +			b43_phy_mask(dev, 0x048A, 0x7FFF);

This cast was introduced to silense a GCC warning. Do we end up in an
infinite loop now? ;)

>   			b43_phy_maskset(dev, 0x0415, 0x8000, 0x36D8);
>   			b43_phy_maskset(dev, 0x0416, 0x8000, 0x36D8);
>   			b43_phy_maskset(dev, 0x0417, 0xFE00, 0x016D);
> diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
> index c6afe9d..fd50eb1 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -1145,7 +1145,7 @@ static void lpphy_write_tx_pctl_mode_to_hardware(struct b43_wldev *dev)
>   		B43_WARN_ON(1);
>   	}
>   	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
> -			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE, ctl);
> +			~B43_LPPHY_TX_PWR_CTL_CMD_MODE&  0xFFFF, ctl);
>   }

>
>   static void lpphy_set_tx_power_control(struct b43_wldev *dev,
> @@ -1522,11 +1522,11 @@ static void lpphy_tx_pctl_init_hw(struct b43_wldev *dev)
>   	b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xFF);
>   	b43_phy_write(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xA);
>   	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
> -			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
> +			~B43_LPPHY_TX_PWR_CTL_CMD_MODE&  0xFFFF,
>   			B43_LPPHY_TX_PWR_CTL_CMD_MODE_OFF);
>   	b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xF8FF);
>   	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
> -			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
> +			~B43_LPPHY_TX_PWR_CTL_CMD_MODE&  0xFFFF,
>   			B43_LPPHY_TX_PWR_CTL_CMD_MODE_SW);

> diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c
> index 97c7916..9a335da 100644
> --- a/drivers/net/wireless/b43/wa.c
> +++ b/drivers/net/wireless/b43/wa.c
> @@ -382,7 +382,7 @@ static void b43_wa_altagc(struct b43_wldev *dev)
>   		b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 3, 25);
>   	}
>
> -	b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, (u16)~0xFF00, 0x5700);
> +	b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, 0x00FF, 0x5700);
>   	b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x007F, 0x000F);
>   	b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x3F80, 0x2B80);
>   	b43_phy_maskset(dev, B43_PHY_ANTWRSETT, 0xF0FF, 0x0300);
> @@ -400,9 +400,9 @@ static void b43_wa_altagc(struct b43_wldev *dev)
>   	b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x00FF, 0x0020);
>   	b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x3F00, 0x0200);
>   	b43_phy_maskset(dev, B43_PHY_OFDM(0x82), ~0x00FF, 0x002E);
> -	b43_phy_maskset(dev, B43_PHY_OFDM(0x96), (u16)~0xFF00, 0x1A00);
> +	b43_phy_maskset(dev, B43_PHY_OFDM(0x96), 0x00FF, 0x1A00);
>   	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), ~0x00FF, 0x0028);
> -	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), (u16)~0xFF00, 0x2C00);
> +	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), 0x00FF, 0x2C00);
>   	if (phy->rev == 1) {
>   		b43_phy_write(dev, B43_PHY_PEAK_COUNT, 0x092B);
>   		b43_phy_maskset(dev, B43_PHY_OFDM(0x1B), ~0x001E, 0x0002);
> @@ -412,7 +412,7 @@ static void b43_wa_altagc(struct b43_wldev *dev)
>   		b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, ~0x000F, 0x0004);
>   		if (phy->rev>= 6) {
>   			b43_phy_write(dev, B43_PHY_OFDM(0x22), 0x287A);
> -			b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, (u16)~0xF000, 0x3000);
> +			b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, 0x0FFF, 0x3000);
>   		}
>   	}
>   	b43_phy_maskset(dev, B43_PHY_DIVSRCHIDX, 0x8080, 0x7874);

Same for all of these.

-- 
Greetings Michael.

^ permalink raw reply

* Re: [PATCH] zd1211rw: make CR_INTERRUPT cast explicit
From: Pavel Roskin @ 2010-07-21 16:36 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Daniel Drake, Ulrich Kunitz
In-Reply-To: <1279724935-16581-1-git-send-email-linville@tuxdriver.com>

On Wed, 2010-07-21 at 11:08 -0400, John W. Linville wrote:
> CHECK   drivers/net/wireless/zd1211rw/zd_usb.c
> drivers/net/wireless/zd1211rw/zd_usb.c:376:24: warning: implicit cast from nocast type
> 
> The value comparison is intentional, so forcing the cast seems warranted
> in order to silence the sparse warning.
> 
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
>  drivers/net/wireless/zd1211rw/zd_usb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
> index 818e148..acbf4d9 100644
> --- a/drivers/net/wireless/zd1211rw/zd_usb.c
> +++ b/drivers/net/wireless/zd1211rw/zd_usb.c
> @@ -373,7 +373,7 @@ static inline void handle_regs_int(struct urb *urb)
>  	spin_lock(&intr->lock);
>  
>  	int_num = le16_to_cpu(*(__le16 *)(urb->transfer_buffer+2));
> -	if (int_num == CR_INTERRUPT) {
> +	if (int_num == (u16 __force) CR_INTERRUPT) {

I think __force should be used sparingly, especially outside headers.  I
tried other ways to prevent the warning.  I tried declaring int_num as
zd_addr_t, but sparse keeps complaining about the same comparison.

I can rewrite "if" as "switch" to suppress the warning, but it makes the
code less readable.  I think it's a bug in sparse.  There should be no
casts when comparing values of the same type.

I understand the benefits of fixing sparse warnings, but this patch
works around a sparse bug and sets a bad example.

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Re: [PATCH] b43: silense most sparse warnings
From: John W. Linville @ 2010-07-21 16:38 UTC (permalink / raw)
  To: Michael Büsch
  Cc: linux-wireless, Larry Finger, Gábor Stefanik,
	Rafał Miłecki
In-Reply-To: <4C471AC2.5040003@bu3sch.de>

On Wed, Jul 21, 2010 at 06:05:22PM +0200, Michael Büsch wrote:
> On 07/21/2010 05:45 PM, John W. Linville wrote:
> >diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
> >index 29bf34c..0dc33b6 100644
> >--- a/drivers/net/wireless/b43/phy_g.c
> >+++ b/drivers/net/wireless/b43/phy_g.c
> >@@ -972,7 +972,7 @@ b43_radio_interference_mitigation_enable(struct b43_wldev *dev, int mode)
> >  		b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B);
> >
> >  		if (phy->rev>= 3) {
> >-			b43_phy_mask(dev, 0x048A, (u16)~0x8000);
> >+			b43_phy_mask(dev, 0x048A, 0x7FFF);
> 
> This cast was introduced to silense a GCC warning. Do we end up in an
> infinite loop now? ;)

This version has the beauty of pleasing both gcc and sparse. :-)

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* [PATCH] wl1251: fix sparse-generated warnings
From: John W. Linville @ 2010-07-21 16:31 UTC (permalink / raw)
  To: linux-wireless; +Cc: Kalle Valo, Luciano Coelho, John W. Linville

  CHECK   drivers/net/wireless/wl12xx/wl1251_tx.c
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32:    expected unsigned short [unsigned] [usertype] frag_threshold
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24:    expected unsigned short [unsigned] [usertype] length
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22:    expected unsigned short [unsigned] [usertype] rate
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29:    expected unsigned int [unsigned] [usertype] expiry_time
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43:    expected restricted __le16 [usertype] fc
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43:    got unsigned short [unsigned] [assigned] [usertype] fc
  CHECK   drivers/net/wireless/wl12xx/wl1251_cmd.c
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39:    expected unsigned int [unsigned] [usertype] rx_config_options
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39:    expected unsigned int [unsigned] [usertype] rx_filter_options
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29:    expected unsigned short [unsigned] [usertype] tx_rate
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47:    expected unsigned int [unsigned] [usertype] min_duration
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47:    expected unsigned int [unsigned] [usertype] max_duration
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47:    got restricted __le32 [usertype] <noident>
  CHECK   drivers/net/wireless/wl12xx/wl1251_boot.c
drivers/net/wireless/wl12xx/wl1251_boot.c:228:22: warning: symbol 'interrupt' shadows an earlier one
/home/linville/git/wireless-next-2.6/arch/x86/include/asm/hw_irq.h:132:13: originally declared here
drivers/net/wireless/wl12xx/wl1251_boot.c:470:21: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_boot.c:470:21:    expected unsigned int [unsigned] [assigned] [usertype] val
drivers/net/wireless/wl12xx/wl1251_boot.c:470:21:    got restricted __le32 [usertype] <noident>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
I made some assumptions about the endian-ness of some structure members
-- please verify!  Also, I'm reasonably certain there are more endian
issues lurking...

 drivers/net/wireless/wl12xx/wl1251_boot.c |   10 +++++-----
 drivers/net/wireless/wl12xx/wl1251_cmd.h  |   12 ++++++------
 drivers/net/wireless/wl12xx/wl1251_tx.c   |   10 ++++++----
 drivers/net/wireless/wl12xx/wl1251_tx.h   |    8 ++++----
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1251_boot.c b/drivers/net/wireless/wl12xx/wl1251_boot.c
index 2545123..c688895 100644
--- a/drivers/net/wireless/wl12xx/wl1251_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1251_boot.c
@@ -225,7 +225,7 @@ static void wl1251_boot_set_ecpu_ctrl(struct wl1251 *wl, u32 flag)
 int wl1251_boot_run_firmware(struct wl1251 *wl)
 {
 	int loop, ret;
-	u32 chip_id, interrupt;
+	u32 chip_id, acx_intr;
 
 	wl1251_boot_set_ecpu_ctrl(wl, ECPU_CONTROL_HALT);
 
@@ -242,15 +242,15 @@ int wl1251_boot_run_firmware(struct wl1251 *wl)
 	loop = 0;
 	while (loop++ < INIT_LOOP) {
 		udelay(INIT_LOOP_DELAY);
-		interrupt = wl1251_reg_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
+		acx_intr = wl1251_reg_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
 
-		if (interrupt == 0xffffffff) {
+		if (acx_intr == 0xffffffff) {
 			wl1251_error("error reading hardware complete "
 				     "init indication");
 			return -EIO;
 		}
 		/* check that ACX_INTR_INIT_COMPLETE is enabled */
-		else if (interrupt & WL1251_ACX_INTR_INIT_COMPLETE) {
+		else if (acx_intr & WL1251_ACX_INTR_INIT_COMPLETE) {
 			wl1251_reg_write32(wl, ACX_REG_INTERRUPT_ACK,
 					   WL1251_ACX_INTR_INIT_COMPLETE);
 			break;
@@ -467,7 +467,7 @@ static int wl1251_boot_upload_nvs(struct wl1251 *wl)
 		val = (nvs_ptr[0] | (nvs_ptr[1] << 8)
 		       | (nvs_ptr[2] << 16) | (nvs_ptr[3] << 24));
 
-		val = cpu_to_le32(val);
+		val = (u32 __force) cpu_to_le32(val);
 
 		wl1251_debug(DEBUG_BOOT,
 			     "nvs write table 0x%x: 0x%x",
diff --git a/drivers/net/wireless/wl12xx/wl1251_cmd.h b/drivers/net/wireless/wl12xx/wl1251_cmd.h
index 4ad67ca..ca1cb24 100644
--- a/drivers/net/wireless/wl12xx/wl1251_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1251_cmd.h
@@ -175,8 +175,8 @@ struct cmd_read_write_memory {
 #define WL1251_SCAN_NUM_PROBES 3
 
 struct wl1251_scan_parameters {
-	u32 rx_config_options;
-	u32 rx_filter_options;
+	__le32 rx_config_options;
+	__le32 rx_filter_options;
 
 	/*
 	 * Scan options:
@@ -186,7 +186,7 @@ struct wl1251_scan_parameters {
 	 * bit 2: voice mode, 0 for normal scan.
 	 * bit 3: scan priority, 1 for high priority.
 	 */
-	u16 scan_options;
+	__le16 scan_options;
 
 	/* Number of channels to scan */
 	u8 num_channels;
@@ -195,7 +195,7 @@ struct wl1251_scan_parameters {
 	u8 num_probe_requests;
 
 	/* Rate and modulation for probe requests */
-	u16 tx_rate;
+	__le16 tx_rate;
 
 	u8 tid_trigger;
 	u8 ssid_len;
@@ -204,8 +204,8 @@ struct wl1251_scan_parameters {
 } __attribute__ ((packed));
 
 struct wl1251_scan_ch_parameters {
-	u32 min_duration; /* in TU */
-	u32 max_duration; /* in TU */
+	__le32 min_duration; /* in TU */
+	__le32 max_duration; /* in TU */
 	u32 bssid_lsb;
 	u16 bssid_msb;
 
diff --git a/drivers/net/wireless/wl12xx/wl1251_tx.c b/drivers/net/wireless/wl12xx/wl1251_tx.c
index c822318..a38ec19 100644
--- a/drivers/net/wireless/wl12xx/wl1251_tx.c
+++ b/drivers/net/wireless/wl12xx/wl1251_tx.c
@@ -117,7 +117,7 @@ static void wl1251_tx_frag_block_num(struct tx_double_buffer_desc *tx_hdr)
 	frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
 	tx_hdr->frag_threshold = cpu_to_le16(frag_threshold);
 
-	payload_len = tx_hdr->length + MAX_MSDU_SECURITY_LENGTH;
+	payload_len = le16_to_cpu(tx_hdr->length) + MAX_MSDU_SECURITY_LENGTH;
 
 	if (payload_len > frag_threshold) {
 		mem_blocks_per_frag =
@@ -191,11 +191,13 @@ static int wl1251_tx_send_packet(struct wl1251 *wl, struct sk_buff *skb,
 	if (control->control.hw_key &&
 	    control->control.hw_key->alg == ALG_TKIP) {
 		int hdrlen;
-		u16 fc;
+		__le16 fc;
+		u16 length;
 		u8 *pos;
 
-		fc = *(u16 *)(skb->data + sizeof(*tx_hdr));
-		tx_hdr->length += WL1251_TKIP_IV_SPACE;
+		fc = *(__le16 *)(skb->data + sizeof(*tx_hdr));
+		length = le16_to_cpu(tx_hdr->length) + WL1251_TKIP_IV_SPACE;
+		tx_hdr->length = cpu_to_le16(length);
 
 		hdrlen = ieee80211_hdrlen(fc);
 
diff --git a/drivers/net/wireless/wl12xx/wl1251_tx.h b/drivers/net/wireless/wl12xx/wl1251_tx.h
index 55856c6..dff127f 100644
--- a/drivers/net/wireless/wl12xx/wl1251_tx.h
+++ b/drivers/net/wireless/wl12xx/wl1251_tx.h
@@ -114,7 +114,7 @@ struct tx_control {
 
 struct tx_double_buffer_desc {
 	/* Length of payload, including headers. */
-	u16 length;
+	__le16 length;
 
 	/*
 	 * A bit mask that specifies the initial rate to be used
@@ -133,10 +133,10 @@ struct tx_double_buffer_desc {
 	 * 0x0800 - 48Mbits
 	 * 0x1000 - 54Mbits
 	 */
-	u16 rate;
+	__le16 rate;
 
 	/* Time in us that a packet can spend in the target */
-	u32 expiry_time;
+	__le32 expiry_time;
 
 	/* index of the TX queue used for this packet */
 	u8 xmit_queue;
@@ -150,7 +150,7 @@ struct tx_double_buffer_desc {
 	 * The FW should cut the packet into fragments
 	 * of this size.
 	 */
-	u16 frag_threshold;
+	__le16 frag_threshold;
 
 	/* Numbers of HW queue blocks to be allocated */
 	u8 num_mem_blocks;
-- 
1.7.1.1


^ permalink raw reply related

* Re: [PATCH] b43: silense most sparse warnings
From: Larry Finger @ 2010-07-21 16:48 UTC (permalink / raw)
  To: Michael Büsch
  Cc: John W. Linville, linux-wireless, Larry Finger,
	Gábor Stefanik, Rafał Miłecki
In-Reply-To: <4C471AC2.5040003@bu3sch.de>

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

On 07/21/2010 11:05 AM, Michael Büsch wrote:
> On 07/21/2010 05:45 PM, John W. Linville wrote:
>> diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
>> index 29bf34c..0dc33b6 100644
>> --- a/drivers/net/wireless/b43/phy_g.c
>> +++ b/drivers/net/wireless/b43/phy_g.c
>> @@ -972,7 +972,7 @@ b43_radio_interference_mitigation_enable(struct b43_wldev
>> *dev, int mode)
>> b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B);
>>
>> if (phy->rev>= 3) {
>> - b43_phy_mask(dev, 0x048A, (u16)~0x8000);
>> + b43_phy_mask(dev, 0x048A, 0x7FFF);
>
> This cast was introduced to silense a GCC warning. Do we end up in an
> infinite loop now? ;)

I get no GCC warnings here with the change. I think it is OK.

Is silense a valid British spelling? I prefer silence.

Do you wish to clean up the warnings from the N-PHY code as well? Ignoring the 
"should it be static?" parts, I get the following sparse warnings:

drivers/net/wireless/b43/phy_n.c:512:53: warning: cast truncates bits from 
constant value (ffff0fff becomes fff)
drivers/net/wireless/b43/phy_n.c:765:66: warning: cast truncates bits from 
constant value (ffff7fff becomes 7fff)
drivers/net/wireless/b43/phy_n.c:1012:38: warning: cast truncates bits from 
constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/phy_n.c:1119:38: warning: cast truncates bits from 
constant value (ffff0fff becomes fff)
drivers/net/wireless/b43/phy_n.c:2458:56: warning: cast truncates bits from 
constant value (ffff7fff becomes 7fff)
drivers/net/wireless/b43/phy_n.c:2933:38: warning: cast truncates bits from 
constant value (ffff0fff becomes fff)
drivers/net/wireless/b43/phy_n.c:3294:57: warning: cast truncates bits from 
constant value (ffff3fff becomes 3fff)

The patch for them is below.

Larry



Index: wireless-testing/drivers/net/wireless/b43/phy_n.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/phy_n.c
+++ wireless-testing/drivers/net/wireless/b43/phy_n.c
@@ -509,8 +509,8 @@ static void b43_nphy_rx_cal_phy_setup(st
  	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, (u16)~B43_NPHY_RFSEQCA_RXDIS,
-			((1 - core) << B43_NPHY_RFSEQCA_RXDIS_SHIFT));
+	b43_phy_maskset(dev, B43_NPHY_RFSEQCA, (u16)(~B43_NPHY_RFSEQCA_RXDIS &
+			0xFFFF), ((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,
@@ -762,7 +762,7 @@ static void b43_nphy_stop_playback(struc
  	if (tmp & 0x1)
  		b43_phy_set(dev, B43_NPHY_SAMP_CMD, B43_NPHY_SAMP_CMD_STOP);
  	else if (tmp & 0x2)
-		b43_phy_mask(dev, B43_NPHY_IQLOCAL_CMDGCTL, (u16)~0x8000);
+		b43_phy_mask(dev, B43_NPHY_IQLOCAL_CMDGCTL, 0x7FFF);

  	b43_phy_mask(dev, B43_NPHY_SAMP_CMD, ~0x0004);

@@ -1009,7 +1009,7 @@ static void b43_nphy_gain_crtl_workaroun
  			b43_nphy_set_rf_sequence(dev, 5,
  					rfseq_events, rfseq_delays, 3);
  			b43_phy_maskset(dev, B43_NPHY_OVER_DGAIN1,
-				(u16)~B43_NPHY_OVER_DGAIN_CCKDGECV,
+				(u16)(~B43_NPHY_OVER_DGAIN_CCKDGECV & 0xFFFF),
  				0x5A << B43_NPHY_OVER_DGAIN_CCKDGECV_SHIFT);

  			if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
@@ -1116,7 +1116,7 @@ static void b43_nphy_workarounds(struct
  		b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20);

  		b43_phy_mask(dev, B43_NPHY_PIL_DW1,
-				(u16)~B43_NPHY_PIL_DW_64QAM);
+				(u16)(~B43_NPHY_PIL_DW_64QAM & 0xFFFF));
  		b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B1, 0xB5);
  		b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B2, 0xA4);
  		b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B3, 0x00);
@@ -2455,7 +2455,8 @@ static void b43_nphy_tx_cal_phy_setup(st
  		b43_phy_write(dev, B43_NPHY_AFECTL_OVER, tmp | 0x0600);

  		regs[4] = b43_phy_read(dev, B43_NPHY_BBCFG);
-		b43_phy_mask(dev, B43_NPHY_BBCFG, (u16)~B43_NPHY_BBCFG_RSTRX);
+		b43_phy_mask(dev, B43_NPHY_BBCFG, (u16)(~B43_NPHY_BBCFG_RSTRX
+			     & 0xFFFF));

  		tmp = b43_ntab_read(dev, B43_NTAB16(8, 3));
  		regs[5] = tmp;
@@ -2930,7 +2931,7 @@ static int b43_nphy_rev2_cal_rx_iq(struc
  		tmp[5] = b43_phy_read(dev, rfctl[1]);

  		b43_phy_maskset(dev, B43_NPHY_RFSEQCA,
-				(u16)~B43_NPHY_RFSEQCA_RXDIS,
+				(u16)(~B43_NPHY_RFSEQCA_RXDIS & 0xFFFF),
  				((1 - i) << B43_NPHY_RFSEQCA_RXDIS_SHIFT));
  		b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_TXEN,
  				(1 - i));
@@ -3291,7 +3292,7 @@ static void b43_nphy_chanspec_setup(stru
  		b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ);
  		tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR);
  		b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4);
-		b43_phy_mask(dev, B43_PHY_B_BBCFG, (u16)~0xC000);
+		b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF);
  		b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32);
  	}


[-- Attachment #2: b43_silence_most_sparse_warnings --]
[-- Type: text/plain, Size: 9749 bytes --]

Subject: [PATCH] b43: silense most sparse warnings
From: "John W. Linville" <linville@tuxdriver.com>
Date: Wed, 21 Jul 2010 11:45:42 -0400
To: linux-wireless@vger.kernel.org
CC: Michael Buesch <mb@bu3sch.de>, Larry Finger <Larry.Finger@wfinger.net>, Gábor Stefanik <netrolller.3d@gmail.com>, Rafał Miłecki <zajec5@gmail.com>, "John W. Linville" <linville@tuxdriver.com>

  CHECK   drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/main.c:111:5: warning: symbol 'b43_modparam_pio' was not declared. Should it be static?
  CHECK   drivers/net/wireless/b43/phy_g.c
drivers/net/wireless/b43/phy_g.c:975:56: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
  CHECK   drivers/net/wireless/b43/phy_lp.c
drivers/net/wireless/b43/phy_lp.c:2701:6: warning: symbol 'b43_lpphy_op_switch_analog' was not declared. Should it be static?
drivers/net/wireless/b43/phy_lp.c:1148:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
drivers/net/wireless/b43/phy_lp.c:1525:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
drivers/net/wireless/b43/phy_lp.c:1529:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
  CHECK   drivers/net/wireless/b43/wa.c
drivers/net/wireless/b43/wa.c:385:60: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:403:55: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:405:55: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:415:71: warning: cast truncates bits from constant value (ffff0fff becomes fff)

AFAICT, none of these amount to real bugs.  But this reduces warning
spam from sparse w/o significantly affecting readability of the code (IMHO).

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/b43/main.c   |    2 +-
 drivers/net/wireless/b43/phy_g.c  |    2 +-
 drivers/net/wireless/b43/phy_lp.c |    8 ++++----
 drivers/net/wireless/b43/wa.c     |    8 ++++----
 4 files changed, 10 insertions(+), 10 deletions(-)

Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c
+++ wireless-testing/drivers/net/wireless/b43/main.c
@@ -108,7 +108,7 @@ int b43_modparam_verbose = B43_VERBOSITY
 module_param_named(verbose, b43_modparam_verbose, int, 0644);
 MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug");
 
-int b43_modparam_pio = B43_PIO_DEFAULT;
+static int b43_modparam_pio = B43_PIO_DEFAULT;
 module_param_named(pio, b43_modparam_pio, int, 0644);
 MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
 
Index: wireless-testing/drivers/net/wireless/b43/phy_g.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/phy_g.c
+++ wireless-testing/drivers/net/wireless/b43/phy_g.c
@@ -972,7 +972,7 @@ b43_radio_interference_mitigation_enable
 		b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B);
 
 		if (phy->rev >= 3) {
-			b43_phy_mask(dev, 0x048A, (u16)~0x8000);
+			b43_phy_mask(dev, 0x048A, 0x7FFF);
 			b43_phy_maskset(dev, 0x0415, 0x8000, 0x36D8);
 			b43_phy_maskset(dev, 0x0416, 0x8000, 0x36D8);
 			b43_phy_maskset(dev, 0x0417, 0xFE00, 0x016D);
Index: wireless-testing/drivers/net/wireless/b43/phy_lp.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/phy_lp.c
+++ wireless-testing/drivers/net/wireless/b43/phy_lp.c
@@ -1145,7 +1145,7 @@ static void lpphy_write_tx_pctl_mode_to_
 		B43_WARN_ON(1);
 	}
 	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
-			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE, ctl);
+			~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF, ctl);
 }
 
 static void lpphy_set_tx_power_control(struct b43_wldev *dev,
@@ -1522,11 +1522,11 @@ static void lpphy_tx_pctl_init_hw(struct
 	b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xFF);
 	b43_phy_write(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xA);
 	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
-			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
+			~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF,
 			B43_LPPHY_TX_PWR_CTL_CMD_MODE_OFF);
 	b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xF8FF);
 	b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
-			(u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
+			~B43_LPPHY_TX_PWR_CTL_CMD_MODE & 0xFFFF,
 			B43_LPPHY_TX_PWR_CTL_CMD_MODE_SW);
 
 	if (dev->phy.rev < 2) {
@@ -2698,7 +2698,7 @@ static enum b43_txpwr_result b43_lpphy_o
 	return B43_TXPWR_RES_DONE;
 }
 
-void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
+static void b43_lpphy_op_switch_analog(struct b43_wldev *dev, bool on)
 {
        if (on) {
                b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVR, 0xfff8);
Index: wireless-testing/drivers/net/wireless/b43/wa.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/wa.c
+++ wireless-testing/drivers/net/wireless/b43/wa.c
@@ -382,7 +382,7 @@ static void b43_wa_altagc(struct b43_wld
 		b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 3, 25);
 	}
 
-	b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, (u16)~0xFF00, 0x5700);
+	b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, 0x00FF, 0x5700);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x007F, 0x000F);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x3F80, 0x2B80);
 	b43_phy_maskset(dev, B43_PHY_ANTWRSETT, 0xF0FF, 0x0300);
@@ -400,9 +400,9 @@ static void b43_wa_altagc(struct b43_wld
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x00FF, 0x0020);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x3F00, 0x0200);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x82), ~0x00FF, 0x002E);
-	b43_phy_maskset(dev, B43_PHY_OFDM(0x96), (u16)~0xFF00, 0x1A00);
+	b43_phy_maskset(dev, B43_PHY_OFDM(0x96), 0x00FF, 0x1A00);
 	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), ~0x00FF, 0x0028);
-	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), (u16)~0xFF00, 0x2C00);
+	b43_phy_maskset(dev, B43_PHY_OFDM(0x81), 0x00FF, 0x2C00);
 	if (phy->rev == 1) {
 		b43_phy_write(dev, B43_PHY_PEAK_COUNT, 0x092B);
 		b43_phy_maskset(dev, B43_PHY_OFDM(0x1B), ~0x001E, 0x0002);
@@ -412,7 +412,7 @@ static void b43_wa_altagc(struct b43_wld
 		b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, ~0x000F, 0x0004);
 		if (phy->rev >= 6) {
 			b43_phy_write(dev, B43_PHY_OFDM(0x22), 0x287A);
-			b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, (u16)~0xF000, 0x3000);
+			b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, 0x0FFF, 0x3000);
 		}
 	}
 	b43_phy_maskset(dev, B43_PHY_DIVSRCHIDX, 0x8080, 0x7874);
Index: wireless-testing/drivers/net/wireless/b43/phy_n.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/phy_n.c
+++ wireless-testing/drivers/net/wireless/b43/phy_n.c
@@ -509,8 +509,8 @@ static void b43_nphy_rx_cal_phy_setup(st
 	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, (u16)~B43_NPHY_RFSEQCA_RXDIS,
-			((1 - core) << B43_NPHY_RFSEQCA_RXDIS_SHIFT));
+	b43_phy_maskset(dev, B43_NPHY_RFSEQCA, (u16)(~B43_NPHY_RFSEQCA_RXDIS &
+			0xFFFF), ((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,
@@ -762,7 +762,7 @@ static void b43_nphy_stop_playback(struc
 	if (tmp & 0x1)
 		b43_phy_set(dev, B43_NPHY_SAMP_CMD, B43_NPHY_SAMP_CMD_STOP);
 	else if (tmp & 0x2)
-		b43_phy_mask(dev, B43_NPHY_IQLOCAL_CMDGCTL, (u16)~0x8000);
+		b43_phy_mask(dev, B43_NPHY_IQLOCAL_CMDGCTL, 0x7FFF);
 
 	b43_phy_mask(dev, B43_NPHY_SAMP_CMD, ~0x0004);
 
@@ -1009,7 +1009,7 @@ static void b43_nphy_gain_crtl_workaroun
 			b43_nphy_set_rf_sequence(dev, 5,
 					rfseq_events, rfseq_delays, 3);
 			b43_phy_maskset(dev, B43_NPHY_OVER_DGAIN1,
-				(u16)~B43_NPHY_OVER_DGAIN_CCKDGECV,
+				(u16)(~B43_NPHY_OVER_DGAIN_CCKDGECV & 0xFFFF),
 				0x5A << B43_NPHY_OVER_DGAIN_CCKDGECV_SHIFT);
 
 			if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
@@ -1116,7 +1116,7 @@ static void b43_nphy_workarounds(struct
 		b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20);
 
 		b43_phy_mask(dev, B43_NPHY_PIL_DW1,
-				(u16)~B43_NPHY_PIL_DW_64QAM);
+				(u16)(~B43_NPHY_PIL_DW_64QAM & 0xFFFF));
 		b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B1, 0xB5);
 		b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B2, 0xA4);
 		b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B3, 0x00);
@@ -2455,7 +2455,8 @@ static void b43_nphy_tx_cal_phy_setup(st
 		b43_phy_write(dev, B43_NPHY_AFECTL_OVER, tmp | 0x0600);
 
 		regs[4] = b43_phy_read(dev, B43_NPHY_BBCFG);
-		b43_phy_mask(dev, B43_NPHY_BBCFG, (u16)~B43_NPHY_BBCFG_RSTRX);
+		b43_phy_mask(dev, B43_NPHY_BBCFG, (u16)(~B43_NPHY_BBCFG_RSTRX
+			     & 0xFFFF));
 
 		tmp = b43_ntab_read(dev, B43_NTAB16(8, 3));
 		regs[5] = tmp;
@@ -2930,7 +2931,7 @@ static int b43_nphy_rev2_cal_rx_iq(struc
 		tmp[5] = b43_phy_read(dev, rfctl[1]);
 
 		b43_phy_maskset(dev, B43_NPHY_RFSEQCA,
-				(u16)~B43_NPHY_RFSEQCA_RXDIS,
+				(u16)(~B43_NPHY_RFSEQCA_RXDIS & 0xFFFF),
 				((1 - i) << B43_NPHY_RFSEQCA_RXDIS_SHIFT));
 		b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_TXEN,
 				(1 - i));
@@ -3291,7 +3292,7 @@ static void b43_nphy_chanspec_setup(stru
 		b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ);
 		tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR);
 		b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4);
-		b43_phy_mask(dev, B43_PHY_B_BBCFG, (u16)~0xC000);
+		b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF);
 		b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32);
 	}
 

^ permalink raw reply

* Re: wl1271 firmware
From: Pazzo Da Legare @ 2010-07-21 17:01 UTC (permalink / raw)
  To: linux-wireless; +Cc: Levi, Shahar, Luciano Coelho, Logan Gunthorpe
In-Reply-To: <4C45ED36.2090604@deltatee.com>

Dear All,
Dear Shahar,

I tried your files but I had errors from the driver.

# ifconfig wlan0 up

[  194.470000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-fw.bin
[  194.620000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-nvs.bin
[  195.080000] ADDRCONF(NETDEV_UP): wlan0: link is not ready
root@hawkboard:~# [  195.590000] wl1271: ERROR ELP wakeup timeout!

I tried to scan but it doesn't work. Note that I'm using a driver
built from compact-wireless-2010-06-20 and I'm going to try to update.

Thank you for your help again,

pz


2010/7/20 Logan Gunthorpe <logang@deltatee.com>:
> Hi Sharar,
>
> Thanks a lot. I'm pleased to report that our module appears to be working
> with the firmware and NVS files you supplied.
>
> Logan
>
> Levi, Shahar wrote:
>>>
>>> -----Original Message-----
>>> From: Levi, Shahar
>>> Sent: Saturday, July 17, 2010 3:20 PM
>>> To: Pazzo Da Legare
>>> Cc: linux-wireless@vger.kernel.org; Logan Gunthorpe; Luciano Coelho
>>> Subject: RE: wl1271 firmware
>>> Hi Pazzo,
>>> I am still pushing the legal stuff to make it happened. I hope to close
>>> that in a few days.
>>> Regards,
>>> Shahar
>>
>> Hi Pazzo and Logan,
>> Until the file will publish in TI web I am enclosing the file for you in
>> the mail.
>> I will publish link to the community as soon it will be in the TI web.
>>
>> Regards,
>> Shahar
>>
>

^ permalink raw reply

* Re: [PATCH] rtl8180: improve signal reporting for rtl8185 hardware
From: Pauli Nieminen @ 2010-07-21 17:07 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless
In-Reply-To: <20100721133320.GB2355@tuxdriver.com>

On Wed, Jul 21, 2010 at 4:33 PM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Wed, Jul 21, 2010 at 08:08:41AM +0300, Pauli Nieminen wrote:
>> On Mon, Jul 19, 2010 at 11:47 PM, John W. Linville
>> <linville@tuxdriver.com> wrote:
>> > The existing code seemed to be somewhat based on the datasheet, but
>> > varied substantially from the vendor-provided driver.  This mirrors the
>> > handling of the rtl8185 case from that driver, but still neglects the
>> > specifics for the rtl8180 hardware.  Those details are a bit muddled...
>> >
>> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
>> > ---
>> >  drivers/net/wireless/rtl818x/rtl8180_dev.c |   11 ++++++++---
>> >  1 files changed, 8 insertions(+), 3 deletions(-)
>
>> I tested this version of patch. Patch didn't apply cleanly for some
>> reason even tough when I mnauly typed it diff looks same.
>
> Please try the v2 version of the patch.  Some "back of the envelope"
> math suggests that the v2 version of the patch will give numbers more
> to your liking.
>
> John
> --
> John W. Linville                Someday the world will need a hero, and you
> linville@tuxdriver.com                  might be all we have.  Be ready.
>

But version 2 doesn't change the fact that driver is going to report
same signal strength even tough I know that only one wifi should have
100 % strength and others less than 50 %. There is only one router in
same room with me and all others routers are a lot more father away.
So driver is either reading wrong bits from hardware or my hardware is
broken.

^ permalink raw reply

* Re: [PATCH] b43: silense most sparse warnings
From: John W. Linville @ 2010-07-21 17:11 UTC (permalink / raw)
  To: Larry Finger
  Cc: Michael Büsch, linux-wireless, Larry Finger,
	Gábor Stefanik, Rafał Miłecki
In-Reply-To: <4C4724C5.4080400@lwfinger.net>

On Wed, Jul 21, 2010 at 11:48:05AM -0500, Larry Finger wrote:
> On 07/21/2010 11:05 AM, Michael Büsch wrote:
> >On 07/21/2010 05:45 PM, John W. Linville wrote:
> >>diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
> >>index 29bf34c..0dc33b6 100644
> >>--- a/drivers/net/wireless/b43/phy_g.c
> >>+++ b/drivers/net/wireless/b43/phy_g.c
> >>@@ -972,7 +972,7 @@ b43_radio_interference_mitigation_enable(struct b43_wldev
> >>*dev, int mode)
> >>b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B);
> >>
> >>if (phy->rev>= 3) {
> >>- b43_phy_mask(dev, 0x048A, (u16)~0x8000);
> >>+ b43_phy_mask(dev, 0x048A, 0x7FFF);
> >
> >This cast was introduced to silense a GCC warning. Do we end up in an
> >infinite loop now? ;)
> 
> I get no GCC warnings here with the change. I think it is OK.
> 
> Is silense a valid British spelling? I prefer silence.

Just a typo. :-)

> Do you wish to clean up the warnings from the N-PHY code as well?
> Ignoring the "should it be static?" parts, I get the following
> sparse warnings:
> 
> drivers/net/wireless/b43/phy_n.c:512:53: warning: cast truncates
> bits from constant value (ffff0fff becomes fff)
> drivers/net/wireless/b43/phy_n.c:765:66: warning: cast truncates
> bits from constant value (ffff7fff becomes 7fff)
> drivers/net/wireless/b43/phy_n.c:1012:38: warning: cast truncates
> bits from constant value (ffff00ff becomes ff)
> drivers/net/wireless/b43/phy_n.c:1119:38: warning: cast truncates
> bits from constant value (ffff0fff becomes fff)
> drivers/net/wireless/b43/phy_n.c:2458:56: warning: cast truncates
> bits from constant value (ffff7fff becomes 7fff)
> drivers/net/wireless/b43/phy_n.c:2933:38: warning: cast truncates
> bits from constant value (ffff0fff becomes fff)
> drivers/net/wireless/b43/phy_n.c:3294:57: warning: cast truncates
> bits from constant value (ffff3fff becomes 3fff)
> 
> The patch for them is below.

Seems fine -- shall I add your Signed-off-by?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [PATCH] rtl8180: improve signal reporting for rtl8185 hardware
From: Pauli Nieminen @ 2010-07-21 17:22 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless
In-Reply-To: <AANLkTint5uT6PQ8pmEIVSoVYOSCZE5k-TGB1knwHtupw@mail.gmail.com>

On Wed, Jul 21, 2010 at 8:07 PM, Pauli Nieminen <suokkos@gmail.com> wrote:
> On Wed, Jul 21, 2010 at 4:33 PM, John W. Linville
> <linville@tuxdriver.com> wrote:
>> On Wed, Jul 21, 2010 at 08:08:41AM +0300, Pauli Nieminen wrote:
>>> On Mon, Jul 19, 2010 at 11:47 PM, John W. Linville
>>> <linville@tuxdriver.com> wrote:
>>> > The existing code seemed to be somewhat based on the datasheet, but
>>> > varied substantially from the vendor-provided driver.  This mirrors the
>>> > handling of the rtl8185 case from that driver, but still neglects the
>>> > specifics for the rtl8180 hardware.  Those details are a bit muddled...
>>> >
>>> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
>>> > ---
>>> >  drivers/net/wireless/rtl818x/rtl8180_dev.c |   11 ++++++++---
>>> >  1 files changed, 8 insertions(+), 3 deletions(-)
>>
>>> I tested this version of patch. Patch didn't apply cleanly for some
>>> reason even tough when I mnauly typed it diff looks same.
>>
>> Please try the v2 version of the patch.  Some "back of the envelope"
>> math suggests that the v2 version of the patch will give numbers more
>> to your liking.
>>
>> John
>> --
>> John W. Linville                Someday the world will need a hero, and you
>> linville@tuxdriver.com                  might be all we have.  Be ready.
>>
>
> But version 2 doesn't change the fact that driver is going to report
> same signal strength even tough I know that only one wifi should have
> 100 % strength and others less than 50 %. There is only one router in
> same room with me and all others routers are a lot more father away.
> So driver is either reading wrong bits from hardware or my hardware is
> broken.
>

yes. This time all networks are showing signal strength of 100%.

But I added some debug output to driver:

printk(KERN_DEBUG " [rtl debug] %x %x, signal %x\n", flags, flags2, signal);

after the raw signal value is extracted from flags2.

So what is in flags2 & 0x7f ?

[  933.501140]  [rtl debug] 30050115 27e26, signal 1
[  933.506067]  [rtl debug] 3005004b 27f06, signal 1
[  933.518955]  [rtl debug] 30050067 27f40, signal 1
[  933.553504]  [rtl debug] 30050093 27f14, signal 1
[  933.574740]  [rtl debug] 3005014f 27f35, signal 1
[  933.603517]  [rtl debug] 30050115 27e36, signal 1
[  933.608457]  [rtl debug] 3005004b 27f10, signal 1
[  933.621354]  [rtl debug] 30050067 27f22, signal 1
[  933.655899]  [rtl debug] 30050093 27f0c, signal 1
[  933.677129]  [rtl debug] 3005014f 27f5d, signal 1
[  933.705938]  [rtl debug] 30050115 27e35, signal 1
[  933.710849]  [rtl debug] 3005004b 27f14, signal 1
[  933.723766]  [rtl debug] 30050067 27f1f, signal 1
[  933.758294]  [rtl debug] 30050093 27f0d, signal 1
[  933.779520]  [rtl debug] 3005014f 27f23, signal 1
[  933.791609]  [rtl debug] 3002008d 27f0b, signal 1
[  933.793015]  [rtl debug] 30220067 27f15, signal 1
[  933.799226]  [rtl debug] 300201a7 27f1d, signal 1
[  933.808314]  [rtl debug] 30050115 27e32, signal 1
[  933.813240]  [rtl debug] 3005004b 27f2a, signal 1
[  933.887783]  [rtl debug] 30020170 27e1b, signal 1
[  933.983846]  [rtl debug] 30020170 27e08, signal 1
[  933.986958]  [rtl debug] 3002008d 27e6a, signal 1
[  934.013075]  [rtl debug] 30050115 27e06, signal 1
[  934.040769]  [rtl debug] 300500aa 27f2d, signal 1
[  934.050505]  [rtl debug] 30050070 27e74, signal 1
[  934.078256]  [rtl debug] 300200a4 27e35, signal 1
[  934.115455]  [rtl debug] 30050115 27e2d, signal 1
[  934.143156]  [rtl debug] 300500aa 27f2d, signal 1
[  934.153119]  [rtl debug] 3005011e 27f11, signal 1
[  934.178435]  [rtl debug] 3002006a 27f3f, signal 1
[  934.182284]  [rtl debug] 700200a4 27f38, signal 1
[  934.245545]  [rtl debug] 300500aa 27f07, signal 1
[  934.255291]  [rtl debug] 30050070 27f19, signal 1
[  934.263122]  [rtl debug] 300500b1 27f56, signal 1
[  934.269774]  [rtl debug] 3002006a 27f37, signal 1
[  934.272079]  [rtl debug] 300200a4 27f09, signal 1
[  934.278878]  [rtl debug] 300500b2 27f14, signal 1
[  934.295966]  [rtl debug] 3005006b 27f22, signal 1
[  934.347946]  [rtl debug] 300500aa 27f38, signal 1
[  934.357664]  [rtl debug] 30050070 27f25, signal 1
[  934.370020]  [rtl debug] 300200a4 27f5d, signal 1
[  934.371459]  [rtl debug] 30020069 27f44, signal 1
[  934.391963]  [rtl debug] 30050070 27e23, signal 1
[  934.398341]  [rtl debug] 3005006b 27f53, signal 1
[  934.450319]  [rtl debug] 300500aa 27f47, signal 1
[  934.460050]  [rtl debug] 30050070 27e3d, signal 1
[  934.461697]  [rtl debug] 3002006a 27f5e, signal 1
[  934.463394]  [rtl debug] 3002006a 27f5c, signal 1
[  934.464816]  [rtl debug] 30020069 27f69, signal 1
[  934.482014]  [rtl debug] 30020067 27e51, signal 1
[  934.494346]  [rtl debug] 30050070 27f46, signal 1
[  934.551575]  [rtl debug] 3005007d 27f27, signal 1
[  934.560559]  [rtl debug] 30020069 27f10, signal 1
[  934.562391]  [rtl debug] 3002006a 27f27, signal 1
[  934.582431]  [rtl debug] 3005010d 27f22, signal 1
[  934.596735]  [rtl debug] 30050070 27e06, signal 1
[  934.603122]  [rtl debug] 3005006b 27f4a, signal 1
[  934.642886]  [rtl debug] 3005006d 27e08, signal 1
[  934.653779]  [rtl debug] 3002006a 27e0b, signal 1
[  934.657375]  [rtl debug] 30020067 27f71, signal 1
[  934.667762]  [rtl debug] 3002006b 27f45, signal 1
[  934.672737]  [rtl debug] 30020069 27f34, signal 1
[  934.676975]  [rtl debug] 70050071 27f38, signal 1
[  934.699125]  [rtl debug] 30050070 27f47, signal 1
[  934.752097]  [rtl debug] 300200f9 27e0a, signal 1
[  934.753643]  [rtl debug] 3002006a 27f79, signal 1
[  934.756595]  [rtl debug] 3005007d 27e0c, signal 1
[  934.758060]  [rtl debug] 30020069 27f4f, signal 1
[  934.767387]  [rtl debug] 3002006b 27f12, signal 1
[  934.775403]  [rtl debug] 3005006f 27f40, signal 1
[  934.801523]  [rtl debug] 30050070 27f4e, signal 1
[  934.847670]  [rtl debug] 3005006d 27f6b, signal 1
[  934.889605]  [rtl debug] 3005010d 27f47, signal 1
[  934.903901]  [rtl debug] 30050070 27f33, signal 1
[  934.961145]  [rtl debug] 3005007d 27f26, signal 1
[  934.984144]  [rtl debug] 30050071 27e5b, signal 1
[  934.991995]  [rtl debug] 3005010d 27f59, signal 1
[  935.063539]  [rtl debug] 3005007d 27f2e, signal 1
[  935.086536]  [rtl debug] 30050071 27e59, signal 1
[  935.094391]  [rtl debug] 3005010d 27f28, signal 1
[  935.294095]  [rtl debug] 30050093 27f0d, signal 1
[  935.315383]  [rtl debug] 3005014f 27f2d, signal 1
[  935.344139]  [rtl debug] 30050115 27e2f, signal 1
[  935.349087]  [rtl debug] 3005004b 27f16, signal 1
[  935.362005]  [rtl debug] 30050067 27f23, signal 1
[  935.396495]  [rtl debug] 30050093 27f0a, signal 1
[  935.417782]  [rtl debug] 3005014f 27f42, signal 1
[  935.446524]  [rtl debug] 30050115 27e31, signal 1
[  935.451484]  [rtl debug] 3005004b 27f30, signal 1
[  935.464403]  [rtl debug] 30050067 27f3a, signal 1
[  935.498892]  [rtl debug] 30050093 27f08, signal 1
[  935.520185]  [rtl debug] 3005014f 27f20, signal 1
[  935.548933]  [rtl debug] 30050115 27e44, signal 1
[  935.553878]  [rtl debug] 3005004b 27e2c, signal 1
[  935.566800]  [rtl debug] 70050067 27f3f, signal 1
[  935.601287]  [rtl debug] 30050093 27f0e, signal 1
[  935.622570]  [rtl debug] 3005014f 27f2e, signal 1
[  935.651311]  [rtl debug] 30050115 27e3f, signal 1
[  935.656268]  [rtl debug] 3005004b 27f07, signal 1
[  935.669200]  [rtl debug] 30050067 27e1b, signal 1
[  935.747870]  [rtl debug] 30020170 27e1b, signal 1
[  935.806065]  [rtl debug] 30050093 27e3d, signal 1
[  935.843897]  [rtl debug] 30020170 27e09, signal 1
[  935.856076]  [rtl debug] 30050115 27e05, signal 1
[  935.883769]  [rtl debug] 300500aa 27f48, signal 1
[  935.893513]  [rtl debug] 30050070 27f3f, signal 1
[  935.896431]  [rtl debug] 3005011e 27f51, signal 1
[  935.939984]  [rtl debug] 30020170 27e25, signal 1
[  935.958469]  [rtl debug] 30050115 27e22, signal 1
[  935.996105]  [rtl debug] 3005011e 27f11, signal 1
[  936.035868]  [rtl debug] 30020170 27e30, signal 1
[  936.061206]  [rtl debug] 30050115 27e30, signal 1
[  936.063493]  [rtl debug] 300400fa 27e35, signal 1
[  936.088562]  [rtl debug] 300500aa 27f0a, signal 1
[  936.098300]  [rtl debug] 30050070 27f0d, signal 1
[  936.122085]  [rtl debug] 300500b2 27f17, signal 1
[  936.139005]  [rtl debug] 3005006b 27f4f, signal 1
[  936.234988]  [rtl debug] 30050070 27e34, signal 1
[  936.281135]  [rtl debug] 3005006d 27f4b, signal 1
[  936.293325]  [rtl debug] 300500aa 27f20, signal 1
[  936.303080]  [rtl debug] 30050070 27f4a, signal 1
[  936.337383]  [rtl debug] 30050070 27f4e, signal 1
[  936.343776]  [rtl debug] 3005006b 27f0f, signal 1
[  936.394633]  [rtl debug] 3005007d 27f3b, signal 1
[  936.413651]  [rtl debug] 3005006f 27f0f, signal 1
[  936.439772]  [rtl debug] 30050070 27f36, signal 1
[  936.446175]  [rtl debug] 7005006b 27f35, signal 1
[  936.485926]  [rtl debug] 3005006d 27f11, signal 1
[  936.497014]  [rtl debug] 3005007d 27f3c, signal 1
[  936.542160]  [rtl debug] 30050070 27f0b, signal 1
[  936.599414]  [rtl debug] 3005007d 27f05, signal 1
[  936.618429]  [rtl debug] 3005006f 27f29, signal 1
[  936.622394]  [rtl debug] 30050071 27f13, signal 1
[  936.630241]  [rtl debug] 3005010d 27f10, signal 1
[  936.631779]  [rtl debug] 30050071 27e20, signal 1
[  936.632875]  [rtl debug] 30050062 27f1d, signal 1
[  936.701810]  [rtl debug] 3005007d 27e4f, signal 1
[  936.724798]  [rtl debug] 30050071 27f53, signal 1
[  936.732630]  [rtl debug] 3005010d 27f3d, signal 1
[  936.746931]  [rtl debug] 30050070 27f2e, signal 1
[  936.793086]  [rtl debug] 3005006d 27e67, signal 1
[  936.835028]  [rtl debug] 3005010d 27e4e, signal 1
[  936.906583]  [rtl debug] 3005007d 27f45, signal 1
[  936.937422]  [rtl debug] 3005010d 27f5d, signal 1
[  936.951708]  [rtl debug] 30050070 27f31, signal 1
[  937.158375]  [rtl debug] 3005014f 27f1a, signal 1
[  937.170097]  [rtl debug] 3002002d 27e4c, signal 1
[  937.187158]  [rtl debug] 30050115 27e0b, signal 1
[  937.210086]  [rtl debug] 3002003d 27e03, signal 1
[  937.212782]  [rtl debug] 3002009d 27e05, signal 1
[  937.289552]  [rtl debug] 30050115 7e05, signal 0
[  937.391949]  [rtl debug] 30050115 7e07, signal 0
[  937.444283]  [rtl debug] 30050093 7f30, signal 0
[  937.494324]  [rtl debug] 30050115 7e09, signal 0
[  937.499296]  [rtl debug] 3005004b 7e2e, signal 0
[  937.596719]  [rtl debug] 30050115 7e09, signal 0
[  937.614632]  [rtl debug] 30050067 7f56, signal 0
[  937.699128]  [rtl debug] 30050115 7e08, signal 0
[  937.704082]  [rtl debug] 7005004b 7e47, signal 0
[  937.717030]  [rtl debug] 30050067 7e74, signal 0
[  937.751456]  [rtl debug] 30050093 7e50, signal 0
[  937.801493]  [rtl debug] 30050115 7e05, signal 0
[  937.819417]  [rtl debug] 30050067 7f3d, signal 0
[  937.903915]  [rtl debug] 30050115 7e05, signal 0
[  937.921808]  [rtl debug] 30050067 7f32, signal 0
[  937.956222]  [rtl debug] 30050093 7e44, signal 0
[  938.006276]  [rtl debug] 30050115 7e05, signal 0
[  938.011255]  [rtl debug] 3005004b 7f7c, signal 0
[  938.058622]  [rtl debug] 30050093 7e39, signal 0
[  938.108670]  [rtl debug] 30050115 7e08, signal 0
[  938.110162]  [rtl debug] 3002009d 27e05, signal 1
[  938.113656]  [rtl debug] 3005004b 7f50, signal 0
[  938.119313]  [rtl debug] 300200d7 27e05, signal 1
[  938.161006]  [rtl debug] 30050093 7f3f, signal 0
[  938.211066]  [rtl debug] 30050115 7e0b, signal 0
[  938.216074]  [rtl debug] 3005004b 7f43, signal 0
[  938.313460]  [rtl debug] 30050115 7e06, signal 0
[  938.415870]  [rtl debug] 30050115 7e04, signal 0
[  938.468184]  [rtl debug] 30050093 7e46, signal 0
[  938.518250]  [rtl debug] 30050115 7e05, signal 0
[  938.523219]  [rtl debug] 3005004b 7e3c, signal 0
[  938.570560]  [rtl debug] 30050093 7e3d, signal 0
[  938.622100]  [rtl debug] 30050115 7e06, signal 0
[  938.723041]  [rtl debug] 30050115 7e08, signal 0
[  938.727448]  [rtl debug] 30040200 27e08, signal 1
[  938.775341]  [rtl debug] 30050093 7e47, signal 0
[  938.825417]  [rtl debug] 30050115 7e04, signal 0
[  938.928355]  [rtl debug] 30050115 7e04, signal 0
[  939.030216]  [rtl debug] 30050115 7e05, signal 0
[  939.034576]  [rtl debug] 30040200 27e0b, signal 1
[  939.132606]  [rtl debug] 70050115 7e0d, signal 0
[  939.150521]  [rtl debug] 30050067 7e4e, signal 0
[  939.234977]  [rtl debug] 30050115 7e07, signal 0
[  939.239339]  [rtl debug] 30040200 27e05, signal 1
[  939.287302]  [rtl debug] 30050093 7e46, signal 0
[  939.337373]  [rtl debug] 30050115 7e0e, signal 0
[  939.342352]  [rtl debug] 3005004b 7e4b, signal 0
[  939.440130]  [rtl debug] 30050115 7e06, signal 0
[  939.444323]  [rtl debug] 300401e8 27e09, signal 1
[  939.492075]  [rtl debug] 30050093 7f66, signal 0
[  939.542162]  [rtl debug] 30050115 7e08, signal 0
[  939.543448]  [rtl debug] 30040084 27e0a, signal 1
[  939.644572]  [rtl debug] 30050115 7e09, signal 0
[  939.696865]  [rtl debug] 30050093 7e4f, signal 0
[  939.746941]  [rtl debug] 30050115 7e03, signal 0
[  939.749714]  [rtl debug] 30040131 27e06, signal 1
[  939.850637]  [rtl debug] 30050115 7e06, signal 0
[  939.854321]  [rtl debug] 3005004b 7fba, signal 0
[  939.951775]  [rtl debug] 30050115 7e03, signal 0
[  940.054123]  [rtl debug] 30050115 7e06, signal 0
[  940.056453]  [rtl debug] 300400fa 27e05, signal 1
[  940.156521]  [rtl debug] 30050115 7e06, signal 0
[  940.258923]  [rtl debug] 30050115 7e06, signal 0
[  940.276844]  [rtl debug] 30050067 7e63, signal 0
[  940.361313]  [rtl debug] 30050115 7e09, signal 0
[  940.366281]  [rtl debug] 3005004b 7f3a, signal 0
[  940.463844]  [rtl debug] 30050115 7e0c, signal 0
[  940.467967]  [rtl debug] 300401e8 27e03, signal 1
[  940.566079]  [rtl debug] 30050115 7e05, signal 0
[  940.571064]  [rtl debug] 3005004b 7e32, signal 0
[  940.618385]  [rtl debug] 30050093 7e62, signal 0
[  940.668480]  [rtl debug] 30050115 7e06, signal 0
[  940.720777]  [rtl debug] 70050093 7e43, signal 0
[  940.770867]  [rtl debug] 30050115 7e0b, signal 0
[  940.788833]  [rtl debug] 30050067 7f24, signal 0
[  940.873266]  [rtl debug] 30050115 7e0b, signal 0
[  940.876593]  [rtl debug] 30050180 27e0f, signal 1
[  940.877623]  [rtl debug] 30050066 27e05, signal 1
[  940.891208]  [rtl debug] 30050067 7e35, signal 0
[  940.975663]  [rtl debug] 30050115 7e02, signal 0
[  940.993603]  [rtl debug] 30050067 7e45, signal 0
[  941.078065]  [rtl debug] 30050115 7e04, signal 0
[  941.096003]  [rtl debug] 30050067 7f45, signal 0
[  941.130335]  [rtl debug] 30050093 7e26, signal 0
[  941.180435]  [rtl debug] 30050115 7e05, signal 0
[  941.198396]  [rtl debug] 30050067 7f3f, signal 0
[  941.282821]  [rtl debug] 30050115 7e02, signal 0
[  941.300783]  [rtl debug] 30050067 7e34, signal 0
[  941.335108]  [rtl debug] 30050093 7e51, signal 0
[  941.385226]  [rtl debug] 30050115 7e07, signal 0
[  941.487626]  [rtl debug] 30050115 7e03, signal 0
[  941.505577]  [rtl debug] 30050067 7f54, signal 0
[  941.589992]  [rtl debug] 30050115 7e0a, signal 0
[  941.607958]  [rtl debug] 30050067 7e53, signal 0
[  941.642285]  [rtl debug] 30050093 7e35, signal 0
[  941.692383]  [rtl debug] 30050115 7e05, signal 0
[  941.710361]  [rtl debug] 30050067 7e2e, signal 0
[  941.794772]  [rtl debug] 30050115 7e0c, signal 0
[  941.799066]  [rtl debug] 300401f4 27e05, signal 1
[  941.828890]  [rtl debug] 3032017c 27e04, signal 1
[  941.847050]  [rtl debug] 30050093 7e3c, signal 0
[  941.897176]  [rtl debug] 30050115 7e08, signal 0
[  941.898256]  [rtl debug] 30040060 27e08, signal 1
[  941.949445]  [rtl debug] 30050093 7e4d, signal 0
[  941.999560]  [rtl debug] 70050115 7e0b, signal 0
[  942.002058]  [rtl debug] 3004011d 27e0a, signal 1
[  942.017538]  [rtl debug] 30050067 7f4f, signal 0
[  942.101965]  [rtl debug] 30050115 7e0b, signal 0
[  942.106946]  [rtl debug] 3005004b 7f5e, signal 0
[  942.154231]  [rtl debug] 30050093 7e5f, signal 0
[  942.204337]  [rtl debug] 30050115 7e0c, signal 0
[  942.209040]  [rtl debug] 30040225 27e05, signal 1
[  942.306739]  [rtl debug] 30050115 7e0c, signal 0
[  942.324720]  [rtl debug] 30050067 7f5d, signal 0
[  942.359000]  [rtl debug] 30050093 7e2d, signal 0
[  942.409134]  [rtl debug] 30050115 7e0b, signal 0
[  942.427123]  [rtl debug] 30050067 7e85, signal 0
[  942.511531]  [rtl debug] 30050115 7e00, signal 0
[  942.516239]  [rtl debug] 30040225 27e04, signal 1
[  942.529510]  [rtl debug] 30050067 7e80, signal 0
[  942.613931]  [rtl debug] 30050115 7e04, signal 0
[  942.615156]  [rtl debug] 30040070 27e01, signal 1
[  942.666177]  [rtl debug] 30050093 7e5f, signal 0
[  942.716300]  [rtl debug] 30050115 7e0b, signal 0
[  942.720763]  [rtl debug] 30040207 27e0c, signal 1
[  942.726560]  [rtl debug] 3005004a 27f3f, signal 1
[  942.737453]  [rtl debug] 3005004a 27e63, signal 1
[  942.818689]  [rtl debug] 30050115 7e06, signal 0
[  942.836666]  [rtl debug] 30050067 7f2a, signal 0
[  942.905983]  [rtl debug] 3005004a 27f0c, signal 1
[  942.910324]  [rtl debug] 3005004a 27f0e, signal 1
[  942.914725]  [rtl debug] 3005004a 27f05, signal 1
[  942.919365]  [rtl debug] 3005004a 27f11, signal 1
[  942.921791]  [rtl debug] 30050115 7f56, signal 0
[  942.939092]  [rtl debug] 30050067 7e3b, signal 0
[  942.939942]  [rtl debug] 3005004a 27f3a, signal 1
[  942.944861]  [rtl debug] 7005004a 27f6b, signal 1
[  943.008754]  [rtl debug] 3005004a 27f2e, signal 1
[  943.009873]  [rtl debug] 3005004a 27f40, signal 1
[  943.010727]  [rtl debug] 3005004a 27e5f, signal 1
[  943.023483]  [rtl debug] 30050115 7e0c, signal 0
[  943.025837]  [rtl debug] 300400fa 27e06, signal 1
[  943.125959]  [rtl debug] 30050115 7e08, signal 0
[  943.178128]  [rtl debug] 30050093 7e41, signal 0
[  943.230676]  [rtl debug] 30050115 7e09, signal 0
[  943.280518]  [rtl debug] 30050093 7f45, signal 0
[  943.332073]  [rtl debug] 30050115 7e0c, signal 0
[  943.433188]  [rtl debug] 30050115 7e07, signal 0
[  943.438046]  [rtl debug] 3005004b 7e5f, signal 0
[  943.535452]  [rtl debug] 30050115 7e04, signal 0
[  943.553435]  [rtl debug] 30050067 7f5a, signal 0
[  943.638570]  [rtl debug] 30050115 7e04, signal 0
[  943.642830]  [rtl debug] 3005004b 7f32, signal 0
[  943.740228]  [rtl debug] 30050115 7e07, signal 0
[  943.744676]  [rtl debug] 30040207 27e08, signal 1
[  943.842634]  [rtl debug] 30050115 7e09, signal 0
[  943.945011]  [rtl debug] 30050115 7e05, signal 0
[  944.047386]  [rtl debug] 30050115 7e09, signal 0
[  944.149789]  [rtl debug] 30050115 7e0c, signal 0
[  944.167804]  [rtl debug] 30050067 7f6a, signal 0
[  944.202032]  [rtl debug] 30050093 7f45, signal 0
[  944.252201]  [rtl debug] 30050115 7e06, signal 0
[  944.270198]  [rtl debug] 30050067 7e51, signal 0
[  944.354571]  [rtl debug] 30050115 7e07, signal 0
[  944.459315]  [rtl debug] 30050115 7e04, signal 0
[  944.559407]  [rtl debug] 30050115 7e02, signal 0
[  944.661755]  [rtl debug] 30050115 7e07, signal 0
[  944.679765]  [rtl debug] 30050067 7e70, signal 0
[  944.764157]  [rtl debug] 70050115 7e07, signal 0
[  944.769146]  [rtl debug] 3005004b 7e47, signal 0
[  944.782178]  [rtl debug] 30050067 7f40, signal 0
[  944.868992]  [rtl debug] 30050115 7e05, signal 0
[  944.887294]  [rtl debug] 30050067 7e65, signal 0
[  944.968937]  [rtl debug] 30050115 7e06, signal 0
[  945.071316]  [rtl debug] 30050115 7e08, signal 0
[  945.075614]  [rtl debug] 300401f0 27e07, signal 1
[  945.076314]  [rtl debug] 3005004b 7f57, signal 0
[  945.123543]  [rtl debug] 30050093 7e36, signal 0
[  945.173710]  [rtl debug] 30050115 7e05, signal 0
[  945.225927]  [rtl debug] 30050093 7e28, signal 0
[  945.276103]  [rtl debug] 30050115 7e0a, signal 0
[  945.378481]  [rtl debug] 30050115 7e05, signal 0
[  945.430720]  [rtl debug] 30050093 7e31, signal 0
[  945.480889]  [rtl debug] 30050115 7e09, signal 0
[  945.485891]  [rtl debug] 3005004b 7f42, signal 0
[  945.498893]  [rtl debug] 30050067 7e5f, signal 0
[  945.533101]  [rtl debug] 30050093 7f4f, signal 0
[  945.583279]  [rtl debug] 30050115 7e03, signal 0
[  945.588271]  [rtl debug] 3005004b 7e32, signal 0
[  945.601354]  [rtl debug] 30050067 7f5b, signal 0
[  945.685654]  [rtl debug] 30050115 7e04, signal 0
[  945.703686]  [rtl debug] 30050067 7e60, signal 0
[  945.737877]  [rtl debug] 30050093 7e52, signal 0
[  945.745718]  [rtl debug] 3005004a 27f40, signal 1
[  945.746729]  [rtl debug] 30050056 27f3a, signal 1
[  945.793119]  [rtl debug] 3005004b 7e3b, signal 0
[  945.840268]  [rtl debug] 30050093 7e2c, signal 0
[  945.890432]  [rtl debug] 30050115 7e08, signal 0
[  945.895443]  [rtl debug] 3005004b 7e31, signal 0
[  945.908467]  [rtl debug] 30050067 7e43, signal 0
[  945.972029]  [rtl debug] 7005004a 27f09, signal 1
[  945.984802]  [rtl debug] 30050056 27f07, signal 1
[  945.985751]  [rtl debug] 3005004a 27f11, signal 1
[  945.995460]  [rtl debug] 300400fa 27e04, signal 1
[  945.996552]  [rtl debug] 3005004a 27f0e, signal 1
[  946.010853]  [rtl debug] 30050067 7f54, signal 0
[  946.044068]  [rtl debug] 3005004a 27f4e, signal 1
[  946.095202]  [rtl debug] 30050115 7e05, signal 0
[  946.133918]  [rtl debug] 3005004a 27e39, signal 1
[  946.197624]  [rtl debug] 30050115 7e06, signal 0
[  946.202618]  [rtl debug] 3005004b 7f47, signal 0
[  946.300019]  [rtl debug] 30050115 7e04, signal 0
[  946.352228]  [rtl debug] 30050093 7e1f, signal 0
[  946.402383]  [rtl debug] 30050115 7e06, signal 0
[  946.504785]  [rtl debug] 30050115 7e08, signal 0
[  946.556994]  [rtl debug] 30050093 7e4e, signal 0
[  946.607182]  [rtl debug] 30050115 7e0c, signal 0
[  946.608742]  [rtl debug] 30040070 27e08, signal 1
[  946.709584]  [rtl debug] 30050115 7e0b, signal 0
[  946.811982]  [rtl debug] 30050115 7e08, signal 0
[  946.915476]  [rtl debug] 30050115 7e08, signal 0
[  946.966573]  [rtl debug] 30050093 7e40, signal 0
[  947.016731]  [rtl debug] 30050115 7e09, signal 0
[  947.119459]  [rtl debug] 30050115 7e07, signal 0
[  947.171337]  [rtl debug] 30050093 7f3c, signal 0
[  947.221519]  [rtl debug] 30050115 7e04, signal 0
[  947.273739]  [rtl debug] 30050093 7f3d, signal 0
[  947.323928]  [rtl debug] 30050115 7e02, signal 0
[  947.341959]  [rtl debug] 30050067 7e4c, signal 0
[  947.426319]  [rtl debug] 30050115 7e05, signal 0
[  947.528717]  [rtl debug] 30050115 7e08, signal 0
[  947.580905]  [rtl debug] 30050093 7e1b, signal 0
[  947.631103]  [rtl debug] 70050115 7e04, signal 0
[  947.632092]  [rtl debug] 30040060 27e09, signal 1
[  947.733521]  [rtl debug] 30050115 7e0f, signal 0
[  947.835905]  [rtl debug] 30050115 7e0f, signal 0
[  947.938301]  [rtl debug] 30050115 7e07, signal 0
[  947.943302]  [rtl debug] 3005004b 7f43, signal 0
[  948.040689]  [rtl debug] 30050115 7e08, signal 0
[  948.092870]  [rtl debug] 30050093 7f44, signal 0
[  948.143064]  [rtl debug] 30050115 7e07, signal 0
[  948.245474]  [rtl debug] 30050115 7e0a, signal 0
[  948.297646]  [rtl debug] 30050093 7e53, signal 0
[  948.347877]  [rtl debug] 30050115 7e0b, signal 0
[  948.400038]  [rtl debug] 30050093 7f5f, signal 0
[  948.450266]  [rtl debug] 30050115 7e07, signal 0
[  948.552642]  [rtl debug] 30050115 7e03, signal 0
[  948.655024]  [rtl debug] 30050115 7e05, signal 0
[  948.707215]  [rtl debug] 30050093 7f73, signal 0
[  948.757897]  [rtl debug] 30050115 7e0c, signal 0
[  948.859822]  [rtl debug] 30050115 7e09, signal 0
[  948.864833]  [rtl debug] 3005004b 7e45, signal 0
[  948.912003]  [rtl debug] 30050093 7f48, signal 0
[  948.962199]  [rtl debug] 30050115 7e05, signal 0
[  948.967225]  [rtl debug] 3005004b 7e59, signal 0
[  949.064601]  [rtl debug] 30050115 7e02, signal 0
[  949.082668]  [rtl debug] 30050067 7e8b, signal 0
[  949.167851]  [rtl debug] 30050115 7e08, signal 0
[  949.269542]  [rtl debug] 30050115 7e0b, signal 0
[  949.371779]  [rtl debug] 30050115 7e0d, signal 0
[  949.474161]  [rtl debug] 30050115 7e0c, signal 0
[  949.576567]  [rtl debug] 30050115 7e0d, signal 0
[  949.678945]  [rtl debug] 30050115 7e06, signal 0
[  949.781350]  [rtl debug] 30050115 7e09, signal 0
[  949.799415]  [rtl debug] 70050067 7f66, signal 0
[  949.833512]  [rtl debug] 30050093 7e4e, signal 0
[  949.883738]  [rtl debug] 30050115 7e08, signal 0
[  949.888758]  [rtl debug] 3005004b 7f29, signal 0
[  949.986119]  [rtl debug] 30050115 7e07, signal 0
[  949.988342]  [rtl debug] 300400fa 27e02, signal 1
[  950.088524]  [rtl debug] 30050115 7e07, signal 0
[  950.190904]  [rtl debug] 30050115 7e08, signal 0
[  950.208993]  [rtl debug] 30050067 7f4d, signal 0
[  950.293319]  [rtl debug] 30050115 7e0d, signal 0
[  950.345469]  [rtl debug] 30050093 7f23, signal 0
[  950.395708]  [rtl debug] 30050115 7e0c, signal 0
[  950.447859]  [rtl debug] 30050093 7f3a, signal 0
[  950.498078]  [rtl debug] 30050115 7e04, signal 0
[  950.600496]  [rtl debug] 30050115 7e05, signal 0
[  950.652642]  [rtl debug] 30050093 7e41, signal 0
[  950.703313]  [rtl debug] 30050115 7e04, signal 0
[  950.720962]  [rtl debug] 30050067 7e65, signal 0
[  950.755031]  [rtl debug] 30050093 7e27, signal 0
[  950.805280]  [rtl debug] 30050115 7e02, signal 0
[  950.823365]  [rtl debug] 30050067 7e28, signal 0
[  950.907658]  [rtl debug] 30050115 7e0b, signal 0
[  950.959804]  [rtl debug] 30050093 7e21, signal 0
[  951.010058]  [rtl debug] 30050115 7e08, signal 0
[  951.112442]  [rtl debug] 30050115 7e06, signal 0
[  951.117479]  [rtl debug] 3005004b 7e5d, signal 0
[  951.130544]  [rtl debug] 30050067 7e3f, signal 0
[  951.214852]  [rtl debug] 30050115 7e0a, signal 0
[  951.232947]  [rtl debug] 30050067 7f47, signal 0
[  951.317225]  [rtl debug] 30050115 7e0b, signal 0
[  951.322263]  [rtl debug] 3005004b 7f3d, signal 0
[  951.419643]  [rtl debug] 30050115 7e09, signal 0
[  951.522008]  [rtl debug] 70050115 7e06, signal 0
[  951.574160]  [rtl debug] 30050093 7f31, signal 0
[  951.624412]  [rtl debug] 30050115 7e0a, signal 0
[  951.629443]  [rtl debug] 3005004b 7e31, signal 0
[  951.642503]  [rtl debug] 30050067 7e32, signal 0
[  951.676544]  [rtl debug] 30050093 7e24, signal 0
[  951.731219]  [rtl debug] 30050115 7e0c, signal 0
[  951.744907]  [rtl debug] 30050067 7e57, signal 0

^ permalink raw reply

* Re: wl1271 firmware
From: Pazzo Da Legare @ 2010-07-21 17:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: Levi, Shahar, Luciano Coelho, Logan Gunthorpe
In-Reply-To: <AANLkTinjvF9UeV7d2aBUy6HfexuAeL_cdsVPGVxSRVMp@mail.gmail.com>

Dear All again,

I've just test with compact-wireless-2010-07-20 but I've the same problem:

root@hawkboard:~# ifconfig wlan0 192.168.0.1 up
[   68.920000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-fw.bin
[   69.100000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-nvs.bin
[   69.510000] ADDRCONF(NETDEV_UP): wlan0: link is not ready
root@hawkboard:~# [   70.020000] wl1271: ERROR ELP wakeup timeout!
[   70.520000] wl1271: ERROR ELP wakeup timeout!


looking at dmesg:

[  68.920000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-fw.bin
[   69.100000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-nvs.bin
[   69.500000] wl1271: firmware booted (Rev 6.1.0.0.310)
[   69.510000] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   70.020000] wl1271: ERROR ELP wakeup timeout!
[   70.520000] wl1271: ERROR ELP wakeup timeout!

[   68.920000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-fw.bin
[   69.100000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-nvs.bin
[   69.500000] wl1271: firmware booted (Rev 6.1.0.0.310)
[   70.020000] wl1271: ERROR ELP wakeup timeout!
[   70.520000] wl1271: ERROR ELP wakeup timeout!

Do you have any clue?

pz


2010/7/21 Pazzo Da Legare <pazzodalegare@gmail.com>:
> Dear All,
> Dear Shahar,
>
> I tried your files but I had errors from the driver.
>
> # ifconfig wlan0 up
>
> [  194.470000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-fw.bin
> [  194.620000] wl1271_sdio mmc0:0001:2: firmware: requesting wl1271-nvs.bin
> [  195.080000] ADDRCONF(NETDEV_UP): wlan0: link is not ready
> root@hawkboard:~# [  195.590000] wl1271: ERROR ELP wakeup timeout!
>
> I tried to scan but it doesn't work. Note that I'm using a driver
> built from compact-wireless-2010-06-20 and I'm going to try to update.
>
> Thank you for your help again,
>
> pz
>
>
> 2010/7/20 Logan Gunthorpe <logang@deltatee.com>:
>> Hi Sharar,
>>
>> Thanks a lot. I'm pleased to report that our module appears to be working
>> with the firmware and NVS files you supplied.
>>
>> Logan
>>
>> Levi, Shahar wrote:
>>>>
>>>> -----Original Message-----
>>>> From: Levi, Shahar
>>>> Sent: Saturday, July 17, 2010 3:20 PM
>>>> To: Pazzo Da Legare
>>>> Cc: linux-wireless@vger.kernel.org; Logan Gunthorpe; Luciano Coelho
>>>> Subject: RE: wl1271 firmware
>>>> Hi Pazzo,
>>>> I am still pushing the legal stuff to make it happened. I hope to close
>>>> that in a few days.
>>>> Regards,
>>>> Shahar
>>>
>>> Hi Pazzo and Logan,
>>> Until the file will publish in TI web I am enclosing the file for you in
>>> the mail.
>>> I will publish link to the community as soon it will be in the TI web.
>>>
>>> Regards,
>>> Shahar
>>>
>>
>

^ permalink raw reply

* Re: [PATCH] rtl8180: improve signal reporting for rtl8185 hardware
From: John W. Linville @ 2010-07-21 17:19 UTC (permalink / raw)
  To: Pauli Nieminen; +Cc: linux-wireless
In-Reply-To: <AANLkTint5uT6PQ8pmEIVSoVYOSCZE5k-TGB1knwHtupw@mail.gmail.com>

On Wed, Jul 21, 2010 at 08:07:56PM +0300, Pauli Nieminen wrote:
> On Wed, Jul 21, 2010 at 4:33 PM, John W. Linville
> <linville@tuxdriver.com> wrote:
> > On Wed, Jul 21, 2010 at 08:08:41AM +0300, Pauli Nieminen wrote:
> >> On Mon, Jul 19, 2010 at 11:47 PM, John W. Linville
> >> <linville@tuxdriver.com> wrote:
> >> > The existing code seemed to be somewhat based on the datasheet, but
> >> > varied substantially from the vendor-provided driver.  This mirrors the
> >> > handling of the rtl8185 case from that driver, but still neglects the
> >> > specifics for the rtl8180 hardware.  Those details are a bit muddled...
> >> >
> >> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> >> > ---
> >> >  drivers/net/wireless/rtl818x/rtl8180_dev.c |   11 ++++++++---
> >> >  1 files changed, 8 insertions(+), 3 deletions(-)
> >
> >> I tested this version of patch. Patch didn't apply cleanly for some
> >> reason even tough when I mnauly typed it diff looks same.
> >
> > Please try the v2 version of the patch.  Some "back of the envelope"
> > math suggests that the v2 version of the patch will give numbers more
> > to your liking.
> >
> > John
> > --
> > John W. Linville                Someday the world will need a hero, and you
> > linville@tuxdriver.com                  might be all we have.  Be ready.
> >
> 
> But version 2 doesn't change the fact that driver is going to report
> same signal strength even tough I know that only one wifi should have
> 100 % strength and others less than 50 %. There is only one router in
> same room with me and all others routers are a lot more father away.
> So driver is either reading wrong bits from hardware or my hardware is
> broken.
 
Did you try the patch?  I suspect not.

I can't really decipher what problem you are reporting here with "100 %
strength and others less than 50 %".  In any case, if you have RTL8185
hardware then this patch changes the signal calculation to match what
the Realtek-provided vendor driver does (which doesn't seem to match
their datasheet, FWIW).  If you have a better source of information
then I am happy to receive it.

If you have RTL8180 (i.e. not RTL8185) hardware then neither version of
the patch is likely to help you much (beyond avoiding the warning you
originally reported).  I hope to improve that as well in the future.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* [PATCH v2 00/20] native support for wl1271 on ZOOM
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen

This patch series adds native support for wl1271 on ZOOM.

Changes since v1:

- introduce a fixed regulator device to control the power of wl1271
- allow to propagate private board-specific data to SDIO function drivers
- allow SDIO function driver to control the card's power via new API
- make it possible to keep the card's power down (without depending
  on an explicit SDIO function driver power-down request)

Thanks to these changes, we no longer need a separate platform
device (carrying e.g. the external irq information of the device),
and no longer need to emulate virtual card detect events.

The two "board muxing" pathces were already taken by Tony, and
are resent here just to make it easier for people to use/test these pathces.

The changes to the MMC core really needs careful review; there still
might be some pitfalls that haven't been covered. E.g., one thing
we plan to look at next is their bahvior together with SDIO Suspend/Resume.

Special thanks to Roger Quadros and Nicolas Pitre for their extensive
review and helpful suggestions.

The patches are based on 2.6.35-rc5, and were tested on ZOOM3.

Thanks,

Ohad Ben-Cohen (20):
  sdio: add TI + wl1271 ids
  wireless: wl1271: remove SDIO IDs from driver
  mmc: support embedded data field in mmc_host
  omap zoom2: wlan board muxing
  omap zoom3: wlan board muxing
  wireless: wl1271: make wl12xx.h common to both spi and sdio
  wireless: wl1271: support return value for the set power func
  wireless: wl1271: take irq info from private board data
  wireless: wl1271: make ref_clock configurable by board
  omap: zoom: add fixed regulator device for wlan
  omap: hsmmc: support mmc3 regulator power control
  omap: hsmmc: allow board-specific settings of private mmc data
  omap: zoom: add mmc3/wl1271 device support
  mmc: sdio: fully reconfigure oldcard on resume
  mmc: sdio: verify existence of resume handler
  mmc: introduce API to control the card's power
  mmc: sdio: relocate sdio_set_block_size call
  mmc: sdio: enable a default power off mode of the card
  omap: zoom: keep the MMC3 wl1271 device powered off
  wireless: wl1271: call SDIO claim/release power API

 arch/arm/mach-omap2/board-zoom-peripherals.c |   54 +++++++++++++++++++
 arch/arm/mach-omap2/board-zoom2.c            |   13 +++++
 arch/arm/mach-omap2/board-zoom3.c            |   13 +++++
 arch/arm/mach-omap2/hsmmc.c                  |   15 ++++--
 arch/arm/mach-omap2/hsmmc.h                  |    2 +
 arch/arm/plat-omap/include/plat/mmc.h        |    5 ++
 drivers/mmc/core/bus.c                       |    3 +
 drivers/mmc/core/core.c                      |   50 ++++++++++++++++++
 drivers/mmc/core/sdio.c                      |   36 +++++++++++--
 drivers/mmc/core/sdio_bus.c                  |    9 ---
 drivers/mmc/core/sdio_io.c                   |   50 ++++++++++++++++++
 drivers/mmc/host/omap_hsmmc.c                |   72 +++++++++++++++++++++++---
 drivers/net/wireless/wl12xx/wl1251_sdio.c    |    2 +-
 drivers/net/wireless/wl12xx/wl1251_spi.c     |    2 +-
 drivers/net/wireless/wl12xx/wl1271.h         |    3 +-
 drivers/net/wireless/wl12xx/wl1271_boot.c    |    9 ++--
 drivers/net/wireless/wl12xx/wl1271_boot.h    |    1 -
 drivers/net/wireless/wl12xx/wl1271_io.h      |    8 ++-
 drivers/net/wireless/wl12xx/wl1271_main.c    |    4 +-
 drivers/net/wireless/wl12xx/wl1271_sdio.c    |   31 +++++------
 drivers/net/wireless/wl12xx/wl1271_spi.c     |    8 ++-
 include/linux/mmc/card.h                     |    2 +
 include/linux/mmc/host.h                     |   15 +++++
 include/linux/mmc/sdio_func.h                |    3 +
 include/linux/mmc/sdio_ids.h                 |    3 +
 include/linux/spi/wl12xx.h                   |   34 ------------
 include/linux/wl12xx.h                       |   35 ++++++++++++
 27 files changed, 393 insertions(+), 89 deletions(-)
 delete mode 100644 include/linux/spi/wl12xx.h
 create mode 100644 include/linux/wl12xx.h


^ permalink raw reply

* [PATCH v2 01/20] sdio: add TI + wl1271 ids
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Add SDIO IDs for TI and for TI's wl1271 wlan device.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 include/linux/mmc/sdio_ids.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 33b2ea0..0d313c6 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -43,4 +43,7 @@
 #define SDIO_DEVICE_ID_SIANO_NOVA_A0		0x1100
 #define SDIO_DEVICE_ID_SIANO_STELLAR 		0x5347
 
+#define SDIO_VENDOR_ID_TI			0x0097
+#define SDIO_DEVICE_ID_TI_WL1271		0x4076
+
 #endif
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 02/20] wireless: wl1271: remove SDIO IDs from driver
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Remove SDIO IDs from the driver code since now it is
included in linux/mmc/sdio_ids.h.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/net/wireless/wl12xx/wl1271_sdio.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index d3d6f30..9903ae9 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -37,14 +37,6 @@
 
 #define RX71_WL1271_IRQ_GPIO		42
 
-#ifndef SDIO_VENDOR_ID_TI
-#define SDIO_VENDOR_ID_TI		0x0097
-#endif
-
-#ifndef SDIO_DEVICE_ID_TI_WL1271
-#define SDIO_DEVICE_ID_TI_WL1271	0x4076
-#endif
-
 static const struct sdio_device_id wl1271_devices[] = {
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271) },
 	{}
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 03/20] mmc: support embedded data field in mmc_host
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Add support to set/get mmc_host private embedded
data.

This is needed to allow software to dynamically
create (and remove) SDIO functions which represents
embedded SDIO devices.

Typically, it will be used to set the context of
a driver that is creating a new SDIO function
(and would then expect to be able to get that context
back upon creation of the new sdio func).

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 include/linux/mmc/host.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f65913c..80db597 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -209,6 +209,8 @@ struct mmc_host {
 	struct led_trigger	*led;		/* activity led */
 #endif
 
+	void			*embedded_data;
+
 	struct dentry		*debugfs_root;
 
 	unsigned long		private[0] ____cacheline_aligned;
@@ -264,5 +266,15 @@ static inline void mmc_set_disable_delay(struct mmc_host *host,
 	host->disable_delay = disable_delay;
 }
 
+static inline void *mmc_get_embedded_data(struct mmc_host *host)
+{
+	return host->embedded_data;
+}
+
+static inline void mmc_set_embedded_data(struct mmc_host *host, void *data)
+{
+	host->embedded_data = data;
+}
+
 #endif
 
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 04/20] omap zoom2: wlan board muxing
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Add board muxing to support the wlan wl1271 chip that is
hardwired to mmc2 (third mmc controller) on the ZOOM2.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 arch/arm/mach-omap2/board-zoom2.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index 803ef14..1520a2c 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -71,6 +71,19 @@ static struct twl4030_platform_data zoom2_twldata = {
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
+	/* WLAN IRQ - GPIO 162 */
+	OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
+	/* WLAN POWER ENABLE - GPIO 101 */
+	OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
+	/* WLAN SDIO: MMC3 CMD */
+	OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
+	/* WLAN SDIO: MMC3 CLK */
+	OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+	/* WLAN SDIO: MMC3 DAT[0-3] */
+	OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+	OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+	OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+	OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 #else
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 05/20] omap zoom3: wlan board muxing
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Add board muxing to support the wlan wl1271 chip that is
hardwired to mmc2 (third mmc controller) on the ZOOM3.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 arch/arm/mach-omap2/board-zoom3.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c
index 3314704..7d17046 100644
--- a/arch/arm/mach-omap2/board-zoom3.c
+++ b/arch/arm/mach-omap2/board-zoom3.c
@@ -46,6 +46,19 @@ static void __init omap_zoom_init_irq(void)
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
+	/* WLAN IRQ - GPIO 162 */
+	OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
+	/* WLAN POWER ENABLE - GPIO 101 */
+	OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
+	/* WLAN SDIO: MMC3 CMD */
+	OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
+	/* WLAN SDIO: MMC3 CLK */
+	OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+	/* WLAN SDIO: MMC3 DAT[0-3] */
+	OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+	OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+	OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+	OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 #else
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 06/20] wireless: wl1271: make wl12xx.h common to both spi and sdio
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Move wl12xx.h outside of the spi-specific location,
so it can be shared with both spi and sdio solutions.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/net/wireless/wl12xx/wl1251_sdio.c |    2 +-
 drivers/net/wireless/wl12xx/wl1251_spi.c  |    2 +-
 drivers/net/wireless/wl12xx/wl1271_spi.c  |    2 +-
 include/linux/spi/wl12xx.h                |   34 -----------------------------
 include/linux/wl12xx.h                    |   34 +++++++++++++++++++++++++++++
 5 files changed, 37 insertions(+), 37 deletions(-)
 delete mode 100644 include/linux/spi/wl12xx.h
 create mode 100644 include/linux/wl12xx.h

diff --git a/drivers/net/wireless/wl12xx/wl1251_sdio.c b/drivers/net/wireless/wl12xx/wl1251_sdio.c
index c561332..416d5aa 100644
--- a/drivers/net/wireless/wl12xx/wl1251_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1251_sdio.c
@@ -24,7 +24,7 @@
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/sdio_ids.h>
 #include <linux/platform_device.h>
-#include <linux/spi/wl12xx.h>
+#include <linux/wl12xx.h>
 #include <linux/irq.h>
 
 #include "wl1251.h"
diff --git a/drivers/net/wireless/wl12xx/wl1251_spi.c b/drivers/net/wireless/wl12xx/wl1251_spi.c
index e814742..4847b6a 100644
--- a/drivers/net/wireless/wl12xx/wl1251_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1251_spi.c
@@ -26,7 +26,7 @@
 #include <linux/slab.h>
 #include <linux/crc7.h>
 #include <linux/spi/spi.h>
-#include <linux/spi/wl12xx.h>
+#include <linux/wl12xx.h>
 
 #include "wl1251.h"
 #include "wl1251_reg.h"
diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c b/drivers/net/wireless/wl12xx/wl1271_spi.c
index 5189b81..e866049 100644
--- a/drivers/net/wireless/wl12xx/wl1271_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1271_spi.c
@@ -25,7 +25,7 @@
 #include <linux/module.h>
 #include <linux/crc7.h>
 #include <linux/spi/spi.h>
-#include <linux/spi/wl12xx.h>
+#include <linux/wl12xx.h>
 #include <linux/slab.h>
 
 #include "wl1271.h"
diff --git a/include/linux/spi/wl12xx.h b/include/linux/spi/wl12xx.h
deleted file mode 100644
index a223ecb..0000000
--- a/include/linux/spi/wl12xx.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of wl12xx
- *
- * Copyright (C) 2009 Nokia Corporation
- *
- * Contact: Kalle Valo <kalle.valo@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef _LINUX_SPI_WL12XX_H
-#define _LINUX_SPI_WL12XX_H
-
-struct wl12xx_platform_data {
-	void (*set_power)(bool enable);
-	/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
-	int irq;
-	bool use_eeprom;
-};
-
-#endif
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
new file mode 100644
index 0000000..137ac89
--- /dev/null
+++ b/include/linux/wl12xx.h
@@ -0,0 +1,34 @@
+/*
+ * This file is part of wl12xx
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ *
+ * Contact: Kalle Valo <kalle.valo@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef _LINUX_WL12XX_H
+#define _LINUX_WL12XX_H
+
+struct wl12xx_platform_data {
+	void (*set_power)(bool enable);
+	/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
+	int irq;
+	bool use_eeprom;
+};
+
+#endif
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 07/20] wireless: wl1271: support return value for the set power func
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Make it possible for the set power method to indicate a
success/failure return value. This is needed to support
more complex power on/off operations such as bringing up
(and down) sdio functions.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/net/wireless/wl12xx/wl1271.h      |    2 +-
 drivers/net/wireless/wl12xx/wl1271_io.h   |    8 +++++---
 drivers/net/wireless/wl12xx/wl1271_main.c |    4 +++-
 drivers/net/wireless/wl12xx/wl1271_sdio.c |    4 +++-
 drivers/net/wireless/wl12xx/wl1271_spi.c  |    4 +++-
 5 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index 6f1b6b5..a21cdb2 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -340,7 +340,7 @@ struct wl1271_if_operations {
 		     bool fixed);
 	void (*reset)(struct wl1271 *wl);
 	void (*init)(struct wl1271 *wl);
-	void (*power)(struct wl1271 *wl, bool enable);
+	int (*power)(struct wl1271 *wl, bool enable);
 	struct device* (*dev)(struct wl1271 *wl);
 	void (*enable_irq)(struct wl1271 *wl);
 	void (*disable_irq)(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/wl1271_io.h b/drivers/net/wireless/wl12xx/wl1271_io.h
index bc806c7..4a5b92c 100644
--- a/drivers/net/wireless/wl12xx/wl1271_io.h
+++ b/drivers/net/wireless/wl12xx/wl1271_io.h
@@ -144,10 +144,12 @@ static inline void wl1271_power_off(struct wl1271 *wl)
 	clear_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
 }
 
-static inline void wl1271_power_on(struct wl1271 *wl)
+static inline int wl1271_power_on(struct wl1271 *wl)
 {
-	wl->if_ops->power(wl, true);
-	set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
+	int ret = wl->if_ops->power(wl, true);
+	if (ret == 0)
+		set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
+	return ret;
 }
 
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index b7d9137..6bd748e 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -620,7 +620,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
 	int ret = 0;
 
 	msleep(WL1271_PRE_POWER_ON_SLEEP);
-	wl1271_power_on(wl);
+	ret = wl1271_power_on(wl);
+	if (ret < 0)
+		goto out;
 	msleep(WL1271_POWER_ON_SLEEP);
 	wl1271_io_reset(wl);
 	wl1271_io_init(wl);
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index 9903ae9..571c6b9 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -144,7 +144,7 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
 
 }
 
-static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
+static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
 {
 	struct sdio_func *func = wl_to_func(wl);
 
@@ -159,6 +159,8 @@ static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
 		sdio_disable_func(func);
 		sdio_release_host(func);
 	}
+
+	return 0;
 }
 
 static struct wl1271_if_operations sdio_ops = {
diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c b/drivers/net/wireless/wl12xx/wl1271_spi.c
index e866049..85a167f 100644
--- a/drivers/net/wireless/wl12xx/wl1271_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1271_spi.c
@@ -313,10 +313,12 @@ static irqreturn_t wl1271_irq(int irq, void *cookie)
 	return IRQ_HANDLED;
 }
 
-static void wl1271_spi_set_power(struct wl1271 *wl, bool enable)
+static int wl1271_spi_set_power(struct wl1271 *wl, bool enable)
 {
 	if (wl->set_power)
 		wl->set_power(enable);
+
+	return 0;
 }
 
 static struct wl1271_if_operations spi_ops = {
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 08/20] wireless: wl1271: take irq info from private board data
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Remove the hard coded irq information, and instead take
the irq information from the board private data
which is supplied by the sdio function.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/net/wireless/wl12xx/wl1271_sdio.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index 571c6b9..75901a6 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -28,15 +28,14 @@
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/sdio_ids.h>
 #include <linux/mmc/card.h>
+#include <linux/mmc/host.h>
+#include <linux/wl12xx.h>
 #include <plat/gpio.h>
 
 #include "wl1271.h"
 #include "wl12xx_80211.h"
 #include "wl1271_io.h"
 
-
-#define RX71_WL1271_IRQ_GPIO		42
-
 static const struct sdio_device_id wl1271_devices[] = {
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271) },
 	{}
@@ -178,6 +177,7 @@ static int __devinit wl1271_probe(struct sdio_func *func,
 				  const struct sdio_device_id *id)
 {
 	struct ieee80211_hw *hw;
+	struct wl12xx_platform_data *wlan_data;
 	struct wl1271 *wl;
 	int ret;
 
@@ -197,9 +197,11 @@ static int __devinit wl1271_probe(struct sdio_func *func,
 	/* Grab access to FN0 for ELP reg. */
 	func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
 
-	wl->irq = gpio_to_irq(RX71_WL1271_IRQ_GPIO);
-	if (wl->irq < 0) {
-		ret = wl->irq;
+	wlan_data = mmc_get_embedded_data(func->card->host);
+	if (wlan_data && wlan_data->irq)
+		wl->irq = wlan_data->irq;
+	else {
+		ret = -EINVAL;
 		wl1271_error("could not get irq!");
 		goto out_free;
 	}
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 09/20] wireless: wl1271: make ref_clock configurable by board
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

The wl1271 device is using a reference clock that may change
between board to board.

Make the ref_clock parameter configurable by the board
files that set up the device, instead of having a hard coded
value in the driver source itself.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/net/wireless/wl12xx/wl1271.h      |    1 +
 drivers/net/wireless/wl12xx/wl1271_boot.c |    9 +++++----
 drivers/net/wireless/wl12xx/wl1271_boot.h |    1 -
 drivers/net/wireless/wl12xx/wl1271_sdio.c |    7 ++++---
 drivers/net/wireless/wl12xx/wl1271_spi.c  |    2 ++
 include/linux/wl12xx.h                    |    1 +
 6 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index a21cdb2..595f1a8 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -357,6 +357,7 @@ struct wl1271 {
 
 	void (*set_power)(bool enable);
 	int irq;
+	int ref_clock;
 
 	spinlock_t wl_lock;
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c
index 1a36d8a..d3f0521 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
@@ -455,17 +455,18 @@ int wl1271_boot(struct wl1271 *wl)
 {
 	int ret = 0;
 	u32 tmp, clk, pause;
+	int ref_clock = wl->ref_clock;
 
 	wl1271_boot_hw_version(wl);
 
-	if (REF_CLOCK == 0 || REF_CLOCK == 2 || REF_CLOCK == 4)
+	if (ref_clock == 0 || ref_clock == 2 || ref_clock == 4)
 		/* ref clk: 19.2/38.4/38.4-XTAL */
 		clk = 0x3;
-	else if (REF_CLOCK == 1 || REF_CLOCK == 3)
+	else if (ref_clock == 1 || ref_clock == 3)
 		/* ref clk: 26/52 */
 		clk = 0x5;
 
-	if (REF_CLOCK != 0) {
+	if (ref_clock != 0) {
 		u16 val;
 		/* Set clock type (open drain) */
 		val = wl1271_top_reg_read(wl, OCP_REG_CLK_TYPE);
@@ -514,7 +515,7 @@ int wl1271_boot(struct wl1271 *wl)
 	wl1271_debug(DEBUG_BOOT, "clk2 0x%x", clk);
 
 	/* 2 */
-	clk |= (REF_CLOCK << 1) << 4;
+	clk |= (ref_clock << 1) << 4;
 	wl1271_write32(wl, DRPW_SCRATCH_START, clk);
 
 	wl1271_set_partition(wl, &part_table[PART_WORK]);
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.h b/drivers/net/wireless/wl12xx/wl1271_boot.h
index f829699..f73b0b1 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.h
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.h
@@ -46,7 +46,6 @@ struct wl1271_static_data {
 /* delay between retries */
 #define INIT_LOOP_DELAY 50
 
-#define REF_CLOCK            2
 #define WU_COUNTER_PAUSE_VAL 0x3FF
 #define WELP_ARM_COMMAND_VAL 0x4
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index 75901a6..5967718 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -198,11 +198,12 @@ static int __devinit wl1271_probe(struct sdio_func *func,
 	func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
 
 	wlan_data = mmc_get_embedded_data(func->card->host);
-	if (wlan_data && wlan_data->irq)
+	if (wlan_data) {
 		wl->irq = wlan_data->irq;
-	else {
+		wl->ref_clock = wlan_data->board_ref_clock;
+	} else {
 		ret = -EINVAL;
-		wl1271_error("could not get irq!");
+		wl1271_error("missing wlan data (needed for irq/ref_clk)!");
 		goto out_free;
 	}
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c b/drivers/net/wireless/wl12xx/wl1271_spi.c
index 85a167f..501b8b4 100644
--- a/drivers/net/wireless/wl12xx/wl1271_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1271_spi.c
@@ -373,6 +373,8 @@ static int __devinit wl1271_probe(struct spi_device *spi)
 		goto out_free;
 	}
 
+	wl->ref_clock = pdata->board_ref_clock;
+
 	wl->irq = spi->irq;
 	if (wl->irq < 0) {
 		wl1271_error("irq missing in platform data");
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index 137ac89..ef6eed9 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -29,6 +29,7 @@ struct wl12xx_platform_data {
 	/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
 	int irq;
 	bool use_eeprom;
+	int board_ref_clock;
 };
 
 #endif
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 10/20] omap: zoom: add fixed regulator device for wlan
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Add a fixed regulator vmmc device to enable power control
of the wl1271 wlan device.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 arch/arm/mach-omap2/board-zoom-peripherals.c |   34 ++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 6b39849..2fc0f4a 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -16,6 +16,7 @@
 #include <linux/gpio.h>
 #include <linux/i2c/twl.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -27,6 +28,8 @@
 #include "mux.h"
 #include "hsmmc.h"
 
+#define OMAP_ZOOM_WLAN_PMENA_GPIO	(101)
+
 /* Zoom2 has Qwerty keyboard*/
 static int board_keymap[] = {
 	KEY(0, 0, KEY_E),
@@ -106,6 +109,10 @@ static struct regulator_consumer_supply zoom_vmmc2_supply = {
 	.supply		= "vmmc",
 };
 
+static struct regulator_consumer_supply zoom_vmmc3_supply = {
+	.supply		= "vmmc",
+};
+
 /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
 static struct regulator_init_data zoom_vmmc1 = {
 	.constraints = {
@@ -151,6 +158,32 @@ static struct regulator_init_data zoom_vsim = {
 	.consumer_supplies      = &zoom_vsim_supply,
 };
 
+static struct regulator_init_data zoom_vmmc3 = {
+	.constraints = {
+		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies = 1,
+	.consumer_supplies = &zoom_vmmc3_supply,
+};
+
+static struct fixed_voltage_config zoom_vwlan = {
+	.supply_name = "vwl1271",
+	.microvolts = 1800000, /* 1.8V */
+	.gpio = OMAP_ZOOM_WLAN_PMENA_GPIO,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,
+	.init_data = &zoom_vmmc3,
+};
+
+static struct platform_device omap_vwlan_device = {
+	.name		= "reg-fixed-voltage",
+	.id		= 1,
+	.dev = {
+		.platform_data = &zoom_vwlan,
+	},
+};
+
 static struct omap2_hsmmc_info mmc[] __initdata = {
 	{
 		.name		= "external",
@@ -280,6 +313,7 @@ static void enable_board_wakeup_source(void)
 void __init zoom_peripherals_init(void)
 {
 	omap_i2c_init();
+	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(&musb_board_data);
 	enable_board_wakeup_source();
 }
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 11/20] omap: hsmmc: support mmc3 regulator power control
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Prepare for mmc3 regulator power control by splitting the power
control functions of mmc2 and mmc3, and expecting mmc3 to have
a single, dedicated, regulator support.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 arch/arm/mach-omap2/hsmmc.c   |   10 ++++--
 drivers/mmc/host/omap_hsmmc.c |   67 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 66 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 1ef54b0..5d3d789 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -174,7 +174,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
 	}
 }
 
-static void hsmmc23_before_set_reg(struct device *dev, int slot,
+static void hsmmc2_before_set_reg(struct device *dev, int slot,
 				   int power_on, int vdd)
 {
 	struct omap_mmc_platform_data *mmc = dev->platform_data;
@@ -325,14 +325,16 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 				c->transceiver = 1;
 			if (c->transceiver && c->wires > 4)
 				c->wires = 4;
-			/* FALLTHROUGH */
-		case 3:
 			if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
 				/* off-chip level shifting, or none */
-				mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
+				mmc->slots[0].before_set_reg = hsmmc2_before_set_reg;
 				mmc->slots[0].after_set_reg = NULL;
 			}
 			break;
+		case 3:
+			mmc->slots[0].before_set_reg = NULL;
+			mmc->slots[0].after_set_reg = NULL;
+			break;
 		default:
 			pr_err("MMC%d configuration not supported!\n", c->mmc);
 			kfree(mmc);
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index b032828..4c5a669 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -258,7 +258,7 @@ static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
 	return ret;
 }
 
-static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on,
+static int omap_hsmmc_2_set_power(struct device *dev, int slot, int power_on,
 				   int vdd)
 {
 	struct omap_hsmmc_host *host =
@@ -309,6 +309,31 @@ static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on,
 	return ret;
 }
 
+static int omap_hsmmc_3_set_power(struct device *dev, int slot, int power_on,
+				   int vdd)
+{
+	struct omap_hsmmc_host *host =
+		platform_get_drvdata(to_platform_device(dev));
+	int ret = 0;
+
+	if (power_on) {
+		ret = mmc_regulator_set_ocr(host->vcc, vdd);
+		/* Enable interface voltage rail, if needed */
+		if (ret == 0 && host->vcc) {
+			ret = regulator_enable(host->vcc);
+			if (ret < 0)
+				ret = mmc_regulator_set_ocr(host->vcc, 0);
+		}
+	} else {
+		if (host->vcc)
+			ret = regulator_disable(host->vcc);
+		if (ret == 0)
+			ret = mmc_regulator_set_ocr(host->vcc, 0);
+	}
+
+	return ret;
+}
+
 static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep,
 				  int vdd, int cardsleep)
 {
@@ -319,7 +344,7 @@ static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep,
 	return regulator_set_mode(host->vcc, mode);
 }
 
-static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep,
+static int omap_hsmmc_2_set_sleep(struct device *dev, int slot, int sleep,
 				   int vdd, int cardsleep)
 {
 	struct omap_hsmmc_host *host =
@@ -358,6 +383,31 @@ static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep,
 		return regulator_enable(host->vcc_aux);
 }
 
+static int omap_hsmmc_3_set_sleep(struct device *dev, int slot, int sleep,
+				   int vdd, int cardsleep)
+{
+	struct omap_hsmmc_host *host =
+		platform_get_drvdata(to_platform_device(dev));
+	int err = 0;
+
+	/*
+	 * If we don't see a Vcc regulator, assume it's a fixed
+	 * voltage always-on regulator.
+	 */
+	if (!host->vcc)
+		return 0;
+
+	if (cardsleep) {
+		/* VCC can be turned off if card is asleep */
+		if (sleep)
+			err = mmc_regulator_set_ocr(host->vcc, 0);
+		else
+			err = mmc_regulator_set_ocr(host->vcc, vdd);
+	}
+
+	return err;
+}
+
 static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
 	struct regulator *reg;
@@ -370,10 +420,13 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 		mmc_slot(host).set_sleep = omap_hsmmc_1_set_sleep;
 		break;
 	case OMAP_MMC2_DEVID:
-	case OMAP_MMC3_DEVID:
 		/* Off-chip level shifting, or none */
-		mmc_slot(host).set_power = omap_hsmmc_23_set_power;
-		mmc_slot(host).set_sleep = omap_hsmmc_23_set_sleep;
+		mmc_slot(host).set_power = omap_hsmmc_2_set_power;
+		mmc_slot(host).set_sleep = omap_hsmmc_2_set_sleep;
+		break;
+	case OMAP_MMC3_DEVID:
+		mmc_slot(host).set_power = omap_hsmmc_3_set_power;
+		mmc_slot(host).set_sleep = omap_hsmmc_3_set_sleep;
 		break;
 	default:
 		pr_err("MMC%d configuration not supported!\n", host->id);
@@ -386,9 +439,9 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 		/*
 		* HACK: until fixed.c regulator is usable,
 		* we don't require a main regulator
-		* for MMC2 or MMC3
+		* for MMC2
 		*/
-		if (host->id == OMAP_MMC1_DEVID) {
+		if (host->id != OMAP_MMC2_DEVID) {
 			ret = PTR_ERR(reg);
 			goto err;
 		}
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2 12/20] omap: hsmmc: allow board-specific settings of private mmc data
From: Ohad Ben-Cohen @ 2010-07-21 17:33 UTC (permalink / raw)
  To: linux-wireless, linux-mmc, linux-omap
  Cc: linux-arm-kernel, linux, Chikkature Rajashekar Madhusudhan,
	Luciano Coelho, akpm, San Mehat, Roger Quadros, Tony Lindgren,
	Nicolas Pitre, Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com>

Allow board-specific settings of private mmc data, in order to
allow embedded SDIO devices to communicate board-specific parameters
to the SDIO function driver (e.g., the external IRQ line of the wl1271).

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
 arch/arm/mach-omap2/hsmmc.c           |    2 ++
 arch/arm/mach-omap2/hsmmc.h           |    1 +
 arch/arm/plat-omap/include/plat/mmc.h |    2 ++
 drivers/mmc/host/omap_hsmmc.c         |    2 ++
 4 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 5d3d789..f06ddd2 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -284,6 +284,8 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 		if (c->vcc_aux_disable_is_sleep)
 			mmc->slots[0].vcc_aux_disable_is_sleep = 1;
 
+		mmc->slots[0].priv_data = c->priv_data;
+
 		/* NOTE:  MMC slots should have a Vcc regulator set up.
 		 * This may be from a TWL4030-family chip, another
 		 * controllable regulator, or a fixed supply.
diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
index 36f0ba8..434a3ed 100644
--- a/arch/arm/mach-omap2/hsmmc.h
+++ b/arch/arm/mach-omap2/hsmmc.h
@@ -23,6 +23,7 @@ struct omap2_hsmmc_info {
 	int	ocr_mask;	/* temporary HACK */
 	/* Remux (pad configuation) when powering on/off */
 	void (*remux)(struct device *dev, int slot, int power_on);
+	void	*priv_data;	/* private data to SDIO function driver */
 };
 
 #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index c835f1e..9db1617 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -140,6 +140,8 @@ struct omap_mmc_platform_data {
 
 		unsigned int ban_openended:1;
 
+		/* card private data that should be used by function driver */
+		void *priv_data;
 	} slots[OMAP_MMC_MAX_SLOTS];
 };
 
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4c5a669..4ac548e 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2157,6 +2157,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
 	if (mmc_slot(host).nonremovable)
 		mmc->caps |= MMC_CAP_NONREMOVABLE;
 
+	mmc_set_embedded_data(mmc, mmc_slot(host).priv_data);
+
 	omap_hsmmc_conf_bus_power(host);
 
 	/* Select DMA lines */
-- 
1.7.0.4


^ permalink raw reply related


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