Commit b04885e7 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: rtl8192e: Replace union qos_tsinfo with embedded struct

Replace union qos_tsinfo with embedded struct as it has only one element.
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/3bedc504ad678332e4ab2a3d99f2a94ab5aed03a.1698042685.git.philipp.g.hortmann@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 64cc56ba
...@@ -474,7 +474,7 @@ void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts, ...@@ -474,7 +474,7 @@ void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts,
ba->dialog_token++; ba->dialog_token++;
ba->ba_param_set.field.amsdu_support = 0; ba->ba_param_set.field.amsdu_support = 0;
ba->ba_param_set.field.ba_policy = policy; ba->ba_param_set.field.ba_policy = policy;
ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.field.ucTSID; ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.ucTSID;
ba->ba_param_set.field.buffer_size = 32; ba->ba_param_set.field.buffer_size = 32;
ba->ba_timeout_value = 0; 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->TxCurSeq + 3) % 4096;
......
...@@ -7,11 +7,9 @@ ...@@ -7,11 +7,9 @@
#ifndef __INC_QOS_TYPE_H #ifndef __INC_QOS_TYPE_H
#define __INC_QOS_TYPE_H #define __INC_QOS_TYPE_H
union qos_tsinfo { struct qos_tsinfo {
struct { u8 ucTSID:4;
u8 ucTSID:4; u8 ucDirection:2;
u8 ucDirection:2;
} field;
}; };
struct octet_string { struct octet_string {
......
...@@ -20,7 +20,7 @@ enum tr_select { ...@@ -20,7 +20,7 @@ enum tr_select {
struct ts_common_info { struct ts_common_info {
struct list_head List; struct list_head List;
u8 addr[ETH_ALEN]; u8 addr[ETH_ALEN];
union qos_tsinfo TSpec; struct qos_tsinfo TSpec;
union qos_tclas TClass[TCLAS_NUM]; union qos_tclas TClass[TCLAS_NUM];
u8 TClasProc; u8 TClasProc;
u8 TClasNum; u8 TClasNum;
......
...@@ -94,7 +94,7 @@ static void TsAddBaProcess(struct timer_list *t) ...@@ -94,7 +94,7 @@ static void TsAddBaProcess(struct timer_list *t)
static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo) static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
{ {
eth_zero_addr(pTsCommonInfo->addr); eth_zero_addr(pTsCommonInfo->addr);
memset(&pTsCommonInfo->TSpec, 0, sizeof(union qos_tsinfo)); memset(&pTsCommonInfo->TSpec, 0, sizeof(struct qos_tsinfo));
memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas) * TCLAS_NUM); memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas) * TCLAS_NUM);
pTsCommonInfo->TClasProc = 0; pTsCommonInfo->TClasProc = 0;
pTsCommonInfo->TClasNum = 0; pTsCommonInfo->TClasNum = 0;
...@@ -201,8 +201,8 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, ...@@ -201,8 +201,8 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
continue; continue;
list_for_each_entry(pRet, psearch_list, List) { list_for_each_entry(pRet, psearch_list, List) {
if (memcmp(pRet->addr, addr, 6) == 0 && if (memcmp(pRet->addr, addr, 6) == 0 &&
pRet->TSpec.field.ucTSID == TID && pRet->TSpec.ucTSID == TID &&
pRet->TSpec.field.ucDirection == dir) pRet->TSpec.ucDirection == dir)
break; break;
} }
if (&pRet->List != psearch_list) if (&pRet->List != psearch_list)
...@@ -215,7 +215,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, ...@@ -215,7 +215,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
} }
static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr, static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,
union qos_tsinfo *pTSPEC, union qos_tclas *pTCLAS, struct qos_tsinfo *pTSPEC, union qos_tclas *pTCLAS,
u8 TCLAS_Num, u8 TCLAS_Proc) u8 TCLAS_Num, u8 TCLAS_Proc)
{ {
u8 count; u8 count;
...@@ -227,7 +227,7 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr, ...@@ -227,7 +227,7 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,
if (pTSPEC) if (pTSPEC)
memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC, memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,
sizeof(union qos_tsinfo)); sizeof(struct qos_tsinfo));
for (count = 0; count < TCLAS_Num; count++) for (count = 0; count < TCLAS_Num; count++)
memcpy((u8 *)(&(pTsCommonInfo->TClass[count])), memcpy((u8 *)(&(pTsCommonInfo->TClass[count])),
...@@ -241,8 +241,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS, ...@@ -241,8 +241,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
u8 *addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) u8 *addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs)
{ {
u8 UP = 0; u8 UP = 0;
union qos_tsinfo TSpec; struct qos_tsinfo TSpec;
union qos_tsinfo *ts_info = &TSpec; struct qos_tsinfo *ts_info = &TSpec;
struct list_head *pUnusedList; struct list_head *pUnusedList;
struct list_head *pAddmitList; struct list_head *pAddmitList;
enum direction_value Dir; enum direction_value Dir;
...@@ -318,8 +318,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS, ...@@ -318,8 +318,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
netdev_dbg(ieee->dev, netdev_dbg(ieee->dev,
"to init current TS, UP:%d, Dir:%d, addr: %pM ppTs=%p\n", "to init current TS, UP:%d, Dir:%d, addr: %pM ppTs=%p\n",
UP, Dir, addr, *ppTS); UP, Dir, addr, *ppTS);
ts_info->field.ucTSID = UP; ts_info->ucTSID = UP;
ts_info->field.ucDirection = Dir; ts_info->ucDirection = Dir;
MakeTSEntry(*ppTS, addr, &TSpec, NULL, 0, 0); MakeTSEntry(*ppTS, addr, &TSpec, NULL, 0, 0);
list_add_tail(&((*ppTS)->List), pAddmitList); list_add_tail(&((*ppTS)->List), pAddmitList);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment