diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-07-18 01:53:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-04 15:09:07 -0400 |
commit | 4bf64efd26f5610cde4fb7846e2f37bd1f62d3a9 (patch) | |
tree | 00e54951b21ffaf2e1c5f2e1459698cb4065ff3a /drivers/net/wireless/iwlwifi/iwl4965-base.c | |
parent | d783b061077f92af55244aef1df8780b0f46b5af (diff) |
iwlwifi: move beacon handling to iwl4965-base.c
This patch concentrates becaon handling in iwl4965-base.c.
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 | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index a34280f65c1a..94ce026ba602 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -444,11 +444,10 @@ static void iwl_free_frame(struct iwl_priv *priv, struct iwl_frame *frame) | |||
444 | list_add(&frame->list, &priv->free_frames); | 444 | list_add(&frame->list, &priv->free_frames); |
445 | } | 445 | } |
446 | 446 | ||
447 | unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv, | 447 | static unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv, |
448 | struct ieee80211_hdr *hdr, | 448 | struct ieee80211_hdr *hdr, |
449 | const u8 *dest, int left) | 449 | const u8 *dest, int left) |
450 | { | 450 | { |
451 | |||
452 | if (!iwl_is_associated(priv) || !priv->ibss_beacon || | 451 | if (!iwl_is_associated(priv) || !priv->ibss_beacon || |
453 | ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) && | 452 | ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) && |
454 | (priv->iw_mode != IEEE80211_IF_TYPE_AP))) | 453 | (priv->iw_mode != IEEE80211_IF_TYPE_AP))) |
@@ -487,6 +486,38 @@ static u8 iwl4965_rate_get_lowest_plcp(struct iwl_priv *priv) | |||
487 | return IWL_RATE_6M_PLCP; | 486 | return IWL_RATE_6M_PLCP; |
488 | } | 487 | } |
489 | 488 | ||
489 | unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, | ||
490 | struct iwl_frame *frame, u8 rate) | ||
491 | { | ||
492 | struct iwl_tx_beacon_cmd *tx_beacon_cmd; | ||
493 | unsigned int frame_size; | ||
494 | |||
495 | tx_beacon_cmd = &frame->u.beacon; | ||
496 | memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd)); | ||
497 | |||
498 | tx_beacon_cmd->tx.sta_id = priv->hw_params.bcast_sta_id; | ||
499 | tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; | ||
500 | |||
501 | frame_size = iwl_fill_beacon_frame(priv, tx_beacon_cmd->frame, | ||
502 | iwl_bcast_addr, | ||
503 | sizeof(frame->u) - sizeof(*tx_beacon_cmd)); | ||
504 | |||
505 | BUG_ON(frame_size > MAX_MPDU_SIZE); | ||
506 | tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size); | ||
507 | |||
508 | if ((rate == IWL_RATE_1M_PLCP) || (rate >= IWL_RATE_2M_PLCP)) | ||
509 | tx_beacon_cmd->tx.rate_n_flags = | ||
510 | iwl_hw_set_rate_n_flags(rate, RATE_MCS_CCK_MSK); | ||
511 | else | ||
512 | tx_beacon_cmd->tx.rate_n_flags = | ||
513 | iwl_hw_set_rate_n_flags(rate, 0); | ||
514 | |||
515 | tx_beacon_cmd->tx.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK | | ||
516 | TX_CMD_FLG_TSF_MSK | | ||
517 | TX_CMD_FLG_STA_RATE_MSK; | ||
518 | |||
519 | return sizeof(*tx_beacon_cmd) + frame_size; | ||
520 | } | ||
490 | static int iwl4965_send_beacon_cmd(struct iwl_priv *priv) | 521 | static int iwl4965_send_beacon_cmd(struct iwl_priv *priv) |
491 | { | 522 | { |
492 | struct iwl_frame *frame; | 523 | struct iwl_frame *frame; |