From: Jes Sorensen <jes.soren...@redhat.com>

Signed-off-by: Jes Sorensen <jes.soren...@redhat.com>
---
 drivers/staging/rtl8723au/core/rtw_ap.c           | 7 +++++--
 drivers/staging/rtl8723au/core/rtw_ieee80211.c    | 7 +------
 drivers/staging/rtl8723au/core/rtw_mlme.c         | 2 +-
 drivers/staging/rtl8723au/core/rtw_mlme_ext.c     | 6 ++----
 drivers/staging/rtl8723au/include/ieee80211.h     | 2 +-
 drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 9 ++++-----
 6 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c 
b/drivers/staging/rtl8723au/core/rtw_ap.c
index a5bbcdc..6c9a933 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -663,7 +663,9 @@ static void start_bss_network(struct rtw_adapter *padapter, 
u8 *pbuf)
        /* check if there is wps ie, */
        /* if there is wpsie in beacon, the hostapd will update beacon twice 
when stating hostapd, */
        /* and at first time the security ie (RSN/WPA IE) will not include in 
beacon. */
-       if (NULL == rtw_get_wps_ie23a(pnetwork->IEs+_FIXED_IE_LENGTH_, 
pnetwork->IELength-_FIXED_IE_LENGTH_, NULL, NULL))
+       if (NULL == rtw_get_wps_ie23a(pnetwork->IEs + _FIXED_IE_LENGTH_,
+                                     pnetwork->IELength - _FIXED_IE_LENGTH_,
+                                     NULL))
                pmlmeext->bstart_bss = true;
 
        /* todo: update wmm, ht cap */
@@ -1244,7 +1246,8 @@ static void update_bcn_wps_ie(struct rtw_adapter 
*padapter)
        if (pwps_ie_src == NULL)
                return;
 
