OSDN Git Service

Remove obsolete parameter from p2p_sd_service_update()
authorDmitry Shmidt <dimitrysh@google.com>
Wed, 14 Aug 2013 22:30:08 +0000 (15:30 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Wed, 14 Aug 2013 22:30:08 +0000 (15:30 -0700)
Bug: 9056601

Change-Id: Ia461ff500df50f1b97ad446dc14d43fa3513677b
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
src/p2p/p2p.h
src/p2p/p2p_i.h
src/p2p/p2p_sd.c
wpa_supplicant/ctrl_iface.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/p2p_supplicant.h

index 6b5679c..0fdad86 100644 (file)
@@ -53,10 +53,6 @@ enum p2p_wps_method {
        WPS_NOT_READY, WPS_PIN_DISPLAY, WPS_PIN_KEYPAD, WPS_PBC
 };
 
-enum p2p_sd_action {
-       SRV_UPDATE, SRV_ADD, SRV_DEL, SRV_FLUSH
-};
-
 /**
  * struct p2p_go_neg_results - P2P Group Owner Negotiation results
  */
@@ -147,7 +143,6 @@ struct p2p_data;
 enum p2p_scan_type {
        P2P_SCAN_SOCIAL,
        P2P_SCAN_FULL,
-       P2P_SCAN_SPECIFIC,
        P2P_SCAN_SOCIAL_PLUS_ONE
 };
 
@@ -1042,11 +1037,7 @@ void p2p_sd_response(struct p2p_data *p2p, int freq, const u8 *dst,
  * of the local services. This will increment the Service Update Indicator
  * value which will be used in SD Request and Response frames.
  */
-#ifdef ANDROID_P2P
-void p2p_sd_service_update(struct p2p_data *p2p, int action);
-#else
 void p2p_sd_service_update(struct p2p_data *p2p);
-#endif
 
 
 enum p2p_invite_role {
index dc629f8..d28aae9 100644 (file)
@@ -357,12 +357,7 @@ struct p2p_data {
         * srv_update_indic - Service Update Indicator for local services
         */
        u16 srv_update_indic;
-#ifdef ANDROID_P2P
-       /**
-        * srv_count - Registered services count
-        */
-       u16 srv_count;
-#endif
+
        struct wpabuf *sd_resp; /* Fragmented SD response */
        u8 sd_resp_addr[ETH_ALEN];
        u8 sd_resp_dialog_token;
index 5d9c1bb..795ca6b 100644 (file)
@@ -891,33 +891,9 @@ void * p2p_sd_request_wfd(struct p2p_data *p2p, const u8 *dst,
 #endif /* CONFIG_WIFI_DISPLAY */
 
 
-#ifdef ANDROID_P2P
-void p2p_sd_service_update(struct p2p_data *p2p, int action)
-#else
 void p2p_sd_service_update(struct p2p_data *p2p)
-#endif
 {
        p2p->srv_update_indic++;
-#ifdef ANDROID_P2P
-       if(action == SRV_FLUSH)
-               p2p->srv_count = 0;
-       else if (action == SRV_DEL)
-               p2p->srv_count--;
-       else if (action == SRV_ADD)
-               p2p->srv_count++;
-
-       if(p2p->cfg->sd_request) {
-               if (p2p->srv_count == 1) {
-                       /* First Service Registered. Enable SD capability */
-                       p2p->dev_capab |= P2P_DEV_CAPAB_SERVICE_DISCOVERY;
-               } else if (p2p->srv_count == 0 && !p2p->sd_queries) {
-                       /* No services remaining + No queries registered .
-                        * Remove the SD Capability 
-                        */
-                       p2p->dev_capab &= ~P2P_DEV_CAPAB_SERVICE_DISCOVERY;
-               }
-       }
-#endif
 }
 
 
index 8edf086..9486f2f 100644 (file)
@@ -5434,11 +5434,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
                if (p2p_ctrl_serv_disc_resp(wpa_s, buf + 19) < 0)
                        reply_len = -1;
        } else if (os_strcmp(buf, "P2P_SERVICE_UPDATE") == 0) {
-#ifdef ANDROID_P2P
-               wpas_p2p_sd_service_update(wpa_s, SRV_UPDATE);
-#else
                wpas_p2p_sd_service_update(wpa_s);
-#endif
        } else if (os_strncmp(buf, "P2P_SERV_DISC_EXTERNAL ", 23) == 0) {
                if (p2p_ctrl_serv_disc_external(wpa_s, buf + 23) < 0)
                        reply_len = -1;
index 08ae9e5..e039594 100644 (file)
@@ -260,11 +260,6 @@ static int wpas_p2p_scan(void *ctx, enum p2p_scan_type type, int freq,
                break;
        case P2P_SCAN_FULL:
                break;
-       case P2P_SCAN_SPECIFIC:
-               social_channels[0] = freq;
-               social_channels[1] = 0;
-               params.freqs = social_channels;
-               break;
        case P2P_SCAN_SOCIAL_PLUS_ONE:
                social_channels[3] = freq;
                params.freqs = social_channels;
@@ -2223,22 +2218,15 @@ void wpas_p2p_sd_response(struct wpa_supplicant *wpa_s, int freq,
                        resp_tlvs);
 }
 
-#ifdef ANDROID_P2P
-void wpas_p2p_sd_service_update(struct wpa_supplicant *wpa_s, int action)
-#else
+
 void wpas_p2p_sd_service_update(struct wpa_supplicant *wpa_s)
-#endif
 {
        if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_MGMT) {
                wpa_drv_p2p_service_update(wpa_s);
                return;
        }
        if (wpa_s->global->p2p)
-#ifdef ANDROID_P2P
-               p2p_sd_service_update(wpa_s->global->p2p, action);
-#else
                p2p_sd_service_update(wpa_s->global->p2p);
-#endif
 }
 
 
@@ -2272,11 +2260,7 @@ void wpas_p2p_service_flush(struct wpa_supplicant *wpa_s)
                              struct p2p_srv_upnp, list)
                wpas_p2p_srv_upnp_free(usrv);
 
-#ifdef ANDROID_P2P
-       wpas_p2p_sd_service_update(wpa_s, SRV_FLUSH);
-#else
        wpas_p2p_sd_service_update(wpa_s);
-#endif
 }
 
 
@@ -2292,11 +2276,7 @@ int wpas_p2p_service_add_bonjour(struct wpa_supplicant *wpa_s,
        bsrv->resp = resp;
        dl_list_add(&wpa_s->global->p2p_srv_bonjour, &bsrv->list);
 
-#ifdef ANDROID_P2P
-       wpas_p2p_sd_service_update(wpa_s, SRV_ADD);
-#else
        wpas_p2p_sd_service_update(wpa_s);
-#endif
        return 0;
 }
 
@@ -2310,11 +2290,7 @@ int wpas_p2p_service_del_bonjour(struct wpa_supplicant *wpa_s,
        if (bsrv == NULL)
                return -1;
        wpas_p2p_srv_bonjour_free(bsrv);
-#ifdef ANDROID_P2P
-       wpas_p2p_sd_service_update(wpa_s, SRV_DEL);
-#else
        wpas_p2p_sd_service_update(wpa_s);
-#endif
        return 0;
 }
 
@@ -2337,11 +2313,7 @@ int wpas_p2p_service_add_upnp(struct wpa_supplicant *wpa_s, u8 version,
        }
        dl_list_add(&wpa_s->global->p2p_srv_upnp, &usrv->list);
 
-#ifdef ANDROID_P2P
-       wpas_p2p_sd_service_update(wpa_s, SRV_ADD);
-#else
        wpas_p2p_sd_service_update(wpa_s);
-#endif
        return 0;
 }
 
@@ -2355,11 +2327,7 @@ int wpas_p2p_service_del_upnp(struct wpa_supplicant *wpa_s, u8 version,
        if (usrv == NULL)
                return -1;
        wpas_p2p_srv_upnp_free(usrv);
-#ifdef ANDROID_P2P
-       wpas_p2p_sd_service_update(wpa_s, SRV_DEL);
-#else
        wpas_p2p_sd_service_update(wpa_s);
-#endif
        return 0;
 }
 
index 3ca6222..7febac7 100644 (file)
@@ -101,11 +101,7 @@ int wpas_p2p_sd_cancel_request(struct wpa_supplicant *wpa_s, u64 req);
 void wpas_p2p_sd_response(struct wpa_supplicant *wpa_s, int freq,
                          const u8 *dst, u8 dialog_token,
                          const struct wpabuf *resp_tlvs);
-#ifdef ANDROID_P2P
-void wpas_p2p_sd_service_update(struct wpa_supplicant *wpa_s, int action);
-#else
 void wpas_p2p_sd_service_update(struct wpa_supplicant *wpa_s);
-#endif
 void wpas_p2p_service_flush(struct wpa_supplicant *wpa_s);
 int wpas_p2p_service_add_bonjour(struct wpa_supplicant *wpa_s,
                                 struct wpabuf *query, struct wpabuf *resp);