@@ -75,9 +75,6 @@ static void tx_policy_build(const struct cw1200_common *priv,
7575 BUG_ON (rates [0 ].idx < 0 );
7676 memset (policy , 0 , sizeof (* policy ));
7777
78- /* minstrel is buggy a little bit, so distille
79- * incoming rates first. */
80-
8178 /* Sort rates in descending order. */
8279 for (i = 1 ; i < count ; ++ i ) {
8380 if (rates [i ].idx < 0 ) {
@@ -108,7 +105,8 @@ static void tx_policy_build(const struct cw1200_common *priv,
108105 count = i + 1 ;
109106
110107 /* Re-fill policy trying to keep every requested rate and with
111- * respect to the global max tx retransmission count. */
108+ * respect to the global max tx retransmission count.
109+ */
112110 if (limit < count )
113111 limit = count ;
114112 if (total > limit ) {
@@ -129,7 +127,6 @@ static void tx_policy_build(const struct cw1200_common *priv,
129127 if (count == 2 && !(rates [0 ].flags & IEEE80211_TX_RC_MCS ) &&
130128 rates [0 ].idx > 4 && rates [0 ].count > 2 &&
131129 rates [1 ].idx < 2 ) {
132- /* ">> 1" is an equivalent of "/ 2", but faster */
133130 int mid_rate = (rates [0 ].idx + 4 ) >> 1 ;
134131
135132 /* Decrease number of retries for the initial rate */
@@ -151,7 +148,8 @@ static void tx_policy_build(const struct cw1200_common *priv,
151148 /* Fallback to 1 Mbps is a really bad thing,
152149 * so let's try to increase probability of
153150 * successful transmission on the lowest g rate
154- * even more */
151+ * even more
152+ */
155153 if (rates [0 ].count >= 3 ) {
156154 -- rates [0 ].count ;
157155 ++ rates [2 ].count ;
@@ -220,7 +218,8 @@ static int tx_policy_find(struct tx_policy_cache *cache,
220218{
221219 /* O(n) complexity. Not so good, but there's only 8 entries in
222220 * the cache.
223- * Also lru helps to reduce search time. */
221+ * Also lru helps to reduce search time.
222+ */
224223 struct tx_policy_cache_entry * it ;
225224 /* First search for policy in "used" list */
226225 list_for_each_entry (it , & cache -> used , link ) {
@@ -264,7 +263,8 @@ void tx_policy_clean(struct cw1200_common *priv)
264263 for (idx = 0 ; idx < TX_POLICY_CACHE_SIZE ; idx ++ ) {
265264 entry = & cache -> cache [idx ];
266265 /* Policy usage count should be 0 at this time as all queues
267- should be empty */
266+ should be empty
267+ */
268268 if (WARN_ON (entry -> policy .usage_count )) {
269269 entry -> policy .usage_count = 0 ;
270270 list_move (& entry -> link , & cache -> free );
@@ -319,7 +319,8 @@ static int tx_policy_get(struct cw1200_common *priv,
319319 struct tx_policy_cache_entry * entry ;
320320 * renew = true;
321321 /* If policy is not found create a new one
322- * using the oldest entry in "free" list */
322+ * using the oldest entry in "free" list
323+ */
323324 entry = list_entry (cache -> free .prev ,
324325 struct tx_policy_cache_entry , link );
325326 entry -> policy = wanted ;
@@ -612,7 +613,8 @@ cw1200_tx_h_bt(struct cw1200_common *priv,
612613 priv -> listen_interval ,
613614 mgt_frame -> u .assoc_req .listen_interval );
614615 /* Replace listen interval derieved from
615- * the one read from SDD */
616+ * the one read from SDD
617+ */
616618 mgt_frame -> u .assoc_req .listen_interval =
617619 priv -> listen_interval ;
618620 }
@@ -667,7 +669,8 @@ cw1200_tx_h_rate_policy(struct cw1200_common *priv,
667669 pr_debug ("[TX] TX policy renew.\n" );
668670 /* It's not so optimal to stop TX queues every now and then.
669671 * Better to reimplement task scheduling with
670- * a counter. TODO. */
672+ * a counter. TODO.
673+ */
671674 wsm_lock_tx_async (priv );
672675 cw1200_tx_queues_lock (priv );
673676 if (queue_work (priv -> workqueue ,
@@ -832,8 +835,7 @@ static int cw1200_handle_pspoll(struct cw1200_common *priv,
832835 priv -> pspoll_mask |= pspoll_mask ;
833836 drop = 0 ;
834837
835- /* Do not report pspols if data for given link id is
836- * queued already. */
838+ /* Do not report pspols if data for given link id is queued already. */
837839 for (i = 0 ; i < 4 ; ++ i ) {
838840 if (cw1200_queue_get_num_queued (& priv -> tx_queue [i ],
839841 pspoll_mask )) {
@@ -924,7 +926,8 @@ void cw1200_tx_confirm_cb(struct cw1200_common *priv,
924926 cw1200_debug_txed (priv );
925927 if (arg -> flags & WSM_TX_STATUS_AGGREGATION ) {
926928 /* Do not report aggregation to mac80211:
927- * it confuses minstrel a lot. */
929+ * it confuses minstrel a lot.
930+ */
928931 /* tx->flags |= IEEE80211_TX_STAT_AMPDU; */
929932 cw1200_debug_txed_agg (priv );
930933 }
@@ -1044,7 +1047,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
10441047 ieee80211_is_action (frame -> frame_control ) &&
10451048 (mgmt -> u .action .category == WLAN_CATEGORY_PUBLIC )) {
10461049 /* Link ID already exists for the ACTION frame.
1047- * Reset and Remap */
1050+ * Reset and Remap
1051+ */
10481052 WARN_ON (work_pending (& priv -> linkid_reset_work ));
10491053 memcpy (& priv -> action_frame_sa [0 ],
10501054 ieee80211_get_SA (frame ), ETH_ALEN );
@@ -1074,7 +1078,6 @@ void cw1200_rx_cb(struct cw1200_common *priv,
10741078 if (cw1200_handle_pspoll (priv , skb ))
10751079 goto drop ;
10761080
1077- hdr -> mactime = 0 ; /* Not supported by WSM */
10781081 hdr -> band = ((arg -> channel_number & 0xff00 ) ||
10791082 (arg -> channel_number > 14 )) ?
10801083 IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ ;
@@ -1102,7 +1105,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
11021105 hdr -> flag |= RX_FLAG_DECRYPTED | RX_FLAG_IV_STRIPPED ;
11031106
11041107 /* Oops... There is no fast way to ask mac80211 about
1105- * IV/ICV lengths. Even defineas are not exposed.*/
1108+ * IV/ICV lengths. Even defineas are not exposed.
1109+ */
11061110 switch (WSM_RX_STATUS_ENCRYPTION (arg -> flags )) {
11071111 case WSM_RX_STATUS_WEP :
11081112 iv_len = 4 /* WEP_IV_LEN */ ;
@@ -1149,6 +1153,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
11491153 hdr -> mactime = le64_to_cpu (hdr -> mactime );
11501154 if (skb -> len >= 8 )
11511155 skb_trim (skb , skb -> len - 8 );
1156+ } else {
1157+ hdr -> mactime = 0 ;
11521158 }
11531159
11541160 cw1200_debug_rxed (priv );
@@ -1192,7 +1198,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
11921198
11931199 /* Stay awake after frame is received to give
11941200 * userspace chance to react and acquire appropriate
1195- * wakelock. */
1201+ * wakelock.
1202+ */
11961203 if (ieee80211_is_auth (frame -> frame_control ))
11971204 grace_period = 5 * HZ ;
11981205 else if (ieee80211_is_deauth (frame -> frame_control ))
0 commit comments