/* * Count bound interfaces which are not p2p, besides data->ignore_vif. * data->station_vif will point to one bound vif of type station, if exists.
*/ staticvoid iwl_mvm_bound_iface_iterator(void *_data, u8 *mac, struct ieee80211_vif *vif)
{ struct iwl_mvm_active_iface_iterator_data *data = _data; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
/* * If we are in association flow - check antenna configuration * capabilities of the AP station, and choose the watermark accordingly.
*/ if (sta) { /* find the maximal NSS number among all links (if relevant) */
rcu_read_lock(); for (link_id = 0; link_id < ARRAY_SIZE(sta->link); link_id++) {
link_sta = rcu_dereference(sta->link[link_id]); if (!link_sta) continue;
/* * If an associated AP sta changed its antenna configuration, the state * will remain FULL_ON but SF parameters need to be reconsidered.
*/ if (new_state != SF_FULL_ON && mvm->sf_state == new_state) return 0;
switch (new_state) { case SF_UNINIT:
iwl_mvm_fill_sf_command(mvm, &sf_cmd, NULL); break; case SF_FULL_ON: if (!sta) {
IWL_ERR(mvm, "No station: Cannot switch SF to FULL_ON\n"); return -EINVAL;
}
iwl_mvm_fill_sf_command(mvm, &sf_cmd, sta); break; case SF_INIT_OFF:
iwl_mvm_fill_sf_command(mvm, &sf_cmd, NULL); break; default:
WARN_ONCE(1, "Invalid state: %d. not sending Smart Fifo cmd\n",
new_state); return -EINVAL;
}
ret = iwl_mvm_send_cmd_pdu(mvm, REPLY_SF_CFG_CMD, CMD_ASYNC, sizeof(sf_cmd), &sf_cmd); if (!ret)
mvm->sf_state = new_state;
return ret;
}
/* * Update Smart fifo: * Count bound interfaces that are not to be removed, ignoring p2p devices, * and set new state accordingly.
*/ int iwl_mvm_sf_update(struct iwl_mvm *mvm, struct ieee80211_vif *changed_vif, bool remove_vif)
{ enum iwl_sf_state new_state; struct iwl_mvm_vif *mvmvif = NULL; struct iwl_mvm_active_iface_iterator_data data = {
.ignore_vif = changed_vif,
.sta_vif_state = SF_UNINIT,
}; struct ieee80211_sta *sta = NULL;
if (fw_has_api(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_API_SMART_FIFO_OFFLOAD)) return 0; /* * Ignore the call if we are in HW Restart flow, or if the handled * vif is a p2p device.
*/ if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) ||
(changed_vif && changed_vif->type == NL80211_IFTYPE_P2P_DEVICE)) return 0;
/* If changed_vif exists and is not to be removed, add to the count */ if (changed_vif && !remove_vif)
data.num_active_macs++;
switch (data.num_active_macs) { case 0: /* If there are no active macs - change state to SF_INIT_OFF */
new_state = SF_INIT_OFF; break; case 1: if (remove_vif) { /* The one active mac left is of type station * and we filled the relevant data during iteration
*/
new_state = data.sta_vif_state;
sta = data.sta_vif_ap_sta;
} else { if (WARN_ON(!changed_vif)) return -EINVAL; if (changed_vif->type != NL80211_IFTYPE_STATION) {
new_state = SF_UNINIT;
} elseif (changed_vif->cfg.assoc &&
changed_vif->bss_conf.dtim_period) {
mvmvif = iwl_mvm_vif_from_mac80211(changed_vif);
sta = mvmvif->ap_sta;
new_state = SF_FULL_ON;
} else {
new_state = SF_INIT_OFF;
}
} break; default: /* If there are multiple active macs - change to SF_UNINIT */
new_state = SF_UNINIT;
}
return iwl_mvm_sf_config(mvm, sta, new_state);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
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.