Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(warnings): on 32 bit systems and types to short for consts #165

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/rtw_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,9 @@ union recv_frame *portctrl(_adapter *adapter, union recv_frame *precv_frame)
* 1. If old PN is 0, any PN is legal
* 2. PN > old PN
*/
#define PN_LESS_CHK(a, b) (((a-b) & 0x800000000000) != 0)
#define PN_LESS_CHK(a, b) (((a-b) & 0x800000000000ull) != 0)
#define VALID_PN_CHK(new, old) (((old) == 0) || PN_LESS_CHK(old, new))
#define CCMPH_2_KEYID(ch) (((ch) & 0x00000000c0000000) >> 30)
#define CCMPH_2_KEYID(ch) (((ch) & 0x00000000c0000000ull) >> 30)
sint recv_ucast_pn_decache(union recv_frame *precv_frame);
sint recv_ucast_pn_decache(union recv_frame *precv_frame)
{
Expand Down Expand Up @@ -849,7 +849,7 @@ sint recv_bcast_pn_decache(union recv_frame *precv_frame)
pkt_pn = CCMPH_2_PN(tmp_iv_hdr);

curr_pn = le64_to_cpu(*(u64*)psecuritypriv->iv_seq[key_id]);
curr_pn &= 0x0000ffffffffffff;
curr_pn &= 0x0000ffffffffffffull;

if (!VALID_PN_CHK(pkt_pn, curr_pn))
return _FAIL;
Expand Down
2 changes: 1 addition & 1 deletion hal/phydm/halrf/halrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3795,7 +3795,7 @@ void halrf_tssi_trigger(void *dm_void)
return;
}
} else {
if (rf->power_track_type >= 0 && rf->power_track_type <= 3) {
if (/* rf->power_track_type >= 0 && */ rf->power_track_type <= 3) {
RF_DBG(dm, DBG_RF_TX_PWR_TRACK,
"[TSSI]======>%s Normal Mode efues is thermal tracking. return !!!\n", __func__);
return;
Expand Down
2 changes: 1 addition & 1 deletion hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ _lok_one_shot_8821c(void *dm_void, u8 path, u8 pad_index)
{
struct dm_struct *dm = (struct dm_struct *)dm_void;
struct dm_iqk_info *iqk_info = &dm->IQK_info;
u8 delay_count = 0;
u32 delay_count = 0;
boolean LOK_notready = false;
u32 LOK_temp2 = 0, LOK_temp3 = 0;
u32 IQK_CMD = 0x0;
Expand Down
4 changes: 2 additions & 2 deletions hal/phydm/phydm_cfotracking.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ void phydm_cfo_tracking(void *dm_void)

if (dm->support_ic_type & (ODM_RTL8822C | ODM_RTL8814B |
ODM_RTL8195B | ODM_RTL8812F|ODM_RTL8723F)) {
if (crystal_cap > 0x7F)
if (crystal_cap & ~0x7F)
crystal_cap = 0x7F;
} else {
if (crystal_cap > 0x3F)
if (crystal_cap & ~0x3F)
crystal_cap = 0x3F;
}
if (crystal_cap < 0)
Expand Down
2 changes: 1 addition & 1 deletion hal/phydm/phydm_phystatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ struct phy_status_rpt_8812 {
__PACK struct phy_sts_rpt_jgr2_type0 {
/* @DW0 */
u8 page_num;
u8 pwdb;
s8 pwdb;
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
u8 gain : 6;
u8 rsvd_0 : 1;
Expand Down
66 changes: 33 additions & 33 deletions hal/phydm/phydm_rainfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,73 +981,73 @@ u64 phydm_get_bb_mod_ra_mask(void *dm_void, u8 sta_idx)
/*N_2G*/
if (tx_stream_num == 1) {
if (bw == CHANNEL_WIDTH_40)
ra_mask_bitmap &= 0x000ff015;
ra_mask_bitmap &= 0x000ff015ull;
else
ra_mask_bitmap &= 0x000ff005;
ra_mask_bitmap &= 0x000ff005ull;
} else if (tx_stream_num == 2) {
if (bw == CHANNEL_WIDTH_40)
ra_mask_bitmap &= 0x0ffff015;
ra_mask_bitmap &= 0x0ffff015ull;
else
ra_mask_bitmap &= 0x0ffff005;
ra_mask_bitmap &= 0x0ffff005ull;
} else if (tx_stream_num == 3) {
ra_mask_bitmap &= 0xffffff015;
ra_mask_bitmap &= 0xffffff015ull;
} else {
ra_mask_bitmap &= 0xffffffff015;
ra_mask_bitmap &= 0xffffffff015ull;
}
} else if (wrls_mode == (WIRELESS_OFDM | WIRELESS_HT)) { /*N_5G*/

if (tx_stream_num == 1) {
if (bw == CHANNEL_WIDTH_40)
ra_mask_bitmap &= 0x000ff030;
ra_mask_bitmap &= 0x000ff030ull;
else
ra_mask_bitmap &= 0x000ff010;
ra_mask_bitmap &= 0x000ff010ull;
} else if (tx_stream_num == 2) {
if (bw == CHANNEL_WIDTH_40)
ra_mask_bitmap &= 0x0ffff030;
ra_mask_bitmap &= 0x0ffff030ull;
else
ra_mask_bitmap &= 0x0ffff010;
ra_mask_bitmap &= 0x0ffff010ull;
} else if (tx_stream_num == 3) {
ra_mask_bitmap &= 0xffffff010;
ra_mask_bitmap &= 0xffffff010ull;
} else {
ra_mask_bitmap &= 0xffffffff010;
ra_mask_bitmap &= 0xffffffff010ull;
}
} else if (wrls_mode == (WIRELESS_CCK | WIRELESS_OFDM | WIRELESS_VHT)) {
/*@AC_2G*/
if (tx_stream_num == 1)
ra_mask_bitmap &= 0x003ff015;
ra_mask_bitmap &= 0x003ff015ull;
else if (tx_stream_num == 2)
ra_mask_bitmap &= 0xfffff015;
ra_mask_bitmap &= 0xfffff015ull;
else if (tx_stream_num == 3)
ra_mask_bitmap &= 0x3fffffff015;
ra_mask_bitmap &= 0x3fffffff015ull;
else /*@AC_4SS 2G*/
ra_mask_bitmap &= 0x000ffffffffff015;
ra_mask_bitmap &= 0x000ffffffffff015ull;
if (bw == CHANNEL_WIDTH_20) {
/* @AC 20MHz doesn't support MCS9 except 3SS & 6SS*/
ra_mask_bitmap &= 0x0007ffff7fdff015;
ra_mask_bitmap &= 0x0007ffff7fdff015ull;
} else if (bw == CHANNEL_WIDTH_80) {
/* @AC 80MHz doesn't support 3SS MCS6*/
ra_mask_bitmap &= 0x000fffbffffff015;
ra_mask_bitmap &= 0x000fffbffffff015ull;
}
} else if (wrls_mode == (WIRELESS_OFDM | WIRELESS_VHT)) { /*@AC_5G*/

if (tx_stream_num == 1)
ra_mask_bitmap &= 0x003ff010;
ra_mask_bitmap &= 0x003ff010ull;
else if (tx_stream_num == 2)
ra_mask_bitmap &= 0xfffff010;
ra_mask_bitmap &= 0xfffff010ull;
else if (tx_stream_num == 3)
ra_mask_bitmap &= 0x3fffffff010;
ra_mask_bitmap &= 0x3fffffff010ull;
else /*@AC_4SS 5G*/
ra_mask_bitmap &= 0x000ffffffffff010;
ra_mask_bitmap &= 0x000ffffffffff010ull;

if (bw == CHANNEL_WIDTH_20) {
/* @AC 20MHz doesn't support MCS9 except 3SS & 6SS*/
ra_mask_bitmap &= 0x0007ffff7fdff010;
ra_mask_bitmap &= 0x0007ffff7fdff010ull;
} else if (bw == CHANNEL_WIDTH_80) {
/* @AC 80MHz doesn't support 3SS MCS6*/
ra_mask_bitmap &= 0x000fffbffffff010;
ra_mask_bitmap &= 0x000fffbffffff010ull;
} else if (bw == CHANNEL_WIDTH_160) {
/* @AC 80M+80M doesn't support 3SS & 4SS*/
ra_mask_bitmap &= 0xfffff010;
ra_mask_bitmap &= 0xfffff010ull;
}
} else {
PHYDM_DBG(dm, DBG_RA, "[Warrning] RA mask is Not found\n");
Expand All @@ -1065,23 +1065,23 @@ u64 phydm_get_bb_mod_ra_mask(void *dm_void, u8 sta_idx)
if (wrls_mode != WIRELESS_CCK) {
if (iot_table->patch_id_40010700) {
ra_mask_bitmap &= (rssi_lv == 0 ?
0xffffffffffffffff :
0xfffffffffffffff0);
0xffffffffffffffffull :
0xfffffffffffffff0ull);
return ra_mask_bitmap;
}

if (rssi_lv == 0)
ra_mask_bitmap &= 0xffffffffffffffff;
ra_mask_bitmap &= 0xffffffffffffffffull;
else if (rssi_lv == 1)
ra_mask_bitmap &= 0xfffffffffffffff0;
ra_mask_bitmap &= 0xfffffffffffffff0ull;
else if (rssi_lv == 2)
ra_mask_bitmap &= 0xffffffffffffefe0;
ra_mask_bitmap &= 0xffffffffffffefe0ull;
else if (rssi_lv == 3)
ra_mask_bitmap &= 0xffffffffffffcfc0;
ra_mask_bitmap &= 0xffffffffffffcfc0ull;
else if (rssi_lv == 4)
ra_mask_bitmap &= 0xffffffffffff8f80;
ra_mask_bitmap &= 0xffffffffffff8f80ull;
else if (rssi_lv >= 5)
ra_mask_bitmap &= 0xffffffffffff0f00;
ra_mask_bitmap &= 0xffffffffffff0f00ull;
}
PHYDM_DBG(dm, DBG_RA, "Mod by RSSI=0x%llx\n", ra_mask_bitmap);

Expand Down
8 changes: 4 additions & 4 deletions include/drv_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -975,10 +975,10 @@ struct macid_ctl_t {
#define RATE_BMP_GET_HT_4SS(_bmp_ht) ((_bmp_ht & RATE_BMP_HT_4SS) >> 24)

/* used for rf_ctl_t.rate_bmp_vht_by_bw */
#define RATE_BMP_VHT_1SS 0x00000003FF
#define RATE_BMP_VHT_2SS 0x00000FFC00
#define RATE_BMP_VHT_3SS 0x003FF00000
#define RATE_BMP_VHT_4SS 0xFFC0000000
#define RATE_BMP_VHT_1SS 0x00000003FFull
#define RATE_BMP_VHT_2SS 0x00000FFC00ull
#define RATE_BMP_VHT_3SS 0x003FF00000ull
#define RATE_BMP_VHT_4SS 0xFFC0000000ull
#define RATE_BMP_HAS_VHT_1SS(_bmp_vht) (_bmp_vht & RATE_BMP_VHT_1SS)
#define RATE_BMP_HAS_VHT_2SS(_bmp_vht) (_bmp_vht & RATE_BMP_VHT_2SS)
#define RATE_BMP_HAS_VHT_3SS(_bmp_vht) (_bmp_vht & RATE_BMP_VHT_3SS)
Expand Down
2 changes: 1 addition & 1 deletion include/rtw_qos.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ struct qos_priv {
};


#endif /* _RTL871X_QOS_H_ */
#endif /* _RTL871X_QOS_H_ */
4 changes: 2 additions & 2 deletions include/rtw_security.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ enum security_type {
#define IEEE80211W_WRONG_KEY 0x1
#define IEEE80211W_NO_KEY 0x2

#define CCMPH_2_PN(ch) ((ch) & 0x000000000000ffff) \
| (((ch) & 0xffffffff00000000) >> 16)
#define CCMPH_2_PN(ch) ((ch) & 0x000000000000ffffull) \
| (((ch) & 0xffffffff00000000ull) >> 16)

#define is_wep_enc(alg) (((alg) == _WEP40_) || ((alg) == _WEP104_))

Expand Down