@@ -31,15 +31,14 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
31
31
struct sk_buff * skb ;
32
32
struct ieee80211_rx_status * rx_status ;
33
33
struct ieee80211_hdr * hdr ;
34
+ struct vnt_rx_header * head ;
34
35
__le16 fc ;
35
36
u8 * rsr , * new_rsr , * rssi ;
36
37
__le64 * tsf_time ;
37
38
u32 frame_size ;
38
39
int ii ;
39
40
u8 * sq , * sq_3 ;
40
- u32 wbk_status ;
41
41
u8 * skb_data ;
42
- u16 * pay_load_len ;
43
42
u16 rx_bitrate , pay_load_with_padding ;
44
43
u8 rate_idx = 0 ;
45
44
long rx_dbm ;
@@ -48,8 +47,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
48
47
rx_status = IEEE80211_SKB_RXCB (skb );
49
48
50
49
/* [31:16]RcvByteCount ( not include 4-byte Status ) */
51
- wbk_status = * (( u32 * )( skb -> data )) ;
52
- frame_size = wbk_status >> 16 ;
50
+ head = ( struct vnt_rx_header * ) skb -> data ;
51
+ frame_size = head -> wbk_status >> 16 ;
53
52
frame_size += 4 ;
54
53
55
54
if (bytes_received != frame_size ) {
@@ -70,19 +69,17 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
70
69
71
70
/* if SQ3 the range is 24~27, if no SQ3 the range is 20~23 */
72
71
73
- pay_load_len = (u16 * )(skb_data + 6 );
74
-
75
72
/*Fix hardware bug => PLCP_Length error */
76
- if (((bytes_received - ( * pay_load_len ) ) > 27 ) ||
77
- ((bytes_received - ( * pay_load_len ) ) < 24 ) ||
78
- (bytes_received < ( * pay_load_len ) )) {
73
+ if (((bytes_received - head -> pay_load_len ) > 27 ) ||
74
+ ((bytes_received - head -> pay_load_len ) < 24 ) ||
75
+ (bytes_received < head -> pay_load_len )) {
79
76
dev_dbg (& priv -> usb -> dev , "Wrong PLCP Length %x\n" ,
80
- * pay_load_len );
77
+ head -> pay_load_len );
81
78
return false;
82
79
}
83
80
84
81
sband = hw -> wiphy -> bands [hw -> conf .chandef .chan -> band ];
85
- rx_bitrate = * ( skb_data + 5 ) * 5 ; /* rx_rate * 5 */
82
+ rx_bitrate = head -> rx_rate * 5 ; /* rx_rate * 5 */
86
83
87
84
for (ii = 0 ; ii < sband -> n_bitrates ; ii ++ ) {
88
85
if (sband -> bitrates [ii ].bitrate == rx_bitrate ) {
@@ -96,8 +93,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
96
93
return false;
97
94
}
98
95
99
- pay_load_with_padding = ((* pay_load_len / 4 ) +
100
- ((* pay_load_len % 4 ) ? 1 : 0 )) * 4 ;
96
+ pay_load_with_padding = ((head -> pay_load_len / 4 ) +
97
+ ((head -> pay_load_len % 4 ) ? 1 : 0 )) * 4 ;
101
98
102
99
tsf_time = (__le64 * )(skb_data + 8 + pay_load_with_padding );
103
100
@@ -118,15 +115,13 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
118
115
if (* rsr & (RSR_IVLDTYP | RSR_IVLDLEN ))
119
116
return false;
120
117
121
- frame_size = * pay_load_len ;
122
-
123
118
vnt_rf_rssi_to_dbm (priv , * rssi , & rx_dbm );
124
119
125
120
priv -> bb_pre_ed_rssi = (u8 )rx_dbm + 1 ;
126
121
priv -> current_rssi = priv -> bb_pre_ed_rssi ;
127
122
128
- skb_pull (skb , 8 );
129
- skb_trim (skb , frame_size );
123
+ skb_pull (skb , sizeof ( * head ) );
124
+ skb_trim (skb , head -> pay_load_len );
130
125
131
126
rx_status -> mactime = priv -> tsf_time ;
132
127
rx_status -> band = hw -> conf .chandef .chan -> band ;
0 commit comments