aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-05-05 15:12:36 -0700
committerGuy Harris <guy@alum.mit.edu>2017-05-05 22:13:28 +0000
commit3ef57b9ea2da5c122c66a62649d2b76b0592002c (patch)
tree636807521e231ae2d16a59ff5d3a2b4a5a96168c /wiretap
parent0d368850aebe054b66959975df4ddbbad58a37a9 (diff)
Small cleanups.
Add some parentheses to make an expression clearer to people who haven't memorized the table of C operator precedences. Don't fiddle the nss variable in place; explicitly combine it with the IS_TX value when we put it in the header, to make it clearer what's in that header byte. Change-Id: I870b892fb9dab2bc210956f923e0183f4e147989 Reviewed-on: https://code.wireshark.org/review/21530 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/vwr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/wiretap/vwr.c b/wiretap/vwr.c
index b9ad67fb0a..d3393da25c 100644
--- a/wiretap/vwr.c
+++ b/wiretap/vwr.c
@@ -554,7 +554,7 @@
* 1 to it.
*/
#define vVW510021_W_S3_MCS_INDEX_VHT(l1p_1) ((l1p_1) & 0x0f) /* MCS index */
-#define vVW510021_W_S3_NSS_VHT(l1p_1) (((l1p_1) >> 4 & 0x3) + 1) /* NSS */
+#define vVW510021_W_S3_NSS_VHT(l1p_1) ((((l1p_1) >> 4) & 0x03) + 1) /* NSS */
/* L1p byte 2 info */
@@ -2155,8 +2155,6 @@ static gboolean vwr_read_s3_W_rec(vwr_t *vwr, struct wtap_pkthdr *phdr,
}
}
- nss = nss << 4;
- nss |= IS_TX;
port_type = IS_TX << 4;
/*
@@ -2423,7 +2421,7 @@ static gboolean vwr_read_s3_W_rec(vwr_t *vwr, struct wtap_pkthdr *phdr,
data_ptr[bytes_written] = l1p_1;
bytes_written += 1;
- data_ptr[bytes_written] = nss;
+ data_ptr[bytes_written] = (nss << 4) | IS_TX;
bytes_written += 1;
phtoles(&data_ptr[bytes_written], phyRate); /* To dosplay Data rate based on the PLCP type & MCS*/