⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 driver.h

📁 最新的Host AP 新添加了许多pcmcia 的驱动
💻 H
📖 第 1 页 / 共 2 页
字号:
	if (hapd->driver == NULL)		return 0;	if (hapd->driver->sta_add2) {		struct hostapd_sta_add_params params;		os_memset(&params, 0, sizeof(params));		params.addr = addr;		params.aid = aid;		params.capability = capability;		params.supp_rates = supp_rates;		params.supp_rates_len = supp_rates_len;		params.flags = flags;		params.listen_interval = listen_interval;		params.ht_capabilities = ht_capabilities;		return hapd->driver->sta_add2(ifname, hapd->drv_priv, &params);	}	if (hapd->driver->sta_add == NULL)		return 0;	return hapd->driver->sta_add(ifname, hapd->drv_priv, addr, aid,				     capability, (u8 *) supp_rates,				     supp_rates_len,				     flags, listen_interval);}static inline inthostapd_get_inact_sec(struct hostapd_data *hapd, const u8 *addr){	if (hapd->driver == NULL || hapd->driver->get_inact_sec == NULL)		return 0;	return hapd->driver->get_inact_sec(hapd->drv_priv, addr);}static inline inthostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int ht_enabled,		 int sec_channel_offset){	if (hapd->driver == NULL)		return 0;	if (hapd->driver->set_freq2) {		struct hostapd_freq_params data;		os_memset(&data, 0, sizeof(data));		data.mode = mode;		data.freq = freq;		data.ht_enabled = ht_enabled;		data.sec_channel_offset = sec_channel_offset;		return hapd->driver->set_freq2(hapd->drv_priv, &data);	}	if (hapd->driver->set_freq == NULL)		return 0;	return hapd->driver->set_freq(hapd->drv_priv, mode, freq);}static inline inthostapd_set_rts(struct hostapd_data *hapd, int rts){	if (hapd->driver == NULL || hapd->driver->set_rts == NULL)		return 0;	return hapd->driver->set_rts(hapd->drv_priv, rts);}static inline inthostapd_get_rts(struct hostapd_data *hapd, int *rts){	if (hapd->driver == NULL || hapd->driver->get_rts == NULL)		return 0;	return hapd->driver->get_rts(hapd->drv_priv, rts);}static inline inthostapd_set_frag(struct hostapd_data *hapd, int frag){	if (hapd->driver == NULL || hapd->driver->set_frag == NULL)		return 0;	return hapd->driver->set_frag(hapd->drv_priv, frag);}static inline inthostapd_get_frag(struct hostapd_data *hapd, int *frag){	if (hapd->driver == NULL || hapd->driver->get_frag == NULL)		return 0;	return hapd->driver->get_frag(hapd->drv_priv, frag);}static inline inthostapd_set_retry(struct hostapd_data *hapd, int short_retry, int long_retry){	if (hapd->driver == NULL || hapd->driver->set_retry == NULL)		return 0;	return hapd->driver->set_retry(hapd->drv_priv, short_retry,				       long_retry);}static inline inthostapd_get_retry(struct hostapd_data *hapd, int *short_retry, int *long_retry){	if (hapd->driver == NULL || hapd->driver->get_retry == NULL)		return 0;	return hapd->driver->get_retry(hapd->drv_priv, short_retry,				       long_retry);}static inline inthostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,		      int total_flags, int flags_or, int flags_and){	if (hapd->driver == NULL || hapd->driver->sta_set_flags == NULL)		return 0;	return hapd->driver->sta_set_flags(hapd->drv_priv, addr, total_flags,					   flags_or, flags_and);}static inline inthostapd_set_rate_sets(struct hostapd_data *hapd, int *supp_rates,		      int *basic_rates, int mode){	if (hapd->driver == NULL || hapd->driver->set_rate_sets == NULL)		return 0;	return hapd->driver->set_rate_sets(hapd->drv_priv, supp_rates,					   basic_rates, mode);}static inline inthostapd_set_regulatory_domain(struct hostapd_data *hapd, unsigned int rd){	if (hapd->driver == NULL ||	    hapd->driver->set_regulatory_domain == NULL)		return 0;	return hapd->driver->set_regulatory_domain(hapd->drv_priv, rd);}static inline inthostapd_set_country(struct hostapd_data *hapd, const char *country){	if (hapd->driver == NULL ||	    hapd->driver->set_country == NULL)		return 0;	return hapd->driver->set_country(hapd->drv_priv, country);}static inline inthostapd_set_ieee80211d(struct hostapd_data *hapd, int enabled){	if (hapd->driver == NULL ||	    hapd->driver->set_ieee80211d == NULL)		return 0;	return hapd->driver->set_ieee80211d(hapd->drv_priv, enabled);}static inline inthostapd_sta_clear_stats(struct hostapd_data *hapd, const u8 *addr){	if (hapd->driver == NULL || hapd->driver->sta_clear_stats == NULL)		return 0;	return hapd->driver->sta_clear_stats(hapd->drv_priv, addr);}static inline inthostapd_set_beacon(const char *ifname, struct hostapd_data *hapd,		   u8 *head, size_t head_len,		   u8 *tail, size_t tail_len){	if (hapd->driver == NULL || hapd->driver->set_beacon == NULL)		return 0;	return hapd->driver->set_beacon(ifname, hapd->drv_priv, head, head_len,					tail, tail_len);}static inline inthostapd_set_internal_bridge(struct hostapd_data *hapd, int value){	if (hapd->driver == NULL || hapd->driver->set_internal_bridge == NULL)		return 0;	return hapd->driver->set_internal_bridge(hapd->drv_priv, value);}static inline inthostapd_set_beacon_int(struct hostapd_data *hapd, int value){	if (hapd->driver == NULL || hapd->driver->set_beacon_int == NULL)		return 0;	return hapd->driver->set_beacon_int(hapd->drv_priv, value);}static inline inthostapd_set_dtim_period(struct hostapd_data *hapd, int value){	if (hapd->driver == NULL || hapd->driver->set_dtim_period == NULL)		return 0;	return hapd->driver->set_dtim_period(hapd->conf->iface, hapd->drv_priv,					     value);}static inline inthostapd_set_broadcast_ssid(struct hostapd_data *hapd, int value){	if (hapd->driver == NULL || hapd->driver->set_broadcast_ssid == NULL)		return 0;	return hapd->driver->set_broadcast_ssid(hapd->drv_priv, value);}static inline inthostapd_set_cts_protect(struct hostapd_data *hapd, int value){	if (hapd->driver == NULL || hapd->driver->set_cts_protect == NULL)		return 0;	return hapd->driver->set_cts_protect(hapd->drv_priv, value);}static inline inthostapd_set_key_tx_rx_threshold(struct hostapd_data *hapd, int value){	if (hapd->driver == NULL ||	    hapd->driver->set_key_tx_rx_threshold == NULL)		return 0;	return hapd->driver->set_key_tx_rx_threshold(hapd->drv_priv, value);}static inline inthostapd_set_preamble(struct hostapd_data *hapd, int value){	if (hapd->driver == NULL || hapd->driver->set_preamble == NULL)		return 0;	return hapd->driver->set_preamble(hapd->drv_priv, value);}static inline inthostapd_set_short_slot_time(struct hostapd_data *hapd, int value){	if (hapd->driver == NULL || hapd->driver->set_short_slot_time == NULL)		return 0;	return hapd->driver->set_short_slot_time(hapd->drv_priv, value);}static inline inthostapd_set_tx_queue_params(struct hostapd_data *hapd, int queue, int aifs,			    int cw_min, int cw_max, int burst_time){	if (hapd->driver == NULL || hapd->driver->set_tx_queue_params == NULL)		return 0;	return hapd->driver->set_tx_queue_params(hapd->drv_priv, queue, aifs,						 cw_min, cw_max, burst_time);}static inline inthostapd_bss_add(struct hostapd_data *hapd, const char *ifname, const u8 *bssid){	if (hapd->driver == NULL || hapd->driver->bss_add == NULL)		return 0;	return hapd->driver->bss_add(hapd->drv_priv, ifname, bssid);}static inline inthostapd_bss_remove(struct hostapd_data *hapd, const char *ifname){	if (hapd->driver == NULL || hapd->driver->bss_remove == NULL)		return 0;	return hapd->driver->bss_remove(hapd->drv_priv, ifname);}static inline inthostapd_valid_bss_mask(struct hostapd_data *hapd, const u8 *addr,		       const u8 *mask){	if (hapd->driver == NULL || hapd->driver->valid_bss_mask == NULL)		return 1;	return hapd->driver->valid_bss_mask(hapd->drv_priv, addr, mask);}static inline inthostapd_if_add(struct hostapd_data *hapd, enum hostapd_driver_if_type type,	       char *ifname, const u8 *addr){	if (hapd->driver == NULL || hapd->driver->if_add == NULL)		return -1;	return hapd->driver->if_add(hapd->conf->iface, hapd->drv_priv, type,				    ifname, addr);}static inline inthostapd_if_update(struct hostapd_data *hapd, enum hostapd_driver_if_type type,		  char *ifname, const u8 *addr){	if (hapd->driver == NULL || hapd->driver->if_update == NULL)		return -1;	return hapd->driver->if_update(hapd->drv_priv, type, ifname, addr);}static inline inthostapd_if_remove(struct hostapd_data *hapd, enum hostapd_driver_if_type type,		  char *ifname, const u8 *addr){	if (hapd->driver == NULL || hapd->driver->if_remove == NULL)		return -1;	return hapd->driver->if_remove(hapd->drv_priv, type, ifname, addr);}static inline inthostapd_passive_scan(struct hostapd_data *hapd, int now, int our_mode_only,		     int interval, int _listen, int *channel,		     int *last_rx){	if (hapd->driver == NULL || hapd->driver->passive_scan == NULL)		return -1;	return hapd->driver->passive_scan(hapd->drv_priv, now, our_mode_only,					  interval, _listen, channel, last_rx);}static inline struct hostapd_hw_modes *hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,			    u16 *flags){	if (hapd->driver == NULL || hapd->driver->get_hw_feature_data == NULL)		return NULL;	return hapd->driver->get_hw_feature_data(hapd->drv_priv, num_modes,						 flags);}static inline inthostapd_set_sta_vlan(const char *ifname, struct hostapd_data *hapd,		     const u8 *addr, int vlan_id){	if (hapd->driver == NULL || hapd->driver->set_sta_vlan == NULL)		return 0;	return hapd->driver->set_sta_vlan(hapd->drv_priv, addr, ifname, vlan_id);}static inline inthostapd_driver_commit(struct hostapd_data *hapd){	if (hapd->driver == NULL || hapd->driver->commit == NULL)		return 0;	return hapd->driver->commit(hapd->drv_priv);}static inline inthostapd_set_radius_acl_auth(struct hostapd_data *hapd, const u8 *mac,			    int accepted, u32 session_timeout){	if (hapd->driver == NULL || hapd->driver->set_radius_acl_auth == NULL)		return 0;	return hapd->driver->set_radius_acl_auth(hapd->drv_priv, mac, accepted,						 session_timeout);}static inline inthostapd_set_radius_acl_expire(struct hostapd_data *hapd, const u8 *mac){	if (hapd->driver == NULL ||	    hapd->driver->set_radius_acl_expire == NULL)		return 0;	return hapd->driver->set_radius_acl_expire(hapd->drv_priv, mac);}#ifdef CONFIG_IEEE80211Nstatic inline inthostapd_set_ht_params(const char *ifname, struct hostapd_data *hapd,		      const u8 *ht_capab, size_t ht_capab_len,		      const u8 *ht_oper, size_t ht_oper_len){	if (hapd->driver == NULL || hapd->driver->set_ht_params == NULL ||	    ht_capab == NULL || ht_oper == NULL)		return 0;	return hapd->driver->set_ht_params(		ifname, hapd->drv_priv, ht_capab, ht_capab_len,		ht_oper, ht_oper_len);}#endif /* CONFIG_IEEE80211N */static inline inthostapd_drv_none(struct hostapd_data *hapd){	return hapd->driver && os_strcmp(hapd->driver->name, "none") == 0;}static inline inthostapd_set_wps_beacon_ie(struct hostapd_data *hapd, const u8 *ie, size_t len){	if (hapd->driver == NULL || hapd->driver->set_wps_beacon_ie == NULL)		return 0;	return hapd->driver->set_wps_beacon_ie(hapd->conf->iface,					       hapd->drv_priv, ie, len);}static inline inthostapd_set_wps_probe_resp_ie(struct hostapd_data *hapd, const u8 *ie,			      size_t len){	if (hapd->driver == NULL ||	    hapd->driver->set_wps_probe_resp_ie == NULL)		return 0;	return hapd->driver->set_wps_probe_resp_ie(hapd->conf->iface,						   hapd->drv_priv, ie, len);}#endif /* DRIVER_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -