diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-dev.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 108 |
1 files changed, 28 insertions, 80 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index c19db438306c..c018121085e9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -225,12 +225,6 @@ struct iwl_frame { | |||
225 | struct list_head list; | 225 | struct list_head list; |
226 | }; | 226 | }; |
227 | 227 | ||
228 | #define SEQ_TO_QUEUE(x) ((x >> 8) & 0xbf) | ||
229 | #define QUEUE_TO_SEQ(x) ((x & 0xbf) << 8) | ||
230 | #define SEQ_TO_INDEX(x) ((u8)(x & 0xff)) | ||
231 | #define INDEX_TO_SEQ(x) ((u8)(x & 0xff)) | ||
232 | #define SEQ_HUGE_FRAME (0x4000) | ||
233 | #define SEQ_RX_FRAME __constant_cpu_to_le16(0x8000) | ||
234 | #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) | 228 | #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) |
235 | #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) | 229 | #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) |
236 | #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) | 230 | #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) |
@@ -412,7 +406,7 @@ struct iwl_ht_info { | |||
412 | /* self configuration data */ | 406 | /* self configuration data */ |
413 | u8 is_ht; | 407 | u8 is_ht; |
414 | u8 supported_chan_width; | 408 | u8 supported_chan_width; |
415 | u16 tx_mimo_ps_mode; | 409 | u8 sm_ps; |
416 | u8 is_green_field; | 410 | u8 is_green_field; |
417 | u8 sgf; /* HT_SHORT_GI_* short guard interval */ | 411 | u8 sgf; /* HT_SHORT_GI_* short guard interval */ |
418 | u8 max_amsdu_size; | 412 | u8 max_amsdu_size; |
@@ -571,50 +565,31 @@ struct iwl_hw_params { | |||
571 | #define IWL_RX_STATS(x) (&x->u.rx_frame.stats) | 565 | #define IWL_RX_STATS(x) (&x->u.rx_frame.stats) |
572 | #define IWL_RX_DATA(x) (IWL_RX_HDR(x)->payload) | 566 | #define IWL_RX_DATA(x) (IWL_RX_HDR(x)->payload) |
573 | 567 | ||
574 | |||
575 | /****************************************************************************** | 568 | /****************************************************************************** |
576 | * | 569 | * |
577 | * Functions implemented in iwl-base.c which are forward declared here | 570 | * Functions implemented in core module which are forward declared here |
578 | * for use by iwl-*.c | 571 | * for use by iwl-[4-5].c |
579 | * | 572 | * |
580 | *****************************************************************************/ | 573 | * NOTE: The implementation of these functions are not hardware specific |
581 | struct iwl_addsta_cmd; | 574 | * which is why they are in the core module files. |
582 | extern int iwl_send_add_sta(struct iwl_priv *priv, | ||
583 | struct iwl_addsta_cmd *sta, u8 flags); | ||
584 | u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap, | ||
585 | u8 flags, struct ieee80211_ht_info *ht_info); | ||
586 | extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv, | ||
587 | struct ieee80211_hdr *hdr, | ||
588 | const u8 *dest, int left); | ||
589 | extern void iwl4965_update_chain_flags(struct iwl_priv *priv); | ||
590 | int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src); | ||
591 | extern int iwl4965_set_power(struct iwl_priv *priv, void *cmd); | ||
592 | |||
593 | extern const u8 iwl_bcast_addr[ETH_ALEN]; | ||
594 | |||
595 | /****************************************************************************** | ||
596 | * | ||
597 | * Functions implemented in iwl-[34]*.c which are forward declared here | ||
598 | * for use by iwl-base.c | ||
599 | * | ||
600 | * NOTE: The implementation of these functions are hardware specific | ||
601 | * which is why they are in the hardware specific files (vs. iwl-base.c) | ||
602 | * | 575 | * |
603 | * Naming convention -- | 576 | * Naming convention -- |
604 | * iwl4965_ <-- Its part of iwlwifi (should be changed to iwl4965_) | 577 | * iwl_ <-- Is part of iwlwifi |
605 | * iwl4965_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW) | ||
606 | * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) | 578 | * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) |
607 | * iwl4965_bg_ <-- Called from work queue context | 579 | * iwl4965_bg_ <-- Called from work queue context |
608 | * iwl4965_mac_ <-- mac80211 callback | 580 | * iwl4965_mac_ <-- mac80211 callback |
609 | * | 581 | * |
610 | ****************************************************************************/ | 582 | ****************************************************************************/ |
583 | struct iwl_addsta_cmd; | ||
584 | extern int iwl_send_add_sta(struct iwl_priv *priv, | ||
585 | struct iwl_addsta_cmd *sta, u8 flags); | ||
586 | extern u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, | ||
587 | int is_ap, u8 flags, struct ieee80211_ht_info *ht_info); | ||
588 | extern void iwl4965_update_chain_flags(struct iwl_priv *priv); | ||
589 | extern int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src); | ||
590 | extern const u8 iwl_bcast_addr[ETH_ALEN]; | ||
611 | extern int iwl_rxq_stop(struct iwl_priv *priv); | 591 | extern int iwl_rxq_stop(struct iwl_priv *priv); |
612 | extern void iwl_txq_ctx_stop(struct iwl_priv *priv); | 592 | extern void iwl_txq_ctx_stop(struct iwl_priv *priv); |
613 | extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, | ||
614 | struct iwl_frame *frame, u8 rate); | ||
615 | extern void iwl4965_disable_events(struct iwl_priv *priv); | ||
616 | |||
617 | extern int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel); | ||
618 | extern int iwl_queue_space(const struct iwl_queue *q); | 593 | extern int iwl_queue_space(const struct iwl_queue *q); |
619 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) | 594 | static inline int iwl_queue_used(const struct iwl_queue *q, int i) |
620 | { | 595 | { |
@@ -637,12 +612,6 @@ static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge) | |||
637 | 612 | ||
638 | struct iwl_priv; | 613 | struct iwl_priv; |
639 | 614 | ||
640 | /* | ||
641 | * Forward declare iwl-4965.c functions for iwl-base.c | ||
642 | */ | ||
643 | extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); | ||
644 | int iwl4965_check_empty_hw_queue(struct iwl_priv *priv, int sta_id, | ||
645 | u8 tid, int txq_id); | ||
646 | 615 | ||
647 | /* Structures, enum, and defines specific to the 4965 */ | 616 | /* Structures, enum, and defines specific to the 4965 */ |
648 | 617 | ||
@@ -657,11 +626,6 @@ struct iwl_kw { | |||
657 | #define IWL_CHANNEL_WIDTH_20MHZ 0 | 626 | #define IWL_CHANNEL_WIDTH_20MHZ 0 |
658 | #define IWL_CHANNEL_WIDTH_40MHZ 1 | 627 | #define IWL_CHANNEL_WIDTH_40MHZ 1 |
659 | 628 | ||
660 | #define IWL_MIMO_PS_STATIC 0 | ||
661 | #define IWL_MIMO_PS_NONE 3 | ||
662 | #define IWL_MIMO_PS_DYNAMIC 1 | ||
663 | #define IWL_MIMO_PS_INVALID 2 | ||
664 | |||
665 | #define IWL_OPERATION_MODE_AUTO 0 | 629 | #define IWL_OPERATION_MODE_AUTO 0 |
666 | #define IWL_OPERATION_MODE_HT_ONLY 1 | 630 | #define IWL_OPERATION_MODE_HT_ONLY 1 |
667 | #define IWL_OPERATION_MODE_MIXED 2 | 631 | #define IWL_OPERATION_MODE_MIXED 2 |
@@ -672,18 +636,6 @@ struct iwl_kw { | |||
672 | 636 | ||
673 | #define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000 | 637 | #define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000 |
674 | 638 | ||
675 | struct iwl4965_lq_mngr { | ||
676 | spinlock_t lock; | ||
677 | s32 max_window_size; | ||
678 | s32 *expected_tpt; | ||
679 | u8 *next_higher_rate; | ||
680 | u8 *next_lower_rate; | ||
681 | unsigned long stamp; | ||
682 | unsigned long stamp_last; | ||
683 | u32 flush_time; | ||
684 | u32 tx_packets; | ||
685 | }; | ||
686 | |||
687 | /* Sensitivity and chain noise calibration */ | 639 | /* Sensitivity and chain noise calibration */ |
688 | #define INTERFERENCE_DATA_AVAILABLE __constant_cpu_to_le32(1) | 640 | #define INTERFERENCE_DATA_AVAILABLE __constant_cpu_to_le32(1) |
689 | #define INITIALIZATION_VALUE 0xFFFF | 641 | #define INITIALIZATION_VALUE 0xFFFF |
@@ -728,8 +680,9 @@ enum iwl4965_false_alarm_state { | |||
728 | 680 | ||
729 | enum iwl4965_chain_noise_state { | 681 | enum iwl4965_chain_noise_state { |
730 | IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */ | 682 | IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */ |
731 | IWL_CHAIN_NOISE_ACCUMULATE = 1, | 683 | IWL_CHAIN_NOISE_ACCUMULATE, |
732 | IWL_CHAIN_NOISE_CALIBRATED = 2, | 684 | IWL_CHAIN_NOISE_CALIBRATED, |
685 | IWL_CHAIN_NOISE_DONE, | ||
733 | }; | 686 | }; |
734 | 687 | ||
735 | enum iwl4965_calib_enabled_state { | 688 | enum iwl4965_calib_enabled_state { |
@@ -746,13 +699,10 @@ struct statistics_general_data { | |||
746 | u32 beacon_energy_c; | 699 | u32 beacon_energy_c; |
747 | }; | 700 | }; |
748 | 701 | ||
749 | struct iwl_calib_results { | 702 | /* Opaque calibration results */ |
750 | void *tx_iq_res; | 703 | struct iwl_calib_result { |
751 | void *tx_iq_perd_res; | 704 | void *buf; |
752 | void *lo_res; | 705 | size_t buf_len; |
753 | u32 tx_iq_res_len; | ||
754 | u32 tx_iq_perd_res_len; | ||
755 | u32 lo_res_len; | ||
756 | }; | 706 | }; |
757 | 707 | ||
758 | enum ucode_type { | 708 | enum ucode_type { |
@@ -790,17 +740,18 @@ struct iwl_sensitivity_data { | |||
790 | 740 | ||
791 | /* Chain noise (differential Rx gain) calib data */ | 741 | /* Chain noise (differential Rx gain) calib data */ |
792 | struct iwl_chain_noise_data { | 742 | struct iwl_chain_noise_data { |
793 | u8 state; | 743 | u32 active_chains; |
794 | u16 beacon_count; | ||
795 | u32 chain_noise_a; | 744 | u32 chain_noise_a; |
796 | u32 chain_noise_b; | 745 | u32 chain_noise_b; |
797 | u32 chain_noise_c; | 746 | u32 chain_noise_c; |
798 | u32 chain_signal_a; | 747 | u32 chain_signal_a; |
799 | u32 chain_signal_b; | 748 | u32 chain_signal_b; |
800 | u32 chain_signal_c; | 749 | u32 chain_signal_c; |
750 | u16 beacon_count; | ||
801 | u8 disconn_array[NUM_RX_CHAINS]; | 751 | u8 disconn_array[NUM_RX_CHAINS]; |
802 | u8 delta_gain_code[NUM_RX_CHAINS]; | 752 | u8 delta_gain_code[NUM_RX_CHAINS]; |
803 | u8 radio_write; | 753 | u8 radio_write; |
754 | u8 state; | ||
804 | }; | 755 | }; |
805 | 756 | ||
806 | #define EEPROM_SEM_TIMEOUT 10 /* milliseconds */ | 757 | #define EEPROM_SEM_TIMEOUT 10 /* milliseconds */ |
@@ -814,6 +765,7 @@ enum { | |||
814 | 765 | ||
815 | 766 | ||
816 | #define IWL_MAX_NUM_QUEUES 20 /* FIXME: do dynamic allocation */ | 767 | #define IWL_MAX_NUM_QUEUES 20 /* FIXME: do dynamic allocation */ |
768 | #define IWL_CALIB_MAX 3 | ||
817 | 769 | ||
818 | struct iwl_priv { | 770 | struct iwl_priv { |
819 | 771 | ||
@@ -829,7 +781,6 @@ struct iwl_priv { | |||
829 | 781 | ||
830 | enum ieee80211_band band; | 782 | enum ieee80211_band band; |
831 | int alloc_rxb_skb; | 783 | int alloc_rxb_skb; |
832 | bool add_radiotap; | ||
833 | 784 | ||
834 | void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv, | 785 | void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv, |
835 | struct iwl_rx_mem_buffer *rxb); | 786 | struct iwl_rx_mem_buffer *rxb); |
@@ -858,7 +809,7 @@ struct iwl_priv { | |||
858 | s32 last_temperature; | 809 | s32 last_temperature; |
859 | 810 | ||
860 | /* init calibration results */ | 811 | /* init calibration results */ |
861 | struct iwl_calib_results calib_results; | 812 | struct iwl_calib_result calib_results[IWL_CALIB_MAX]; |
862 | 813 | ||
863 | /* Scan related variables */ | 814 | /* Scan related variables */ |
864 | unsigned long last_scan_jiffies; | 815 | unsigned long last_scan_jiffies; |
@@ -940,9 +891,6 @@ struct iwl_priv { | |||
940 | u8 last_phy_res[100]; | 891 | u8 last_phy_res[100]; |
941 | 892 | ||
942 | /* Rate scaling data */ | 893 | /* Rate scaling data */ |
943 | struct iwl4965_lq_mngr lq_mngr; | ||
944 | |||
945 | /* Rate scaling data */ | ||
946 | s8 data_retry_limit; | 894 | s8 data_retry_limit; |
947 | u8 retry_rate; | 895 | u8 retry_rate; |
948 | 896 | ||
@@ -1006,7 +954,7 @@ struct iwl_priv { | |||
1006 | u8 *eeprom; | 954 | u8 *eeprom; |
1007 | struct iwl_eeprom_calib_info *calib_info; | 955 | struct iwl_eeprom_calib_info *calib_info; |
1008 | 956 | ||
1009 | enum ieee80211_if_types iw_mode; | 957 | enum nl80211_iftype iw_mode; |
1010 | 958 | ||
1011 | struct sk_buff *ibss_beacon; | 959 | struct sk_buff *ibss_beacon; |
1012 | 960 | ||
@@ -1026,7 +974,6 @@ struct iwl_priv { | |||
1026 | * hardware */ | 974 | * hardware */ |
1027 | u16 assoc_id; | 975 | u16 assoc_id; |
1028 | u16 assoc_capability; | 976 | u16 assoc_capability; |
1029 | u8 ps_mode; | ||
1030 | 977 | ||
1031 | struct iwl_qos_info qos_data; | 978 | struct iwl_qos_info qos_data; |
1032 | 979 | ||
@@ -1048,6 +995,7 @@ struct iwl_priv { | |||
1048 | 995 | ||
1049 | struct tasklet_struct irq_tasklet; | 996 | struct tasklet_struct irq_tasklet; |
1050 | 997 | ||
998 | struct delayed_work set_power_save; | ||
1051 | struct delayed_work init_alive_start; | 999 | struct delayed_work init_alive_start; |
1052 | struct delayed_work alive_start; | 1000 | struct delayed_work alive_start; |
1053 | struct delayed_work scan_check; | 1001 | struct delayed_work scan_check; |