net: wireless: bcmdhd: Fix country checking

Bug: 11319610

Change-Id: I5c52ed594614d8039f167de3c98bd9f802b521df
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: fixed power consumption issue of P2P.

	solution : add wake_lock not to go to suspend during removing P2P GO
	interface in wl_cfg80211.c.
	Description of this issue :
	if device goes to suspend during removing the interface,
	we will fail to remove P2P GO virtual
	interface(p2p-p2p0-0).
	This will causes P2P GO still alive in firmware
	Bugnizer case id : 10874302
	This issue is reported by LG team.
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Change-Id: I9d258bef1473aa289e53d8fe117409140702e250
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: Fixed a problem of buganizer issue (11190960)

	Problem : if PNO scan occurs in Driver after p2p scan,
		  we failed to do PNO scan
	Root cause : In the wl_run_escan function, we still goes into
	p2p scan code even though current scan is PNO which is kind of
	legacy scan.

	Solution : we need to clear the staus of P2P scan before doing
	PNO SCAN.

Change-Id: I0461a21b61c776f3e8fe52bc81d4705226444e74
Signed-off-by: Ecco Park <eccopark@broadcom.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
net-fixes: flow_dissector: prevent an infinite loop (CVE-2013-4348)

Jason Wang found that a malicious packet could make skb_flow_dissect()
loop forever. We must check that IP header has a valid ihl to avoid
this loop. It involves IPIP encapsulation and ihl = 0 to trigger.

Given this bug is critical, I cooked a patch before having
a fix in upstream kernel.

Tested:

 Compiled/booted
 Ran some tests on bnx2x and explicitely disabled hardware provided rxhash
 ethtool -K eth1 rxhash off
 ethtool -K eth2 rxhash off

Google-Bug-Id: 11465355
Effort: net-fixes
Change-Id: I813e4dc48cecb05f8edfa218304e1f13fd764323
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: cancel current PNO if connection will happen

	Issue : Manta: Lack of WLS causes PNO problem
	Problem : we found that race condition happens
		between connection and PNO sometimes.
		Connection is failed due to this race condition.
	Solution: we need to cancel PNO explicitly if the connection
	request start in DHD driver.
	Bug : 11174374
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Change-Id: I7bf81d127901a74e9f47d6cc4ee7b265c6936dc3
net: wireless: bcmdhd: Change DTIM skip policy in suspend

	issue : WiFi continuously disconnects
	Root cause :
	Sometimes we got link down event due to beacon
	lost when device goes to suspend.
	This problem sometimes happens in case that DTIM is 3 and beacon
	100ms because we wake up on 900ms (100ms * 3 * 3) during
	suspend.
	This value(900ms) is too big to STA for sync up with AP time.
	This causes STA out of sync for time with the AP.
	Eventually STA got lost of beacon during long time (4secs).

	Solution :
	If the total dtim skip interval (beacon_interval *
	DTIM * 3) is greater than 300ms, we will not extend DTIM to DTIM
	* 3.
	Instead of that, we will use original value (DTIM) for wake up
	in suspend.
	Bug : 1343127 WiFi continuously disconnects

Signed-off-by: Ecco Park <eccopark@broadcom.com>

Change-Id: I6d89bd1c56127befe4d9606869396ee25b7911ef
net: wireless: bcmdhd: Set MAX_DTIM_ALLOWED_INTERVAL to 600

Change-Id: Ie4d9cac1e0828651a142d64762b251537431ea99
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Enable IPv6 RA filter feature

1) We will block IPv6 Router Advertisement multicast packet in suspend mode to save power on device.

Bug: 11638281
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Change-Id: Icbd6e6ca54004d3c29bd2ef8fd1fbe26fcb88ce4
sync: Fix a race condition between release_obj and print_obj

Before this change, a timeline would only be removed from the timeline
list *after* the sync driver had its release_obj() called. However, the
driver's release_obj() may free resources needed by print_obj().

Although the timeline list is locked when print_obj() is called, it is
not locked when release_obj() is called. If one CPU was in print_obj()
when another was in release_obj(), the print_obj() may make unsafe
accesses.

It is not actually necessary to hold the timeline list lock when calling
release_obj() if the call is made after the timeline is unlinked from
the list, since there is no possibility another thread could be in --
or enter -- print_obj() for that timeline.

This change moves the release_obj() call to after the timeline is
unlinked, preventing the above race from occurring.

Change-Id: I027827f87afe74876bab738c842d16c6a9420973
Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
net: wireless: bcmdhd: enable TDLS_auto_mode

	Requirement :
	1. enable auto mode for SETUP request
	2. disable auto mode for TEARDOWN request
	bug : 11632025 TDLS hybrid mode support

Change-Id: Idc0cb60e65a45bb32b8beb2bb3daf72c9112eab6
Signed-off-by: Ecco Park <eccopark@broadcom.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>

Conflicts:
	drivers/net/wireless/bcmdhd/wl_cfg80211.c
net: wireless: bcmdhd: Change the parameter for TDLS

	1) tuned the parameter for TDLS connection to transit between AP
	and TDLS smoothly.
	2) tdls_rssi_high : -70 dbm -> -60 dbm (for setup)
	   tdls_rssi_low : -80 dbm -> -70dbm (for teardown)
	bug : 11632025
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>