bcmdhd: use the wiphy from private data structure (i.e., wl_priv)
authorMursalin Akon <makon@nvidia.com>
Fri, 7 Sep 2012 17:57:02 +0000 (10:57 -0700)
committerMatthew Pedro <mapedro@nvidia.com>
Thu, 4 Oct 2012 22:39:15 +0000 (15:39 -0700)
commita4a73f7bc48e771e493e6e363e5c323ce8513ae9
treefb6f326baae081198bd769c95e1acbebe9d8d554
parent3ae23c3dab9151cca239513888d55146515931c1
bcmdhd: use the wiphy from private data structure (i.e., wl_priv)

problem:
The macro wiphy_from_scan retrieves wiphy from
wl_priv->escan_info.wiphy which is in turn set by
a 'scan' initiated from kernel space (like
scheduled scan) or from user space (like iwlist command).
Without a scan, a 'connect' crashes in function
wl_inform_single_bss, with NULL pointer access,
as the variable wiphy (in turn, wl->escan_info.wiphy)
is not initialized properly.

solution:
wireless_device data structures maintained for both
STA and P2P mode point to the same wiphy (see,
wl_cfgp2p_register_ndev in wl_cfgp2p.c). So,
irrespective of whatever wireless_device is in
use, a scan will always set wl_priv->escan_info.wiphy
to the same wiphy. There is no point in getting
wiphy using wl_priv->escan_info.wiphy, rather use
the wiphy referred by all wireless_device structures.

Bug 1029792
Bug 1029733

Change-Id: I6d744950d3a053642ffa998b3c3f3ba60c0cb687
Signed-off-by: Mursalin Akon <makon@nvidia.com>
Reviewed-on: http://git-master/r/141629
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
GVS: Gerrit_Virtual_Submit
drivers/net/wireless/bcmdhd/wl_cfg80211.c
drivers/net/wireless/bcmdhd/wl_cfg80211.h