Use C99 designated initializers to cleanup driver_ops setup

These driver wrappers use UNIX domain sockets and as such, won't be
built with Microsoft compiler. Consequently, use of C99-style designated
initializers can be used to make these files easier to maintain. Only
driver_ndis.c needs to support the old C89-style due to Microsoft
compiler not supporting newer C standard.
This commit is contained in:
Jouni Malinen 2009-04-17 15:58:34 +03:00 committed by Jouni Malinen
parent 61693eaa80
commit b08d177aad
2 changed files with 43 additions and 196 deletions

View file

@ -768,100 +768,22 @@ static int wpa_driver_privsep_set_country(void *priv, const char *alpha2)
struct wpa_driver_ops wpa_driver_privsep_ops = {
"privsep",
"wpa_supplicant privilege separated driver",
wpa_driver_privsep_get_bssid,
wpa_driver_privsep_get_ssid,
wpa_driver_privsep_set_wpa,
wpa_driver_privsep_set_key,
wpa_driver_privsep_init,
wpa_driver_privsep_deinit,
wpa_driver_privsep_set_param,
NULL /* set_countermeasures */,
NULL /* set_drop_unencrypted */,
wpa_driver_privsep_scan,
NULL /* get_scan_results */,
wpa_driver_privsep_deauthenticate,
wpa_driver_privsep_disassociate,
wpa_driver_privsep_associate,
NULL /* set_auth_alg */,
NULL /* add_pmkid */,
NULL /* remove_pmkid */,
NULL /* flush_pmkid */,
wpa_driver_privsep_get_capa,
NULL /* poll */,
NULL /* get_ifname */,
wpa_driver_privsep_get_mac_addr,
NULL /* send_eapol */,
NULL /* set_operstate */,
NULL /* mlme_setprotection */,
NULL /* get_hw_feature_data */,
NULL /* set_channel */,
NULL /* set_ssid */,
NULL /* set_bssid */,
NULL /* send_mlme */,
NULL /* mlme_add_sta */,
NULL /* mlme_remove_sta */,
NULL /* update_ft_ies */,
NULL /* send_ft_action */,
wpa_driver_privsep_get_scan_results2,
NULL /* set_probe_req_ie */,
wpa_driver_privsep_set_mode,
wpa_driver_privsep_set_country,
NULL /* global_init */,
NULL /* global_deinit */,
NULL /* init2 */,
NULL /* get_interfaces */,
NULL /* scan2 */,
NULL /* authenticate */,
NULL /* set_beacon */,
NULL /* set_beacon_int */,
NULL /* hapd_init */,
NULL /* hapd_deinit */,
NULL /* set_ieee8021x */,
NULL /* set_privacy */,
NULL /* hapd_set_key */,
NULL /* get_seqnum */,
NULL /* get_seqnum_igtk */,
NULL /* flush */,
NULL /* set_generic_elem */,
NULL /* read_sta_data */,
NULL /* hapd_send_eapol */,
NULL /* sta_deauth */,
NULL /* sta_disassoc */,
NULL /* sta_remove */,
NULL /* hapd_get_ssid */,
NULL /* hapd_set_ssid */,
NULL /* hapd_set_countermeasures */,
NULL /* sta_add */,
NULL /* get_inact_sec */,
NULL /* sta_clear_stats */,
NULL /* set_freq */,
NULL /* set_rts */,
NULL /* set_frag */,
NULL /* set_retry */,
NULL /* sta_set_flags */,
NULL /* set_rate_sets */,
NULL /* set_ieee80211d */,
NULL /* hapd_set_beacon */,
NULL /* set_internal_bridge */,
NULL /* set_broadcast_ssid */,
NULL /* set_cts_protect */,
NULL /* set_preamble */,
NULL /* set_short_slot_time */,
NULL /* set_tx_queue_params */,
NULL /* bss_add */,
NULL /* bss_remove */,
NULL /* valid_bss_mask */,
NULL /* if_add */,
NULL /* if_update */,
NULL /* if_remove */,
NULL /* set_sta_vlan */,
NULL /* commit */,
NULL /* send_ether */,
NULL /* set_radius_acl_auth */,
NULL /* set_radius_acl_expire */,
NULL /* set_ht_params */,
NULL /* set_wps_beacon_ie */,
NULL /* set_wps_probe_resp_ie */
.get_bssid = wpa_driver_privsep_get_bssid,
.get_ssid = wpa_driver_privsep_get_ssid,
.set_wpa = wpa_driver_privsep_set_wpa,
.set_key = wpa_driver_privsep_set_key,
.init = wpa_driver_privsep_init,
.deinit = wpa_driver_privsep_deinit,
.set_param = wpa_driver_privsep_set_param,
.scan = wpa_driver_privsep_scan,
.deauthenticate = wpa_driver_privsep_deauthenticate,
.disassociate = wpa_driver_privsep_disassociate,
.associate = wpa_driver_privsep_associate,
.get_capa = wpa_driver_privsep_get_capa,
.get_mac_addr = wpa_driver_privsep_get_mac_addr,
.get_scan_results2 = wpa_driver_privsep_get_scan_results2,
.set_mode = wpa_driver_privsep_set_mode,
.set_country = wpa_driver_privsep_set_country,
};

View file

@ -2465,109 +2465,34 @@ const struct wpa_driver_ops wpa_driver_test_ops = {
.set_wps_beacon_ie = test_driver_set_wps_beacon_ie,
.set_wps_probe_resp_ie = test_driver_set_wps_probe_resp_ie,
#else /* HOSTAPD */
wpa_driver_test_get_bssid,
wpa_driver_test_get_ssid,
wpa_driver_test_set_wpa,
wpa_driver_test_set_key,
NULL /* init */,
wpa_driver_test_deinit,
wpa_driver_test_set_param,
NULL /* set_countermeasures */,
NULL /* set_drop_unencrypted */,
NULL /* scan */,
NULL /* get_scan_results */,
wpa_driver_test_deauthenticate,
wpa_driver_test_disassociate,
wpa_driver_test_associate,
NULL /* set_auth_alg */,
NULL /* add_pmkid */,
NULL /* remove_pmkid */,
NULL /* flush_pmkid */,
wpa_driver_test_get_capa,
NULL /* poll */,
NULL /* get_ifname */,
wpa_driver_test_get_mac_addr,
wpa_driver_test_send_eapol,
NULL /* set_operstate */,
wpa_driver_test_mlme_setprotection,
.get_bssid = wpa_driver_test_get_bssid,
.get_ssid = wpa_driver_test_get_ssid,
.set_wpa = wpa_driver_test_set_wpa,
.set_key = wpa_driver_test_set_key,
.deinit = wpa_driver_test_deinit,
.set_param = wpa_driver_test_set_param,
.deauthenticate = wpa_driver_test_deauthenticate,
.disassociate = wpa_driver_test_disassociate,
.associate = wpa_driver_test_associate,
.get_capa = wpa_driver_test_get_capa,
.get_mac_addr = wpa_driver_test_get_mac_addr,
.send_eapol = wpa_driver_test_send_eapol,
.mlme_setprotection = wpa_driver_test_mlme_setprotection,
#ifdef CONFIG_CLIENT_MLME
wpa_driver_test_get_hw_feature_data,
wpa_driver_test_set_channel,
wpa_driver_test_set_ssid,
wpa_driver_test_set_bssid,
wpa_driver_test_send_mlme,
wpa_driver_test_mlme_add_sta,
wpa_driver_test_mlme_remove_sta,
#else /* CONFIG_CLIENT_MLME */
NULL /* get_hw_feature_data */,
NULL /* set_channel */,
NULL /* set_ssid */,
NULL /* set_bssid */,
NULL /* send_mlme */,
NULL /* mlme_add_sta */,
NULL /* mlme_remove_sta */,
.get_hw_feature_data = wpa_driver_test_get_hw_feature_data,
.set_channel = wpa_driver_test_set_channel,
.set_ssid = wpa_driver_test_set_ssid,
.set_bssid = wpa_driver_test_set_bssid,
.send_mlme = wpa_driver_test_send_mlme,
.mlme_add_sta = wpa_driver_test_mlme_add_sta,
.mlme_remove_sta = wpa_driver_test_mlme_remove_sta,
#endif /* CONFIG_CLIENT_MLME */
NULL /* update_ft_ies */,
NULL /* send_ft_action */,
wpa_driver_test_get_scan_results2,
wpa_driver_test_set_probe_req_ie,
NULL /* set_mode */,
NULL /* set_country */,
wpa_driver_test_global_init,
wpa_driver_test_global_deinit,
wpa_driver_test_init2,
wpa_driver_test_get_interfaces,
wpa_driver_test_scan,
NULL /* authenticate */,
NULL /* set_beacon */,
NULL /* set_beacon_int */,
NULL /* hapd_init */,
NULL /* hapd_deinit */,
NULL /* set_ieee8021x */,
NULL /* set_privacy */,
NULL /* hapd_set_key */,
NULL /* get_seqnum */,
NULL /* get_seqnum_igtk */,
NULL /* flush */,
NULL /* set_generic_elem */,
NULL /* read_sta_data */,
NULL /* hapd_send_eapol */,
NULL /* sta_deauth */,
NULL /* sta_disassoc */,
NULL /* sta_remove */,
NULL /* hapd_get_ssid */,
NULL /* hapd_set_ssid */,
NULL /* hapd_set_countermeasures */,
NULL /* sta_add */,
NULL /* get_inact_sec */,
NULL /* sta_clear_stats */,
NULL /* set_freq */,
NULL /* set_rts */,
NULL /* set_frag */,
NULL /* set_retry */,
NULL /* sta_set_flags */,
NULL /* set_rate_sets */,
NULL /* set_ieee80211d */,
NULL /* hapd_set_beacon */,
NULL /* set_internal_bridge */,
NULL /* set_broadcast_ssid */,
NULL /* set_cts_protect */,
NULL /* set_preamble */,
NULL /* set_short_slot_time */,
NULL /* set_tx_queue_params */,
NULL /* bss_add */,
NULL /* bss_remove */,
NULL /* valid_bss_mask */,
NULL /* if_add */,
NULL /* if_update */,
NULL /* if_remove */,
NULL /* set_sta_vlan */,
NULL /* commit */,
NULL /* send_ether */,
NULL /* set_radius_acl_auth */,
NULL /* set_radius_acl_expire */,
NULL /* set_ht_params */,
NULL /* set_wps_beacon_ie */,
NULL /* set_wps_probe_resp_ie */
.get_scan_results2 = wpa_driver_test_get_scan_results2,
.set_probe_req_ie = wpa_driver_test_set_probe_req_ie,
.global_init = wpa_driver_test_global_init,
.global_deinit = wpa_driver_test_global_deinit,
.init2 = wpa_driver_test_init2,
.get_interfaces = wpa_driver_test_get_interfaces,
.scan2 = wpa_driver_test_scan,
#endif /* HOSTAPD */
};