diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 65 |
1 files changed, 11 insertions, 54 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index f675b2993a3d..119185fb1e26 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
| @@ -1593,7 +1593,7 @@ static u16 iwl3945_supported_rate_to_ie(u8 *ie, u16 supported_rate, | |||
| 1593 | */ | 1593 | */ |
| 1594 | static u16 iwl3945_fill_probe_req(struct iwl3945_priv *priv, | 1594 | static u16 iwl3945_fill_probe_req(struct iwl3945_priv *priv, |
| 1595 | struct ieee80211_mgmt *frame, | 1595 | struct ieee80211_mgmt *frame, |
| 1596 | int left, int is_direct) | 1596 | int left) |
| 1597 | { | 1597 | { |
| 1598 | int len = 0; | 1598 | int len = 0; |
| 1599 | u8 *pos = NULL; | 1599 | u8 *pos = NULL; |
| @@ -1623,20 +1623,6 @@ static u16 iwl3945_fill_probe_req(struct iwl3945_priv *priv, | |||
| 1623 | *pos++ = WLAN_EID_SSID; | 1623 | *pos++ = WLAN_EID_SSID; |
| 1624 | *pos++ = 0; | 1624 | *pos++ = 0; |
| 1625 | 1625 | ||
| 1626 | /* fill in our direct SSID IE... */ | ||
| 1627 | if (is_direct) { | ||
| 1628 | /* ...next IE... */ | ||
| 1629 | left -= 2 + priv->essid_len; | ||
| 1630 | if (left < 0) | ||
| 1631 | return 0; | ||
| 1632 | /* ... fill it in... */ | ||
| 1633 | *pos++ = WLAN_EID_SSID; | ||
| 1634 | *pos++ = priv->essid_len; | ||
| 1635 | memcpy(pos, priv->essid, priv->essid_len); | ||
| 1636 | pos += priv->essid_len; | ||
| 1637 | len += 2 + priv->essid_len; | ||
| 1638 | } | ||
| 1639 | |||
| 1640 | /* fill in supported rate */ | 1626 | /* fill in supported rate */ |
| 1641 | /* ...next IE... */ | 1627 | /* ...next IE... */ |
| 1642 | left -= 2; | 1628 | left -= 2; |
| @@ -2189,13 +2175,14 @@ static void iwl3945_set_flags_for_phymode(struct iwl3945_priv *priv, | |||
| 2189 | /* | 2175 | /* |
| 2190 | * initialize rxon structure with default values from eeprom | 2176 | * initialize rxon structure with default values from eeprom |
| 2191 | */ | 2177 | */ |
| 2192 | static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv) | 2178 | static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv, |
| 2179 | int mode) | ||
| 2193 | { | 2180 | { |
| 2194 | const struct iwl3945_channel_info *ch_info; | 2181 | const struct iwl3945_channel_info *ch_info; |
| 2195 | 2182 | ||
| 2196 | memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon)); | 2183 | memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon)); |
| 2197 | 2184 | ||
| 2198 | switch (priv->iw_mode) { | 2185 | switch (mode) { |
| 2199 | case NL80211_IFTYPE_AP: | 2186 | case NL80211_IFTYPE_AP: |
| 2200 | priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP; | 2187 | priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP; |
| 2201 | break; | 2188 | break; |
| @@ -2218,7 +2205,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv) | |||
| 2218 | RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; | 2205 | RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; |
| 2219 | break; | 2206 | break; |
| 2220 | default: | 2207 | default: |
| 2221 | IWL_ERROR("Unsupported interface type %d\n", priv->iw_mode); | 2208 | IWL_ERROR("Unsupported interface type %d\n", mode); |
| 2222 | break; | 2209 | break; |
| 2223 | } | 2210 | } |
| 2224 | 2211 | ||
| @@ -2241,8 +2228,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv) | |||
| 2241 | * in some case A channels are all non IBSS | 2228 | * in some case A channels are all non IBSS |
| 2242 | * in this case force B/G channel | 2229 | * in this case force B/G channel |
| 2243 | */ | 2230 | */ |
| 2244 | if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) && | 2231 | if ((mode == NL80211_IFTYPE_ADHOC) && !(is_channel_ibss(ch_info))) |
| 2245 | !(is_channel_ibss(ch_info))) | ||
| 2246 | ch_info = &priv->channel_info[0]; | 2232 | ch_info = &priv->channel_info[0]; |
| 2247 | 2233 | ||
| 2248 | priv->staging_rxon.channel = cpu_to_le16(ch_info->channel); | 2234 | priv->staging_rxon.channel = cpu_to_le16(ch_info->channel); |
| @@ -2275,9 +2261,7 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) | |||
| 2275 | } | 2261 | } |
| 2276 | } | 2262 | } |
| 2277 | 2263 | ||
| 2278 | priv->iw_mode = mode; | 2264 | iwl3945_connection_init_rx_config(priv, mode); |
| 2279 | |||
| 2280 | iwl3945_connection_init_rx_config(priv); | ||
| 2281 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); | 2265 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); |
| 2282 | 2266 | ||
| 2283 | iwl3945_clear_stations_table(priv); | 2267 | iwl3945_clear_stations_table(priv); |
| @@ -5699,7 +5683,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv) | |||
| 5699 | active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 5683 | active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
| 5700 | } else { | 5684 | } else { |
| 5701 | /* Initialize our rx_config data */ | 5685 | /* Initialize our rx_config data */ |
| 5702 | iwl3945_connection_init_rx_config(priv); | 5686 | iwl3945_connection_init_rx_config(priv, priv->iw_mode); |
| 5703 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); | 5687 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); |
| 5704 | } | 5688 | } |
| 5705 | 5689 | ||
| @@ -6015,6 +5999,7 @@ static void iwl3945_bg_set_monitor(struct work_struct *work) | |||
| 6015 | IWL_ERROR("iwl3945_set_mode() failed\n"); | 5999 | IWL_ERROR("iwl3945_set_mode() failed\n"); |
| 6016 | 6000 | ||
| 6017 | mutex_unlock(&priv->mutex); | 6001 | mutex_unlock(&priv->mutex); |
| 6002 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
| 6018 | } | 6003 | } |
| 6019 | 6004 | ||
| 6020 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) | 6005 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) |
| @@ -6162,14 +6147,6 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
| 6162 | memcpy(scan->direct_scan[0].ssid, | 6147 | memcpy(scan->direct_scan[0].ssid, |
| 6163 | priv->direct_ssid, priv->direct_ssid_len); | 6148 | priv->direct_ssid, priv->direct_ssid_len); |
| 6164 | n_probes++; | 6149 | n_probes++; |
| 6165 | } else if (!iwl3945_is_associated(priv) && priv->essid_len) { | ||
| 6166 | IWL_DEBUG_SCAN | ||
| 6167 | ("Kicking off one direct scan for '%s' when not associated\n", | ||
| 6168 | print_ssid(ssid, priv->essid, priv->essid_len)); | ||
| 6169 | scan->direct_scan[0].id = WLAN_EID_SSID; | ||
| 6170 | scan->direct_scan[0].len = priv->essid_len; | ||
| 6171 | memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); | ||
| 6172 | n_probes++; | ||
| 6173 | } else | 6150 | } else |
| 6174 | IWL_DEBUG_SCAN("Kicking off one indirect scan.\n"); | 6151 | IWL_DEBUG_SCAN("Kicking off one indirect scan.\n"); |
| 6175 | 6152 | ||
| @@ -6177,7 +6154,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
| 6177 | * that based on the direct_mask added to each channel entry */ | 6154 | * that based on the direct_mask added to each channel entry */ |
| 6178 | scan->tx_cmd.len = cpu_to_le16( | 6155 | scan->tx_cmd.len = cpu_to_le16( |
| 6179 | iwl3945_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data, | 6156 | iwl3945_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data, |
| 6180 | IWL_MAX_SCAN_SIZE - sizeof(*scan), 0)); | 6157 | IWL_MAX_SCAN_SIZE - sizeof(*scan))); |
| 6181 | scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; | 6158 | scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; |
| 6182 | scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id; | 6159 | scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id; |
| 6183 | scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; | 6160 | scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; |
| @@ -6566,6 +6543,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, | |||
| 6566 | 6543 | ||
| 6567 | spin_lock_irqsave(&priv->lock, flags); | 6544 | spin_lock_irqsave(&priv->lock, flags); |
| 6568 | priv->vif = conf->vif; | 6545 | priv->vif = conf->vif; |
| 6546 | priv->iw_mode = conf->type; | ||
| 6569 | 6547 | ||
| 6570 | spin_unlock_irqrestore(&priv->lock, flags); | 6548 | spin_unlock_irqrestore(&priv->lock, flags); |
| 6571 | 6549 | ||
| @@ -6742,7 +6720,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, | |||
| 6742 | struct ieee80211_if_conf *conf) | 6720 | struct ieee80211_if_conf *conf) |
| 6743 | { | 6721 | { |
| 6744 | struct iwl3945_priv *priv = hw->priv; | 6722 | struct iwl3945_priv *priv = hw->priv; |
| 6745 | unsigned long flags; | ||
| 6746 | int rc; | 6723 | int rc; |
| 6747 | 6724 | ||
| 6748 | if (conf == NULL) | 6725 | if (conf == NULL) |
| @@ -6764,15 +6741,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, | |||
| 6764 | return rc; | 6741 | return rc; |
| 6765 | } | 6742 | } |
| 6766 | 6743 | ||
| 6767 | /* XXX: this MUST use conf->mac_addr */ | ||
| 6768 | |||
| 6769 | if ((priv->iw_mode == NL80211_IFTYPE_AP) && | ||
| 6770 | (!conf->ssid_len)) { | ||
| 6771 | IWL_DEBUG_MAC80211 | ||
| 6772 | ("Leaving in AP mode because HostAPD is not ready.\n"); | ||
| 6773 | return 0; | ||
| 6774 | } | ||
| 6775 | |||
| 6776 | if (!iwl3945_is_alive(priv)) | 6744 | if (!iwl3945_is_alive(priv)) |
| 6777 | return -EAGAIN; | 6745 | return -EAGAIN; |
| 6778 | 6746 | ||
| @@ -6839,15 +6807,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, | |||
| 6839 | } | 6807 | } |
| 6840 | 6808 | ||
| 6841 | done: | 6809 | done: |
| 6842 | spin_lock_irqsave(&priv->lock, flags); | ||
| 6843 | if (!conf->ssid_len) | ||
| 6844 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); | ||
| 6845 | else | ||
| 6846 | memcpy(priv->essid, conf->ssid, conf->ssid_len); | ||
| 6847 | |||
| 6848 | priv->essid_len = conf->ssid_len; | ||
| 6849 | spin_unlock_irqrestore(&priv->lock, flags); | ||
| 6850 | |||
| 6851 | IWL_DEBUG_MAC80211("leave\n"); | 6810 | IWL_DEBUG_MAC80211("leave\n"); |
| 6852 | mutex_unlock(&priv->mutex); | 6811 | mutex_unlock(&priv->mutex); |
| 6853 | 6812 | ||
| @@ -6890,8 +6849,6 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, | |||
| 6890 | if (priv->vif == conf->vif) { | 6849 | if (priv->vif == conf->vif) { |
| 6891 | priv->vif = NULL; | 6850 | priv->vif = NULL; |
| 6892 | memset(priv->bssid, 0, ETH_ALEN); | 6851 | memset(priv->bssid, 0, ETH_ALEN); |
| 6893 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); | ||
| 6894 | priv->essid_len = 0; | ||
| 6895 | } | 6852 | } |
| 6896 | mutex_unlock(&priv->mutex); | 6853 | mutex_unlock(&priv->mutex); |
| 6897 | 6854 | ||
