if (priv->bss_mode == NL80211_IFTYPE_STATION ||
(sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 &&
(priv->adapter->sec_chan_offset !=
IEEE80211_HT_PARAM_CHA_SEC_NONE))) /* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */
SETHT_MCS32(ht_cap->mcs.rx_mask);
/* Clear RD responder bit */
ht_ext_cap &= ~IEEE80211_HT_EXT_CAP_RD_RESPONDER;
if (ISSUPP_BEAMFORMING(priv->adapter->hw_dot_11n_dev_cap))
ht_cap->tx_BF_cap_info = cpu_to_le32(MWIFIEX_DEF_11N_TX_BF_CAP);
return 0;
}
/* * This function returns the pointer to an entry in BA Stream * table which matches the requested BA status.
*/ staticstruct mwifiex_tx_ba_stream_tbl *
mwifiex_get_ba_status(struct mwifiex_private *priv, enum mwifiex_ba_status ba_status)
{ struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl;
/* * This function handles the command response of delete a block * ack request. * * The function checks the response success status and takes action * accordingly (send an add BA request in case of success, or recreate * the deleted stream in case of failure, if the add BA was also * initiated by us).
*/ int mwifiex_ret_11n_delba(struct mwifiex_private *priv, struct host_cmd_ds_command *resp)
{ int tid; struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl; struct host_cmd_ds_11n_delba *del_ba = &resp->params.del_ba;
uint16_t del_ba_param_set = le16_to_cpu(del_ba->del_ba_param_set);
tid = del_ba_param_set >> DELBA_TID_POS; if (del_ba->del_result == BA_RESULT_SUCCESS) {
mwifiex_del_ba_tbl(priv, tid, del_ba->peer_mac_addr,
TYPE_DELBA_SENT,
INITIATOR_BIT(del_ba_param_set));
tx_ba_tbl = mwifiex_get_ba_status(priv, BA_SETUP_INPROGRESS); if (tx_ba_tbl)
mwifiex_send_addba(priv, tx_ba_tbl->tid,
tx_ba_tbl->ra);
} else { /* * In case of failure, recreate the deleted stream in case * we initiated the DELBA
*/ if (!INITIATOR_BIT(del_ba_param_set)) return 0;
if (tx_ba_tbl)
mwifiex_del_ba_tbl(priv, tx_ba_tbl->tid, tx_ba_tbl->ra,
TYPE_DELBA_SENT, true);
}
return 0;
}
/* * This function handles the command response of add a block * ack request. * * Handling includes changing the header fields to CPU formats, checking * the response success status and taking actions accordingly (delete the * BA stream table in case of failure).
*/ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv, struct host_cmd_ds_command *resp)
{ int tid, tid_down; struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &resp->params.add_ba_rsp; struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl; struct mwifiex_ra_list_tbl *ra_list;
u16 block_ack_param_set = le16_to_cpu(add_ba_rsp->block_ack_param_set);
/* * This function checks if the given pointer is valid entry of * Tx BA Stream table.
*/ staticint mwifiex_is_tx_ba_stream_ptr_valid(struct mwifiex_private *priv, struct mwifiex_tx_ba_stream_tbl *tx_tbl_ptr)
{ struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl;
list_for_each_entry(tx_ba_tsr_tbl, &priv->tx_ba_stream_tbl_ptr, list) { if (tx_ba_tsr_tbl == tx_tbl_ptr) returntrue;
}
returnfalse;
}
/* * This function deletes the given entry in Tx BA Stream table. * * The function also performs a validity check on the supplied * pointer before trying to delete.
*/ void mwifiex_11n_delete_tx_ba_stream_tbl_entry(struct mwifiex_private *priv, struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl)
{ if (!tx_ba_tsr_tbl &&
mwifiex_is_tx_ba_stream_ptr_valid(priv, tx_ba_tsr_tbl)) return;
/* * This function deletes all the entries in Tx BA Stream table.
*/ void mwifiex_11n_delete_all_tx_ba_stream_tbl(struct mwifiex_private *priv)
{ int i; struct mwifiex_tx_ba_stream_tbl *del_tbl_ptr, *tmp_node;
for (i = 0; i < MAX_NUM_TID; ++i)
priv->aggr_prio_tbl[i].ampdu_ap =
priv->aggr_prio_tbl[i].ampdu_user;
}
/* * This function returns the pointer to an entry in BA Stream * table which matches the given RA/TID pair.
*/ struct mwifiex_tx_ba_stream_tbl *
mwifiex_get_ba_tbl(struct mwifiex_private *priv, int tid, u8 *ra)
{ struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl;
/* * This function creates an entry in Tx BA stream table for the * given RA/TID pair.
*/ void mwifiex_create_ba_tbl(struct mwifiex_private *priv, u8 *ra, int tid, enum mwifiex_ba_status ba_status)
{ struct mwifiex_tx_ba_stream_tbl *new_node; struct mwifiex_ra_list_tbl *ra_list; int tid_down;
if (!mwifiex_get_ba_tbl(priv, tid, ra)) {
new_node = kzalloc(sizeof(struct mwifiex_tx_ba_stream_tbl),
GFP_ATOMIC); if (!new_node) return;
/* * This function sends an add BA request to the given TID/RA pair.
*/ int mwifiex_send_addba(struct mwifiex_private *priv, int tid, u8 *peer_mac)
{ struct host_cmd_ds_11n_addba_req add_ba_req;
u32 tx_win_size = priv->add_ba_param.tx_win_size; static u8 dialog_tok; int ret;
u16 block_ack_param_set;
mwifiex_dbg(priv->adapter, CMD, "cmd: %s: tid %d\n", __func__, tid);
/* We don't wait for the response of this command */
ret = mwifiex_send_cmd(priv, HostCmd_CMD_11N_ADDBA_REQ,
0, 0, &add_ba_req, false);
return ret;
}
/* * This function sends a delete BA request to the given TID/RA pair.
*/ int mwifiex_send_delba(struct mwifiex_private *priv, int tid, u8 *peer_mac, int initiator)
{ struct host_cmd_ds_11n_delba delba; int ret;
uint16_t del_ba_param_set;
memset(&delba, 0, sizeof(delba));
del_ba_param_set = tid << DELBA_TID_POS;
if (initiator)
del_ba_param_set |= IEEE80211_DELBA_PARAM_INITIATOR_MASK; else
del_ba_param_set &= ~IEEE80211_DELBA_PARAM_INITIATOR_MASK;
/* We don't wait for the response of this command */
ret = mwifiex_send_cmd(priv, HostCmd_CMD_11N_DELBA,
HostCmd_ACT_GEN_SET, 0, &delba, false);
return ret;
}
/* * This function sends delba to specific tid
*/ void mwifiex_11n_delba(struct mwifiex_private *priv, int tid)
{ struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr;
/* * This function handles the command response of a delete BA request.
*/ void mwifiex_11n_delete_ba_stream(struct mwifiex_private *priv, u8 *del_ba)
{ struct host_cmd_ds_11n_delba *cmd_del_ba =
(struct host_cmd_ds_11n_delba *) del_ba;
uint16_t del_ba_param_set = le16_to_cpu(cmd_del_ba->del_ba_param_set); int tid;
/* * This function retrieves the entry for specific tx BA stream table by RA and * deletes it.
*/ void mwifiex_del_tx_ba_stream_tbl_by_ra(struct mwifiex_private *priv, u8 *ra)
{ struct mwifiex_tx_ba_stream_tbl *tbl, *tmp;
/* This function initializes the BlockACK setup information for given * mwifiex_private structure.
*/ void mwifiex_set_ba_params(struct mwifiex_private *priv)
{
priv->add_ba_param.timeout = MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT;
switch (chan) { case 36: case 44: case 52: case 60: case 100: case 108: case 116: case 124: case 132: case 140: case 149: case 157:
sec_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; break; case 40: case 48: case 56: case 64: case 104: case 112: case 120: case 128: case 136: case 144: case 153: case 161:
sec_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW; break; case 165: default:
sec_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE; break;
}
return sec_offset;
}
/* This function will send DELBA to entries in the priv's * Tx BA stream table
*/ staticvoid
mwifiex_send_delba_txbastream_tbl(struct mwifiex_private *priv, u8 tid)
{ struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_tx_ba_stream_tbl *tx_ba_stream_tbl_ptr;
/* This function updates all the tx_win_size
*/ void mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *adapter)
{
u8 i, j;
u32 tx_win_size; struct mwifiex_private *priv;
for (i = 0; i < adapter->priv_num; i++) {
priv = adapter->priv[i];
tx_win_size = priv->add_ba_param.tx_win_size;
if (priv->bss_type == MWIFIEX_BSS_TYPE_STA)
priv->add_ba_param.tx_win_size =
MWIFIEX_STA_AMPDU_DEF_TXWINSIZE;
if (priv->bss_type == MWIFIEX_BSS_TYPE_P2P)
priv->add_ba_param.tx_win_size =
MWIFIEX_STA_AMPDU_DEF_TXWINSIZE;
if (priv->bss_type == MWIFIEX_BSS_TYPE_UAP)
priv->add_ba_param.tx_win_size =
MWIFIEX_UAP_AMPDU_DEF_TXWINSIZE;
if (adapter->coex_win_size) { if (adapter->coex_tx_win_size)
priv->add_ba_param.tx_win_size =
adapter->coex_tx_win_size;
}
if (tx_win_size != priv->add_ba_param.tx_win_size) { if (!priv->media_connected) continue; for (j = 0; j < MAX_NUM_TID; j++)
mwifiex_send_delba_txbastream_tbl(priv, j);
}
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.4 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.