wlan_cfg80211: Add SOFTAP WPS type to support WPS in tethering 59/82259/9 accepted/tizen/mobile/20160809.232534 submit/tizen/20160809.043430 submit/tizen/20160809.063303
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 2 Aug 2016 09:00:56 +0000 (18:00 +0900)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Tue, 9 Aug 2016 00:40:27 +0000 (17:40 -0700)
The tethering and soft AP should offer features of general APs.
The WPS is one of security types and standard to create a secure wireless home network.

This patch makes 80211 packets(beacon, probe response and associate response) include WPS ies.

Change-Id: I89f60d5ee7a797c48b80b9f3dbfa2eca6825b5f2
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
drivers/net/wireless/sc2331/wlan_cfg80211.c
drivers/net/wireless/sc2331/wlan_cfg80211.h

index a4a4a20..70d051d 100644 (file)
@@ -2314,6 +2314,59 @@ static int wlan_change_beacon(wlan_vif_t *vif,
        unsigned char vif_id = vif->id;
 
        printkd("%s enter\n", __func__);
+
+       if (vif->id == NETIF_0_ID) {
+               /* send beacon extra ies */
+               if (beacon->beacon_ies != NULL) {
+                       printkd("begin send beacon extra ies\n");
+
+                       ret = wlan_cmd_set_wps_ie(vif_id,
+                                       SOFTAP_WPS_BEACON_IE,
+                                       beacon->beacon_ies,
+                                       beacon->beacon_ies_len);
+                       if (ret) {
+                               printkd("wlan_cmd_set_wps_ie failed with %d\n", ret);
+                               return ret;
+                       } else {
+                               printkd("send beacon extra ies successfully\n");
+                       }
+               }
+
+               /* send probe response ies */
+               if (beacon->proberesp_ies != NULL) {
+                       printkd("begin send probe response extra ies\n");
+
+                       ret = wlan_cmd_set_wps_ie(vif_id,
+                                       SOFTAP_WPS_PROBERESP_IE,
+                                       beacon->proberesp_ies,
+                                       beacon->proberesp_ies_len);
+                       if (ret) {
+                               printkd("wlan_cmd_set_wps_ie failed with %d\n", ret);
+                               return ret;
+                       } else {
+                               printkd("send proberesp_ies successfully\n");
+                       }
+               }
+
+               /* send associate response ies */
+               if (beacon->assocresp_ies != NULL) {
+                       printkd("begin send associate response extra ies\n");
+
+                       ret = wlan_cmd_set_wps_ie(vif_id,
+                                       SOFTAP_WPS_ASSOCRESP_IE,
+                                       beacon->assocresp_ies,
+                                       beacon->assocresp_ies_len);
+                       if (ret) {
+                               printkd("wlan_cmd_set_wps_ie failed with %d\n", ret);
+                               return ret;
+                       } else {
+                               printkd("send assocresp_iessuccessfully\n");
+                       }
+               }
+
+               return ret;
+       }
+
 #ifdef WIFI_DIRECT_SUPPORT
        /* send beacon extra ies */
        if (beacon->head != NULL) {
index 832b37d..c15fc3c 100644 (file)
@@ -80,7 +80,10 @@ enum WPS_TYPE {
        P2P_PROBERESP_IE,
        P2P_ASSOCRESP_IE,
        P2P_BEACON_IE_HEAD,
-       P2P_BEACON_IE_TAIL
+       P2P_BEACON_IE_TAIL,
+       SOFTAP_WPS_PROBERESP_IE = 11,
+       SOFTAP_WPS_BEACON_IE,
+       SOFTAP_WPS_ASSOCRESP_IE,
 };
 
 enum wlan_state {