Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iwm/if_iwm.c
Show First 20 Lines • Show All 3,021 Lines • ▼ Show 20 Lines | iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, | ||||
IWM_LOCK(sc); | IWM_LOCK(sc); | ||||
} | } | ||||
static int | static int | ||||
iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, | iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, | ||||
struct iwm_node *in) | struct iwm_node *in) | ||||
{ | { | ||||
struct iwm_mvm_tx_resp *tx_resp = (void *)pkt->data; | struct iwm_mvm_tx_resp *tx_resp = (void *)pkt->data; | ||||
struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; | |||||
struct ieee80211_node *ni = &in->in_ni; | struct ieee80211_node *ni = &in->in_ni; | ||||
struct ieee80211vap *vap = ni->ni_vap; | |||||
int status = le16toh(tx_resp->status.status) & IWM_TX_STATUS_MSK; | int status = le16toh(tx_resp->status.status) & IWM_TX_STATUS_MSK; | ||||
int failack = tx_resp->failure_frame; | |||||
KASSERT(tx_resp->frame_count == 1, ("too many frames")); | KASSERT(tx_resp->frame_count == 1, ("too many frames")); | ||||
/* Update rate control statistics. */ | /* Update rate control statistics. */ | ||||
IWM_DPRINTF(sc, IWM_DEBUG_XMIT, "%s: status=0x%04x, seq=%d, fc=%d, btc=%d, frts=%d, ff=%d, irate=%08x, wmt=%d\n", | IWM_DPRINTF(sc, IWM_DEBUG_XMIT, "%s: status=0x%04x, seq=%d, fc=%d, btc=%d, frts=%d, ff=%d, irate=%08x, wmt=%d\n", | ||||
__func__, | __func__, | ||||
(int) le16toh(tx_resp->status.status), | (int) le16toh(tx_resp->status.status), | ||||
(int) le16toh(tx_resp->status.sequence), | (int) le16toh(tx_resp->status.sequence), | ||||
tx_resp->frame_count, | tx_resp->frame_count, | ||||
tx_resp->bt_kill_count, | tx_resp->bt_kill_count, | ||||
tx_resp->failure_rts, | tx_resp->failure_rts, | ||||
tx_resp->failure_frame, | tx_resp->failure_frame, | ||||
le32toh(tx_resp->initial_rate), | le32toh(tx_resp->initial_rate), | ||||
(int) le16toh(tx_resp->wireless_media_time)); | (int) le16toh(tx_resp->wireless_media_time)); | ||||
txs->flags = IEEE80211_RATECTL_STATUS_SHORT_RETRY | | |||||
IEEE80211_RATECTL_STATUS_LONG_RETRY; | |||||
txs->short_retries = tx_resp->failure_rts; | |||||
txs->long_retries = tx_resp->failure_frame; | |||||
if (status != IWM_TX_STATUS_SUCCESS && | if (status != IWM_TX_STATUS_SUCCESS && | ||||
status != IWM_TX_STATUS_DIRECT_DONE) { | status != IWM_TX_STATUS_DIRECT_DONE) { | ||||
ieee80211_ratectl_tx_complete(vap, ni, | switch (status) { | ||||
IEEE80211_RATECTL_TX_FAILURE, &failack, NULL); | case IWM_TX_STATUS_FAIL_SHORT_LIMIT: | ||||
return (1); | txs->status = IEEE80211_RATECTL_TX_FAIL_SHORT; | ||||
break; | |||||
case IWM_TX_STATUS_FAIL_LONG_LIMIT: | |||||
txs->status = IEEE80211_RATECTL_TX_FAIL_LONG; | |||||
break; | |||||
case IWM_TX_STATUS_FAIL_LIFE_EXPIRE: | |||||
txs->status = IEEE80211_RATECTL_TX_FAIL_EXPIRED; | |||||
break; | |||||
default: | |||||
txs->status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED; | |||||
break; | |||||
} | |||||
} else { | } else { | ||||
ieee80211_ratectl_tx_complete(vap, ni, | txs->status = IEEE80211_RATECTL_TX_SUCCESS; | ||||
IEEE80211_RATECTL_TX_SUCCESS, &failack, NULL); | |||||
return (0); | |||||
} | } | ||||
ieee80211_ratectl_tx_complete(ni, txs); | |||||
return (txs->status != IEEE80211_RATECTL_TX_SUCCESS); | |||||
} | } | ||||
static void | static void | ||||
iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, | iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, | ||||
struct iwm_rx_packet *pkt, struct iwm_rx_data *data) | struct iwm_rx_packet *pkt, struct iwm_rx_data *data) | ||||
{ | { | ||||
struct iwm_cmd_header *cmd_hdr = &pkt->hdr; | struct iwm_cmd_header *cmd_hdr = &pkt->hdr; | ||||
int idx = cmd_hdr->idx; | int idx = cmd_hdr->idx; | ||||
▲ Show 20 Lines • Show All 3,185 Lines • Show Last 20 Lines |