iwl-rx.c 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved.
  4. *
  5. * Portions of this file are derived from the ipw3945 project, as well
  6. * as portions of the ieee80211 subsystem header files.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of version 2 of the GNU General Public License as
  10. * published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along with
  18. * this program; if not, write to the Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  20. *
  21. * The full GNU General Public License is included in this distribution in the
  22. * file called LICENSE.
  23. *
  24. * Contact Information:
  25. * Intel Linux Wireless <ilw@linux.intel.com>
  26. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  27. *
  28. *****************************************************************************/
  29. #include <linux/etherdevice.h>
  30. #include <linux/slab.h>
  31. #include <linux/sched.h>
  32. #include <net/mac80211.h>
  33. #include <asm/unaligned.h>
  34. #include "iwl-eeprom.h"
  35. #include "iwl-dev.h"
  36. #include "iwl-core.h"
  37. #include "iwl-sta.h"
  38. #include "iwl-io.h"
  39. #include "iwl-helpers.h"
  40. #include "iwl-agn-calib.h"
  41. #include "iwl-agn.h"
  42. /******************************************************************************
  43. *
  44. * Generic RX handler implementations
  45. *
  46. ******************************************************************************/
  47. static void iwl_rx_reply_error(struct iwl_priv *priv,
  48. struct iwl_rx_mem_buffer *rxb)
  49. {
  50. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  51. IWL_ERR(priv, "Error Reply type 0x%08X cmd %s (0x%02X) "
  52. "seq 0x%04X ser 0x%08X\n",
  53. le32_to_cpu(pkt->u.err_resp.error_type),
  54. get_cmd_string(pkt->u.err_resp.cmd_id),
  55. pkt->u.err_resp.cmd_id,
  56. le16_to_cpu(pkt->u.err_resp.bad_cmd_seq_num),
  57. le32_to_cpu(pkt->u.err_resp.error_info));
  58. }
  59. static void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
  60. {
  61. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  62. struct iwl_csa_notification *csa = &(pkt->u.csa_notif);
  63. /*
  64. * MULTI-FIXME
  65. * See iwl_mac_channel_switch.
  66. */
  67. struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
  68. struct iwl_rxon_cmd *rxon = (void *)&ctx->active;
  69. if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
  70. return;
  71. if (!le32_to_cpu(csa->status) && csa->channel == priv->switch_channel) {
  72. rxon->channel = csa->channel;
  73. ctx->staging.channel = csa->channel;
  74. IWL_DEBUG_11H(priv, "CSA notif: channel %d\n",
  75. le16_to_cpu(csa->channel));
  76. iwl_chswitch_done(priv, true);
  77. } else {
  78. IWL_ERR(priv, "CSA notif (fail) : channel %d\n",
  79. le16_to_cpu(csa->channel));
  80. iwl_chswitch_done(priv, false);
  81. }
  82. }
  83. static void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv,
  84. struct iwl_rx_mem_buffer *rxb)
  85. {
  86. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  87. struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif);
  88. if (!report->state) {
  89. IWL_DEBUG_11H(priv,
  90. "Spectrum Measure Notification: Start\n");
  91. return;
  92. }
  93. memcpy(&priv->measure_report, report, sizeof(*report));
  94. priv->measurement_status |= MEASUREMENT_READY;
  95. }
  96. static void iwl_rx_pm_sleep_notif(struct iwl_priv *priv,
  97. struct iwl_rx_mem_buffer *rxb)
  98. {
  99. #ifdef CONFIG_IWLWIFI_DEBUG
  100. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  101. struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif);
  102. IWL_DEBUG_RX(priv, "sleep mode: %d, src: %d\n",
  103. sleep->pm_sleep_mode, sleep->pm_wakeup_src);
  104. #endif
  105. }
  106. static void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
  107. struct iwl_rx_mem_buffer *rxb)
  108. {
  109. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  110. u32 len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
  111. IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled "
  112. "notification for %s:\n", len,
  113. get_cmd_string(pkt->hdr.cmd));
  114. iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, len);
  115. }
  116. static void iwl_rx_beacon_notif(struct iwl_priv *priv,
  117. struct iwl_rx_mem_buffer *rxb)
  118. {
  119. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  120. struct iwlagn_beacon_notif *beacon = (void *)pkt->u.raw;
  121. #ifdef CONFIG_IWLWIFI_DEBUG
  122. u16 status = le16_to_cpu(beacon->beacon_notify_hdr.status.status);
  123. u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags);
  124. IWL_DEBUG_RX(priv, "beacon status %#x, retries:%d ibssmgr:%d "
  125. "tsf:0x%.8x%.8x rate:%d\n",
  126. status & TX_STATUS_MSK,
  127. beacon->beacon_notify_hdr.failure_frame,
  128. le32_to_cpu(beacon->ibss_mgr_status),
  129. le32_to_cpu(beacon->high_tsf),
  130. le32_to_cpu(beacon->low_tsf), rate);
  131. #endif
  132. priv->ibss_manager = le32_to_cpu(beacon->ibss_mgr_status);
  133. if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
  134. queue_work(priv->workqueue, &priv->beacon_update);
  135. }
  136. /* the threshold ratio of actual_ack_cnt to expected_ack_cnt in percent */
  137. #define ACK_CNT_RATIO (50)
  138. #define BA_TIMEOUT_CNT (5)
  139. #define BA_TIMEOUT_MAX (16)
  140. /**
  141. * iwl_good_ack_health - checks for ACK count ratios, BA timeout retries.
  142. *
  143. * When the ACK count ratio is low and aggregated BA timeout retries exceeding
  144. * the BA_TIMEOUT_MAX, reload firmware and bring system back to normal
  145. * operation state.
  146. */
  147. static bool iwl_good_ack_health(struct iwl_priv *priv,
  148. struct statistics_tx *cur)
  149. {
  150. int actual_delta, expected_delta, ba_timeout_delta;
  151. struct statistics_tx *old;
  152. if (priv->agg_tids_count)
  153. return true;
  154. old = &priv->statistics.tx;
  155. actual_delta = le32_to_cpu(cur->actual_ack_cnt) -
  156. le32_to_cpu(old->actual_ack_cnt);
  157. expected_delta = le32_to_cpu(cur->expected_ack_cnt) -
  158. le32_to_cpu(old->expected_ack_cnt);
  159. /* Values should not be negative, but we do not trust the firmware */
  160. if (actual_delta <= 0 || expected_delta <= 0)
  161. return true;
  162. ba_timeout_delta = le32_to_cpu(cur->agg.ba_timeout) -
  163. le32_to_cpu(old->agg.ba_timeout);
  164. if ((actual_delta * 100 / expected_delta) < ACK_CNT_RATIO &&
  165. ba_timeout_delta > BA_TIMEOUT_CNT) {
  166. IWL_DEBUG_RADIO(priv, "deltas: actual %d expected %d ba_timeout %d\n",
  167. actual_delta, expected_delta, ba_timeout_delta);
  168. #ifdef CONFIG_IWLWIFI_DEBUGFS
  169. /*
  170. * This is ifdef'ed on DEBUGFS because otherwise the
  171. * statistics aren't available. If DEBUGFS is set but
  172. * DEBUG is not, these will just compile out.
  173. */
  174. IWL_DEBUG_RADIO(priv, "rx_detected_cnt delta %d\n",
  175. priv->delta_stats.tx.rx_detected_cnt);
  176. IWL_DEBUG_RADIO(priv,
  177. "ack_or_ba_timeout_collision delta %d\n",
  178. priv->delta_stats.tx.ack_or_ba_timeout_collision);
  179. #endif
  180. if (ba_timeout_delta >= BA_TIMEOUT_MAX)
  181. return false;
  182. }
  183. return true;
  184. }
  185. /**
  186. * iwl_good_plcp_health - checks for plcp error.
  187. *
  188. * When the plcp error is exceeding the thresholds, reset the radio
  189. * to improve the throughput.
  190. */
  191. static bool iwl_good_plcp_health(struct iwl_priv *priv,
  192. struct statistics_rx_phy *cur_ofdm,
  193. struct statistics_rx_ht_phy *cur_ofdm_ht,
  194. unsigned int msecs)
  195. {
  196. int delta;
  197. int threshold = priv->cfg->base_params->plcp_delta_threshold;
  198. if (threshold == IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE) {
  199. IWL_DEBUG_RADIO(priv, "plcp_err check disabled\n");
  200. return true;
  201. }
  202. delta = le32_to_cpu(cur_ofdm->plcp_err) -
  203. le32_to_cpu(priv->statistics.rx_ofdm.plcp_err) +
  204. le32_to_cpu(cur_ofdm_ht->plcp_err) -
  205. le32_to_cpu(priv->statistics.rx_ofdm_ht.plcp_err);
  206. /* Can be negative if firmware reset statistics */
  207. if (delta <= 0)
  208. return true;
  209. if ((delta * 100 / msecs) > threshold) {
  210. IWL_DEBUG_RADIO(priv,
  211. "plcp health threshold %u delta %d msecs %u\n",
  212. threshold, delta, msecs);
  213. return false;
  214. }
  215. return true;
  216. }
  217. static void iwl_recover_from_statistics(struct iwl_priv *priv,
  218. struct statistics_rx_phy *cur_ofdm,
  219. struct statistics_rx_ht_phy *cur_ofdm_ht,
  220. struct statistics_tx *tx,
  221. unsigned long stamp)
  222. {
  223. unsigned int msecs;
  224. if (test_bit(STATUS_EXIT_PENDING, &priv->status))
  225. return;
  226. msecs = jiffies_to_msecs(stamp - priv->rx_statistics_jiffies);
  227. /* Only gather statistics and update time stamp when not associated */
  228. if (!iwl_is_any_associated(priv))
  229. return;
  230. /* Do not check/recover when do not have enough statistics data */
  231. if (msecs < 99)
  232. return;
  233. if (iwlagn_mod_params.ack_check && !iwl_good_ack_health(priv, tx)) {
  234. IWL_ERR(priv, "low ack count detected, restart firmware\n");
  235. if (!iwl_force_reset(priv, IWL_FW_RESET, false))
  236. return;
  237. }
  238. if (iwlagn_mod_params.plcp_check &&
  239. !iwl_good_plcp_health(priv, cur_ofdm, cur_ofdm_ht, msecs))
  240. iwl_force_reset(priv, IWL_RF_RESET, false);
  241. }
  242. /* Calculate noise level, based on measurements during network silence just
  243. * before arriving beacon. This measurement can be done only if we know
  244. * exactly when to expect beacons, therefore only when we're associated. */
  245. static void iwl_rx_calc_noise(struct iwl_priv *priv)
  246. {
  247. struct statistics_rx_non_phy *rx_info;
  248. int num_active_rx = 0;
  249. int total_silence = 0;
  250. int bcn_silence_a, bcn_silence_b, bcn_silence_c;
  251. int last_rx_noise;
  252. rx_info = &priv->statistics.rx_non_phy;
  253. bcn_silence_a =
  254. le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER;
  255. bcn_silence_b =
  256. le32_to_cpu(rx_info->beacon_silence_rssi_b) & IN_BAND_FILTER;
  257. bcn_silence_c =
  258. le32_to_cpu(rx_info->beacon_silence_rssi_c) & IN_BAND_FILTER;
  259. if (bcn_silence_a) {
  260. total_silence += bcn_silence_a;
  261. num_active_rx++;
  262. }
  263. if (bcn_silence_b) {
  264. total_silence += bcn_silence_b;
  265. num_active_rx++;
  266. }
  267. if (bcn_silence_c) {
  268. total_silence += bcn_silence_c;
  269. num_active_rx++;
  270. }
  271. /* Average among active antennas */
  272. if (num_active_rx)
  273. last_rx_noise = (total_silence / num_active_rx) - 107;
  274. else
  275. last_rx_noise = IWL_NOISE_MEAS_NOT_AVAILABLE;
  276. IWL_DEBUG_CALIB(priv, "inband silence a %u, b %u, c %u, dBm %d\n",
  277. bcn_silence_a, bcn_silence_b, bcn_silence_c,
  278. last_rx_noise);
  279. }
  280. #ifdef CONFIG_IWLWIFI_DEBUGFS
  281. /*
  282. * based on the assumption of all statistics counter are in DWORD
  283. * FIXME: This function is for debugging, do not deal with
  284. * the case of counters roll-over.
  285. */
  286. static void accum_stats(__le32 *prev, __le32 *cur, __le32 *delta,
  287. __le32 *max_delta, __le32 *accum, int size)
  288. {
  289. int i;
  290. for (i = 0;
  291. i < size / sizeof(__le32);
  292. i++, prev++, cur++, delta++, max_delta++, accum++) {
  293. if (le32_to_cpu(*cur) > le32_to_cpu(*prev)) {
  294. *delta = cpu_to_le32(
  295. le32_to_cpu(*cur) - le32_to_cpu(*prev));
  296. le32_add_cpu(accum, le32_to_cpu(*delta));
  297. if (le32_to_cpu(*delta) > le32_to_cpu(*max_delta))
  298. *max_delta = *delta;
  299. }
  300. }
  301. }
  302. static void
  303. iwl_accumulative_statistics(struct iwl_priv *priv,
  304. struct statistics_general_common *common,
  305. struct statistics_rx_non_phy *rx_non_phy,
  306. struct statistics_rx_phy *rx_ofdm,
  307. struct statistics_rx_ht_phy *rx_ofdm_ht,
  308. struct statistics_rx_phy *rx_cck,
  309. struct statistics_tx *tx,
  310. struct statistics_bt_activity *bt_activity)
  311. {
  312. #define ACCUM(_name) \
  313. accum_stats((__le32 *)&priv->statistics._name, \
  314. (__le32 *)_name, \
  315. (__le32 *)&priv->delta_stats._name, \
  316. (__le32 *)&priv->max_delta_stats._name, \
  317. (__le32 *)&priv->accum_stats._name, \
  318. sizeof(*_name));
  319. ACCUM(common);
  320. ACCUM(rx_non_phy);
  321. ACCUM(rx_ofdm);
  322. ACCUM(rx_ofdm_ht);
  323. ACCUM(rx_cck);
  324. ACCUM(tx);
  325. if (bt_activity)
  326. ACCUM(bt_activity);
  327. #undef ACCUM
  328. }
  329. #else
  330. static inline void
  331. iwl_accumulative_statistics(struct iwl_priv *priv,
  332. struct statistics_general_common *common,
  333. struct statistics_rx_non_phy *rx_non_phy,
  334. struct statistics_rx_phy *rx_ofdm,
  335. struct statistics_rx_ht_phy *rx_ofdm_ht,
  336. struct statistics_rx_phy *rx_cck,
  337. struct statistics_tx *tx,
  338. struct statistics_bt_activity *bt_activity)
  339. {
  340. }
  341. #endif
  342. static void iwl_rx_statistics(struct iwl_priv *priv,
  343. struct iwl_rx_mem_buffer *rxb)
  344. {
  345. unsigned long stamp = jiffies;
  346. const int reg_recalib_period = 60;
  347. int change;
  348. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  349. u32 len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
  350. __le32 *flag;
  351. struct statistics_general_common *common;
  352. struct statistics_rx_non_phy *rx_non_phy;
  353. struct statistics_rx_phy *rx_ofdm;
  354. struct statistics_rx_ht_phy *rx_ofdm_ht;
  355. struct statistics_rx_phy *rx_cck;
  356. struct statistics_tx *tx;
  357. struct statistics_bt_activity *bt_activity;
  358. len -= sizeof(struct iwl_cmd_header); /* skip header */
  359. IWL_DEBUG_RX(priv, "Statistics notification received (%d bytes).\n",
  360. len);
  361. if (len == sizeof(struct iwl_bt_notif_statistics)) {
  362. struct iwl_bt_notif_statistics *stats;
  363. stats = &pkt->u.stats_bt;
  364. flag = &stats->flag;
  365. common = &stats->general.common;
  366. rx_non_phy = &stats->rx.general.common;
  367. rx_ofdm = &stats->rx.ofdm;
  368. rx_ofdm_ht = &stats->rx.ofdm_ht;
  369. rx_cck = &stats->rx.cck;
  370. tx = &stats->tx;
  371. bt_activity = &stats->general.activity;
  372. #ifdef CONFIG_IWLWIFI_DEBUGFS
  373. /* handle this exception directly */
  374. priv->statistics.num_bt_kills = stats->rx.general.num_bt_kills;
  375. le32_add_cpu(&priv->statistics.accum_num_bt_kills,
  376. le32_to_cpu(stats->rx.general.num_bt_kills));
  377. #endif
  378. } else if (len == sizeof(struct iwl_notif_statistics)) {
  379. struct iwl_notif_statistics *stats;
  380. stats = &pkt->u.stats;
  381. flag = &stats->flag;
  382. common = &stats->general.common;
  383. rx_non_phy = &stats->rx.general;
  384. rx_ofdm = &stats->rx.ofdm;
  385. rx_ofdm_ht = &stats->rx.ofdm_ht;
  386. rx_cck = &stats->rx.cck;
  387. tx = &stats->tx;
  388. bt_activity = NULL;
  389. } else {
  390. WARN_ONCE(1, "len %d doesn't match BT (%zu) or normal (%zu)\n",
  391. len, sizeof(struct iwl_bt_notif_statistics),
  392. sizeof(struct iwl_notif_statistics));
  393. return;
  394. }
  395. change = common->temperature != priv->statistics.common.temperature ||
  396. (*flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK) !=
  397. (priv->statistics.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK);
  398. iwl_accumulative_statistics(priv, common, rx_non_phy, rx_ofdm,
  399. rx_ofdm_ht, rx_cck, tx, bt_activity);
  400. iwl_recover_from_statistics(priv, rx_ofdm, rx_ofdm_ht, tx, stamp);
  401. priv->statistics.flag = *flag;
  402. memcpy(&priv->statistics.common, common, sizeof(*common));
  403. memcpy(&priv->statistics.rx_non_phy, rx_non_phy, sizeof(*rx_non_phy));
  404. memcpy(&priv->statistics.rx_ofdm, rx_ofdm, sizeof(*rx_ofdm));
  405. memcpy(&priv->statistics.rx_ofdm_ht, rx_ofdm_ht, sizeof(*rx_ofdm_ht));
  406. memcpy(&priv->statistics.rx_cck, rx_cck, sizeof(*rx_cck));
  407. memcpy(&priv->statistics.tx, tx, sizeof(*tx));
  408. #ifdef CONFIG_IWLWIFI_DEBUGFS
  409. if (bt_activity)
  410. memcpy(&priv->statistics.bt_activity, bt_activity,
  411. sizeof(*bt_activity));
  412. #endif
  413. priv->rx_statistics_jiffies = stamp;
  414. set_bit(STATUS_STATISTICS, &priv->status);
  415. /* Reschedule the statistics timer to occur in
  416. * reg_recalib_period seconds to ensure we get a
  417. * thermal update even if the uCode doesn't give
  418. * us one */
  419. mod_timer(&priv->statistics_periodic, jiffies +
  420. msecs_to_jiffies(reg_recalib_period * 1000));
  421. if (unlikely(!test_bit(STATUS_SCANNING, &priv->status)) &&
  422. (pkt->hdr.cmd == STATISTICS_NOTIFICATION)) {
  423. iwl_rx_calc_noise(priv);
  424. queue_work(priv->workqueue, &priv->run_time_calib_work);
  425. }
  426. if (priv->cfg->lib->temperature && change)
  427. priv->cfg->lib->temperature(priv);
  428. }
  429. static void iwl_rx_reply_statistics(struct iwl_priv *priv,
  430. struct iwl_rx_mem_buffer *rxb)
  431. {
  432. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  433. if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATISTICS_CLEAR_MSK) {
  434. #ifdef CONFIG_IWLWIFI_DEBUGFS
  435. memset(&priv->accum_stats, 0,
  436. sizeof(priv->accum_stats));
  437. memset(&priv->delta_stats, 0,
  438. sizeof(priv->delta_stats));
  439. memset(&priv->max_delta_stats, 0,
  440. sizeof(priv->max_delta_stats));
  441. #endif
  442. IWL_DEBUG_RX(priv, "Statistics have been cleared\n");
  443. }
  444. iwl_rx_statistics(priv, rxb);
  445. }
  446. /* Handle notification from uCode that card's power state is changing
  447. * due to software, hardware, or critical temperature RFKILL */
  448. static void iwl_rx_card_state_notif(struct iwl_priv *priv,
  449. struct iwl_rx_mem_buffer *rxb)
  450. {
  451. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  452. u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags);
  453. unsigned long status = priv->status;
  454. IWL_DEBUG_RF_KILL(priv, "Card state received: HW:%s SW:%s CT:%s\n",
  455. (flags & HW_CARD_DISABLED) ? "Kill" : "On",
  456. (flags & SW_CARD_DISABLED) ? "Kill" : "On",
  457. (flags & CT_CARD_DISABLED) ?
  458. "Reached" : "Not reached");
  459. if (flags & (SW_CARD_DISABLED | HW_CARD_DISABLED |
  460. CT_CARD_DISABLED)) {
  461. iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
  462. CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
  463. iwl_write_direct32(priv, HBUS_TARG_MBX_C,
  464. HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED);
  465. if (!(flags & RXON_CARD_DISABLED)) {
  466. iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
  467. CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
  468. iwl_write_direct32(priv, HBUS_TARG_MBX_C,
  469. HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED);
  470. }
  471. if (flags & CT_CARD_DISABLED)
  472. iwl_tt_enter_ct_kill(priv);
  473. }
  474. if (!(flags & CT_CARD_DISABLED))
  475. iwl_tt_exit_ct_kill(priv);
  476. if (flags & HW_CARD_DISABLED)
  477. set_bit(STATUS_RF_KILL_HW, &priv->status);
  478. else
  479. clear_bit(STATUS_RF_KILL_HW, &priv->status);
  480. if (!(flags & RXON_CARD_DISABLED))
  481. iwl_scan_cancel(priv);
  482. if ((test_bit(STATUS_RF_KILL_HW, &status) !=
  483. test_bit(STATUS_RF_KILL_HW, &priv->status)))
  484. wiphy_rfkill_set_hw_state(priv->hw->wiphy,
  485. test_bit(STATUS_RF_KILL_HW, &priv->status));
  486. else
  487. wake_up_interruptible(&priv->wait_command_queue);
  488. }
  489. static void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,
  490. struct iwl_rx_mem_buffer *rxb)
  491. {
  492. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  493. struct iwl_missed_beacon_notif *missed_beacon;
  494. missed_beacon = &pkt->u.missed_beacon;
  495. if (le32_to_cpu(missed_beacon->consecutive_missed_beacons) >
  496. priv->missed_beacon_threshold) {
  497. IWL_DEBUG_CALIB(priv,
  498. "missed bcn cnsq %d totl %d rcd %d expctd %d\n",
  499. le32_to_cpu(missed_beacon->consecutive_missed_beacons),
  500. le32_to_cpu(missed_beacon->total_missed_becons),
  501. le32_to_cpu(missed_beacon->num_recvd_beacons),
  502. le32_to_cpu(missed_beacon->num_expected_beacons));
  503. if (!test_bit(STATUS_SCANNING, &priv->status))
  504. iwl_init_sensitivity(priv);
  505. }
  506. }
  507. /* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD).
  508. * This will be used later in iwl_rx_reply_rx() for REPLY_RX_MPDU_CMD. */
  509. static void iwl_rx_reply_rx_phy(struct iwl_priv *priv,
  510. struct iwl_rx_mem_buffer *rxb)
  511. {
  512. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  513. priv->last_phy_res_valid = true;
  514. memcpy(&priv->last_phy_res, pkt->u.raw,
  515. sizeof(struct iwl_rx_phy_res));
  516. }
  517. /*
  518. * returns non-zero if packet should be dropped
  519. */
  520. static int iwl_set_decrypted_flag(struct iwl_priv *priv,
  521. struct ieee80211_hdr *hdr,
  522. u32 decrypt_res,
  523. struct ieee80211_rx_status *stats)
  524. {
  525. u16 fc = le16_to_cpu(hdr->frame_control);
  526. /*
  527. * All contexts have the same setting here due to it being
  528. * a module parameter, so OK to check any context.
  529. */
  530. if (priv->contexts[IWL_RXON_CTX_BSS].active.filter_flags &
  531. RXON_FILTER_DIS_DECRYPT_MSK)
  532. return 0;
  533. if (!(fc & IEEE80211_FCTL_PROTECTED))
  534. return 0;
  535. IWL_DEBUG_RX(priv, "decrypt_res:0x%x\n", decrypt_res);
  536. switch (decrypt_res & RX_RES_STATUS_SEC_TYPE_MSK) {
  537. case RX_RES_STATUS_SEC_TYPE_TKIP:
  538. /* The uCode has got a bad phase 1 Key, pushes the packet.
  539. * Decryption will be done in SW. */
  540. if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
  541. RX_RES_STATUS_BAD_KEY_TTAK)
  542. break;
  543. case RX_RES_STATUS_SEC_TYPE_WEP:
  544. if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
  545. RX_RES_STATUS_BAD_ICV_MIC) {
  546. /* bad ICV, the packet is destroyed since the
  547. * decryption is inplace, drop it */
  548. IWL_DEBUG_RX(priv, "Packet destroyed\n");
  549. return -1;
  550. }
  551. case RX_RES_STATUS_SEC_TYPE_CCMP:
  552. if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
  553. RX_RES_STATUS_DECRYPT_OK) {
  554. IWL_DEBUG_RX(priv, "hw decrypt successfully!!!\n");
  555. stats->flag |= RX_FLAG_DECRYPTED;
  556. }
  557. break;
  558. default:
  559. break;
  560. }
  561. return 0;
  562. }
  563. static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv,
  564. struct ieee80211_hdr *hdr,
  565. u16 len,
  566. u32 ampdu_status,
  567. struct iwl_rx_mem_buffer *rxb,
  568. struct ieee80211_rx_status *stats)
  569. {
  570. struct sk_buff *skb;
  571. __le16 fc = hdr->frame_control;
  572. struct iwl_rxon_context *ctx;
  573. /* We only process data packets if the interface is open */
  574. if (unlikely(!priv->is_open)) {
  575. IWL_DEBUG_DROP_LIMIT(priv,
  576. "Dropping packet while interface is not open.\n");
  577. return;
  578. }
  579. /* In case of HW accelerated crypto and bad decryption, drop */
  580. if (!iwlagn_mod_params.sw_crypto &&
  581. iwl_set_decrypted_flag(priv, hdr, ampdu_status, stats))
  582. return;
  583. skb = dev_alloc_skb(128);
  584. if (!skb) {
  585. IWL_ERR(priv, "dev_alloc_skb failed\n");
  586. return;
  587. }
  588. skb_add_rx_frag(skb, 0, rxb->page, (void *)hdr - rxb_addr(rxb), len);
  589. iwl_update_stats(priv, false, fc, len);
  590. /*
  591. * Wake any queues that were stopped due to a passive channel tx
  592. * failure. This can happen because the regulatory enforcement in
  593. * the device waits for a beacon before allowing transmission,
  594. * sometimes even after already having transmitted frames for the
  595. * association because the new RXON may reset the information.
  596. */
  597. if (unlikely(ieee80211_is_beacon(fc))) {
  598. for_each_context(priv, ctx) {
  599. if (!ctx->last_tx_rejected)
  600. continue;
  601. if (compare_ether_addr(hdr->addr3,
  602. ctx->active.bssid_addr))
  603. continue;
  604. ctx->last_tx_rejected = false;
  605. iwl_wake_any_queue(priv, ctx);
  606. }
  607. }
  608. memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats));
  609. ieee80211_rx(priv->hw, skb);
  610. rxb->page = NULL;
  611. }
  612. static u32 iwl_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in)
  613. {
  614. u32 decrypt_out = 0;
  615. if ((decrypt_in & RX_RES_STATUS_STATION_FOUND) ==
  616. RX_RES_STATUS_STATION_FOUND)
  617. decrypt_out |= (RX_RES_STATUS_STATION_FOUND |
  618. RX_RES_STATUS_NO_STATION_INFO_MISMATCH);
  619. decrypt_out |= (decrypt_in & RX_RES_STATUS_SEC_TYPE_MSK);
  620. /* packet was not encrypted */
  621. if ((decrypt_in & RX_RES_STATUS_SEC_TYPE_MSK) ==
  622. RX_RES_STATUS_SEC_TYPE_NONE)
  623. return decrypt_out;
  624. /* packet was encrypted with unknown alg */
  625. if ((decrypt_in & RX_RES_STATUS_SEC_TYPE_MSK) ==
  626. RX_RES_STATUS_SEC_TYPE_ERR)
  627. return decrypt_out;
  628. /* decryption was not done in HW */
  629. if ((decrypt_in & RX_MPDU_RES_STATUS_DEC_DONE_MSK) !=
  630. RX_MPDU_RES_STATUS_DEC_DONE_MSK)
  631. return decrypt_out;
  632. switch (decrypt_in & RX_RES_STATUS_SEC_TYPE_MSK) {
  633. case RX_RES_STATUS_SEC_TYPE_CCMP:
  634. /* alg is CCM: check MIC only */
  635. if (!(decrypt_in & RX_MPDU_RES_STATUS_MIC_OK))
  636. /* Bad MIC */
  637. decrypt_out |= RX_RES_STATUS_BAD_ICV_MIC;
  638. else
  639. decrypt_out |= RX_RES_STATUS_DECRYPT_OK;
  640. break;
  641. case RX_RES_STATUS_SEC_TYPE_TKIP:
  642. if (!(decrypt_in & RX_MPDU_RES_STATUS_TTAK_OK)) {
  643. /* Bad TTAK */
  644. decrypt_out |= RX_RES_STATUS_BAD_KEY_TTAK;
  645. break;
  646. }
  647. /* fall through if TTAK OK */
  648. default:
  649. if (!(decrypt_in & RX_MPDU_RES_STATUS_ICV_OK))
  650. decrypt_out |= RX_RES_STATUS_BAD_ICV_MIC;
  651. else
  652. decrypt_out |= RX_RES_STATUS_DECRYPT_OK;
  653. break;
  654. }
  655. IWL_DEBUG_RX(priv, "decrypt_in:0x%x decrypt_out = 0x%x\n",
  656. decrypt_in, decrypt_out);
  657. return decrypt_out;
  658. }
  659. /* Calc max signal level (dBm) among 3 possible receivers */
  660. static int iwlagn_calc_rssi(struct iwl_priv *priv,
  661. struct iwl_rx_phy_res *rx_resp)
  662. {
  663. /* data from PHY/DSP regarding signal strength, etc.,
  664. * contents are always there, not configurable by host
  665. */
  666. struct iwlagn_non_cfg_phy *ncphy =
  667. (struct iwlagn_non_cfg_phy *)rx_resp->non_cfg_phy_buf;
  668. u32 val, rssi_a, rssi_b, rssi_c, max_rssi;
  669. u8 agc;
  670. val = le32_to_cpu(ncphy->non_cfg_phy[IWLAGN_RX_RES_AGC_IDX]);
  671. agc = (val & IWLAGN_OFDM_AGC_MSK) >> IWLAGN_OFDM_AGC_BIT_POS;
  672. /* Find max rssi among 3 possible receivers.
  673. * These values are measured by the digital signal processor (DSP).
  674. * They should stay fairly constant even as the signal strength varies,
  675. * if the radio's automatic gain control (AGC) is working right.
  676. * AGC value (see below) will provide the "interesting" info.
  677. */
  678. val = le32_to_cpu(ncphy->non_cfg_phy[IWLAGN_RX_RES_RSSI_AB_IDX]);
  679. rssi_a = (val & IWLAGN_OFDM_RSSI_INBAND_A_BITMSK) >>
  680. IWLAGN_OFDM_RSSI_A_BIT_POS;
  681. rssi_b = (val & IWLAGN_OFDM_RSSI_INBAND_B_BITMSK) >>
  682. IWLAGN_OFDM_RSSI_B_BIT_POS;
  683. val = le32_to_cpu(ncphy->non_cfg_phy[IWLAGN_RX_RES_RSSI_C_IDX]);
  684. rssi_c = (val & IWLAGN_OFDM_RSSI_INBAND_C_BITMSK) >>
  685. IWLAGN_OFDM_RSSI_C_BIT_POS;
  686. max_rssi = max_t(u32, rssi_a, rssi_b);
  687. max_rssi = max_t(u32, max_rssi, rssi_c);
  688. IWL_DEBUG_STATS(priv, "Rssi In A %d B %d C %d Max %d AGC dB %d\n",
  689. rssi_a, rssi_b, rssi_c, max_rssi, agc);
  690. /* dBm = max_rssi dB - agc dB - constant.
  691. * Higher AGC (higher radio gain) means lower signal. */
  692. return max_rssi - agc - IWLAGN_RSSI_OFFSET;
  693. }
  694. /* Called for REPLY_RX (legacy ABG frames), or
  695. * REPLY_RX_MPDU_CMD (HT high-throughput N frames). */
  696. static void iwl_rx_reply_rx(struct iwl_priv *priv,
  697. struct iwl_rx_mem_buffer *rxb)
  698. {
  699. struct ieee80211_hdr *header;
  700. struct ieee80211_rx_status rx_status;
  701. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  702. struct iwl_rx_phy_res *phy_res;
  703. __le32 rx_pkt_status;
  704. struct iwl_rx_mpdu_res_start *amsdu;
  705. u32 len;
  706. u32 ampdu_status;
  707. u32 rate_n_flags;
  708. /**
  709. * REPLY_RX and REPLY_RX_MPDU_CMD are handled differently.
  710. * REPLY_RX: physical layer info is in this buffer
  711. * REPLY_RX_MPDU_CMD: physical layer info was sent in separate
  712. * command and cached in priv->last_phy_res
  713. *
  714. * Here we set up local variables depending on which command is
  715. * received.
  716. */
  717. if (pkt->hdr.cmd == REPLY_RX) {
  718. phy_res = (struct iwl_rx_phy_res *)pkt->u.raw;
  719. header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*phy_res)
  720. + phy_res->cfg_phy_cnt);
  721. len = le16_to_cpu(phy_res->byte_count);
  722. rx_pkt_status = *(__le32 *)(pkt->u.raw + sizeof(*phy_res) +
  723. phy_res->cfg_phy_cnt + len);
  724. ampdu_status = le32_to_cpu(rx_pkt_status);
  725. } else {
  726. if (!priv->last_phy_res_valid) {
  727. IWL_ERR(priv, "MPDU frame without cached PHY data\n");
  728. return;
  729. }
  730. phy_res = &priv->last_phy_res;
  731. amsdu = (struct iwl_rx_mpdu_res_start *)pkt->u.raw;
  732. header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*amsdu));
  733. len = le16_to_cpu(amsdu->byte_count);
  734. rx_pkt_status = *(__le32 *)(pkt->u.raw + sizeof(*amsdu) + len);
  735. ampdu_status = iwl_translate_rx_status(priv,
  736. le32_to_cpu(rx_pkt_status));
  737. }
  738. if ((unlikely(phy_res->cfg_phy_cnt > 20))) {
  739. IWL_DEBUG_DROP(priv, "dsp size out of range [0,20]: %d/n",
  740. phy_res->cfg_phy_cnt);
  741. return;
  742. }
  743. if (!(rx_pkt_status & RX_RES_STATUS_NO_CRC32_ERROR) ||
  744. !(rx_pkt_status & RX_RES_STATUS_NO_RXE_OVERFLOW)) {
  745. IWL_DEBUG_RX(priv, "Bad CRC or FIFO: 0x%08X.\n",
  746. le32_to_cpu(rx_pkt_status));
  747. return;
  748. }
  749. /* This will be used in several places later */
  750. rate_n_flags = le32_to_cpu(phy_res->rate_n_flags);
  751. /* rx_status carries information about the packet to mac80211 */
  752. rx_status.mactime = le64_to_cpu(phy_res->timestamp);
  753. rx_status.band = (phy_res->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
  754. IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
  755. rx_status.freq =
  756. ieee80211_channel_to_frequency(le16_to_cpu(phy_res->channel),
  757. rx_status.band);
  758. rx_status.rate_idx =
  759. iwlagn_hwrate_to_mac80211_idx(rate_n_flags, rx_status.band);
  760. rx_status.flag = 0;
  761. /* TSF isn't reliable. In order to allow smooth user experience,
  762. * this W/A doesn't propagate it to the mac80211 */
  763. /*rx_status.flag |= RX_FLAG_MACTIME_MPDU;*/
  764. priv->ucode_beacon_time = le32_to_cpu(phy_res->beacon_time_stamp);
  765. /* Find max signal strength (dBm) among 3 antenna/receiver chains */
  766. rx_status.signal = iwlagn_calc_rssi(priv, phy_res);
  767. iwl_dbg_log_rx_data_frame(priv, len, header);
  768. IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, TSF %llu\n",
  769. rx_status.signal, (unsigned long long)rx_status.mactime);
  770. /*
  771. * "antenna number"
  772. *
  773. * It seems that the antenna field in the phy flags value
  774. * is actually a bit field. This is undefined by radiotap,
  775. * it wants an actual antenna number but I always get "7"
  776. * for most legacy frames I receive indicating that the
  777. * same frame was received on all three RX chains.
  778. *
  779. * I think this field should be removed in favor of a
  780. * new 802.11n radiotap field "RX chains" that is defined
  781. * as a bitmask.
  782. */
  783. rx_status.antenna =
  784. (le16_to_cpu(phy_res->phy_flags) & RX_RES_PHY_FLAGS_ANTENNA_MSK)
  785. >> RX_RES_PHY_FLAGS_ANTENNA_POS;
  786. /* set the preamble flag if appropriate */
  787. if (phy_res->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
  788. rx_status.flag |= RX_FLAG_SHORTPRE;
  789. /* Set up the HT phy flags */
  790. if (rate_n_flags & RATE_MCS_HT_MSK)
  791. rx_status.flag |= RX_FLAG_HT;
  792. if (rate_n_flags & RATE_MCS_HT40_MSK)
  793. rx_status.flag |= RX_FLAG_40MHZ;
  794. if (rate_n_flags & RATE_MCS_SGI_MSK)
  795. rx_status.flag |= RX_FLAG_SHORT_GI;
  796. iwl_pass_packet_to_mac80211(priv, header, len, ampdu_status,
  797. rxb, &rx_status);
  798. }
  799. /**
  800. * iwl_setup_rx_handlers - Initialize Rx handler callbacks
  801. *
  802. * Setup the RX handlers for each of the reply types sent from the uCode
  803. * to the host.
  804. */
  805. void iwl_setup_rx_handlers(struct iwl_priv *priv)
  806. {
  807. void (**handlers)(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb);
  808. handlers = priv->rx_handlers;
  809. handlers[REPLY_ERROR] = iwl_rx_reply_error;
  810. handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa;
  811. handlers[SPECTRUM_MEASURE_NOTIFICATION] = iwl_rx_spectrum_measure_notif;
  812. handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif;
  813. handlers[PM_DEBUG_STATISTIC_NOTIFIC] = iwl_rx_pm_debug_statistics_notif;
  814. handlers[BEACON_NOTIFICATION] = iwl_rx_beacon_notif;
  815. /*
  816. * The same handler is used for both the REPLY to a discrete
  817. * statistics request from the host as well as for the periodic
  818. * statistics notifications (after received beacons) from the uCode.
  819. */
  820. handlers[REPLY_STATISTICS_CMD] = iwl_rx_reply_statistics;
  821. handlers[STATISTICS_NOTIFICATION] = iwl_rx_statistics;
  822. iwl_setup_rx_scan_handlers(priv);
  823. handlers[CARD_STATE_NOTIFICATION] = iwl_rx_card_state_notif;
  824. handlers[MISSED_BEACONS_NOTIFICATION] = iwl_rx_missed_beacon_notif;
  825. /* Rx handlers */
  826. handlers[REPLY_RX_PHY_CMD] = iwl_rx_reply_rx_phy;
  827. handlers[REPLY_RX_MPDU_CMD] = iwl_rx_reply_rx;
  828. /* block ack */
  829. handlers[REPLY_COMPRESSED_BA] = iwlagn_rx_reply_compressed_ba;
  830. /* init calibration handlers */
  831. priv->rx_handlers[CALIBRATION_RES_NOTIFICATION] =
  832. iwlagn_rx_calib_result;
  833. priv->rx_handlers[REPLY_TX] = iwlagn_rx_reply_tx;
  834. /* set up notification wait support */
  835. spin_lock_init(&priv->notif_wait_lock);
  836. INIT_LIST_HEAD(&priv->notif_waits);
  837. init_waitqueue_head(&priv->notif_waitq);
  838. /* Set up BT Rx handlers */
  839. if (priv->cfg->lib->bt_rx_handler_setup)
  840. priv->cfg->lib->bt_rx_handler_setup(priv);
  841. }
  842. void iwl_rx_dispatch(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
  843. {
  844. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  845. /*
  846. * Do the notification wait before RX handlers so
  847. * even if the RX handler consumes the RXB we have
  848. * access to it in the notification wait entry.
  849. */
  850. if (!list_empty(&priv->notif_waits)) {
  851. struct iwl_notification_wait *w;
  852. spin_lock(&priv->notif_wait_lock);
  853. list_for_each_entry(w, &priv->notif_waits, list) {
  854. if (w->cmd != pkt->hdr.cmd)
  855. continue;
  856. IWL_DEBUG_RX(priv,
  857. "Notif: %s, 0x%02x - wake the callers up\n",
  858. get_cmd_string(pkt->hdr.cmd),
  859. pkt->hdr.cmd);
  860. w->triggered = true;
  861. if (w->fn)
  862. w->fn(priv, pkt, w->fn_data);
  863. }
  864. spin_unlock(&priv->notif_wait_lock);
  865. wake_up_all(&priv->notif_waitq);
  866. }
  867. if (priv->pre_rx_handler)
  868. priv->pre_rx_handler(priv, rxb);
  869. /* Based on type of command response or notification,
  870. * handle those that need handling via function in
  871. * rx_handlers table. See iwl_setup_rx_handlers() */
  872. if (priv->rx_handlers[pkt->hdr.cmd]) {
  873. priv->isr_stats.rx_handlers[pkt->hdr.cmd]++;
  874. priv->rx_handlers[pkt->hdr.cmd] (priv, rxb);
  875. } else {
  876. /* No handling needed */
  877. IWL_DEBUG_RX(priv,
  878. "No handler needed for %s, 0x%02x\n",
  879. get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd);
  880. }
  881. }