diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-12-03 04:50:30 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-12-09 15:29:49 -0500 |
commit | 9d10849e4ea8bf9d8da80afa73918a9fe45c09ef (patch) | |
tree | 8e45604c9f12c10032b03557c0f5099786bc592f | |
parent | b9c509cc994f11799174a8a94ac5c4c09cf773a6 (diff) |
iwlwifi: mvm: rs: fix compilation without CONFIG_MAC80211_DEBUGFS
This fixes compilation issues with CONFIG_MAC80211_DEBUGFS
not enabled.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/rs.c | 128 |
1 files changed, 63 insertions, 65 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c index 1bb6581f3b25..bf6e29f5b4d0 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/iwlwifi/mvm/rs.c | |||
@@ -355,8 +355,6 @@ static void rs_fill_link_cmd(struct iwl_mvm *mvm, | |||
355 | struct ieee80211_sta *sta, | 355 | struct ieee80211_sta *sta, |
356 | struct iwl_lq_sta *lq_sta, u32 rate_n_flags); | 356 | struct iwl_lq_sta *lq_sta, u32 rate_n_flags); |
357 | static void rs_stay_in_table(struct iwl_lq_sta *lq_sta, bool force_search); | 357 | static void rs_stay_in_table(struct iwl_lq_sta *lq_sta, bool force_search); |
358 | static const char *rs_pretty_lq_type(enum iwl_table_type type); | ||
359 | static const char *rs_pretty_ant(u8 ant); | ||
360 | 358 | ||
361 | #ifdef CONFIG_MAC80211_DEBUGFS | 359 | #ifdef CONFIG_MAC80211_DEBUGFS |
362 | static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, | 360 | static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, |
@@ -446,6 +444,43 @@ static const struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_COUNT] = { | |||
446 | 444 | ||
447 | #define MCS_INDEX_PER_STREAM (8) | 445 | #define MCS_INDEX_PER_STREAM (8) |
448 | 446 | ||
447 | static const char *rs_pretty_ant(u8 ant) | ||
448 | { | ||
449 | static const char * const ant_name[] = { | ||
450 | [ANT_NONE] = "None", | ||
451 | [ANT_A] = "A", | ||
452 | [ANT_B] = "B", | ||
453 | [ANT_AB] = "AB", | ||
454 | [ANT_C] = "C", | ||
455 | [ANT_AC] = "AC", | ||
456 | [ANT_BC] = "BC", | ||
457 | [ANT_ABC] = "ABC", | ||
458 | }; | ||
459 | |||
460 | if (ant > ANT_ABC) | ||
461 | return "UNKNOWN"; | ||
462 | |||
463 | return ant_name[ant]; | ||
464 | } | ||
465 | |||
466 | static const char *rs_pretty_lq_type(enum iwl_table_type type) | ||
467 | { | ||
468 | static const char * const lq_types[] = { | ||
469 | [LQ_NONE] = "NONE", | ||
470 | [LQ_LEGACY_A] = "LEGACY_A", | ||
471 | [LQ_LEGACY_G] = "LEGACY_G", | ||
472 | [LQ_HT_SISO] = "HT SISO", | ||
473 | [LQ_HT_MIMO2] = "HT MIMO", | ||
474 | [LQ_VHT_SISO] = "VHT SISO", | ||
475 | [LQ_VHT_MIMO2] = "VHT MIMO", | ||
476 | }; | ||
477 | |||
478 | if (type < LQ_NONE || type >= LQ_MAX) | ||
479 | return "UNKNOWN"; | ||
480 | |||
481 | return lq_types[type]; | ||
482 | } | ||
483 | |||
449 | static inline void rs_dump_rate(struct iwl_mvm *mvm, const struct rs_rate *rate, | 484 | static inline void rs_dump_rate(struct iwl_mvm *mvm, const struct rs_rate *rate, |
450 | const char *prefix) | 485 | const char *prefix) |
451 | { | 486 | { |
@@ -2524,69 +2559,6 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, | |||
2524 | } | 2559 | } |
2525 | } | 2560 | } |
2526 | 2561 | ||
2527 | static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file, | ||
2528 | const char __user *user_buf, size_t count, loff_t *ppos) | ||
2529 | { | ||
2530 | struct iwl_lq_sta *lq_sta = file->private_data; | ||
2531 | struct iwl_mvm *mvm; | ||
2532 | char buf[64]; | ||
2533 | size_t buf_size; | ||
2534 | u32 parsed_rate; | ||
2535 | |||
2536 | |||
2537 | mvm = lq_sta->drv; | ||
2538 | memset(buf, 0, sizeof(buf)); | ||
2539 | buf_size = min(count, sizeof(buf) - 1); | ||
2540 | if (copy_from_user(buf, user_buf, buf_size)) | ||
2541 | return -EFAULT; | ||
2542 | |||
2543 | if (sscanf(buf, "%x", &parsed_rate) == 1) | ||
2544 | lq_sta->dbg_fixed_rate = parsed_rate; | ||
2545 | else | ||
2546 | lq_sta->dbg_fixed_rate = 0; | ||
2547 | |||
2548 | rs_program_fix_rate(mvm, lq_sta); | ||
2549 | |||
2550 | return count; | ||
2551 | } | ||
2552 | |||
2553 | static const char *rs_pretty_lq_type(enum iwl_table_type type) | ||
2554 | { | ||
2555 | static const char * const lq_types[] = { | ||
2556 | [LQ_NONE] = "NONE", | ||
2557 | [LQ_LEGACY_A] = "LEGACY_A", | ||
2558 | [LQ_LEGACY_G] = "LEGACY_G", | ||
2559 | [LQ_HT_SISO] = "HT SISO", | ||
2560 | [LQ_HT_MIMO2] = "HT MIMO", | ||
2561 | [LQ_VHT_SISO] = "VHT SISO", | ||
2562 | [LQ_VHT_MIMO2] = "VHT MIMO", | ||
2563 | }; | ||
2564 | |||
2565 | if (type < LQ_NONE || type >= LQ_MAX) | ||
2566 | return "UNKNOWN"; | ||
2567 | |||
2568 | return lq_types[type]; | ||
2569 | } | ||
2570 | |||
2571 | static const char *rs_pretty_ant(u8 ant) | ||
2572 | { | ||
2573 | static const char * const ant_name[] = { | ||
2574 | [ANT_NONE] = "None", | ||
2575 | [ANT_A] = "A", | ||
2576 | [ANT_B] = "B", | ||
2577 | [ANT_AB] = "AB", | ||
2578 | [ANT_C] = "C", | ||
2579 | [ANT_AC] = "AC", | ||
2580 | [ANT_BC] = "BC", | ||
2581 | [ANT_ABC] = "ABC", | ||
2582 | }; | ||
2583 | |||
2584 | if (ant > ANT_ABC) | ||
2585 | return "UNKNOWN"; | ||
2586 | |||
2587 | return ant_name[ant]; | ||
2588 | } | ||
2589 | |||
2590 | static int rs_pretty_print_rate(char *buf, const u32 rate) | 2562 | static int rs_pretty_print_rate(char *buf, const u32 rate) |
2591 | { | 2563 | { |
2592 | 2564 | ||
@@ -2640,6 +2612,32 @@ static int rs_pretty_print_rate(char *buf, const u32 rate) | |||
2640 | (rate & RATE_MCS_ZLF_MSK) ? "ZLF " : ""); | 2612 | (rate & RATE_MCS_ZLF_MSK) ? "ZLF " : ""); |
2641 | } | 2613 | } |
2642 | 2614 | ||
2615 | static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file, | ||
2616 | const char __user *user_buf, size_t count, loff_t *ppos) | ||
2617 | { | ||
2618 | struct iwl_lq_sta *lq_sta = file->private_data; | ||
2619 | struct iwl_mvm *mvm; | ||
2620 | char buf[64]; | ||
2621 | size_t buf_size; | ||
2622 | u32 parsed_rate; | ||
2623 | |||
2624 | |||
2625 | mvm = lq_sta->drv; | ||
2626 | memset(buf, 0, sizeof(buf)); | ||
2627 | buf_size = min(count, sizeof(buf) - 1); | ||
2628 | if (copy_from_user(buf, user_buf, buf_size)) | ||
2629 | return -EFAULT; | ||
2630 | |||
2631 | if (sscanf(buf, "%x", &parsed_rate) == 1) | ||
2632 | lq_sta->dbg_fixed_rate = parsed_rate; | ||
2633 | else | ||
2634 | lq_sta->dbg_fixed_rate = 0; | ||
2635 | |||
2636 | rs_program_fix_rate(mvm, lq_sta); | ||
2637 | |||
2638 | return count; | ||
2639 | } | ||
2640 | |||
2643 | static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, | 2641 | static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, |
2644 | char __user *user_buf, size_t count, loff_t *ppos) | 2642 | char __user *user_buf, size_t count, loff_t *ppos) |
2645 | { | 2643 | { |