diff --git a/wpa_supplicant-2.9_standard/src/ap/sta_info.c b/wpa_supplicant-2.9_standard/src/ap/sta_info.c index 1fa2802e2e3f1b97ca7246357de7a5ccf357f6fb..b9587e877405f8a2c8c14fafc0e2806a272794e0 100644 --- a/wpa_supplicant-2.9_standard/src/ap/sta_info.c +++ b/wpa_supplicant-2.9_standard/src/ap/sta_info.c @@ -36,7 +36,7 @@ #include "wnm_ap.h" #include "mbo_ap.h" #include "ndisc_snoop.h" -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT #include "hm_miracast_sink.h" #endif #include "sta_info.h" @@ -1528,7 +1528,7 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd, #ifdef CONFIG_P2P u8 addr[ETH_ALEN]; u8 ip_addr_buf[4]; -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT struct hm_p2p_pvt_peer *peer = NULL; #endif #endif /* CONFIG_P2P */ @@ -1578,7 +1578,7 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd, ip_addr_buf[2], ip_addr_buf[3]); ip_ptr = ip_addr_buf; } -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT peer = hm_p2p_find_peer(dev_addr); if (peer != NULL) { peer->go_req_cnt = 0; diff --git a/wpa_supplicant-2.9_standard/src/common/ieee802_11_common.c b/wpa_supplicant-2.9_standard/src/common/ieee802_11_common.c index f4fc8b1078ec479010bb51ca478c873fa975064f..9a9429bbc88c0e52663dda3ec6d1e31a16a514e8 100644 --- a/wpa_supplicant-2.9_standard/src/common/ieee802_11_common.c +++ b/wpa_supplicant-2.9_standard/src/common/ieee802_11_common.c @@ -16,7 +16,7 @@ #include "ieee802_11_defs.h" #include "ieee802_11_common.h" -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT #include "hm_miracast_sink.h" #endif @@ -182,12 +182,6 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen, elems->pref_freq_list = pos; elems->pref_freq_list_len = elen; break; -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) - case HM_PVT_VENDOR_P2P_OUI: - if (hm_ieee80211_parse_vendor_opt_ie(pos, elen, elems)) - wpa_printf(MSG_ERROR, "hm_ieee80211_parse_vendor_opt_ie parse vendor p2p oui fail"); - break; -#endif default: wpa_printf(MSG_EXCESSIVE, "Unknown QCA information element ignored (type=%d len=%lu)", @@ -195,7 +189,12 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen, return -1; } break; - +#ifdef CONFIG_MIRACAST_SINK_OPT + case HM_PVT_VENDOR_P2P_OUI: + if (hm_ieee80211_parse_vendor_opt_ie(pos, elen, elems)) + wpa_printf(MSG_ERROR, "hm_ieee80211_parse_vendor_opt_ie parse vendor p2p oui fail"); + break; +#endif default: wpa_printf(MSG_EXCESSIVE, "unknown vendor specific " "information element ignored (vendor OUI " diff --git a/wpa_supplicant-2.9_standard/src/common/ieee802_11_common.h b/wpa_supplicant-2.9_standard/src/common/ieee802_11_common.h index 5ba914ced34ffcdf8a731fd364a598da837ddc01..05473776c5a766d03bd226b8aeb1e02590afa0e5 100644 --- a/wpa_supplicant-2.9_standard/src/common/ieee802_11_common.h +++ b/wpa_supplicant-2.9_standard/src/common/ieee802_11_common.h @@ -104,7 +104,7 @@ struct ieee802_11_elems { const u8 *fils_pk; const u8 *fils_nonce; const u8 *owe_dh; -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT const u8 *pvt_peer_band; const u8 *pvt_peer_ch; const u8 *pvt_peer_cap; diff --git a/wpa_supplicant-2.9_standard/src/p2p/p2p.c b/wpa_supplicant-2.9_standard/src/p2p/p2p.c index bcdef24c830fe9c4864f586d576e21e0aa360238..fb422a706bffe43b51ddbbd47625ed2e3904507f 100644 --- a/wpa_supplicant-2.9_standard/src/p2p/p2p.c +++ b/wpa_supplicant-2.9_standard/src/p2p/p2p.c @@ -49,7 +49,9 @@ static void p2p_process_presence_resp(struct p2p_data *p2p, const u8 *da, const u8 *sa, const u8 *data, size_t len); -#if !defined(CONFIG_OPEN_HARMONY_PATCH) || !defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT +void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx); +#else static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx); #endif static void p2p_scan_timeout(void *eloop_ctx, void *timeout_ctx); @@ -2560,7 +2562,7 @@ p2p_reply_probe(struct p2p_data *p2p, const u8 *addr, const u8 *dst, return P2P_PREQ_NOT_P2P; } -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT hm_p2p_save_peer_info(&elems, addr); #endif @@ -3176,7 +3178,7 @@ struct p2p_data * p2p_init(const struct p2p_config *cfg) /* GO negotiation optimization initial, set enable to 1 and process to 1*/ p2p_set_enable_go_neg_opt(p2p, 1); p2p_set_process_go_neg_opt(p2p, 1); -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT p2p->calculated_go_intent = P2P_GO_NEG_OPT_INTENT; #endif #endif @@ -4856,7 +4858,7 @@ static void p2p_process_presence_resp(struct p2p_data *p2p, const u8 *da, p2p_parse_free(&msg); } -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx) #else static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx) diff --git a/wpa_supplicant-2.9_standard/src/p2p/p2p.h b/wpa_supplicant-2.9_standard/src/p2p/p2p.h index aeb206a36c4e7da88fe40b792c21ff51c30bc4b1..2a8c9b1616558957c60309252ecff88a5a808348 100644 --- a/wpa_supplicant-2.9_standard/src/p2p/p2p.h +++ b/wpa_supplicant-2.9_standard/src/p2p/p2p.h @@ -40,7 +40,7 @@ struct weighted_pcl; */ #define P2P_MAX_REG_CLASS_CHANNELS 60 -#ifdef HARMONY_P2P_CONNECTIVITY_PATCH +#if defined(HARMONY_P2P_CONNECTIVITY_PATCH) || defined(CONFIG_MIRACAST_SINK_OPT) /** * P2P_GO_NEG_OPT_INTENT - p2p go negotiation optimization intent value */ @@ -2473,7 +2473,7 @@ void set_p2p_allow_6ghz(struct p2p_data *p2p, bool value); int p2p_remove_6ghz_channels(struct weighted_pcl *pref_freq_list, int size); int p2p_channel_to_freq(int op_class, int channel); -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx); #endif diff --git a/wpa_supplicant-2.9_standard/src/p2p/p2p_go_neg.c b/wpa_supplicant-2.9_standard/src/p2p/p2p_go_neg.c index 6fa3cce82445d2d25bec57a92ac0250378f0d5e5..ed31dc7e5e942dbafac4556115b493b1bf9d1267 100644 --- a/wpa_supplicant-2.9_standard/src/p2p/p2p_go_neg.c +++ b/wpa_supplicant-2.9_standard/src/p2p/p2p_go_neg.c @@ -17,7 +17,7 @@ #include "p2p_i.h" #include "p2p.h" -#ifdef CONFIG_OPEN_HARMONY_PATCH +#ifdef CONFIG_MIRACAST_SINK_OPT #include "wpa_supplicant_i.h" #define LTECOEX_SAFE_CHANNEL 6 #ifdef OPEN_HARMONY_MIRACAST_SINK_OPT @@ -663,7 +663,7 @@ int p2p_go_select_channel(struct p2p_data *p2p, struct p2p_device *dev, u8 *status) { struct p2p_channels tmp, intersection; -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT int pvt_peer = FALSE; struct hm_p2p_pvt_peer pvt_peer_info; #endif @@ -684,7 +684,7 @@ int p2p_go_select_channel(struct p2p_data *p2p, struct p2p_device *dev, return -1; } -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT pvt_peer = hm_p2p_get_peer_info(dev, &pvt_peer_info); p2p_dbg(p2p, "origin pepare operating channel (op_class %u channel %u)", @@ -711,7 +711,7 @@ int p2p_go_select_channel(struct p2p_data *p2p, struct p2p_device *dev, p2p->op_reg_class, p2p->op_channel); p2p_reselect_channel(p2p, &intersection); } -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT } #endif diff --git a/wpa_supplicant-2.9_standard/src/p2p/p2p_i.h b/wpa_supplicant-2.9_standard/src/p2p/p2p_i.h index f2cdd4bc4ec623c36333eb1035716b7692338fe0..c7984cbf87ed0d905dcadd996565ae5a75c825f1 100644 --- a/wpa_supplicant-2.9_standard/src/p2p/p2p_i.h +++ b/wpa_supplicant-2.9_standard/src/p2p/p2p_i.h @@ -597,9 +597,8 @@ struct p2p_data { bool p2p_6ghz_capable; bool include_6ghz; bool allow_6ghz; -#ifdef CONFIG_OPEN_HARMONY_PATCH +#ifdef CONFIG_MIRACAST_SINK_OPT u8 ltecoex_flag; -#ifdef OPEN_HARMONY_MIRACAST_SINK_OPT u8 calculated_go_intent; unsigned int original_ext_listen_period; u8 original_reg_class; @@ -608,7 +607,6 @@ struct p2p_data { u8 on_op_channel_listen:1; u8 invite_resp_callback_result; #endif -#endif #ifdef HARMONY_CONNECTIVITY_PATCH int persistent_group_need_remove; u8 pvt_p2p_service; diff --git a/wpa_supplicant-2.9_standard/src/p2p/p2p_invitation.c b/wpa_supplicant-2.9_standard/src/p2p/p2p_invitation.c index 615c379b98c7bc074c9fd501576053502aa5e8e5..fe61b33fac309a60b882d78eb506989d7485061e 100644 --- a/wpa_supplicant-2.9_standard/src/p2p/p2p_invitation.c +++ b/wpa_supplicant-2.9_standard/src/p2p/p2p_invitation.c @@ -14,7 +14,7 @@ #include "p2p_i.h" #include "p2p.h" -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT #include "hm_miracast_sink.h" #endif @@ -202,7 +202,7 @@ void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa, u8 reg_class = 0, channel = 0; struct p2p_channels all_channels, intersection, *channels = NULL; int persistent; -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT struct hm_p2p_pvt_peer pvt_peer_info; int pvt_peer = 0; #endif @@ -389,7 +389,7 @@ void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa, } #endif -#if defined(CONFIG_OPEN_HARMONY_PATCH) && defined(OPEN_HARMONY_MIRACAST_SINK_OPT) +#ifdef CONFIG_MIRACAST_SINK_OPT if (go) { u8 operating_channel = ((msg.operating_channel == NULL) ? 0 : msg.operating_channel[HM_OPERATING_CHANNEL_POS]); diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c index 5d1c202101ce4ba8c859d98917b9b6f918ba2d63..1198a63f104911211d6248a94fe5818acbe51041 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c @@ -78,12 +78,10 @@ #include "driver_nl80211.h" #endif -#ifdef CONFIG_OPEN_HARMONY_PATCH -#include "p2p/p2p_i.h" #ifdef CONFIG_MIRACAST_SINK_OPT +#include "p2p/p2p_i.h" #include "hm_miracast_sink.h" #endif -#endif #ifdef OPEN_HARMONY_P2P_ONEHOP_FIND #include "p2p_onehop_scan_opt.h" #endif @@ -6905,15 +6903,13 @@ int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd, if (go_intent < 0 || go_intent > 15) return -1; } -#ifdef CONFIG_OPEN_HARMONY_PATCH -#ifdef OPEN_HARMONY_MIRACAST_SINK_OPT +#ifdef CONFIG_MIRACAST_SINK_OPT go_intent = hm_wpas_go_neg_vendor_intent_opt(wpa_s, go_intent, addr); #else #ifdef HARMONY_P2P_CONNECTIVITY_PATCH /* GO negotiation optimization to modify intent*/ go_intent = wpas_go_neg_opt_intent_modify(wpa_s, go_intent); #endif -#endif #endif pos2 = os_strstr(pos, " freq="); if (pos2) { diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant-2.9_standard/wpa_supplicant/p2p_supplicant.c index 75c634d7114afd3b29c26c60e2a1ec29e3516540..2194027f2a7b2937e6a3e48bb1699f4fce8a28ea 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/p2p_supplicant.c @@ -63,11 +63,9 @@ #include "vendor_ext.h" #endif -#ifdef CONFIG_OPEN_HARMONY_PATCH -#ifdef OPEN_HARMONY_MIRACAST_SINK_OPT +#ifdef CONFIG_MIRACAST_SINK_OPT #include "hm_miracast_sink.h" #endif -#endif #ifdef CONFIG_P2P_CHR #include "wpa_hw_p2p_chr.h"