Commit Graph

698 Commits

Author SHA1 Message Date
Jes Sorensen
68e6c79609 staging: rtl8723au: Stop carrying half the beacon frame header in the stored IE array
This gets rid of the odd carrying of half the beacon frame in the IE
array stored for the network. Instead we rely on the relevant fields
(timestamp, beacon_interval, and capability) stored in struct
wlan_bssid_ex.

Carrying only half the ieee80211_mgmt header led to a number of bugs
and simply obfuscated the code.

I have tried catching all instances relying on these three elements in
the IEs array, but missed cases may still need to be tracked down.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:59 -04:00
Jes Sorensen
a4cf0d65e5 staging: rtl8723au: rtw_generate_ie23a(): update network info as well as IE
We need to make sure to update the network info as well as the IE
array.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:59 -04:00
Jes Sorensen
0f728f1033 staging: rtl8723au: issue_beacon23a(): Determine ie buffer location using 80211_mgmt
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:59 -04:00
Jes Sorensen
89060370db staging: rtl8723au: issue_beacon23a(): Fix another case issuing a corrupted beacon
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:59 -04:00
Jes Sorensen
2131891c6a staging: rtl8723au: Remove unused dump_txrpt_ccx_8723a()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:59 -04:00
Jes Sorensen
559789d6cb staging: rtl8723au: Remove no-op CheckFwRsvdPageContent23a()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:59 -04:00
Jes Sorensen
a22301ec96 staging: rtl8723au: ConstructProbeRsp(): Use struct ieee80211_mgmt
Use ieee80211_mgmt to construct the frame instead of relying on hard
coded offsets.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:59 -04:00
Jes Sorensen
e61fc7cf90 staging: rtl8723au: Use _FIXED_IE_LEN_ instead of hard coded value
This should help catching all the users once we stop carrying the
fixed beacon elements in the IE array.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:58 -04:00
Jes Sorensen
51a26d26fe staging: rtl8723au: rtw_check_beacon_data23a(): Capability is already uptodate in cur_network
Beacon capability was already added to mlme_priv->cur_network before
calling this function, so no need to retrieve it from the IE array
again.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:58 -04:00
Jes Sorensen
fb5fd46dbd staging: rtl8723au: rtw_add_beacon(): Construct a full beacon frame for validation
Clean up and correct the beacon frame validation using a full beacon
frame, and pass that to rtw_check_beacon_data23a(). Previous we went
through hoops to construct the frame, minus the ieee80211_3addr header
which just made it more complicated, and resulted in inconsistencies
and bugs.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:58 -04:00
Jes Sorensen
1d33b07663 staging: rtl8723au: rtw_get_cur_max_rate(): Use _FIXED_IE_LENGTH_ instead of hardcoded value
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:57 -04:00
Jes Sorensen
5b5cf9941f staging: rtl8723au: Remove unused IE offset #defines
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:57 -04:00
Jes Sorensen
60e78f3df4 staging: rtl8723au: Remove usage of _{RE, }ASOCREQ_IE_OFFSET_
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:57 -04:00
Jes Sorensen
40954b6385 staging: rtl8723au: Remove unused size defines for mgmt frame elements
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-24 13:50:57 -04:00
Jes Sorensen
ad8686bc05 staging: rtl8723au: issue_probersp(): No need to calculate location of IEs, we know where they are
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
d642a0a0b9 staging: rtl8723au: issue_probersp(): Don't insert beacon data twice
In case of AP mode, we were inserting the beacon data twice in the
probe_resp frame, leading to a corrupted on the wire frame.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
2bde052753 staging: rtl8723au: rtw_joinbss_update_network23a(): update beacon info as well
We need to copy over the beacon info (interval, capability, tsf) as
well as the IE data.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
eb4f07bf85 staging: rtl8723au: rtw_survey_event_cb23a(): Remember to clone beacon data
We need to clone all the beacon information, not just the IE data, in
particular as the long term goal is to stop carrying this information
in the IE data.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
a131aac3b6 staging: rtl8723au: Remove (hopefully) last duplicate define of WLAN_EID_RSN
So much for thinking the removal of the previous 217 duplicate copies
would suffice ....

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
2bd3b4fb37 staging: rtl8723au: Remove write-only struct security_priv->authenticator_ie
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
d4fc0213dd staging: rtl8723au: Remove unused struct mlme_priv->wfd_* entries
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
a8607ffcf2 staging: rtl8723au: Remove obsolete mlme_priv->p2p_* entries
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
86bbac609d staging: rtl8723au: Remove unused struct mlme_priv->wps_probe_resp_ie
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
302b1cd631 staging: rtl8723au: Remove unused mlme_priv->wps_assoc_resp_ie and friends
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:37 -07:00
Jes Sorensen
2331ef89ef staging: rtl8723au: struct mlme_priv->wps_beacon_ie is never set
Remove all code trying to use it

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-21 13:08:36 -07:00
Jes Sorensen
0fd90b74cb staging: rtl8723au: Eliminate last rtw_get_beacon_interval*() usage
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:51 -07:00
Jes Sorensen
a94e12b183 staging: rtl8723au: Remove last users of rtw_get_capability*() functions
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:51 -07:00
Jes Sorensen
0396416f54 staging: rtl8723au: rtw_get_bcn_info23a(): Use __func__ in debug prints
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:51 -07:00
Jes Sorensen
9ce73e2e6a staging: rtl8723au: rtw_get_bcn_info23a(): Use capability from wlan_bssid_ex
This eliminates yet another user of rtw_get_capability23a_from_ie()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:51 -07:00
Jes Sorensen
92af4499c6 staging: rtl8723au: issue_assocreq(): Use struct ieee80211_mgmt to build assoc_req frame
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:51 -07:00
Jes Sorensen
5376badca0 staging: rtl8723au: issue_assocrsp(): Use capability from struct wlan_bssid_ex
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:51 -07:00
Jes Sorensen
08519034b3 staging: rtl8723au: issue_probersp(): Do not copy the IEs in front of probe_resp data
Another case where the driver was copying IEs in front of the
probe_resp data in the management frame, when running in AP mode. This
would result in badly corrupted frames hitting the wire - ouf ouf ouf!

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:51 -07:00
Jes Sorensen
5d43182bc3 staging: rtl8723au: issue_beacon23a(): Use struct ieee80211_mgmt to build beacon
Why on Earth we have two functions in the driver constructing beacon
frames is beyond me ... but one step at a time

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:51 -07:00
Jes Sorensen
b81d36cbee staging: rtl8723au: issue_beacon23a(): Do not copy IEs in front of beacon data
Not sure how this happened, but one should never copy the IEs in front
of the beacon frame info. This could lead to some nasty corrupted
beacon frames hitting the wire if running AP mode - ouf!

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
0b46cfdd03 staging: rtl8723au: ConstructBeacon(): Use struct ieee80211_mgmt to build beacon
This gets rid of a bunch of hard coded offsets and reduces the
dependency of the ugly rtw_get_*_from_ie() functions.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
ccb1bdcb48 staging: rtl8723au: is_same_network23a(): Use the capability info from wlan_bssid_ex
We already have the capability info in struct wlan_bssid_ex, no point
in searching for it once again.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
ddf5c2bd10 staging: rtl8723au: Update bss beacon info in rtw_add_beacon()
Pull out the core info beacon_interval, capability, and tsf and update
cur_network.network with the info in rtw_add_beacon() instead of
relying on it being in ->IEs.

This will help later when getting rid of the beacon struct info from
->IEs and only carrying the actual IEs there.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
db97812c2c staging: rtl8723au: rtw_add_beacon(): Replace magic constant with appropriate struct size
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
143ced27ac staging: rtl8723au: struct wlan_bssid_ex: Rename BeaconPeriod to beacon_interval
This is to be more consistent mapping the names in wlan_bssid_ex to
those in struct ieee80211_mgmt.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
11a80e8877 staging: rtl8723au: rtw_cfg80211_inform_bss(): Use the capability info we already saved
No point in pulling capability info out of the IE array when it's
already stored in struct wlan_bssid_ex

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
53c6600067 staging: rtl8723au: collect_bss_info(): Save capability in struct wlan_bssid_ex
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
2620e339e8 staging: rtl8723au: rtw_cfg80211_inform_bss(): Report the beacon interval already retrieved
Use the beacon interval we already retreived in collect_bss_info()
instead of pulling it out of the saved IE array again.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
993c52ba61 staging: rtl8723au: Save timestamp for network in collect_bss_info() and report it to the stack
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
4062f7aa8f staging: rtl8723au: rtw_cfg80211_inform_bss(): Use cfg80211_inform_bss()
There is no point in creating a fake beacon frame to call
cfg80211_inform_bss_frame() when we can just call
cfg80211_inform_bss() with the parameters we were sticking into the
fake frame.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Jes Sorensen
8a3adc2480 staging: rtl8723au: rtw_cfg80211_inform_bss(): timestamp isn't used
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 13:08:50 -07:00
Sachin Kamat
db5767a3f9 staging: rtl8723au: Remove redundant casting in rtw_mlme.c
Casting value returned by kzalloc is useless.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18 14:09:49 -07:00
Sachin Kamat
248c959152 staging: rtl8723au: Remove redundant casting in rtw_mlme_ext.c
Casting value returned by kzalloc is useless.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18 14:09:48 -07:00
Geert Uytterhoeven
ee264346fa staging: rtl8723au: Add compiler check for -Wtype-limits
Gcc versions before 4.3 do not support -Wtype-limits:

cc1: error: unrecognized command line option "-Wtype-limits"

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18 14:08:58 -07:00
Jes Sorensen
7579a7e47d staging: rtl8723au: rtw_cfg80211_set_wpa_ie(): Avoid pointless memcpy
There is no point copying a buffer, just to scan it and then free it
again.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18 14:07:30 -07:00
Jes Sorensen
3798786626 staging: rtl8723au: Move FillH2CCmd() prototype to rtl8723a_cmd.h where it really belongs
As an added bonus, remove the now obsolete rtw_ioctl_set.h

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18 14:07:30 -07:00