-       pwps_ie = rtw_get_wps_ie23a(ie+_FIXED_IE_LENGTH_, 
ielen-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
+       pwps_ie = rtw_get_wps_ie23a(ie + _FIXED_IE_LENGTH_,
+                                   ielen - _FIXED_IE_LENGTH_, &wps_ielen);
 
        if (pwps_ie == NULL || wps_ielen == 0)
                return;
diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723au/core/rtw_ieee80211.c
index dd9446a..f05d6e0 100644
--- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c
@@ -700,14 +700,12 @@ int rtw_get_sec_ie23a(u8 *in_ie, uint in_len, u8 *rsn_ie, 
u16 *rsn_len,
  * rtw_get_wps_ie23a - Search WPS IE from a series of IEs
  * @in_ie: Address of IEs to search
  * @in_len: Length limit from in_ie
- * @wps_ie: If not NULL and WPS IE is found, WPS IE will be copied to the
- *          buf starting from wps_ie
  * @wps_ielen: If not NULL and WPS IE is found, will set to the length of
  *             the entire WPS IE
  *
  * Returns: The address of the WPS IE found, or NULL
  */
-u8 *rtw_get_wps_ie23a(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
+u8 *rtw_get_wps_ie23a(u8 *in_ie, uint in_len, uint *wps_ielen)
 {
        uint cnt;
        u8 *wpsie_ptr = NULL;
@@ -728,9 +726,6 @@ u8 *rtw_get_wps_ie23a(u8 *in_ie, uint in_len, u8 *wps_ie, 
uint *wps_ielen)
                    !memcmp(&in_ie[cnt+2], wps_oui, 4)) {
                        wpsie_ptr = &in_ie[cnt];
 
-                       if (wps_ie)
-                               memcpy(wps_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
-
                        if (wps_ielen)
                                *wps_ielen = in_ie[cnt + 1] + 2;
 
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c 
b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 7a354ae..b1fa5dc 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -599,7 +599,7 @@ static int rtw_is_desired_network(struct rtw_adapter 
*adapter,
        if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
                if (rtw_get_wps_ie23a(pnetwork->network.IEs + _FIXED_IE_LENGTH_,
                                      pnetwork->network.IELength -
-                                     _FIXED_IE_LENGTH_, NULL, &wps_ielen))
+                                     _FIXED_IE_LENGTH_, &wps_ielen))
                        return true;
                else
                        return false;
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index 1e1f845..9b401fb 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -2548,8 +2548,7 @@ void issue_beacon23a(struct rtw_adapter *padapter, int 
timeout_ms)
                                           sizeof (struct ieee80211_hdr_3addr) +
                                           _BEACON_IE_OFFSET_, pattrib->pktlen -
                                           sizeof (struct ieee80211_hdr_3addr) -
-                                          _BEACON_IE_OFFSET_, NULL,
-                                          &wps_ielen);
+                                          _BEACON_IE_OFFSET_, &wps_ielen);
                if (wps_ie && wps_ielen > 0) {
                        rtw_get_wps_attr_content23a(wps_ie, wps_ielen,
                                                    WPS_ATTR_SELECTED_REGISTRAR,
@@ -2714,8 +2713,7 @@ static void issue_probersp(struct rtw_adapter *padapter, 
unsigned char *da,
                pwps_ie = rtw_get_wps_ie23a(cur_network->IEs +
                                            _FIXED_IE_LENGTH_,
                                            cur_network->IELength -
-                                           _FIXED_IE_LENGTH_, NULL,
-                                           &wps_ielen);
+                                           _FIXED_IE_LENGTH_, &wps_ielen);
 
                /* inerset & update wps_probe_resp_ie */
                if (pmlmepriv->wps_probe_resp_ie && pwps_ie && wps_ielen > 0) {
diff --git a/drivers/staging/rtl8723au/include/ieee80211.h 
b/drivers/staging/rtl8723au/include/ieee80211.h
index b680ee0..6dedc10 100644
--- a/drivers/staging/rtl8723au/include/ieee80211.h
+++ b/drivers/staging/rtl8723au/include/ieee80211.h
@@ -432,7 +432,7 @@ int rtw_parse_wpa2_ie23a(const u8* wpa_ie, int wpa_ie_len, 
int *group_cipher, in
 
 int rtw_get_sec_ie23a(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 
*wpa_ie,u16 *wpa_len);
 
-u8 *rtw_get_wps_ie23a(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen);
+u8 *rtw_get_wps_ie23a(u8 *in_ie, uint in_len, uint *wps_ielen);
 u8 *rtw_get_wps_attr23a(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 
*buf_attr, u32 *len_attr);
 u8 *rtw_get_wps_attr_content23a(u8 *wps_ie, uint wps_ielen, u16 target_attr_id 
,u8 *buf_content, uint *len_content);
 
diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c 
b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
index 0c9f5ce..4c5b1e1 100644
--- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
@@ -1486,7 +1486,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct 
rtw_adapter *padapter,
        DBG_8723A("%s, ielen =%d\n", __func__, len);
 
        if (len > 0) {
-               wps_ie = rtw_get_wps_ie23a(buf, len, NULL, &wps_ielen);
+               wps_ie = rtw_get_wps_ie23a(buf, len, &wps_ielen);
                if (wps_ie) {
                        DBG_8723A("probe_req_wps_ielen =%d\n", wps_ielen);
 
@@ -1886,7 +1886,7 @@ static int rtw_cfg80211_set_wpa_ie(struct rtw_adapter 
*padapter, const u8 *pie,
                uint wps_ielen;
                u8 *wps_ie;
 
-               wps_ie = rtw_get_wps_ie23a(buf, ielen, NULL, &wps_ielen);
+               wps_ie = rtw_get_wps_ie23a(buf, ielen, &wps_ielen);
                if (wps_ie && wps_ielen > 0) {
                        DBG_8723A("got wps_ie, wps_ielen:%u\n", wps_ielen);
                        padapter->securitypriv.wps_ie_len =
@@ -2825,9 +2825,8 @@ static int rtw_add_beacon(struct rtw_adapter *adapter, 
const u8 *head,
        len = head_len + tail_len - 24;
 
        /* check wps ie if inclued */
-       if (rtw_get_wps_ie23a
-           (pbuf + _FIXED_IE_LENGTH_, len - _FIXED_IE_LENGTH_, NULL,
-            &wps_ielen))
+       if (rtw_get_wps_ie23a(pbuf + _FIXED_IE_LENGTH_, len - _FIXED_IE_LENGTH_,
+                             &wps_ielen))
                DBG_8723A("add bcn, wps_ielen =%d\n", wps_ielen);
 
        /* pbss_network->IEs will not include p2p_ie, wfd ie */
-- 
1.9.3

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to