diff options
Diffstat (limited to 'drivers/staging/rtl8192e/rtl819x_BAProc.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtl819x_BAProc.c | 228 |
1 files changed, 114 insertions, 114 deletions
diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 4af8055d24..ee9ce39215 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -23,35 +23,35 @@ static void deactivate_ba_entry(struct rtllib_device *ieee, struct ba_record *ba del_timer_sync(&ba->timer); } -static u8 tx_ts_delete_ba(struct rtllib_device *ieee, struct tx_ts_record *pTxTs) +static u8 tx_ts_delete_ba(struct rtllib_device *ieee, struct tx_ts_record *ts) { - struct ba_record *admitted_ba = &pTxTs->TxAdmittedBARecord; - struct ba_record *pending_ba = &pTxTs->TxPendingBARecord; - u8 bSendDELBA = false; + struct ba_record *admitted_ba = &ts->tx_admitted_ba_record; + struct ba_record *pending_ba = &ts->tx_pending_ba_record; + u8 send_del_ba = false; if (pending_ba->b_valid) { deactivate_ba_entry(ieee, pending_ba); - bSendDELBA = true; + send_del_ba = true; } if (admitted_ba->b_valid) { deactivate_ba_entry(ieee, admitted_ba); - bSendDELBA = true; + send_del_ba = true; } - return bSendDELBA; + return send_del_ba; } static u8 rx_ts_delete_ba(struct rtllib_device *ieee, struct rx_ts_record *ts) { struct ba_record *ba = &ts->rx_admitted_ba_record; - u8 bSendDELBA = false; + u8 send_del_ba = false; if (ba->b_valid) { deactivate_ba_entry(ieee, ba); - bSendDELBA = true; + send_del_ba = true; } - return bSendDELBA; + return send_del_ba; } void rtllib_reset_ba_entry(struct ba_record *ba) @@ -68,7 +68,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *dst, u16 status_code, u8 type) { struct sk_buff *skb = NULL; - struct ieee80211_hdr_3addr *BAReq = NULL; + struct ieee80211_hdr_3addr *ba_req = NULL; u8 *tag = NULL; u16 len = ieee->tx_headroom + 9; @@ -87,13 +87,13 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *dst, skb_reserve(skb, ieee->tx_headroom); - BAReq = skb_put(skb, sizeof(struct ieee80211_hdr_3addr)); + ba_req = skb_put(skb, sizeof(struct ieee80211_hdr_3addr)); - ether_addr_copy(BAReq->addr1, dst); - ether_addr_copy(BAReq->addr2, ieee->dev->dev_addr); + ether_addr_copy(ba_req->addr1, dst); + ether_addr_copy(ba_req->addr2, ieee->dev->dev_addr); - ether_addr_copy(BAReq->addr3, ieee->current_network.bssid); - BAReq->frame_control = cpu_to_le16(IEEE80211_STYPE_ACTION); + ether_addr_copy(ba_req->addr3, ieee->current_network.bssid); + ba_req->frame_control = cpu_to_le16(IEEE80211_STYPE_ACTION); tag = skb_put(skb, 9); *tag++ = ACT_CAT_BA; @@ -127,9 +127,9 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, struct ba_record *ba, enum tr_select TxRxSelect, u16 reason_code) { - union delba_param_set DelbaParamSet; + union delba_param_set del_ba_param_set; struct sk_buff *skb = NULL; - struct ieee80211_hdr_3addr *Delba = NULL; + struct ieee80211_hdr_3addr *del_ba = NULL; u8 *tag = NULL; u16 len = 6 + ieee->tx_headroom; @@ -137,10 +137,10 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, netdev_dbg(ieee->dev, "%s(): reason_code(%d) sentd to: %pM\n", __func__, reason_code, dst); - memset(&DelbaParamSet, 0, 2); + memset(&del_ba_param_set, 0, 2); - DelbaParamSet.field.initiator = (TxRxSelect == TX_DIR) ? 1 : 0; - DelbaParamSet.field.tid = ba->ba_param_set.field.tid; + del_ba_param_set.field.initiator = (TxRxSelect == TX_DIR) ? 1 : 0; + del_ba_param_set.field.tid = ba->ba_param_set.field.tid; skb = dev_alloc_skb(len + sizeof(struct ieee80211_hdr_3addr)); if (!skb) @@ -148,19 +148,19 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, skb_reserve(skb, ieee->tx_headroom); - Delba = skb_put(skb, sizeof(struct ieee80211_hdr_3addr)); + del_ba = skb_put(skb, sizeof(struct ieee80211_hdr_3addr)); - ether_addr_copy(Delba->addr1, dst); - ether_addr_copy(Delba->addr2, ieee->dev->dev_addr); - ether_addr_copy(Delba->addr3, ieee->current_network.bssid); - Delba->frame_control = cpu_to_le16(IEEE80211_STYPE_ACTION); + ether_addr_copy(del_ba->addr1, dst); + ether_addr_copy(del_ba->addr2, ieee->dev->dev_addr); + ether_addr_copy(del_ba->addr3, ieee->current_network.bssid); + del_ba->frame_control = cpu_to_le16(IEEE80211_STYPE_ACTION); tag = skb_put(skb, 6); *tag++ = ACT_CAT_BA; *tag++ = ACT_DELBA; - put_unaligned_le16(DelbaParamSet.short_data, tag); + put_unaligned_le16(del_ba_param_set.short_data, tag); tag += 2; put_unaligned_le16(reason_code, tag); @@ -215,11 +215,11 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) { struct ieee80211_hdr_3addr *req = NULL; u16 rc = 0; - u8 *dst = NULL, *pDialogToken = NULL, *tag = NULL; + u8 *dst = NULL, *dialog_token = NULL, *tag = NULL; struct ba_record *ba = NULL; - union ba_param_set *pBaParamSet = NULL; - u16 *pBaTimeoutVal = NULL; - union sequence_control *pBaStartSeqCtrl = NULL; + union ba_param_set *ba_param_set = NULL; + u16 *ba_timeout_value = NULL; + union sequence_control *ba_start_seq_ctrl = NULL; struct rx_ts_record *ts = NULL; if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 9) { @@ -238,10 +238,10 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) tag = (u8 *)req; dst = (u8 *)(&req->addr2[0]); tag += sizeof(struct ieee80211_hdr_3addr); - pDialogToken = tag + 2; - pBaParamSet = (union ba_param_set *)(tag + 3); - pBaTimeoutVal = (u16 *)(tag + 5); - pBaStartSeqCtrl = (union sequence_control *)(req + 7); + dialog_token = tag + 2; + ba_param_set = (union ba_param_set *)(tag + 3); + ba_timeout_value = (u16 *)(tag + 5); + ba_start_seq_ctrl = (union sequence_control *)(req + 7); if (!ieee->current_network.qos_data.active || !ieee->ht_info->current_ht_support || @@ -254,14 +254,14 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) goto OnADDBAReq_Fail; } if (!rtllib_get_ts(ieee, (struct ts_common_info **)&ts, dst, - (u8)(pBaParamSet->field.tid), RX_DIR, true)) { + (u8)(ba_param_set->field.tid), RX_DIR, true)) { rc = ADDBA_STATUS_REFUSED; netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); goto OnADDBAReq_Fail; } ba = &ts->rx_admitted_ba_record; - if (pBaParamSet->field.ba_policy == BA_POLICY_DELAYED) { + if (ba_param_set->field.ba_policy == BA_POLICY_DELAYED) { rc = ADDBA_STATUS_INVALID_PARAM; netdev_warn(ieee->dev, "%s(): BA Policy is not correct\n", __func__); @@ -271,10 +271,10 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) rtllib_FlushRxTsPendingPkts(ieee, ts); deactivate_ba_entry(ieee, ba); - ba->dialog_token = *pDialogToken; - ba->ba_param_set = *pBaParamSet; - ba->ba_timeout_value = *pBaTimeoutVal; - ba->ba_start_seq_ctrl = *pBaStartSeqCtrl; + ba->dialog_token = *dialog_token; + ba->ba_param_set = *ba_param_set; + ba->ba_timeout_value = *ba_timeout_value; + ba->ba_start_seq_ctrl = *ba_start_seq_ctrl; if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev) || (ieee->ht_info->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT)) @@ -291,9 +291,9 @@ OnADDBAReq_Fail: { struct ba_record BA; - BA.ba_param_set = *pBaParamSet; - BA.ba_timeout_value = *pBaTimeoutVal; - BA.dialog_token = *pDialogToken; + BA.ba_param_set = *ba_param_set; + BA.ba_timeout_value = *ba_timeout_value; + BA.dialog_token = *dialog_token; BA.ba_param_set.field.ba_policy = BA_POLICY_IMMEDIATE; rtllib_send_ADDBARsp(ieee, dst, &BA, rc); return 0; @@ -303,11 +303,11 @@ OnADDBAReq_Fail: int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) { struct ieee80211_hdr_3addr *rsp = NULL; - struct ba_record *pending_ba, *pAdmittedBA; + struct ba_record *pending_ba, *admitted_ba; struct tx_ts_record *ts = NULL; - u8 *dst = NULL, *pDialogToken = NULL, *tag = NULL; - u16 *status_code = NULL, *pBaTimeoutVal = NULL; - union ba_param_set *pBaParamSet = NULL; + u8 *dst = NULL, *dialog_token = NULL, *tag = NULL; + u16 *status_code = NULL, *ba_timeout_value = NULL; + union ba_param_set *ba_param_set = NULL; u16 reason_code; if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 9) { @@ -320,40 +320,40 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) tag = (u8 *)rsp; dst = (u8 *)(&rsp->addr2[0]); tag += sizeof(struct ieee80211_hdr_3addr); - pDialogToken = tag + 2; + dialog_token = tag + 2; status_code = (u16 *)(tag + 3); - pBaParamSet = (union ba_param_set *)(tag + 5); - pBaTimeoutVal = (u16 *)(tag + 7); + ba_param_set = (union ba_param_set *)(tag + 5); + ba_timeout_value = (u16 *)(tag + 7); if (!ieee->current_network.qos_data.active || !ieee->ht_info->current_ht_support || - !ieee->ht_info->bCurrentAMPDUEnable) { + !ieee->ht_info->current_ampdu_enable) { netdev_warn(ieee->dev, "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n", ieee->current_network.qos_data.active, ieee->ht_info->current_ht_support, - ieee->ht_info->bCurrentAMPDUEnable); + ieee->ht_info->current_ampdu_enable); reason_code = DELBA_REASON_UNKNOWN_BA; goto OnADDBARsp_Reject; } if (!rtllib_get_ts(ieee, (struct ts_common_info **)&ts, dst, - (u8)(pBaParamSet->field.tid), TX_DIR, false)) { + (u8)(ba_param_set->field.tid), TX_DIR, false)) { netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); reason_code = DELBA_REASON_UNKNOWN_BA; goto OnADDBARsp_Reject; } - ts->bAddBaReqInProgress = false; - pending_ba = &ts->TxPendingBARecord; - pAdmittedBA = &ts->TxAdmittedBARecord; + ts->add_ba_req_in_progress = false; + pending_ba = &ts->tx_pending_ba_record; + admitted_ba = &ts->tx_admitted_ba_record; - if (pAdmittedBA->b_valid) { + if (admitted_ba->b_valid) { netdev_dbg(ieee->dev, "%s(): ADDBA response already admitted\n", __func__); return -1; } else if (!pending_ba->b_valid || - (*pDialogToken != pending_ba->dialog_token)) { + (*dialog_token != pending_ba->dialog_token)) { netdev_warn(ieee->dev, "%s(): ADDBA Rsp. BA invalid, DELBA!\n", __func__); @@ -367,22 +367,22 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) } if (*status_code == ADDBA_STATUS_SUCCESS) { - if (pBaParamSet->field.ba_policy == BA_POLICY_DELAYED) { - ts->bAddBaReqDelayed = true; - deactivate_ba_entry(ieee, pAdmittedBA); + if (ba_param_set->field.ba_policy == BA_POLICY_DELAYED) { + ts->add_ba_req_delayed = true; + deactivate_ba_entry(ieee, admitted_ba); reason_code = DELBA_REASON_END_BA; goto OnADDBARsp_Reject; } - pAdmittedBA->dialog_token = *pDialogToken; - pAdmittedBA->ba_timeout_value = *pBaTimeoutVal; - pAdmittedBA->ba_start_seq_ctrl = pending_ba->ba_start_seq_ctrl; - pAdmittedBA->ba_param_set = *pBaParamSet; - deactivate_ba_entry(ieee, pAdmittedBA); - activate_ba_entry(pAdmittedBA, *pBaTimeoutVal); + admitted_ba->dialog_token = *dialog_token; + admitted_ba->ba_timeout_value = *ba_timeout_value; + admitted_ba->ba_start_seq_ctrl = pending_ba->ba_start_seq_ctrl; + admitted_ba->ba_param_set = *ba_param_set; + deactivate_ba_entry(ieee, admitted_ba); + activate_ba_entry(admitted_ba, *ba_timeout_value); } else { - ts->bAddBaReqDelayed = true; - ts->bDisable_AddBa = true; + ts->add_ba_req_delayed = true; + ts->disable_add_ba = true; reason_code = DELBA_REASON_END_BA; goto OnADDBARsp_Reject; } @@ -393,7 +393,7 @@ OnADDBARsp_Reject: { struct ba_record BA; - BA.ba_param_set = *pBaParamSet; + BA.ba_param_set = *ba_param_set; rtllib_send_DELBA(ieee, dst, &BA, TX_DIR, reason_code); return 0; } @@ -402,7 +402,7 @@ OnADDBARsp_Reject: int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) { struct ieee80211_hdr_3addr *delba = NULL; - union delba_param_set *pDelBaParamSet = NULL; + union delba_param_set *del_ba_param_set = NULL; u8 *dst = NULL; if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 6) { @@ -427,46 +427,46 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) #endif delba = (struct ieee80211_hdr_3addr *)skb->data; dst = (u8 *)(&delba->addr2[0]); - pDelBaParamSet = (union delba_param_set *)&delba->seq_ctrl + 2; + del_ba_param_set = (union delba_param_set *)&delba->seq_ctrl + 2; - if (pDelBaParamSet->field.initiator == 1) { + if (del_ba_param_set->field.initiator == 1) { struct rx_ts_record *ts; if (!rtllib_get_ts(ieee, (struct ts_common_info **)&ts, dst, - (u8)pDelBaParamSet->field.tid, RX_DIR, false)) { + (u8)del_ba_param_set->field.tid, RX_DIR, false)) { netdev_warn(ieee->dev, "%s(): can't get TS for RXTS. dst:%pM TID:%d\n", __func__, dst, - (u8)pDelBaParamSet->field.tid); + (u8)del_ba_param_set->field.tid); return -1; } rx_ts_delete_ba(ieee, ts); } else { - struct tx_ts_record *pTxTs; + struct tx_ts_record *ts; - if (!rtllib_get_ts(ieee, (struct ts_common_info **)&pTxTs, dst, - (u8)pDelBaParamSet->field.tid, TX_DIR, false)) { + if (!rtllib_get_ts(ieee, (struct ts_common_info **)&ts, dst, + (u8)del_ba_param_set->field.tid, TX_DIR, false)) { netdev_warn(ieee->dev, "%s(): can't get TS for TXTS\n", __func__); return -1; } - pTxTs->bUsingBa = false; - pTxTs->bAddBaReqInProgress = false; - pTxTs->bAddBaReqDelayed = false; - del_timer_sync(&pTxTs->TsAddBaTimer); - tx_ts_delete_ba(ieee, pTxTs); + ts->using_ba = false; + ts->add_ba_req_in_progress = false; + ts->add_ba_req_delayed = false; + del_timer_sync(&ts->ts_add_ba_timer); + tx_ts_delete_ba(ieee, ts); } return 0; } void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts, - u8 policy, u8 bOverwritePending) + u8 policy, u8 overwrite_pending) { - struct ba_record *ba = &ts->TxPendingBARecord; + struct ba_record *ba = &ts->tx_pending_ba_record; - if (ba->b_valid && !bOverwritePending) + if (ba->b_valid && !overwrite_pending) return; deactivate_ba_entry(ieee, ba); @@ -474,35 +474,35 @@ void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts, ba->dialog_token++; ba->ba_param_set.field.amsdu_support = 0; ba->ba_param_set.field.ba_policy = policy; - ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.ucTSID; + ba->ba_param_set.field.tid = ts->ts_common_info.tspec.ts_id; ba->ba_param_set.field.buffer_size = 32; ba->ba_timeout_value = 0; - ba->ba_start_seq_ctrl.field.seq_num = (ts->TxCurSeq + 3) % 4096; + ba->ba_start_seq_ctrl.field.seq_num = (ts->tx_cur_seq + 3) % 4096; activate_ba_entry(ba, BA_SETUP_TIMEOUT); - rtllib_send_ADDBAReq(ieee, ts->TsCommonInfo.addr, ba); + rtllib_send_ADDBAReq(ieee, ts->ts_common_info.addr, ba); } void rtllib_ts_init_del_ba(struct rtllib_device *ieee, - struct ts_common_info *pTsCommonInfo, + struct ts_common_info *ts_common_info, enum tr_select TxRxSelect) { if (TxRxSelect == TX_DIR) { - struct tx_ts_record *pTxTs = - (struct tx_ts_record *)pTsCommonInfo; - - if (tx_ts_delete_ba(ieee, pTxTs)) - rtllib_send_DELBA(ieee, pTsCommonInfo->addr, - (pTxTs->TxAdmittedBARecord.b_valid) ? - (&pTxTs->TxAdmittedBARecord) : - (&pTxTs->TxPendingBARecord), + struct tx_ts_record *ts = + (struct tx_ts_record *)ts_common_info; + + if (tx_ts_delete_ba(ieee, ts)) + rtllib_send_DELBA(ieee, ts_common_info->addr, + (ts->tx_admitted_ba_record.b_valid) ? + (&ts->tx_admitted_ba_record) : + (&ts->tx_pending_ba_record), TxRxSelect, DELBA_REASON_END_BA); } else if (TxRxSelect == RX_DIR) { struct rx_ts_record *ts = - (struct rx_ts_record *)pTsCommonInfo; + (struct rx_ts_record *)ts_common_info; if (rx_ts_delete_ba(ieee, ts)) - rtllib_send_DELBA(ieee, pTsCommonInfo->addr, + rtllib_send_DELBA(ieee, ts_common_info->addr, &ts->rx_admitted_ba_record, TxRxSelect, DELBA_REASON_END_BA); } @@ -510,23 +510,23 @@ void rtllib_ts_init_del_ba(struct rtllib_device *ieee, void rtllib_ba_setup_timeout(struct timer_list *t) { - struct tx_ts_record *pTxTs = from_timer(pTxTs, t, - TxPendingBARecord.timer); + struct tx_ts_record *ts = from_timer(ts, t, + tx_pending_ba_record.timer); - pTxTs->bAddBaReqInProgress = false; - pTxTs->bAddBaReqDelayed = true; - pTxTs->TxPendingBARecord.b_valid = false; + ts->add_ba_req_in_progress = false; + ts->add_ba_req_delayed = true; + ts->tx_pending_ba_record.b_valid = false; } void rtllib_tx_ba_inact_timeout(struct timer_list *t) { - struct tx_ts_record *pTxTs = from_timer(pTxTs, t, - TxAdmittedBARecord.timer); - struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, - TxTsRecord[pTxTs->num]); - tx_ts_delete_ba(ieee, pTxTs); - rtllib_send_DELBA(ieee, pTxTs->TsCommonInfo.addr, - &pTxTs->TxAdmittedBARecord, TX_DIR, + struct tx_ts_record *ts = from_timer(ts, t, + tx_admitted_ba_record.timer); + struct rtllib_device *ieee = container_of(ts, struct rtllib_device, + tx_ts_records[ts->num]); + tx_ts_delete_ba(ieee, ts); + rtllib_send_DELBA(ieee, ts->ts_common_info.addr, + &ts->tx_admitted_ba_record, TX_DIR, DELBA_REASON_TIMEOUT); } @@ -535,7 +535,7 @@ void rtllib_rx_ba_inact_timeout(struct timer_list *t) struct rx_ts_record *ts = from_timer(ts, t, rx_admitted_ba_record.timer); struct rtllib_device *ieee = container_of(ts, struct rtllib_device, - RxTsRecord[ts->num]); + rx_ts_records[ts->num]); rx_ts_delete_ba(ieee, ts); rtllib_send_DELBA(ieee, ts->ts_common_info.addr, |