Search Linux Wireless

RE: [PATCH 20/20] wlcore: Always pass DMA-able buffers to mmc functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

thanks in advance for your support.

I’m trying to make working the WL1271 TI Murata chip with our custom board.  The SPI driver seems to be running but I cannot scan from our Wifi Network. 

After booting the board I’m doing:

•	insmod /media/red/root/wl1271/wl1271.ko
•	insmod /media/red/root/wl1271/wl1271_spi.ko
•	iwconfig wlan0 mode managed
•	iwconfig wlan0 essid xxxxxxx
•	ifconfig wlan0 hw ether 00:80:E1:12:26:17 
•	ifconfig wlan0 192.168.40.100 netmask 255.255.255.0 up

Then I botain:

chip_id read from memory: 04030111
wl1271_fetch_firmware - fetching firmware wl1271-fw.bin
wl1271_fetch_nvs - fetching firmware wl1271-nvs.bin
wl1271: firmware booted (Rev 6.1.0.50.350)

but unfortunately the when I run “iwlist wlan0 scan”

I obtain “wlan0 No scan results”


Could you please help us in fixing this issue ?

Thanks again.

Alberto

-----Original Message-----
From: linux-wireless-owner@xxxxxxxxxxxxxxx [mailto:linux-wireless-owner@xxxxxxxxxxxxxxx] On Behalf Of Luciano Coelho
Sent: lunedì 10 dicembre 2012 18:07
To: Arik Nemtsov
Cc: linux-wireless@xxxxxxxxxxxxxxx; Ido Yariv
Subject: Re: [PATCH 20/20] wlcore: Always pass DMA-able buffers to mmc functions

On Wed, 2012-11-28 at 11:42 +0200, Arik Nemtsov wrote:
> From: Ido Yariv <ido@xxxxxxxxxx>
> 
> Some of the mmc drivers initiate DMA transfers with buffers passed 
> from higher layers. This means that the driver shouldn't ever pass non 
> DMA-able buffers, such as ones that are unaligned, allocated on the 
> stack or static.
> 
> Fix a couple of calls to the mmc layer in which buffers which weren't 
> necessarily DMA-able were passed.
> 
> Signed-off-by: Ido Yariv <ido@xxxxxxxxxx>
> Signed-off-by: Arik Nemtsov <arik@xxxxxxxxxx>
> ---

[...]

> diff --git a/drivers/net/wireless/ti/wlcore/io.h 
> b/drivers/net/wireless/ti/wlcore/io.h
> index 5897747..70f9bdc 100644
> --- a/drivers/net/wireless/ti/wlcore/io.h
> +++ b/drivers/net/wireless/ti/wlcore/io.h
> @@ -105,13 +105,12 @@ static inline int __must_check 
> wlcore_raw_read32(struct wl1271 *wl, int addr,  {
>  	int ret;
>  
> -	ret = wlcore_raw_read(wl, addr, &wl->buffer_32,
> -			      sizeof(wl->buffer_32), false);
> +	ret = wlcore_raw_read(wl, addr, wl->buffer_32, sizeof(u32), false);
>  	if (ret < 0)
>  		return ret;
>  
>  	if (val)
> -		*val = le32_to_cpu(wl->buffer_32);
> +		*val = le32_to_cpu(*wl->buffer_32);
>  
>  	return 0;
>  }
> @@ -119,9 +118,8 @@ static inline int __must_check 
> wlcore_raw_read32(struct wl1271 *wl, int addr,  static inline int __must_check wlcore_raw_write32(struct wl1271 *wl, int addr,
>  						  u32 val)
>  {
> -	wl->buffer_32 = cpu_to_le32(val);
> -	return wlcore_raw_write(wl, addr, &wl->buffer_32,
> -				sizeof(wl->buffer_32), false);
> +	*wl->buffer_32 = cpu_to_le32(val);
> +	return wlcore_raw_write(wl, addr, wl->buffer_32, sizeof(u32), 
> +false);
>  }
>  
>  static inline int __must_check wlcore_read(struct wl1271 *wl, int 
> addr, diff --git a/drivers/net/wireless/ti/wlcore/main.c 
> b/drivers/net/wireless/ti/wlcore/main.c
> index 1793a82..e4ff66a 100644
> --- a/drivers/net/wireless/ti/wlcore/main.c
> +++ b/drivers/net/wireless/ti/wlcore/main.c
> @@ -5890,8 +5890,17 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
>  		goto err_fwlog;
>  	}
>  
> +	wl->buffer_32 = kmalloc(sizeof(u32), GFP_KERNEL);
> +	if (!wl->buffer_32) {
> +		ret = -ENOMEM;
> +		goto err_mbox;
> +	}
> +
>  	return hw;
>  
> +err_mbox:
> +	kfree(wl->mbox);
> +
>  err_fwlog:
>  	free_page((unsigned long)wl->fwlog);


Can't we change sizeof(u32) to sizeof(__le32) or sizeof(*wl->buffer_32) just for consistency?

I'll change it to the latter if you agree.

--
Luca.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at  http://vger.kernel.org/majordomo-info.html

��.n��������+%������w��{.n�����{���zW����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux