aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c47
1 files changed, 15 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 3bee0f119bcd..4edb6cfc5488 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -753,18 +753,6 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
753 return added; 753 return added;
754} 754}
755 755
756static int iwl_fill_offch_tx(struct iwl_priv *priv, void *data, size_t maxlen)
757{
758 struct sk_buff *skb = priv->offchan_tx_skb;
759
760 if (skb->len < maxlen)
761 maxlen = skb->len;
762
763 memcpy(data, skb->data, maxlen);
764
765 return maxlen;
766}
767
768int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) 756int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
769{ 757{
770 struct iwl_host_cmd cmd = { 758 struct iwl_host_cmd cmd = {
@@ -807,7 +795,7 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
807 scan->quiet_plcp_th = IWL_PLCP_QUIET_THRESH; 795 scan->quiet_plcp_th = IWL_PLCP_QUIET_THRESH;
808 scan->quiet_time = IWL_ACTIVE_QUIET_TIME; 796 scan->quiet_time = IWL_ACTIVE_QUIET_TIME;
809 797
810 if (priv->scan_type != IWL_SCAN_OFFCH_TX && 798 if (priv->scan_type != IWL_SCAN_ROC &&
811 iwl_is_any_associated(priv)) { 799 iwl_is_any_associated(priv)) {
812 u16 interval = 0; 800 u16 interval = 0;
813 u32 extra; 801 u32 extra;
@@ -816,7 +804,7 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
816 804
817 IWL_DEBUG_INFO(priv, "Scanning while associated...\n"); 805 IWL_DEBUG_INFO(priv, "Scanning while associated...\n");
818 switch (priv->scan_type) { 806 switch (priv->scan_type) {
819 case IWL_SCAN_OFFCH_TX: 807 case IWL_SCAN_ROC:
820 WARN_ON(1); 808 WARN_ON(1);
821 break; 809 break;
822 case IWL_SCAN_RADIO_RESET: 810 case IWL_SCAN_RADIO_RESET:
@@ -838,10 +826,11 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
838 scan->suspend_time = cpu_to_le32(scan_suspend_time); 826 scan->suspend_time = cpu_to_le32(scan_suspend_time);
839 IWL_DEBUG_SCAN(priv, "suspend_time 0x%X beacon interval %d\n", 827 IWL_DEBUG_SCAN(priv, "suspend_time 0x%X beacon interval %d\n",
840 scan_suspend_time, interval); 828 scan_suspend_time, interval);
841 } else if (priv->scan_type == IWL_SCAN_OFFCH_TX) { 829 } else if (priv->scan_type == IWL_SCAN_ROC) {
842 scan->suspend_time = 0; 830 scan->suspend_time = 0;
843 scan->max_out_time = 831 scan->max_out_time = 0;
844 cpu_to_le32(1024 * priv->offchan_tx_timeout); 832 scan->quiet_time = 0;
833 scan->quiet_plcp_th = 0;
845 } 834 }
846 835
847 switch (priv->scan_type) { 836 switch (priv->scan_type) {
@@ -869,8 +858,8 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
869 } else 858 } else
870 IWL_DEBUG_SCAN(priv, "Start passive scan.\n"); 859 IWL_DEBUG_SCAN(priv, "Start passive scan.\n");
871 break; 860 break;
872 case IWL_SCAN_OFFCH_TX: 861 case IWL_SCAN_ROC:
873 IWL_DEBUG_SCAN(priv, "Start offchannel TX scan.\n"); 862 IWL_DEBUG_SCAN(priv, "Start ROC scan.\n");
874 break; 863 break;
875 } 864 }
876 865
@@ -988,19 +977,13 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
988 IWL_MAX_SCAN_SIZE - sizeof(*scan)); 977 IWL_MAX_SCAN_SIZE - sizeof(*scan));
989 break; 978 break;
990 case IWL_SCAN_RADIO_RESET: 979 case IWL_SCAN_RADIO_RESET:
980 case IWL_SCAN_ROC:
991 /* use bcast addr, will not be transmitted but must be valid */ 981 /* use bcast addr, will not be transmitted but must be valid */
992 cmd_len = iwl_fill_probe_req(priv, 982 cmd_len = iwl_fill_probe_req(priv,
993 (struct ieee80211_mgmt *)scan->data, 983 (struct ieee80211_mgmt *)scan->data,
994 iwl_bcast_addr, NULL, 0, 984 iwl_bcast_addr, NULL, 0,
995 IWL_MAX_SCAN_SIZE - sizeof(*scan)); 985 IWL_MAX_SCAN_SIZE - sizeof(*scan));
996 break; 986 break;
997 case IWL_SCAN_OFFCH_TX:
998 cmd_len = iwl_fill_offch_tx(priv, scan->data,
999 IWL_MAX_SCAN_SIZE
1000 - sizeof(*scan)
1001 - sizeof(struct iwl_scan_channel));
1002 scan->scan_flags |= IWL_SCAN_FLAGS_ACTION_FRAME_TX;
1003 break;
1004 default: 987 default:
1005 BUG(); 988 BUG();
1006 } 989 }
@@ -1021,18 +1004,18 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1021 is_active, n_probes, 1004 is_active, n_probes,
1022 (void *)&scan->data[cmd_len]); 1005 (void *)&scan->data[cmd_len]);
1023 break; 1006 break;
1024 case IWL_SCAN_OFFCH_TX: { 1007 case IWL_SCAN_ROC: {
1025 struct iwl_scan_channel *scan_ch; 1008 struct iwl_scan_channel *scan_ch;
1026 1009
1027 scan->channel_count = 1; 1010 scan->channel_count = 1;
1028 1011
1029 scan_ch = (void *)&scan->data[cmd_len]; 1012 scan_ch = (void *)&scan->data[cmd_len];
1030 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; 1013 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
1031 scan_ch->channel = 1014 scan_ch->channel =
1032 cpu_to_le16(priv->offchan_tx_chan->hw_value); 1015 cpu_to_le16(priv->hw_roc_channel->hw_value);
1033 scan_ch->active_dwell = 1016 scan_ch->active_dwell =
1034 cpu_to_le16(priv->offchan_tx_timeout); 1017 scan_ch->passive_dwell =
1035 scan_ch->passive_dwell = 0; 1018 cpu_to_le16(priv->hw_roc_duration);
1036 1019
1037 /* Set txpower levels to defaults */ 1020 /* Set txpower levels to defaults */
1038 scan_ch->dsp_atten = 110; 1021 scan_ch->dsp_atten = 110;
@@ -1041,7 +1024,7 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1041 * power level: 1024 * power level:
1042 * scan_ch->tx_gain = ((1 << 5) | (2 << 3)) | 3; 1025 * scan_ch->tx_gain = ((1 << 5) | (2 << 3)) | 3;
1043 */ 1026 */
1044 if (priv->offchan_tx_chan->band == IEEE80211_BAND_5GHZ) 1027 if (priv->hw_roc_channel->band == IEEE80211_BAND_5GHZ)
1045 scan_ch->tx_gain = ((1 << 5) | (3 << 3)) | 3; 1028 scan_ch->tx_gain = ((1 << 5) | (3 << 3)) | 3;
1046 else 1029 else
1047 scan_ch->tx_gain = ((1 << 5) | (5 << 3)); 1030 scan_ch->tx_gain = ((1 << 5) | (5 << 3));