diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-23 04:46:55 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-08-27 12:48:16 -0400 |
commit | 47313e340ee6faa43d8ad8a509a00ed1584fb34d (patch) | |
tree | ccef408ed10257eb3f23437961affdc13e6ab6d4 /drivers/net/wireless/iwlwifi/iwl-core.c | |
parent | 52a02d1500e4cbb347006e407d1c0bd941eee7fc (diff) |
iwlwifi: pass context to iwl_send_rxon_timing
Sometimes we need to send RXON timing even
when we don't have a virtual interface yet,
so pass the context and allow passing one
without a virtual interface pointer.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index b61b838a24b5..91ca5173e862 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -500,13 +500,13 @@ static u16 iwl_adjust_beacon_interval(u16 beacon_val, u16 max_beacon_val) | |||
500 | return new_val; | 500 | return new_val; |
501 | } | 501 | } |
502 | 502 | ||
503 | int iwl_send_rxon_timing(struct iwl_priv *priv, struct ieee80211_vif *vif) | 503 | int iwl_send_rxon_timing(struct iwl_priv *priv, struct iwl_rxon_context *ctx) |
504 | { | 504 | { |
505 | u64 tsf; | 505 | u64 tsf; |
506 | s32 interval_tm, rem; | 506 | s32 interval_tm, rem; |
507 | struct ieee80211_conf *conf = NULL; | 507 | struct ieee80211_conf *conf = NULL; |
508 | u16 beacon_int; | 508 | u16 beacon_int; |
509 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); | 509 | struct ieee80211_vif *vif = ctx->vif; |
510 | 510 | ||
511 | conf = ieee80211_get_hw_conf(priv->hw); | 511 | conf = ieee80211_get_hw_conf(priv->hw); |
512 | 512 | ||
@@ -517,15 +517,13 @@ int iwl_send_rxon_timing(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
517 | ctx->timing.timestamp = cpu_to_le64(priv->timestamp); | 517 | ctx->timing.timestamp = cpu_to_le64(priv->timestamp); |
518 | ctx->timing.listen_interval = cpu_to_le16(conf->listen_interval); | 518 | ctx->timing.listen_interval = cpu_to_le16(conf->listen_interval); |
519 | 519 | ||
520 | beacon_int = vif->bss_conf.beacon_int; | 520 | beacon_int = vif ? vif->bss_conf.beacon_int : 0; |
521 | 521 | ||
522 | if (vif->type == NL80211_IFTYPE_ADHOC) { | 522 | /* |
523 | /* TODO: we need to get atim_window from upper stack | 523 | * TODO: For IBSS we need to get atim_window from mac80211, |
524 | * for now we set to 0 */ | 524 | * for now just always use 0 |
525 | ctx->timing.atim_window = 0; | 525 | */ |
526 | } else { | 526 | ctx->timing.atim_window = 0; |
527 | ctx->timing.atim_window = 0; | ||
528 | } | ||
529 | 527 | ||
530 | beacon_int = iwl_adjust_beacon_interval(beacon_int, | 528 | beacon_int = iwl_adjust_beacon_interval(beacon_int, |
531 | priv->hw_params.max_beacon_itrvl * TIME_UNIT); | 529 | priv->hw_params.max_beacon_itrvl * TIME_UNIT); |
@@ -536,7 +534,7 @@ int iwl_send_rxon_timing(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
536 | rem = do_div(tsf, interval_tm); | 534 | rem = do_div(tsf, interval_tm); |
537 | ctx->timing.beacon_init_val = cpu_to_le32(interval_tm - rem); | 535 | ctx->timing.beacon_init_val = cpu_to_le32(interval_tm - rem); |
538 | 536 | ||
539 | ctx->timing.dtim_period = vif->bss_conf.dtim_period; | 537 | ctx->timing.dtim_period = vif ? (vif->bss_conf.dtim_period ?: 1) : 1; |
540 | 538 | ||
541 | IWL_DEBUG_ASSOC(priv, | 539 | IWL_DEBUG_ASSOC(priv, |
542 | "beacon interval %d beacon timer %d beacon tim %d\n", | 540 | "beacon interval %d beacon timer %d beacon tim %d\n", |