staging: rtl8723au: Fix buffer overflow in rtw_get_wfd_ie()

Add bounds checking to not allow WFD Information Elements larger than
128, and make sure we use the correct buffer size MAX_WFD_IE_LEN
instea of hardcoding the size.

This also simplifies rtw_get_wfd_ie() by using the cfg80211
infrastructure.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: Remove duplicate #defines for WLAN_EID_VENDOR_SPECIFIC

Lets not keep one local copy ... no lets keep two ... no lets keep three!
Rip them all out and use the kernel provided one.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_security.h - remove some unused macros

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: make source * argument const

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_mlme_ext.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_mlme.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_ap.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_p2p.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_ieee80211.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_wlan_util.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtl8723a_cmd.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_xmit.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_recv.c: Use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: Fixup last users to use the kernel's WLAN_EID_* definitions

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: Remove obsolete local defines matching WLAN_EID_*

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: Remove P2P/WiFiDirect/WiFiDisplay code

Discussing with Johannes Berg and Larry Finger, we have concluded that
this code really should be handled through wpa_supplicant, and not in
the kernel.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: Remove another stack of unused P2P related #defines

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_restructure_ht_ie23a(): use cfg80211_find_ie()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: rtw_update_ht_ie23a(): use cfg80211_find_ie()

Switch to using cfg80211_find_ie() and remove commented out code.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
staging: rtl8723au: OnProbeReq23a() Use cfg80211_find_ie()

Switch to using cfg80211_find_ie() and tidy of the code.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>