pandora-wifi.git
14 years agowl1251: fix potential crash
Grazvydas Ignotas [Thu, 11 Mar 2010 15:45:26 +0000 (17:45 +0200)]
wl1251: fix potential crash

In case debugfs does not init for some reason (or is disabled
on older kernels) driver does not allocate stats.fw_stats
structure, but tries to clear it later and trips on a NULL
pointer:

Unable to handle kernel NULL pointer dereference at virtual address
00000000
PC is at __memzero+0x24/0x80
Backtrace:
[<bf0ddb88>] (wl1251_debugfs_reset+0x0/0x30 [wl1251])
[<bf0d6a2c>] (wl1251_op_stop+0x0/0x12c [wl1251])
[<bf0bc228>] (ieee80211_stop_device+0x0/0x74 [mac80211])
[<bf0b0d10>] (ieee80211_stop+0x0/0x4ac [mac80211])
[<c02deeac>] (dev_close+0x0/0xb4)
[<c02deac0>] (dev_change_flags+0x0/0x184)
[<c031f478>] (devinet_ioctl+0x0/0x704)
[<c0320720>] (inet_ioctl+0x0/0x100)

Add a NULL pointer check to fix this.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1251: reduce eeprom read wait time
Grazvydas Ignotas [Thu, 11 Mar 2010 15:45:07 +0000 (17:45 +0200)]
wl1251: reduce eeprom read wait time

4sec wait is way too pessimistic, TI driver uses 40ms here,
and testing shows that is ebough, so let's also use that.
While at it, add useful sounding comment from the TI driver.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1251: fix ELP_CTRL register accesses when using SDIO
Grazvydas Ignotas [Thu, 11 Mar 2010 15:44:57 +0000 (17:44 +0200)]
wl1251: fix ELP_CTRL register accesses when using SDIO

For some unknown reason ELP_CTRL can't be accesed using
sdio_memcpy_* functions (any attemts to do so result in timeouts):

 wl1251: ERROR sdio write failed (-110)
 wl1251: ERROR sdio read failed (-110)
 wl1251: WARNING WLAN not ready

To fix this, add special IO functions for ELP_CTRL access that are
using sdio_readb/sdio_writeb. Similar handling is done in TI
reference driver from Android code drop.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Cc: Bob Copeland <me@bobcopeland.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1251: make local symbols static
Grazvydas Ignotas [Fri, 12 Mar 2010 10:28:41 +0000 (12:28 +0200)]
wl1251: make local symbols static

Make local functions and data static, also constify
some structures. While at it, clean up unneeded includes.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Cc: Bob Copeland <me@bobcopeland.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocompat-wireless-2010-03-10
Grazvydas Ignotas [Mon, 19 Apr 2010 16:08:33 +0000 (19:08 +0300)]
compat-wireless-2010-03-10