diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-03 16:06:57 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-17 12:48:56 -0500 |
commit | 2f73d7c2b1f92e34aceee21740ec5fb9b8262ecb (patch) | |
tree | d2da8f95c38e32dd5180b235dd38123671621c84 /drivers/net/wireless/iwlwifi/iwl-testmode.c | |
parent | ca994a36f585432458ead9133fcfe05440edbb7b (diff) |
iwlwifi: log as error when error detected
A lot of error conditions in testmode log as IWL_DEBUG_INFO which is not
logged by default. Change it
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-testmode.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-testmode.c | 122 |
1 files changed, 51 insertions, 71 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c index df7ab332c833..e42e0768880b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-testmode.c +++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c | |||
@@ -172,7 +172,7 @@ static void iwl_testmode_ucode_rx_pkt(struct iwl_priv *priv, | |||
172 | skb = cfg80211_testmode_alloc_event_skb(hw->wiphy, 20 + length, | 172 | skb = cfg80211_testmode_alloc_event_skb(hw->wiphy, 20 + length, |
173 | GFP_ATOMIC); | 173 | GFP_ATOMIC); |
174 | if (skb == NULL) { | 174 | if (skb == NULL) { |
175 | IWL_DEBUG_INFO(priv, | 175 | IWL_ERR(priv, |
176 | "Run out of memory for messages to user space ?\n"); | 176 | "Run out of memory for messages to user space ?\n"); |
177 | return; | 177 | return; |
178 | } | 178 | } |
@@ -183,7 +183,7 @@ static void iwl_testmode_ucode_rx_pkt(struct iwl_priv *priv, | |||
183 | 183 | ||
184 | nla_put_failure: | 184 | nla_put_failure: |
185 | kfree_skb(skb); | 185 | kfree_skb(skb); |
186 | IWL_DEBUG_INFO(priv, "Ouch, overran buffer, check allocation!\n"); | 186 | IWL_ERR(priv, "Ouch, overran buffer, check allocation!\n"); |
187 | } | 187 | } |
188 | 188 | ||
189 | void iwl_testmode_init(struct iwl_priv *priv) | 189 | void iwl_testmode_init(struct iwl_priv *priv) |
@@ -252,8 +252,7 @@ static int iwl_testmode_ucode(struct ieee80211_hw *hw, struct nlattr **tb) | |||
252 | 252 | ||
253 | if (!tb[IWL_TM_ATTR_UCODE_CMD_ID] || | 253 | if (!tb[IWL_TM_ATTR_UCODE_CMD_ID] || |
254 | !tb[IWL_TM_ATTR_UCODE_CMD_DATA]) { | 254 | !tb[IWL_TM_ATTR_UCODE_CMD_DATA]) { |
255 | IWL_DEBUG_INFO(priv, | 255 | IWL_ERR(priv, "Missing ucode command mandatory fields\n"); |
256 | "Error finding ucode command mandatory fields\n"); | ||
257 | return -ENOMSG; | 256 | return -ENOMSG; |
258 | } | 257 | } |
259 | 258 | ||
@@ -295,7 +294,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) | |||
295 | int status = 0; | 294 | int status = 0; |
296 | 295 | ||
297 | if (!tb[IWL_TM_ATTR_REG_OFFSET]) { | 296 | if (!tb[IWL_TM_ATTR_REG_OFFSET]) { |
298 | IWL_DEBUG_INFO(priv, "Error finding register offset\n"); | 297 | IWL_ERR(priv, "Missing register offset\n"); |
299 | return -ENOMSG; | 298 | return -ENOMSG; |
300 | } | 299 | } |
301 | ofs = nla_get_u32(tb[IWL_TM_ATTR_REG_OFFSET]); | 300 | ofs = nla_get_u32(tb[IWL_TM_ATTR_REG_OFFSET]); |
@@ -309,7 +308,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) | |||
309 | cmd == IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE32 || | 308 | cmd == IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE32 || |
310 | cmd == IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE8) && | 309 | cmd == IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE8) && |
311 | (ofs >= FH_MEM_UPPER_BOUND)) { | 310 | (ofs >= FH_MEM_UPPER_BOUND)) { |
312 | IWL_DEBUG_INFO(priv, "offset out of segment (0x0 - 0x%x)\n", | 311 | IWL_ERR(priv, "offset out of segment (0x0 - 0x%x)\n", |
313 | FH_MEM_UPPER_BOUND); | 312 | FH_MEM_UPPER_BOUND); |
314 | return -EINVAL; | 313 | return -EINVAL; |
315 | } | 314 | } |
@@ -321,19 +320,17 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) | |||
321 | 320 | ||
322 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); | 321 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); |
323 | if (!skb) { | 322 | if (!skb) { |
324 | IWL_DEBUG_INFO(priv, "Error allocating memory\n"); | 323 | IWL_ERR(priv, "Memory allocation fail\n"); |
325 | return -ENOMEM; | 324 | return -ENOMEM; |
326 | } | 325 | } |
327 | NLA_PUT_U32(skb, IWL_TM_ATTR_REG_VALUE32, val32); | 326 | NLA_PUT_U32(skb, IWL_TM_ATTR_REG_VALUE32, val32); |
328 | status = cfg80211_testmode_reply(skb); | 327 | status = cfg80211_testmode_reply(skb); |
329 | if (status < 0) | 328 | if (status < 0) |
330 | IWL_DEBUG_INFO(priv, | 329 | IWL_ERR(priv, "Error sending msg : %d\n", status); |
331 | "Error sending msg : %d\n", status); | ||
332 | break; | 330 | break; |
333 | case IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE32: | 331 | case IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE32: |
334 | if (!tb[IWL_TM_ATTR_REG_VALUE32]) { | 332 | if (!tb[IWL_TM_ATTR_REG_VALUE32]) { |
335 | IWL_DEBUG_INFO(priv, | 333 | IWL_ERR(priv, "Missing value to write\n"); |
336 | "Error finding value to write\n"); | ||
337 | return -ENOMSG; | 334 | return -ENOMSG; |
338 | } else { | 335 | } else { |
339 | val32 = nla_get_u32(tb[IWL_TM_ATTR_REG_VALUE32]); | 336 | val32 = nla_get_u32(tb[IWL_TM_ATTR_REG_VALUE32]); |
@@ -343,7 +340,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) | |||
343 | break; | 340 | break; |
344 | case IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE8: | 341 | case IWL_TM_CMD_APP2DEV_DIRECT_REG_WRITE8: |
345 | if (!tb[IWL_TM_ATTR_REG_VALUE8]) { | 342 | if (!tb[IWL_TM_ATTR_REG_VALUE8]) { |
346 | IWL_DEBUG_INFO(priv, "Error finding value to write\n"); | 343 | IWL_ERR(priv, "Missing value to write\n"); |
347 | return -ENOMSG; | 344 | return -ENOMSG; |
348 | } else { | 345 | } else { |
349 | val8 = nla_get_u8(tb[IWL_TM_ATTR_REG_VALUE8]); | 346 | val8 = nla_get_u8(tb[IWL_TM_ATTR_REG_VALUE8]); |
@@ -357,19 +354,17 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) | |||
357 | 354 | ||
358 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); | 355 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); |
359 | if (!skb) { | 356 | if (!skb) { |
360 | IWL_DEBUG_INFO(priv, "Error allocating memory\n"); | 357 | IWL_ERR(priv, "Memory allocation fail\n"); |
361 | return -ENOMEM; | 358 | return -ENOMEM; |
362 | } | 359 | } |
363 | NLA_PUT_U32(skb, IWL_TM_ATTR_REG_VALUE32, val32); | 360 | NLA_PUT_U32(skb, IWL_TM_ATTR_REG_VALUE32, val32); |
364 | status = cfg80211_testmode_reply(skb); | 361 | status = cfg80211_testmode_reply(skb); |
365 | if (status < 0) | 362 | if (status < 0) |
366 | IWL_DEBUG_INFO(priv, | 363 | IWL_ERR(priv, "Error sending msg : %d\n", status); |
367 | "Error sending msg : %d\n", status); | ||
368 | break; | 364 | break; |
369 | case IWL_TM_CMD_APP2DEV_INDIRECT_REG_WRITE32: | 365 | case IWL_TM_CMD_APP2DEV_INDIRECT_REG_WRITE32: |
370 | if (!tb[IWL_TM_ATTR_REG_VALUE32]) { | 366 | if (!tb[IWL_TM_ATTR_REG_VALUE32]) { |
371 | IWL_DEBUG_INFO(priv, | 367 | IWL_ERR(priv, "Missing value to write\n"); |
372 | "Error finding value to write\n"); | ||
373 | return -ENOMSG; | 368 | return -ENOMSG; |
374 | } else { | 369 | } else { |
375 | val32 = nla_get_u32(tb[IWL_TM_ATTR_REG_VALUE32]); | 370 | val32 = nla_get_u32(tb[IWL_TM_ATTR_REG_VALUE32]); |
@@ -378,7 +373,7 @@ static int iwl_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb) | |||
378 | } | 373 | } |
379 | break; | 374 | break; |
380 | default: | 375 | default: |
381 | IWL_DEBUG_INFO(priv, "Unknown testmode register command ID\n"); | 376 | IWL_ERR(priv, "Unknown testmode register command ID\n"); |
382 | return -ENOSYS; | 377 | return -ENOSYS; |
383 | } | 378 | } |
384 | 379 | ||
@@ -400,14 +395,13 @@ static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv) | |||
400 | NULL, NULL); | 395 | NULL, NULL); |
401 | ret = iwl_init_alive_start(trans(priv)); | 396 | ret = iwl_init_alive_start(trans(priv)); |
402 | if (ret) { | 397 | if (ret) { |
403 | IWL_DEBUG_INFO(priv, | 398 | IWL_ERR(priv, "Fail init calibration: %d\n", ret); |
404 | "Error configuring init calibration: %d\n", ret); | ||
405 | goto cfg_init_calib_error; | 399 | goto cfg_init_calib_error; |
406 | } | 400 | } |
407 | 401 | ||
408 | ret = iwl_wait_notification(priv->shrd, &calib_wait, 2 * HZ); | 402 | ret = iwl_wait_notification(priv->shrd, &calib_wait, 2 * HZ); |
409 | if (ret) | 403 | if (ret) |
410 | IWL_DEBUG_INFO(priv, "Error detecting" | 404 | IWL_ERR(priv, "Error detecting" |
411 | " CALIBRATION_COMPLETE_NOTIFICATION: %d\n", ret); | 405 | " CALIBRATION_COMPLETE_NOTIFICATION: %d\n", ret); |
412 | return ret; | 406 | return ret; |
413 | 407 | ||
@@ -448,8 +442,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
448 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, | 442 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, |
449 | rsp_data_len + 20); | 443 | rsp_data_len + 20); |
450 | if (!skb) { | 444 | if (!skb) { |
451 | IWL_DEBUG_INFO(priv, | 445 | IWL_ERR(priv, "Memory allocation fail\n"); |
452 | "Error allocating memory\n"); | ||
453 | return -ENOMEM; | 446 | return -ENOMEM; |
454 | } | 447 | } |
455 | NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, | 448 | NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, |
@@ -458,15 +451,13 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
458 | rsp_data_len, rsp_data_ptr); | 451 | rsp_data_len, rsp_data_ptr); |
459 | status = cfg80211_testmode_reply(skb); | 452 | status = cfg80211_testmode_reply(skb); |
460 | if (status < 0) | 453 | if (status < 0) |
461 | IWL_DEBUG_INFO(priv, "Error sending msg : %d\n", | 454 | IWL_ERR(priv, "Error sending msg : %d\n", status); |
462 | status); | ||
463 | break; | 455 | break; |
464 | 456 | ||
465 | case IWL_TM_CMD_APP2DEV_LOAD_INIT_FW: | 457 | case IWL_TM_CMD_APP2DEV_LOAD_INIT_FW: |
466 | status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_INIT); | 458 | status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_INIT); |
467 | if (status) | 459 | if (status) |
468 | IWL_DEBUG_INFO(priv, | 460 | IWL_ERR(priv, "Error loading init ucode: %d\n", status); |
469 | "Error loading init ucode: %d\n", status); | ||
470 | break; | 461 | break; |
471 | 462 | ||
472 | case IWL_TM_CMD_APP2DEV_CFG_INIT_CALIB: | 463 | case IWL_TM_CMD_APP2DEV_CFG_INIT_CALIB: |
@@ -477,13 +468,13 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
477 | case IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW: | 468 | case IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW: |
478 | status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_REGULAR); | 469 | status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_REGULAR); |
479 | if (status) { | 470 | if (status) { |
480 | IWL_DEBUG_INFO(priv, | 471 | IWL_ERR(priv, |
481 | "Error loading runtime ucode: %d\n", status); | 472 | "Error loading runtime ucode: %d\n", status); |
482 | break; | 473 | break; |
483 | } | 474 | } |
484 | status = iwl_alive_start(priv); | 475 | status = iwl_alive_start(priv); |
485 | if (status) | 476 | if (status) |
486 | IWL_DEBUG_INFO(priv, | 477 | IWL_ERR(priv, |
487 | "Error starting the device: %d\n", status); | 478 | "Error starting the device: %d\n", status); |
488 | break; | 479 | break; |
489 | 480 | ||
@@ -492,13 +483,13 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
492 | iwl_trans_stop_device(trans); | 483 | iwl_trans_stop_device(trans); |
493 | status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_WOWLAN); | 484 | status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_WOWLAN); |
494 | if (status) { | 485 | if (status) { |
495 | IWL_DEBUG_INFO(priv, | 486 | IWL_ERR(priv, |
496 | "Error loading WOWLAN ucode: %d\n", status); | 487 | "Error loading WOWLAN ucode: %d\n", status); |
497 | break; | 488 | break; |
498 | } | 489 | } |
499 | status = iwl_alive_start(priv); | 490 | status = iwl_alive_start(priv); |
500 | if (status) | 491 | if (status) |
501 | IWL_DEBUG_INFO(priv, | 492 | IWL_ERR(priv, |
502 | "Error starting the device: %d\n", status); | 493 | "Error starting the device: %d\n", status); |
503 | break; | 494 | break; |
504 | 495 | ||
@@ -507,8 +498,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
507 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, | 498 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, |
508 | cfg(priv)->base_params->eeprom_size + 20); | 499 | cfg(priv)->base_params->eeprom_size + 20); |
509 | if (!skb) { | 500 | if (!skb) { |
510 | IWL_DEBUG_INFO(priv, | 501 | IWL_ERR(priv, "Memory allocation fail\n"); |
511 | "Error allocating memory\n"); | ||
512 | return -ENOMEM; | 502 | return -ENOMEM; |
513 | } | 503 | } |
514 | NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, | 504 | NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, |
@@ -518,17 +508,15 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
518 | priv->shrd->eeprom); | 508 | priv->shrd->eeprom); |
519 | status = cfg80211_testmode_reply(skb); | 509 | status = cfg80211_testmode_reply(skb); |
520 | if (status < 0) | 510 | if (status < 0) |
521 | IWL_DEBUG_INFO(priv, | 511 | IWL_ERR(priv, "Error sending msg : %d\n", |
522 | "Error sending msg : %d\n", | 512 | status); |
523 | status); | ||
524 | } else | 513 | } else |
525 | return -EFAULT; | 514 | return -EFAULT; |
526 | break; | 515 | break; |
527 | 516 | ||
528 | case IWL_TM_CMD_APP2DEV_FIXRATE_REQ: | 517 | case IWL_TM_CMD_APP2DEV_FIXRATE_REQ: |
529 | if (!tb[IWL_TM_ATTR_FIXRATE]) { | 518 | if (!tb[IWL_TM_ATTR_FIXRATE]) { |
530 | IWL_DEBUG_INFO(priv, | 519 | IWL_ERR(priv, "Missing fixrate setting\n"); |
531 | "Error finding fixrate setting\n"); | ||
532 | return -ENOMSG; | 520 | return -ENOMSG; |
533 | } | 521 | } |
534 | priv->tm_fixed_rate = nla_get_u32(tb[IWL_TM_ATTR_FIXRATE]); | 522 | priv->tm_fixed_rate = nla_get_u32(tb[IWL_TM_ATTR_FIXRATE]); |
@@ -539,14 +527,13 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
539 | 527 | ||
540 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); | 528 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); |
541 | if (!skb) { | 529 | if (!skb) { |
542 | IWL_DEBUG_INFO(priv, "Error allocating memory\n"); | 530 | IWL_ERR(priv, "Memory allocation fail\n"); |
543 | return -ENOMEM; | 531 | return -ENOMEM; |
544 | } | 532 | } |
545 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_VERSION, priv->ucode_ver); | 533 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_VERSION, priv->ucode_ver); |
546 | status = cfg80211_testmode_reply(skb); | 534 | status = cfg80211_testmode_reply(skb); |
547 | if (status < 0) | 535 | if (status < 0) |
548 | IWL_DEBUG_INFO(priv, | 536 | IWL_ERR(priv, "Error sending msg : %d\n", status); |
549 | "Error sending msg : %d\n", status); | ||
550 | break; | 537 | break; |
551 | 538 | ||
552 | case IWL_TM_CMD_APP2DEV_GET_DEVICE_ID: | 539 | case IWL_TM_CMD_APP2DEV_GET_DEVICE_ID: |
@@ -555,20 +542,19 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
555 | 542 | ||
556 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); | 543 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20); |
557 | if (!skb) { | 544 | if (!skb) { |
558 | IWL_DEBUG_INFO(priv, "Error allocating memory\n"); | 545 | IWL_ERR(priv, "Memory allocation fail\n"); |
559 | return -ENOMEM; | 546 | return -ENOMEM; |
560 | } | 547 | } |
561 | NLA_PUT_U32(skb, IWL_TM_ATTR_DEVICE_ID, devid); | 548 | NLA_PUT_U32(skb, IWL_TM_ATTR_DEVICE_ID, devid); |
562 | status = cfg80211_testmode_reply(skb); | 549 | status = cfg80211_testmode_reply(skb); |
563 | if (status < 0) | 550 | if (status < 0) |
564 | IWL_DEBUG_INFO(priv, | 551 | IWL_ERR(priv, "Error sending msg : %d\n", status); |
565 | "Error sending msg : %d\n", status); | ||
566 | break; | 552 | break; |
567 | 553 | ||
568 | case IWL_TM_CMD_APP2DEV_GET_FW_INFO: | 554 | case IWL_TM_CMD_APP2DEV_GET_FW_INFO: |
569 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20 + 8); | 555 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20 + 8); |
570 | if (!skb) { | 556 | if (!skb) { |
571 | IWL_DEBUG_INFO(priv, "Error allocating memory\n"); | 557 | IWL_ERR(priv, "Memory allocation fail\n"); |
572 | return -ENOMEM; | 558 | return -ENOMEM; |
573 | } | 559 | } |
574 | switch (priv->shrd->ucode_type) { | 560 | switch (priv->shrd->ucode_type) { |
@@ -585,10 +571,10 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
585 | data_size = trans(priv)->ucode_wowlan.data.len; | 571 | data_size = trans(priv)->ucode_wowlan.data.len; |
586 | break; | 572 | break; |
587 | case IWL_UCODE_NONE: | 573 | case IWL_UCODE_NONE: |
588 | IWL_DEBUG_INFO(priv, "The uCode has not been loaded\n"); | 574 | IWL_ERR(priv, "No uCode has not been loaded\n"); |
589 | break; | 575 | break; |
590 | default: | 576 | default: |
591 | IWL_DEBUG_INFO(priv, "Unsupported uCode type\n"); | 577 | IWL_ERR(priv, "Unsupported uCode type\n"); |
592 | break; | 578 | break; |
593 | } | 579 | } |
594 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_TYPE, priv->shrd->ucode_type); | 580 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_TYPE, priv->shrd->ucode_type); |
@@ -596,12 +582,11 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) | |||
596 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_DATA_SIZE, data_size); | 582 | NLA_PUT_U32(skb, IWL_TM_ATTR_FW_DATA_SIZE, data_size); |
597 | status = cfg80211_testmode_reply(skb); | 583 | status = cfg80211_testmode_reply(skb); |
598 | if (status < 0) | 584 | if (status < 0) |
599 | IWL_DEBUG_INFO(priv, | 585 | IWL_ERR(priv, "Error sending msg : %d\n", status); |
600 | "Error sending msg : %d\n", status); | ||
601 | break; | 586 | break; |
602 | 587 | ||
603 | default: | 588 | default: |
604 | IWL_DEBUG_INFO(priv, "Unknown testmode driver command ID\n"); | 589 | IWL_ERR(priv, "Unknown testmode driver command ID\n"); |
605 | return -ENOSYS; | 590 | return -ENOSYS; |
606 | } | 591 | } |
607 | return status; | 592 | return status; |
@@ -664,8 +649,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb) | |||
664 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, | 649 | skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, |
665 | sizeof(priv->testmode_trace.dma_addr) + 20); | 650 | sizeof(priv->testmode_trace.dma_addr) + 20); |
666 | if (!skb) { | 651 | if (!skb) { |
667 | IWL_DEBUG_INFO(priv, | 652 | IWL_ERR(priv, "Memory allocation fail\n"); |
668 | "Error allocating memory\n"); | ||
669 | iwl_trace_cleanup(priv); | 653 | iwl_trace_cleanup(priv); |
670 | return -ENOMEM; | 654 | return -ENOMEM; |
671 | } | 655 | } |
@@ -674,9 +658,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb) | |||
674 | (u64 *)&priv->testmode_trace.dma_addr); | 658 | (u64 *)&priv->testmode_trace.dma_addr); |
675 | status = cfg80211_testmode_reply(skb); | 659 | status = cfg80211_testmode_reply(skb); |
676 | if (status < 0) { | 660 | if (status < 0) { |
677 | IWL_DEBUG_INFO(priv, | 661 | IWL_ERR(priv, "Error sending msg : %d\n", status); |
678 | "Error sending msg : %d\n", | ||
679 | status); | ||
680 | } | 662 | } |
681 | priv->testmode_trace.num_chunks = | 663 | priv->testmode_trace.num_chunks = |
682 | DIV_ROUND_UP(priv->testmode_trace.buff_size, | 664 | DIV_ROUND_UP(priv->testmode_trace.buff_size, |
@@ -687,7 +669,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb) | |||
687 | iwl_trace_cleanup(priv); | 669 | iwl_trace_cleanup(priv); |
688 | break; | 670 | break; |
689 | default: | 671 | default: |
690 | IWL_DEBUG_INFO(priv, "Unknown testmode mem command ID\n"); | 672 | IWL_ERR(priv, "Unknown testmode mem command ID\n"); |
691 | return -ENOSYS; | 673 | return -ENOSYS; |
692 | } | 674 | } |
693 | return status; | 675 | return status; |
@@ -752,7 +734,7 @@ static int iwl_testmode_ownership(struct ieee80211_hw *hw, struct nlattr **tb) | |||
752 | u8 owner; | 734 | u8 owner; |
753 | 735 | ||
754 | if (!tb[IWL_TM_ATTR_UCODE_OWNER]) { | 736 | if (!tb[IWL_TM_ATTR_UCODE_OWNER]) { |
755 | IWL_DEBUG_INFO(priv, "Error finding ucode owner\n"); | 737 | IWL_ERR(priv, "Missing ucode owner\n"); |
756 | return -ENOMSG; | 738 | return -ENOMSG; |
757 | } | 739 | } |
758 | 740 | ||
@@ -760,7 +742,7 @@ static int iwl_testmode_ownership(struct ieee80211_hw *hw, struct nlattr **tb) | |||
760 | if ((owner == IWL_OWNERSHIP_DRIVER) || (owner == IWL_OWNERSHIP_TM)) | 742 | if ((owner == IWL_OWNERSHIP_DRIVER) || (owner == IWL_OWNERSHIP_TM)) |
761 | priv->shrd->ucode_owner = owner; | 743 | priv->shrd->ucode_owner = owner; |
762 | else { | 744 | else { |
763 | IWL_DEBUG_INFO(priv, "Invalid owner\n"); | 745 | IWL_ERR(priv, "Invalid owner\n"); |
764 | return -EINVAL; | 746 | return -EINVAL; |
765 | } | 747 | } |
766 | return 0; | 748 | return 0; |
@@ -791,12 +773,12 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb) | |||
791 | return -EBUSY; | 773 | return -EBUSY; |
792 | 774 | ||
793 | if (!tb[IWL_TM_ATTR_SRAM_ADDR]) { | 775 | if (!tb[IWL_TM_ATTR_SRAM_ADDR]) { |
794 | IWL_DEBUG_INFO(priv, "Error finding SRAM offset address\n"); | 776 | IWL_ERR(priv, "Missing SRAM offset address\n"); |
795 | return -ENOMSG; | 777 | return -ENOMSG; |
796 | } | 778 | } |
797 | ofs = nla_get_u32(tb[IWL_TM_ATTR_SRAM_ADDR]); | 779 | ofs = nla_get_u32(tb[IWL_TM_ATTR_SRAM_ADDR]); |
798 | if (!tb[IWL_TM_ATTR_SRAM_SIZE]) { | 780 | if (!tb[IWL_TM_ATTR_SRAM_SIZE]) { |
799 | IWL_DEBUG_INFO(priv, "Error finding size for SRAM reading\n"); | 781 | IWL_ERR(priv, "Missing size for SRAM reading\n"); |
800 | return -ENOMSG; | 782 | return -ENOMSG; |
801 | } | 783 | } |
802 | size = nla_get_u32(tb[IWL_TM_ATTR_SRAM_SIZE]); | 784 | size = nla_get_u32(tb[IWL_TM_ATTR_SRAM_SIZE]); |
@@ -811,10 +793,10 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb) | |||
811 | maxsize = trans(priv)->ucode_wowlan.data.len; | 793 | maxsize = trans(priv)->ucode_wowlan.data.len; |
812 | break; | 794 | break; |
813 | case IWL_UCODE_NONE: | 795 | case IWL_UCODE_NONE: |
814 | IWL_ERR(priv, "Error, uCode does not been loaded\n"); | 796 | IWL_ERR(priv, "uCode does not been loaded\n"); |
815 | return -ENOSYS; | 797 | return -ENOSYS; |
816 | default: | 798 | default: |
817 | IWL_ERR(priv, "Error, unsupported uCode type\n"); | 799 | IWL_ERR(priv, "unsupported uCode type\n"); |
818 | return -ENOSYS; | 800 | return -ENOSYS; |
819 | } | 801 | } |
820 | if ((ofs + size) > (maxsize + SRAM_DATA_SEG_OFFSET)) { | 802 | if ((ofs + size) > (maxsize + SRAM_DATA_SEG_OFFSET)) { |
@@ -825,7 +807,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb) | |||
825 | priv->testmode_sram.buff_addr = | 807 | priv->testmode_sram.buff_addr = |
826 | kmalloc(priv->testmode_sram.buff_size, GFP_KERNEL); | 808 | kmalloc(priv->testmode_sram.buff_size, GFP_KERNEL); |
827 | if (priv->testmode_sram.buff_addr == NULL) { | 809 | if (priv->testmode_sram.buff_addr == NULL) { |
828 | IWL_ERR(priv, "Error allocating memory\n"); | 810 | IWL_ERR(priv, "Memory allocation fail\n"); |
829 | return -ENOMEM; | 811 | return -ENOMEM; |
830 | } | 812 | } |
831 | _iwl_read_targ_mem_words(trans(priv), ofs, | 813 | _iwl_read_targ_mem_words(trans(priv), ofs, |
@@ -898,14 +880,13 @@ int iwlagn_mac_testmode_cmd(struct ieee80211_hw *hw, void *data, int len) | |||
898 | result = nla_parse(tb, IWL_TM_ATTR_MAX - 1, data, len, | 880 | result = nla_parse(tb, IWL_TM_ATTR_MAX - 1, data, len, |
899 | iwl_testmode_gnl_msg_policy); | 881 | iwl_testmode_gnl_msg_policy); |
900 | if (result != 0) { | 882 | if (result != 0) { |
901 | IWL_DEBUG_INFO(priv, | 883 | IWL_ERR(priv, "Error parsing the gnl message : %d\n", result); |
902 | "Error parsing the gnl message : %d\n", result); | ||
903 | return result; | 884 | return result; |
904 | } | 885 | } |
905 | 886 | ||
906 | /* IWL_TM_ATTR_COMMAND is absolutely mandatory */ | 887 | /* IWL_TM_ATTR_COMMAND is absolutely mandatory */ |
907 | if (!tb[IWL_TM_ATTR_COMMAND]) { | 888 | if (!tb[IWL_TM_ATTR_COMMAND]) { |
908 | IWL_DEBUG_INFO(priv, "Error finding testmode command type\n"); | 889 | IWL_ERR(priv, "Missing testmode command type\n"); |
909 | return -ENOMSG; | 890 | return -ENOMSG; |
910 | } | 891 | } |
911 | /* in case multiple accesses to the device happens */ | 892 | /* in case multiple accesses to the device happens */ |
@@ -956,7 +937,7 @@ int iwlagn_mac_testmode_cmd(struct ieee80211_hw *hw, void *data, int len) | |||
956 | break; | 937 | break; |
957 | 938 | ||
958 | default: | 939 | default: |
959 | IWL_DEBUG_INFO(priv, "Unknown testmode command\n"); | 940 | IWL_ERR(priv, "Unknown testmode command\n"); |
960 | result = -ENOSYS; | 941 | result = -ENOSYS; |
961 | break; | 942 | break; |
962 | } | 943 | } |
@@ -981,15 +962,14 @@ int iwlagn_mac_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
981 | result = nla_parse(tb, IWL_TM_ATTR_MAX - 1, data, len, | 962 | result = nla_parse(tb, IWL_TM_ATTR_MAX - 1, data, len, |
982 | iwl_testmode_gnl_msg_policy); | 963 | iwl_testmode_gnl_msg_policy); |
983 | if (result) { | 964 | if (result) { |
984 | IWL_DEBUG_INFO(priv, | 965 | IWL_ERR(priv, |
985 | "Error parsing the gnl message : %d\n", result); | 966 | "Error parsing the gnl message : %d\n", result); |
986 | return result; | 967 | return result; |
987 | } | 968 | } |
988 | 969 | ||
989 | /* IWL_TM_ATTR_COMMAND is absolutely mandatory */ | 970 | /* IWL_TM_ATTR_COMMAND is absolutely mandatory */ |
990 | if (!tb[IWL_TM_ATTR_COMMAND]) { | 971 | if (!tb[IWL_TM_ATTR_COMMAND]) { |
991 | IWL_DEBUG_INFO(priv, | 972 | IWL_ERR(priv, "Missing testmode command type\n"); |
992 | "Error finding testmode command type\n"); | ||
993 | return -ENOMSG; | 973 | return -ENOMSG; |
994 | } | 974 | } |
995 | cmd = nla_get_u32(tb[IWL_TM_ATTR_COMMAND]); | 975 | cmd = nla_get_u32(tb[IWL_TM_ATTR_COMMAND]); |