diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-08-26 02:11:01 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-29 15:25:34 -0400 |
commit | 04e1cabe4294fdf744489deb1e91edb1ec02e9a4 (patch) | |
tree | bf96250512769c0c16d5f73623540e69161a85b9 | |
parent | a0eaad713f6fc1f63fe293ad6ce63cb01e05c03c (diff) |
iwlagn: move reclaim related functions
Now that the reclaim flow has been moved to the transport layer, a lot of
functions can be made static or don't need to be exported outside the transport
layer.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 193 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 197 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 19 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-int-pcie.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 7 |
6 files changed, 200 insertions, 231 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 52ddb49d2017..bca5f99377ac 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -42,184 +42,6 @@ | |||
42 | #include "iwl-trans.h" | 42 | #include "iwl-trans.h" |
43 | #include "iwl-shared.h" | 43 | #include "iwl-shared.h" |
44 | 44 | ||
45 | static void iwlagn_count_tx_err_status(struct iwl_priv *priv, u16 status) | ||
46 | { | ||
47 | status &= TX_STATUS_MSK; | ||
48 | |||
49 | switch (status) { | ||
50 | case TX_STATUS_POSTPONE_DELAY: | ||
51 | priv->reply_tx_stats.pp_delay++; | ||
52 | break; | ||
53 | case TX_STATUS_POSTPONE_FEW_BYTES: | ||
54 | priv->reply_tx_stats.pp_few_bytes++; | ||
55 | break; | ||
56 | case TX_STATUS_POSTPONE_BT_PRIO: | ||
57 | priv->reply_tx_stats.pp_bt_prio++; | ||
58 | break; | ||
59 | case TX_STATUS_POSTPONE_QUIET_PERIOD: | ||
60 | priv->reply_tx_stats.pp_quiet_period++; | ||
61 | break; | ||
62 | case TX_STATUS_POSTPONE_CALC_TTAK: | ||
63 | priv->reply_tx_stats.pp_calc_ttak++; | ||
64 | break; | ||
65 | case TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY: | ||
66 | priv->reply_tx_stats.int_crossed_retry++; | ||
67 | break; | ||
68 | case TX_STATUS_FAIL_SHORT_LIMIT: | ||
69 | priv->reply_tx_stats.short_limit++; | ||
70 | break; | ||
71 | case TX_STATUS_FAIL_LONG_LIMIT: | ||
72 | priv->reply_tx_stats.long_limit++; | ||
73 | break; | ||
74 | case TX_STATUS_FAIL_FIFO_UNDERRUN: | ||
75 | priv->reply_tx_stats.fifo_underrun++; | ||
76 | break; | ||
77 | case TX_STATUS_FAIL_DRAIN_FLOW: | ||
78 | priv->reply_tx_stats.drain_flow++; | ||
79 | break; | ||
80 | case TX_STATUS_FAIL_RFKILL_FLUSH: | ||
81 | priv->reply_tx_stats.rfkill_flush++; | ||
82 | break; | ||
83 | case TX_STATUS_FAIL_LIFE_EXPIRE: | ||
84 | priv->reply_tx_stats.life_expire++; | ||
85 | break; | ||
86 | case TX_STATUS_FAIL_DEST_PS: | ||
87 | priv->reply_tx_stats.dest_ps++; | ||
88 | break; | ||
89 | case TX_STATUS_FAIL_HOST_ABORTED: | ||
90 | priv->reply_tx_stats.host_abort++; | ||
91 | break; | ||
92 | case TX_STATUS_FAIL_BT_RETRY: | ||
93 | priv->reply_tx_stats.bt_retry++; | ||
94 | break; | ||
95 | case TX_STATUS_FAIL_STA_INVALID: | ||
96 | priv->reply_tx_stats.sta_invalid++; | ||
97 | break; | ||
98 | case TX_STATUS_FAIL_FRAG_DROPPED: | ||
99 | priv->reply_tx_stats.frag_drop++; | ||
100 | break; | ||
101 | case TX_STATUS_FAIL_TID_DISABLE: | ||
102 | priv->reply_tx_stats.tid_disable++; | ||
103 | break; | ||
104 | case TX_STATUS_FAIL_FIFO_FLUSHED: | ||
105 | priv->reply_tx_stats.fifo_flush++; | ||
106 | break; | ||
107 | case TX_STATUS_FAIL_INSUFFICIENT_CF_POLL: | ||
108 | priv->reply_tx_stats.insuff_cf_poll++; | ||
109 | break; | ||
110 | case TX_STATUS_FAIL_PASSIVE_NO_RX: | ||
111 | priv->reply_tx_stats.fail_hw_drop++; | ||
112 | break; | ||
113 | case TX_STATUS_FAIL_NO_BEACON_ON_RADAR: | ||
114 | priv->reply_tx_stats.sta_color_mismatch++; | ||
115 | break; | ||
116 | default: | ||
117 | priv->reply_tx_stats.unknown++; | ||
118 | break; | ||
119 | } | ||
120 | } | ||
121 | |||
122 | void iwlagn_count_agg_tx_err_status(struct iwl_priv *priv, u16 status) | ||
123 | { | ||
124 | status &= AGG_TX_STATUS_MSK; | ||
125 | |||
126 | switch (status) { | ||
127 | case AGG_TX_STATE_UNDERRUN_MSK: | ||
128 | priv->reply_agg_tx_stats.underrun++; | ||
129 | break; | ||
130 | case AGG_TX_STATE_BT_PRIO_MSK: | ||
131 | priv->reply_agg_tx_stats.bt_prio++; | ||
132 | break; | ||
133 | case AGG_TX_STATE_FEW_BYTES_MSK: | ||
134 | priv->reply_agg_tx_stats.few_bytes++; | ||
135 | break; | ||
136 | case AGG_TX_STATE_ABORT_MSK: | ||
137 | priv->reply_agg_tx_stats.abort++; | ||
138 | break; | ||
139 | case AGG_TX_STATE_LAST_SENT_TTL_MSK: | ||
140 | priv->reply_agg_tx_stats.last_sent_ttl++; | ||
141 | break; | ||
142 | case AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK: | ||
143 | priv->reply_agg_tx_stats.last_sent_try++; | ||
144 | break; | ||
145 | case AGG_TX_STATE_LAST_SENT_BT_KILL_MSK: | ||
146 | priv->reply_agg_tx_stats.last_sent_bt_kill++; | ||
147 | break; | ||
148 | case AGG_TX_STATE_SCD_QUERY_MSK: | ||
149 | priv->reply_agg_tx_stats.scd_query++; | ||
150 | break; | ||
151 | case AGG_TX_STATE_TEST_BAD_CRC32_MSK: | ||
152 | priv->reply_agg_tx_stats.bad_crc32++; | ||
153 | break; | ||
154 | case AGG_TX_STATE_RESPONSE_MSK: | ||
155 | priv->reply_agg_tx_stats.response++; | ||
156 | break; | ||
157 | case AGG_TX_STATE_DUMP_TX_MSK: | ||
158 | priv->reply_agg_tx_stats.dump_tx++; | ||
159 | break; | ||
160 | case AGG_TX_STATE_DELAY_TX_MSK: | ||
161 | priv->reply_agg_tx_stats.delay_tx++; | ||
162 | break; | ||
163 | default: | ||
164 | priv->reply_agg_tx_stats.unknown++; | ||
165 | break; | ||
166 | } | ||
167 | } | ||
168 | |||
169 | void iwlagn_set_tx_status(struct iwl_priv *priv, | ||
170 | struct ieee80211_tx_info *info, | ||
171 | struct iwlagn_tx_resp *tx_resp, | ||
172 | bool is_agg) | ||
173 | { | ||
174 | u16 status = le16_to_cpu(tx_resp->status.status); | ||
175 | |||
176 | info->status.rates[0].count = tx_resp->failure_frame + 1; | ||
177 | if (is_agg) | ||
178 | info->flags &= ~IEEE80211_TX_CTL_AMPDU; | ||
179 | info->flags |= iwl_tx_status_to_mac80211(status); | ||
180 | iwlagn_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags), | ||
181 | info); | ||
182 | if (!iwl_is_tx_success(status)) | ||
183 | iwlagn_count_tx_err_status(priv, status); | ||
184 | } | ||
185 | |||
186 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
187 | #define AGG_TX_STATE_FAIL(x) case AGG_TX_STATE_ ## x: return #x | ||
188 | |||
189 | const char *iwl_get_agg_tx_fail_reason(u16 status) | ||
190 | { | ||
191 | status &= AGG_TX_STATUS_MSK; | ||
192 | switch (status) { | ||
193 | case AGG_TX_STATE_TRANSMITTED: | ||
194 | return "SUCCESS"; | ||
195 | AGG_TX_STATE_FAIL(UNDERRUN_MSK); | ||
196 | AGG_TX_STATE_FAIL(BT_PRIO_MSK); | ||
197 | AGG_TX_STATE_FAIL(FEW_BYTES_MSK); | ||
198 | AGG_TX_STATE_FAIL(ABORT_MSK); | ||
199 | AGG_TX_STATE_FAIL(LAST_SENT_TTL_MSK); | ||
200 | AGG_TX_STATE_FAIL(LAST_SENT_TRY_CNT_MSK); | ||
201 | AGG_TX_STATE_FAIL(LAST_SENT_BT_KILL_MSK); | ||
202 | AGG_TX_STATE_FAIL(SCD_QUERY_MSK); | ||
203 | AGG_TX_STATE_FAIL(TEST_BAD_CRC32_MSK); | ||
204 | AGG_TX_STATE_FAIL(RESPONSE_MSK); | ||
205 | AGG_TX_STATE_FAIL(DUMP_TX_MSK); | ||
206 | AGG_TX_STATE_FAIL(DELAY_TX_MSK); | ||
207 | } | ||
208 | |||
209 | return "UNKNOWN"; | ||
210 | } | ||
211 | #endif /* CONFIG_IWLWIFI_DEBUG */ | ||
212 | |||
213 | void iwl_check_abort_status(struct iwl_priv *priv, | ||
214 | u8 frame_count, u32 status) | ||
215 | { | ||
216 | if (frame_count == 1 && status == TX_STATUS_FAIL_RFKILL_FLUSH) { | ||
217 | IWL_ERR(priv, "Tx flush command to flush out all frames\n"); | ||
218 | if (!test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) | ||
219 | queue_work(priv->shrd->workqueue, &priv->tx_flush); | ||
220 | } | ||
221 | } | ||
222 | |||
223 | int iwlagn_hw_valid_rtc_data_addr(u32 addr) | 45 | int iwlagn_hw_valid_rtc_data_addr(u32 addr) |
224 | { | 46 | { |
225 | return (addr >= IWLAGN_RTC_DATA_LOWER_BOUND) && | 47 | return (addr >= IWLAGN_RTC_DATA_LOWER_BOUND) && |
@@ -812,21 +634,6 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv, | |||
812 | vif->bss_conf.bssid); | 634 | vif->bss_conf.bssid); |
813 | } | 635 | } |
814 | 636 | ||
815 | void iwl_free_tfds_in_queue(struct iwl_priv *priv, | ||
816 | int sta_id, int tid, int freed) | ||
817 | { | ||
818 | lockdep_assert_held(&priv->shrd->sta_lock); | ||
819 | |||
820 | if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed) | ||
821 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; | ||
822 | else { | ||
823 | IWL_DEBUG_TX(priv, "free more than tfds_in_queue (%u:%d)\n", | ||
824 | priv->stations[sta_id].tid[tid].tfds_in_queue, | ||
825 | freed); | ||
826 | priv->stations[sta_id].tid[tid].tfds_in_queue = 0; | ||
827 | } | ||
828 | } | ||
829 | |||
830 | #define IWL_FLUSH_WAIT_MS 2000 | 637 | #define IWL_FLUSH_WAIT_MS 2000 |
831 | 638 | ||
832 | int iwlagn_wait_tx_queue_empty(struct iwl_priv *priv) | 639 | int iwlagn_wait_tx_queue_empty(struct iwl_priv *priv) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index b56a269aa5f4..e95f9c61f95a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -638,7 +638,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, | |||
638 | return 0; | 638 | return 0; |
639 | } | 639 | } |
640 | 640 | ||
641 | int iwlagn_txq_check_empty(struct iwl_priv *priv, | 641 | static int iwlagn_txq_check_empty(struct iwl_priv *priv, |
642 | int sta_id, u8 tid, int txq_id) | 642 | int sta_id, u8 tid, int txq_id) |
643 | { | 643 | { |
644 | struct iwl_queue *q = &priv->txq[txq_id].q; | 644 | struct iwl_queue *q = &priv->txq[txq_id].q; |
@@ -700,7 +700,7 @@ static void iwlagn_non_agg_tx_status(struct iwl_priv *priv, | |||
700 | /** | 700 | /** |
701 | * translate ucode response to mac80211 tx status control values | 701 | * translate ucode response to mac80211 tx status control values |
702 | */ | 702 | */ |
703 | void iwlagn_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags, | 703 | static void iwlagn_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags, |
704 | struct ieee80211_tx_info *info) | 704 | struct ieee80211_tx_info *info) |
705 | { | 705 | { |
706 | struct ieee80211_tx_rate *r = &info->control.rates[0]; | 706 | struct ieee80211_tx_rate *r = &info->control.rates[0]; |
@@ -760,6 +760,53 @@ const char *iwl_get_tx_fail_reason(u32 status) | |||
760 | } | 760 | } |
761 | #endif /* CONFIG_IWLWIFI_DEBUG */ | 761 | #endif /* CONFIG_IWLWIFI_DEBUG */ |
762 | 762 | ||
763 | static void iwlagn_count_agg_tx_err_status(struct iwl_priv *priv, u16 status) | ||
764 | { | ||
765 | status &= AGG_TX_STATUS_MSK; | ||
766 | |||
767 | switch (status) { | ||
768 | case AGG_TX_STATE_UNDERRUN_MSK: | ||
769 | priv->reply_agg_tx_stats.underrun++; | ||
770 | break; | ||
771 | case AGG_TX_STATE_BT_PRIO_MSK: | ||
772 | priv->reply_agg_tx_stats.bt_prio++; | ||
773 | break; | ||
774 | case AGG_TX_STATE_FEW_BYTES_MSK: | ||
775 | priv->reply_agg_tx_stats.few_bytes++; | ||
776 | break; | ||
777 | case AGG_TX_STATE_ABORT_MSK: | ||
778 | priv->reply_agg_tx_stats.abort++; | ||
779 | break; | ||
780 | case AGG_TX_STATE_LAST_SENT_TTL_MSK: | ||
781 | priv->reply_agg_tx_stats.last_sent_ttl++; | ||
782 | break; | ||
783 | case AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK: | ||
784 | priv->reply_agg_tx_stats.last_sent_try++; | ||
785 | break; | ||
786 | case AGG_TX_STATE_LAST_SENT_BT_KILL_MSK: | ||
787 | priv->reply_agg_tx_stats.last_sent_bt_kill++; | ||
788 | break; | ||
789 | case AGG_TX_STATE_SCD_QUERY_MSK: | ||
790 | priv->reply_agg_tx_stats.scd_query++; | ||
791 | break; | ||
792 | case AGG_TX_STATE_TEST_BAD_CRC32_MSK: | ||
793 | priv->reply_agg_tx_stats.bad_crc32++; | ||
794 | break; | ||
795 | case AGG_TX_STATE_RESPONSE_MSK: | ||
796 | priv->reply_agg_tx_stats.response++; | ||
797 | break; | ||
798 | case AGG_TX_STATE_DUMP_TX_MSK: | ||
799 | priv->reply_agg_tx_stats.dump_tx++; | ||
800 | break; | ||
801 | case AGG_TX_STATE_DELAY_TX_MSK: | ||
802 | priv->reply_agg_tx_stats.delay_tx++; | ||
803 | break; | ||
804 | default: | ||
805 | priv->reply_agg_tx_stats.unknown++; | ||
806 | break; | ||
807 | } | ||
808 | } | ||
809 | |||
763 | static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, | 810 | static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, |
764 | struct iwlagn_tx_resp *tx_resp) | 811 | struct iwlagn_tx_resp *tx_resp) |
765 | { | 812 | { |
@@ -808,12 +855,158 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, | |||
808 | } | 855 | } |
809 | } | 856 | } |
810 | 857 | ||
858 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
859 | #define AGG_TX_STATE_FAIL(x) case AGG_TX_STATE_ ## x: return #x | ||
860 | |||
861 | const char *iwl_get_agg_tx_fail_reason(u16 status) | ||
862 | { | ||
863 | status &= AGG_TX_STATUS_MSK; | ||
864 | switch (status) { | ||
865 | case AGG_TX_STATE_TRANSMITTED: | ||
866 | return "SUCCESS"; | ||
867 | AGG_TX_STATE_FAIL(UNDERRUN_MSK); | ||
868 | AGG_TX_STATE_FAIL(BT_PRIO_MSK); | ||
869 | AGG_TX_STATE_FAIL(FEW_BYTES_MSK); | ||
870 | AGG_TX_STATE_FAIL(ABORT_MSK); | ||
871 | AGG_TX_STATE_FAIL(LAST_SENT_TTL_MSK); | ||
872 | AGG_TX_STATE_FAIL(LAST_SENT_TRY_CNT_MSK); | ||
873 | AGG_TX_STATE_FAIL(LAST_SENT_BT_KILL_MSK); | ||
874 | AGG_TX_STATE_FAIL(SCD_QUERY_MSK); | ||
875 | AGG_TX_STATE_FAIL(TEST_BAD_CRC32_MSK); | ||
876 | AGG_TX_STATE_FAIL(RESPONSE_MSK); | ||
877 | AGG_TX_STATE_FAIL(DUMP_TX_MSK); | ||
878 | AGG_TX_STATE_FAIL(DELAY_TX_MSK); | ||
879 | } | ||
880 | |||
881 | return "UNKNOWN"; | ||
882 | } | ||
883 | #endif /* CONFIG_IWLWIFI_DEBUG */ | ||
884 | |||
811 | static inline u32 iwlagn_get_scd_ssn(struct iwlagn_tx_resp *tx_resp) | 885 | static inline u32 iwlagn_get_scd_ssn(struct iwlagn_tx_resp *tx_resp) |
812 | { | 886 | { |
813 | return le32_to_cpup((__le32 *)&tx_resp->status + | 887 | return le32_to_cpup((__le32 *)&tx_resp->status + |
814 | tx_resp->frame_count) & MAX_SN; | 888 | tx_resp->frame_count) & MAX_SN; |
815 | } | 889 | } |
816 | 890 | ||
891 | static void iwl_free_tfds_in_queue(struct iwl_priv *priv, | ||
892 | int sta_id, int tid, int freed) | ||
893 | { | ||
894 | lockdep_assert_held(&priv->shrd->sta_lock); | ||
895 | |||
896 | if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed) | ||
897 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; | ||
898 | else { | ||
899 | IWL_DEBUG_TX(priv, "free more than tfds_in_queue (%u:%d)\n", | ||
900 | priv->stations[sta_id].tid[tid].tfds_in_queue, | ||
901 | freed); | ||
902 | priv->stations[sta_id].tid[tid].tfds_in_queue = 0; | ||
903 | } | ||
904 | } | ||
905 | |||
906 | static void iwlagn_count_tx_err_status(struct iwl_priv *priv, u16 status) | ||
907 | { | ||
908 | status &= TX_STATUS_MSK; | ||
909 | |||
910 | switch (status) { | ||
911 | case TX_STATUS_POSTPONE_DELAY: | ||
912 | priv->reply_tx_stats.pp_delay++; | ||
913 | break; | ||
914 | case TX_STATUS_POSTPONE_FEW_BYTES: | ||
915 | priv->reply_tx_stats.pp_few_bytes++; | ||
916 | break; | ||
917 | case TX_STATUS_POSTPONE_BT_PRIO: | ||
918 | priv->reply_tx_stats.pp_bt_prio++; | ||
919 | break; | ||
920 | case TX_STATUS_POSTPONE_QUIET_PERIOD: | ||
921 | priv->reply_tx_stats.pp_quiet_period++; | ||
922 | break; | ||
923 | case TX_STATUS_POSTPONE_CALC_TTAK: | ||
924 | priv->reply_tx_stats.pp_calc_ttak++; | ||
925 | break; | ||
926 | case TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY: | ||
927 | priv->reply_tx_stats.int_crossed_retry++; | ||
928 | break; | ||
929 | case TX_STATUS_FAIL_SHORT_LIMIT: | ||
930 | priv->reply_tx_stats.short_limit++; | ||
931 | break; | ||
932 | case TX_STATUS_FAIL_LONG_LIMIT: | ||
933 | priv->reply_tx_stats.long_limit++; | ||
934 | break; | ||
935 | case TX_STATUS_FAIL_FIFO_UNDERRUN: | ||
936 | priv->reply_tx_stats.fifo_underrun++; | ||
937 | break; | ||
938 | case TX_STATUS_FAIL_DRAIN_FLOW: | ||
939 | priv->reply_tx_stats.drain_flow++; | ||
940 | break; | ||
941 | case TX_STATUS_FAIL_RFKILL_FLUSH: | ||
942 | priv->reply_tx_stats.rfkill_flush++; | ||
943 | break; | ||
944 | case TX_STATUS_FAIL_LIFE_EXPIRE: | ||
945 | priv->reply_tx_stats.life_expire++; | ||
946 | break; | ||
947 | case TX_STATUS_FAIL_DEST_PS: | ||
948 | priv->reply_tx_stats.dest_ps++; | ||
949 | break; | ||
950 | case TX_STATUS_FAIL_HOST_ABORTED: | ||
951 | priv->reply_tx_stats.host_abort++; | ||
952 | break; | ||
953 | case TX_STATUS_FAIL_BT_RETRY: | ||
954 | priv->reply_tx_stats.bt_retry++; | ||
955 | break; | ||
956 | case TX_STATUS_FAIL_STA_INVALID: | ||
957 | priv->reply_tx_stats.sta_invalid++; | ||
958 | break; | ||
959 | case TX_STATUS_FAIL_FRAG_DROPPED: | ||
960 | priv->reply_tx_stats.frag_drop++; | ||
961 | break; | ||
962 | case TX_STATUS_FAIL_TID_DISABLE: | ||
963 | priv->reply_tx_stats.tid_disable++; | ||
964 | break; | ||
965 | case TX_STATUS_FAIL_FIFO_FLUSHED: | ||
966 | priv->reply_tx_stats.fifo_flush++; | ||
967 | break; | ||
968 | case TX_STATUS_FAIL_INSUFFICIENT_CF_POLL: | ||
969 | priv->reply_tx_stats.insuff_cf_poll++; | ||
970 | break; | ||
971 | case TX_STATUS_FAIL_PASSIVE_NO_RX: | ||
972 | priv->reply_tx_stats.fail_hw_drop++; | ||
973 | break; | ||
974 | case TX_STATUS_FAIL_NO_BEACON_ON_RADAR: | ||
975 | priv->reply_tx_stats.sta_color_mismatch++; | ||
976 | break; | ||
977 | default: | ||
978 | priv->reply_tx_stats.unknown++; | ||
979 | break; | ||
980 | } | ||
981 | } | ||
982 | |||
983 | static void iwlagn_set_tx_status(struct iwl_priv *priv, | ||
984 | struct ieee80211_tx_info *info, | ||
985 | struct iwlagn_tx_resp *tx_resp, | ||
986 | bool is_agg) | ||
987 | { | ||
988 | u16 status = le16_to_cpu(tx_resp->status.status); | ||
989 | |||
990 | info->status.rates[0].count = tx_resp->failure_frame + 1; | ||
991 | if (is_agg) | ||
992 | info->flags &= ~IEEE80211_TX_CTL_AMPDU; | ||
993 | info->flags |= iwl_tx_status_to_mac80211(status); | ||
994 | iwlagn_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags), | ||
995 | info); | ||
996 | if (!iwl_is_tx_success(status)) | ||
997 | iwlagn_count_tx_err_status(priv, status); | ||
998 | } | ||
999 | |||
1000 | static void iwl_check_abort_status(struct iwl_priv *priv, | ||
1001 | u8 frame_count, u32 status) | ||
1002 | { | ||
1003 | if (frame_count == 1 && status == TX_STATUS_FAIL_RFKILL_FLUSH) { | ||
1004 | IWL_ERR(priv, "Tx flush command to flush out all frames\n"); | ||
1005 | if (!test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) | ||
1006 | queue_work(priv->shrd->workqueue, &priv->tx_flush); | ||
1007 | } | ||
1008 | } | ||
1009 | |||
817 | void iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | 1010 | void iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) |
818 | { | 1011 | { |
819 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 1012 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index f34590765074..c30299da4daf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -121,10 +121,6 @@ static inline void iwl_set_calib_hdr(struct iwl_calib_hdr *hdr, u8 cmd) | |||
121 | hdr->data_valid = 1; | 121 | hdr->data_valid = 1; |
122 | } | 122 | } |
123 | 123 | ||
124 | /* tx queue */ | ||
125 | void iwl_free_tfds_in_queue(struct iwl_priv *priv, | ||
126 | int sta_id, int tid, int freed); | ||
127 | |||
128 | /* RXON */ | 124 | /* RXON */ |
129 | int iwlagn_set_pan_params(struct iwl_priv *priv); | 125 | int iwlagn_set_pan_params(struct iwl_priv *priv); |
130 | int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx); | 126 | int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx); |
@@ -146,13 +142,6 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv, | |||
146 | enum iwlagn_ucode_type ucode_type); | 142 | enum iwlagn_ucode_type ucode_type); |
147 | 143 | ||
148 | /* lib */ | 144 | /* lib */ |
149 | void iwlagn_set_tx_status(struct iwl_priv *priv, | ||
150 | struct ieee80211_tx_info *info, | ||
151 | struct iwlagn_tx_resp *tx_resp, | ||
152 | bool is_agg); | ||
153 | void iwlagn_count_agg_tx_err_status(struct iwl_priv *priv, u16 status); | ||
154 | void iwl_check_abort_status(struct iwl_priv *priv, | ||
155 | u8 frame_count, u32 status); | ||
156 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); | 145 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); |
157 | int iwlagn_send_tx_power(struct iwl_priv *priv); | 146 | int iwlagn_send_tx_power(struct iwl_priv *priv); |
158 | void iwlagn_temperature(struct iwl_priv *priv); | 147 | void iwlagn_temperature(struct iwl_priv *priv); |
@@ -169,22 +158,14 @@ void iwl_rx_dispatch(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb); | |||
169 | 158 | ||
170 | 159 | ||
171 | /* tx */ | 160 | /* tx */ |
172 | void iwlagn_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq, | ||
173 | int index); | ||
174 | void iwlagn_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags, | ||
175 | struct ieee80211_tx_info *info); | ||
176 | int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb); | 161 | int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb); |
177 | int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, | 162 | int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, |
178 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 163 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
179 | int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, | 164 | int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, |
180 | struct ieee80211_sta *sta, u16 tid); | 165 | struct ieee80211_sta *sta, u16 tid); |
181 | int iwlagn_txq_check_empty(struct iwl_priv *priv, | ||
182 | int sta_id, u8 tid, int txq_id); | ||
183 | void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, | 166 | void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, |
184 | struct iwl_rx_mem_buffer *rxb); | 167 | struct iwl_rx_mem_buffer *rxb); |
185 | void iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb); | 168 | void iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb); |
186 | void iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index, | ||
187 | struct sk_buff_head *skbs); | ||
188 | 169 | ||
189 | static inline u32 iwl_tx_status_to_mac80211(u32 status) | 170 | static inline u32 iwl_tx_status_to_mac80211(u32 status) |
190 | { | 171 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-int-pcie.h b/drivers/net/wireless/iwlwifi/iwl-trans-int-pcie.h index f60b26f4dc7b..717b6dc38b20 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-int-pcie.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans-int-pcie.h | |||
@@ -136,8 +136,6 @@ irqreturn_t iwl_isr_ict(int irq, void *data); | |||
136 | * TX / HCMD | 136 | * TX / HCMD |
137 | ******************************************************/ | 137 | ******************************************************/ |
138 | void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq); | 138 | void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq); |
139 | void iwlagn_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq, | ||
140 | int index); | ||
141 | int iwlagn_txq_attach_buf_to_tfd(struct iwl_priv *priv, | 139 | int iwlagn_txq_attach_buf_to_tfd(struct iwl_priv *priv, |
142 | struct iwl_tx_queue *txq, | 140 | struct iwl_tx_queue *txq, |
143 | dma_addr_t addr, u16 len, u8 reset); | 141 | dma_addr_t addr, u16 len, u8 reset); |
@@ -159,6 +157,10 @@ void iwl_trans_tx_queue_set_status(struct iwl_priv *priv, | |||
159 | int tx_fifo_id, int scd_retry); | 157 | int tx_fifo_id, int scd_retry); |
160 | void iwl_trans_pcie_txq_agg_setup(struct iwl_priv *priv, int sta_id, int tid, | 158 | void iwl_trans_pcie_txq_agg_setup(struct iwl_priv *priv, int sta_id, int tid, |
161 | int frame_limit); | 159 | int frame_limit); |
160 | void iwlagn_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq, | ||
161 | int index); | ||
162 | void iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index, | ||
163 | struct sk_buff_head *skbs); | ||
162 | 164 | ||
163 | /***************************************************** | 165 | /***************************************************** |
164 | * Error handling | 166 | * Error handling |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c index 7438aaedbd5c..e1f9ceeb02ed 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c | |||
@@ -332,13 +332,7 @@ int iwl_queue_init(struct iwl_priv *priv, struct iwl_queue *q, | |||
332 | return 0; | 332 | return 0; |
333 | } | 333 | } |
334 | 334 | ||
335 | /*TODO: this functions should NOT be exported from trans module - export it | 335 | static void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, |
336 | * until the reclaim flow will be brought to the transport module too. | ||
337 | * Add a declaration to make sparse happy */ | ||
338 | void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, | ||
339 | struct iwl_tx_queue *txq); | ||
340 | |||
341 | void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, | ||
342 | struct iwl_tx_queue *txq) | 336 | struct iwl_tx_queue *txq) |
343 | { | 337 | { |
344 | struct iwlagn_scd_bc_tbl *scd_bc_tbl = priv->scd_bc_tbls.addr; | 338 | struct iwlagn_scd_bc_tbl *scd_bc_tbl = priv->scd_bc_tbls.addr; |
@@ -1042,7 +1036,6 @@ int iwl_trans_pcie_send_cmd_pdu(struct iwl_priv *priv, u8 id, u32 flags, | |||
1042 | /* Frees buffers until index _not_ inclusive */ | 1036 | /* Frees buffers until index _not_ inclusive */ |
1043 | void iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index, | 1037 | void iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index, |
1044 | struct sk_buff_head *skbs) | 1038 | struct sk_buff_head *skbs) |
1045 | |||
1046 | { | 1039 | { |
1047 | struct iwl_tx_queue *txq = &priv(trans)->txq[txq_id]; | 1040 | struct iwl_tx_queue *txq = &priv(trans)->txq[txq_id]; |
1048 | struct iwl_queue *q = &txq->q; | 1041 | struct iwl_queue *q = &txq->q; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 519ad91bda1c..7fd0296f155e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -272,11 +272,4 @@ static inline int iwl_trans_resume(struct iwl_trans *trans) | |||
272 | ******************************************************/ | 272 | ******************************************************/ |
273 | extern const struct iwl_trans_ops trans_ops_pcie; | 273 | extern const struct iwl_trans_ops trans_ops_pcie; |
274 | 274 | ||
275 | /*TODO: this functions should NOT be exported from trans module - export it | ||
276 | * until the reclaim flow will be brought to the transport module too */ | ||
277 | |||
278 | struct iwl_tx_queue; | ||
279 | void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, | ||
280 | struct iwl_tx_queue *txq); | ||
281 | |||
282 | #endif /* __iwl_trans_h__ */ | 275 | #endif /* __iwl_trans_h__ */ |