diff options
author | Assaf Krauss <assaf.krauss@intel.com> | 2008-06-11 21:47:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-14 12:18:07 -0400 |
commit | c46fbefa32c3c314884d3d3be27d0e1839de2c24 (patch) | |
tree | dc85d2017a5f8a99a4d17c1a74fc392f5bb7093b /drivers/net/wireless/iwlwifi/iwl4965-base.c | |
parent | f3d5b45b40c42b0b55710667740cc545b6e17c10 (diff) |
iwlwifi enabling IBSS (Ad-Hoc) mode
This patch enables ibss mode. It consists of two changes upon entering ibss
mode:
1. Removing the redundant line which clears the driver's station table.
This line creates a discrepancy between the driver and the FW's station
table. This prevented the generation of beacons.
2. Assigning a default value to priv's assoc_id. Normally given by an AP in
STA mode, this field is used as an indication for association. Being 0,
it prevented normal TX flow.
3. Remove a redundant ADD_STA command that cause uCode error.
4. Delay the set_mode until after the uCode is ready.
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 3f54decb310b..4570fd133d74 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -2900,6 +2900,10 @@ static void iwl_alive_start(struct iwl_priv *priv) | |||
2900 | 2900 | ||
2901 | iwlcore_low_level_notify(priv, IWLCORE_START_EVT); | 2901 | iwlcore_low_level_notify(priv, IWLCORE_START_EVT); |
2902 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | 2902 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); |
2903 | |||
2904 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) | ||
2905 | iwl4965_set_mode(priv, priv->iw_mode); | ||
2906 | |||
2903 | return; | 2907 | return; |
2904 | 2908 | ||
2905 | restart: | 2909 | restart: |
@@ -3189,16 +3193,20 @@ static void iwl4965_bg_set_monitor(struct work_struct *work) | |||
3189 | { | 3193 | { |
3190 | struct iwl_priv *priv = container_of(work, | 3194 | struct iwl_priv *priv = container_of(work, |
3191 | struct iwl_priv, set_monitor); | 3195 | struct iwl_priv, set_monitor); |
3196 | int ret; | ||
3192 | 3197 | ||
3193 | IWL_DEBUG(IWL_DL_STATE, "setting monitor mode\n"); | 3198 | IWL_DEBUG(IWL_DL_STATE, "setting monitor mode\n"); |
3194 | 3199 | ||
3195 | mutex_lock(&priv->mutex); | 3200 | mutex_lock(&priv->mutex); |
3196 | 3201 | ||
3197 | if (!iwl_is_ready(priv)) | 3202 | ret = iwl4965_set_mode(priv, IEEE80211_IF_TYPE_MNTR); |
3198 | IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n"); | 3203 | |
3199 | else | 3204 | if (ret) { |
3200 | if (iwl4965_set_mode(priv, IEEE80211_IF_TYPE_MNTR) != 0) | 3205 | if (ret == -EAGAIN) |
3201 | IWL_ERROR("iwl4965_set_mode() failed\n"); | 3206 | IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n"); |
3207 | else | ||
3208 | IWL_ERROR("iwl4965_set_mode() failed ret = %d\n", ret); | ||
3209 | } | ||
3202 | 3210 | ||
3203 | mutex_unlock(&priv->mutex); | 3211 | mutex_unlock(&priv->mutex); |
3204 | } | 3212 | } |
@@ -3575,10 +3583,9 @@ static void iwl4965_post_associate(struct iwl_priv *priv) | |||
3575 | 3583 | ||
3576 | case IEEE80211_IF_TYPE_IBSS: | 3584 | case IEEE80211_IF_TYPE_IBSS: |
3577 | 3585 | ||
3578 | /* clear out the station table */ | 3586 | /* assume default assoc id */ |
3579 | iwlcore_clear_stations_table(priv); | 3587 | priv->assoc_id = 1; |
3580 | 3588 | ||
3581 | iwl_rxon_add_station(priv, iwl_bcast_addr, 0); | ||
3582 | iwl_rxon_add_station(priv, priv->bssid, 0); | 3589 | iwl_rxon_add_station(priv, priv->bssid, 0); |
3583 | iwl4965_rate_scale_init(priv->hw, IWL_STA_ID); | 3590 | iwl4965_rate_scale_init(priv->hw, IWL_STA_ID); |
3584 | iwl4965_send_beacon_cmd(priv); | 3591 | iwl4965_send_beacon_cmd(priv); |
@@ -3826,8 +3833,9 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw, | |||
3826 | memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); | 3833 | memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); |
3827 | } | 3834 | } |
3828 | 3835 | ||
3829 | if (iwl_is_ready(priv)) | 3836 | if (iwl4965_set_mode(priv, conf->type) == -EAGAIN) |
3830 | iwl4965_set_mode(priv, conf->type); | 3837 | /* we are not ready, will run again when ready */ |
3838 | set_bit(STATUS_MODE_PENDING, &priv->status); | ||
3831 | 3839 | ||
3832 | mutex_unlock(&priv->mutex); | 3840 | mutex_unlock(&priv->mutex); |
3833 | 3841 | ||
@@ -4608,7 +4616,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk | |||
4608 | 4616 | ||
4609 | iwl_reset_qos(priv); | 4617 | iwl_reset_qos(priv); |
4610 | 4618 | ||
4611 | queue_work(priv->workqueue, &priv->post_associate.work); | 4619 | iwl4965_post_associate(priv); |
4612 | 4620 | ||
4613 | mutex_unlock(&priv->mutex); | 4621 | mutex_unlock(&priv->mutex); |
4614 | 4622 | ||