1
0
mirror of https://github.com/morrownr/8821cu-20210916.git synced 2024-12-28 00:58:39 +00:00

fix(warnings): const to long

on 32 bit systems with 32 bit as default for type long
This commit is contained in:
H. Nestler 2024-11-04 20:59:19 +01:00
parent 0da653935f
commit 51deb0f7f4
5 changed files with 43 additions and 43 deletions

View File

@ -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 * 1. If old PN is 0, any PN is legal
* 2. PN > old PN * 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 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);
sint recv_ucast_pn_decache(union recv_frame *precv_frame) sint recv_ucast_pn_decache(union recv_frame *precv_frame)
{ {
@ -849,7 +849,7 @@ sint recv_bcast_pn_decache(union recv_frame *precv_frame)
pkt_pn = CCMPH_2_PN(tmp_iv_hdr); pkt_pn = CCMPH_2_PN(tmp_iv_hdr);
curr_pn = le64_to_cpu(*(u64*)psecuritypriv->iv_seq[key_id]); 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)) if (!VALID_PN_CHK(pkt_pn, curr_pn))
return _FAIL; return _FAIL;

View File

@ -197,7 +197,7 @@ struct phy_status_rpt_8812 {
__PACK struct phy_sts_rpt_jgr2_type0 { __PACK struct phy_sts_rpt_jgr2_type0 {
/* @DW0 */ /* @DW0 */
u8 page_num; u8 page_num;
u8 pwdb; s8 pwdb;
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
u8 gain : 6; u8 gain : 6;
u8 rsvd_0 : 1; u8 rsvd_0 : 1;

View File

@ -981,73 +981,73 @@ u64 phydm_get_bb_mod_ra_mask(void *dm_void, u8 sta_idx)
/*N_2G*/ /*N_2G*/
if (tx_stream_num == 1) { if (tx_stream_num == 1) {
if (bw == CHANNEL_WIDTH_40) if (bw == CHANNEL_WIDTH_40)
ra_mask_bitmap &= 0x000ff015; ra_mask_bitmap &= 0x000ff015ull;
else else
ra_mask_bitmap &= 0x000ff005; ra_mask_bitmap &= 0x000ff005ull;
} else if (tx_stream_num == 2) { } else if (tx_stream_num == 2) {
if (bw == CHANNEL_WIDTH_40) if (bw == CHANNEL_WIDTH_40)
ra_mask_bitmap &= 0x0ffff015; ra_mask_bitmap &= 0x0ffff015ull;
else else
ra_mask_bitmap &= 0x0ffff005; ra_mask_bitmap &= 0x0ffff005ull;
} else if (tx_stream_num == 3) { } else if (tx_stream_num == 3) {
ra_mask_bitmap &= 0xffffff015; ra_mask_bitmap &= 0xffffff015ull;
} else { } else {
ra_mask_bitmap &= 0xffffffff015; ra_mask_bitmap &= 0xffffffff015ull;
} }
} else if (wrls_mode == (WIRELESS_OFDM | WIRELESS_HT)) { /*N_5G*/ } else if (wrls_mode == (WIRELESS_OFDM | WIRELESS_HT)) { /*N_5G*/
if (tx_stream_num == 1) { if (tx_stream_num == 1) {
if (bw == CHANNEL_WIDTH_40) if (bw == CHANNEL_WIDTH_40)
ra_mask_bitmap &= 0x000ff030; ra_mask_bitmap &= 0x000ff030ull;
else else
ra_mask_bitmap &= 0x000ff010; ra_mask_bitmap &= 0x000ff010ull;
} else if (tx_stream_num == 2) { } else if (tx_stream_num == 2) {
if (bw == CHANNEL_WIDTH_40) if (bw == CHANNEL_WIDTH_40)
ra_mask_bitmap &= 0x0ffff030; ra_mask_bitmap &= 0x0ffff030ull;
else else
ra_mask_bitmap &= 0x0ffff010; ra_mask_bitmap &= 0x0ffff010ull;
} else if (tx_stream_num == 3) { } else if (tx_stream_num == 3) {
ra_mask_bitmap &= 0xffffff010; ra_mask_bitmap &= 0xffffff010ull;
} else { } else {
ra_mask_bitmap &= 0xffffffff010; ra_mask_bitmap &= 0xffffffff010ull;
} }
} else if (wrls_mode == (WIRELESS_CCK | WIRELESS_OFDM | WIRELESS_VHT)) { } else if (wrls_mode == (WIRELESS_CCK | WIRELESS_OFDM | WIRELESS_VHT)) {
/*@AC_2G*/ /*@AC_2G*/
if (tx_stream_num == 1) if (tx_stream_num == 1)
ra_mask_bitmap &= 0x003ff015; ra_mask_bitmap &= 0x003ff015ull;
else if (tx_stream_num == 2) else if (tx_stream_num == 2)
ra_mask_bitmap &= 0xfffff015; ra_mask_bitmap &= 0xfffff015ull;
else if (tx_stream_num == 3) else if (tx_stream_num == 3)
ra_mask_bitmap &= 0x3fffffff015; ra_mask_bitmap &= 0x3fffffff015ull;
else /*@AC_4SS 2G*/ else /*@AC_4SS 2G*/
ra_mask_bitmap &= 0x000ffffffffff015; ra_mask_bitmap &= 0x000ffffffffff015ull;
if (bw == CHANNEL_WIDTH_20) { if (bw == CHANNEL_WIDTH_20) {
/* @AC 20MHz doesn't support MCS9 except 3SS & 6SS*/ /* @AC 20MHz doesn't support MCS9 except 3SS & 6SS*/
ra_mask_bitmap &= 0x0007ffff7fdff015; ra_mask_bitmap &= 0x0007ffff7fdff015ull;
} else if (bw == CHANNEL_WIDTH_80) { } else if (bw == CHANNEL_WIDTH_80) {
/* @AC 80MHz doesn't support 3SS MCS6*/ /* @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*/ } else if (wrls_mode == (WIRELESS_OFDM | WIRELESS_VHT)) { /*@AC_5G*/
if (tx_stream_num == 1) if (tx_stream_num == 1)
ra_mask_bitmap &= 0x003ff010; ra_mask_bitmap &= 0x003ff010ull;
else if (tx_stream_num == 2) else if (tx_stream_num == 2)
ra_mask_bitmap &= 0xfffff010; ra_mask_bitmap &= 0xfffff010ull;
else if (tx_stream_num == 3) else if (tx_stream_num == 3)
ra_mask_bitmap &= 0x3fffffff010; ra_mask_bitmap &= 0x3fffffff010ull;
else /*@AC_4SS 5G*/ else /*@AC_4SS 5G*/
ra_mask_bitmap &= 0x000ffffffffff010; ra_mask_bitmap &= 0x000ffffffffff010ull;
if (bw == CHANNEL_WIDTH_20) { if (bw == CHANNEL_WIDTH_20) {
/* @AC 20MHz doesn't support MCS9 except 3SS & 6SS*/ /* @AC 20MHz doesn't support MCS9 except 3SS & 6SS*/
ra_mask_bitmap &= 0x0007ffff7fdff010; ra_mask_bitmap &= 0x0007ffff7fdff010ull;
} else if (bw == CHANNEL_WIDTH_80) { } else if (bw == CHANNEL_WIDTH_80) {
/* @AC 80MHz doesn't support 3SS MCS6*/ /* @AC 80MHz doesn't support 3SS MCS6*/
ra_mask_bitmap &= 0x000fffbffffff010; ra_mask_bitmap &= 0x000fffbffffff010ull;
} else if (bw == CHANNEL_WIDTH_160) { } else if (bw == CHANNEL_WIDTH_160) {
/* @AC 80M+80M doesn't support 3SS & 4SS*/ /* @AC 80M+80M doesn't support 3SS & 4SS*/
ra_mask_bitmap &= 0xfffff010; ra_mask_bitmap &= 0xfffff010ull;
} }
} else { } else {
PHYDM_DBG(dm, DBG_RA, "[Warrning] RA mask is Not found\n"); PHYDM_DBG(dm, DBG_RA, "[Warrning] RA mask is Not found\n");
@ -1065,23 +1065,23 @@ u64 phydm_get_bb_mod_ra_mask(void *dm_void, u8 sta_idx)
if (wrls_mode != WIRELESS_CCK) { if (wrls_mode != WIRELESS_CCK) {
if (iot_table->patch_id_40010700) { if (iot_table->patch_id_40010700) {
ra_mask_bitmap &= (rssi_lv == 0 ? ra_mask_bitmap &= (rssi_lv == 0 ?
0xffffffffffffffff : 0xffffffffffffffffull :
0xfffffffffffffff0); 0xfffffffffffffff0ull);
return ra_mask_bitmap; return ra_mask_bitmap;
} }
if (rssi_lv == 0) if (rssi_lv == 0)
ra_mask_bitmap &= 0xffffffffffffffff; ra_mask_bitmap &= 0xffffffffffffffffull;
else if (rssi_lv == 1) else if (rssi_lv == 1)
ra_mask_bitmap &= 0xfffffffffffffff0; ra_mask_bitmap &= 0xfffffffffffffff0ull;
else if (rssi_lv == 2) else if (rssi_lv == 2)
ra_mask_bitmap &= 0xffffffffffffefe0; ra_mask_bitmap &= 0xffffffffffffefe0ull;
else if (rssi_lv == 3) else if (rssi_lv == 3)
ra_mask_bitmap &= 0xffffffffffffcfc0; ra_mask_bitmap &= 0xffffffffffffcfc0ull;
else if (rssi_lv == 4) else if (rssi_lv == 4)
ra_mask_bitmap &= 0xffffffffffff8f80; ra_mask_bitmap &= 0xffffffffffff8f80ull;
else if (rssi_lv >= 5) 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); PHYDM_DBG(dm, DBG_RA, "Mod by RSSI=0x%llx\n", ra_mask_bitmap);

View File

@ -975,10 +975,10 @@ struct macid_ctl_t {
#define RATE_BMP_GET_HT_4SS(_bmp_ht) ((_bmp_ht & RATE_BMP_HT_4SS) >> 24) #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 */ /* used for rf_ctl_t.rate_bmp_vht_by_bw */
#define RATE_BMP_VHT_1SS 0x00000003FF #define RATE_BMP_VHT_1SS 0x00000003FFull
#define RATE_BMP_VHT_2SS 0x00000FFC00 #define RATE_BMP_VHT_2SS 0x00000FFC00ull
#define RATE_BMP_VHT_3SS 0x003FF00000 #define RATE_BMP_VHT_3SS 0x003FF00000ull
#define RATE_BMP_VHT_4SS 0xFFC0000000 #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_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_2SS(_bmp_vht) (_bmp_vht & RATE_BMP_VHT_2SS)
#define RATE_BMP_HAS_VHT_3SS(_bmp_vht) (_bmp_vht & RATE_BMP_VHT_3SS) #define RATE_BMP_HAS_VHT_3SS(_bmp_vht) (_bmp_vht & RATE_BMP_VHT_3SS)

View File

@ -49,8 +49,8 @@ enum security_type {
#define IEEE80211W_WRONG_KEY 0x1 #define IEEE80211W_WRONG_KEY 0x1
#define IEEE80211W_NO_KEY 0x2 #define IEEE80211W_NO_KEY 0x2
#define CCMPH_2_PN(ch) ((ch) & 0x000000000000ffff) \ #define CCMPH_2_PN(ch) ((ch) & 0x000000000000ffffull) \
| (((ch) & 0xffffffff00000000) >> 16) | (((ch) & 0xffffffff00000000ull) >> 16)
#define is_wep_enc(alg) (((alg) == _WEP40_) || ((alg) == _WEP104_)) #define is_wep_enc(alg) (((alg) == _WEP40_) || ((alg) == _WEP104_))