// SPDX-License-Identifier: GPL-2.0-only /* * This file is part of wl1271 * * Copyright (C) 2009 Nokia Corporation * * Contact: Luciano Coelho <luciano.coelho@nokia.com>
*/
/* * Put very large empty placeholders for all templates. These * reserve memory for later.
*/
ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
CMD_TEMPL_AP_PROBE_RESPONSE, NULL,
WL1271_CMD_TEMPL_MAX_SIZE,
0, WL1271_RATE_AUTOMATIC); if (ret < 0) return ret;
ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
CMD_TEMPL_AP_BEACON, NULL,
WL1271_CMD_TEMPL_MAX_SIZE,
0, WL1271_RATE_AUTOMATIC); if (ret < 0) return ret;
ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
CMD_TEMPL_DEAUTH_AP, NULL, sizeof
(struct wl12xx_disconn_template),
0, WL1271_RATE_AUTOMATIC); if (ret < 0) return ret;
for (i = 0; i < WLCORE_MAX_KLV_TEMPLATES; i++) {
ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
CMD_TEMPL_KLV, NULL, sizeof(struct ieee80211_qos_hdr),
i, WL1271_RATE_AUTOMATIC); if (ret < 0) return ret;
}
/* disable the keep-alive feature */
ret = wl1271_acx_keep_alive_mode(wl, wlvif, false); if (ret < 0) return ret;
return 0;
}
/* generic ap initialization (non vif-specific) */ staticint wl1271_ap_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif)
{ int ret;
ret = wl1271_init_ap_rates(wl, wlvif); if (ret < 0) return ret;
/* configure AP sleep, if enabled */
ret = wlcore_hw_ap_sleep(wl); if (ret < 0) return ret;
return 0;
}
int wl1271_ap_init_templates(struct wl1271 *wl, struct ieee80211_vif *vif)
{ struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); int ret;
ret = wl1271_ap_init_deauth_template(wl, wlvif); if (ret < 0) return ret;
ret = wl1271_ap_init_null_template(wl, vif); if (ret < 0) return ret;
ret = wl1271_ap_init_qos_null_template(wl, vif); if (ret < 0) return ret;
/* * when operating as AP we want to receive external beacons for * configuring ERP protection.
*/
ret = wl1271_acx_beacon_filter_opt(wl, wlvif, false); if (ret < 0) return ret;
/* use the min basic rate for AP broadcast/multicast */
rc.enabled_rates = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
rc.short_retry_limit = 10;
rc.long_retry_limit = 10;
rc.aflags = 0;
ret = wl1271_acx_ap_rate_policy(wl, &rc, wlvif->ap.bcast_rate_idx); if (ret < 0) return ret;
/* * If the basic rates contain OFDM rates, use OFDM only * rates for unicast TX as well. Else use all supported rates.
*/ if (wl->ofdm_only_ap && (wlvif->basic_rate_set & CONF_TX_OFDM_RATES))
supported_rates = CONF_TX_OFDM_RATES; else
supported_rates = CONF_TX_ENABLED_RATES;
/* consider all existing roles before configuring psm. */
if (wl->ap_count == 0 && is_ap) { /* first AP */
ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_ELP); if (ret < 0) return ret;
/* unmask ap events */
wl->event_mask |= wl->ap_event_mask;
ret = wl1271_event_unmask(wl); if (ret < 0) return ret; /* first STA, no APs */
} elseif (wl->sta_count == 0 && wl->ap_count == 0 && !is_ap) {
u8 sta_auth = wl->conf.conn.sta_sleep_auth; /* Configure for power according to debugfs */ if (sta_auth != WL1271_PSM_ILLEGAL)
ret = wl1271_acx_sleep_auth(wl, sta_auth); /* Configure for ELP power saving */ else
ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_ELP);
if (ret < 0) return ret;
}
/* Mode specific init */ if (is_ap) {
ret = wl1271_ap_hw_init(wl, wlvif); if (ret < 0) return ret;
ret = wl12xx_init_ap_role(wl, wlvif); if (ret < 0) return ret;
} else {
ret = wl1271_sta_hw_init(wl, wlvif); if (ret < 0) return ret;
ret = wl12xx_init_sta_role(wl, wlvif); if (ret < 0) return ret;
}
wl12xx_init_phy_vif_config(wl, wlvif);
/* Default TID/AC configuration */
BUG_ON(wl->conf.tx.tid_conf_count != wl->conf.tx.ac_conf_count); for (i = 0; i < wl->conf.tx.tid_conf_count; i++) {
conf_ac = &wl->conf.tx.ac_conf[i];
ret = wl1271_acx_ac_cfg(wl, wlvif, conf_ac->ac,
conf_ac->cw_min, conf_ac->cw_max,
conf_ac->aifsn, conf_ac->tx_op_limit); if (ret < 0) return ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.