diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2009-04-08 14:26:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:41 -0400 |
commit | 5bbe233b9bafabc08a5404d54b9fa086e8390fc7 (patch) | |
tree | f0a4a015d2429d9b2aac4c198543e483494d9214 /drivers/net/wireless/iwlwifi/iwl-3945.c | |
parent | de2b3e864aa908e613dd9912def88af7877d85f3 (diff) |
iwl3945: use iwl_bss_info_changed
3945 can use iwl_bss_info_changed.
A new lib op is created for post_assoicate to distinguish between
3945 and iwlwifi's post_associate operations.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 2399328e8de7..519e8922d9f4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -1964,6 +1964,50 @@ int iwl3945_hw_reg_set_txpower(struct iwl_priv *priv, s8 power) | |||
1964 | return 0; | 1964 | return 0; |
1965 | } | 1965 | } |
1966 | 1966 | ||
1967 | static int iwl3945_send_rxon_assoc(struct iwl_priv *priv) | ||
1968 | { | ||
1969 | int rc = 0; | ||
1970 | struct iwl_rx_packet *res = NULL; | ||
1971 | struct iwl3945_rxon_assoc_cmd rxon_assoc; | ||
1972 | struct iwl_host_cmd cmd = { | ||
1973 | .id = REPLY_RXON_ASSOC, | ||
1974 | .len = sizeof(rxon_assoc), | ||
1975 | .meta.flags = CMD_WANT_SKB, | ||
1976 | .data = &rxon_assoc, | ||
1977 | }; | ||
1978 | const struct iwl_rxon_cmd *rxon1 = &priv->staging_rxon; | ||
1979 | const struct iwl_rxon_cmd *rxon2 = &priv->active_rxon; | ||
1980 | |||
1981 | if ((rxon1->flags == rxon2->flags) && | ||
1982 | (rxon1->filter_flags == rxon2->filter_flags) && | ||
1983 | (rxon1->cck_basic_rates == rxon2->cck_basic_rates) && | ||
1984 | (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { | ||
1985 | IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n"); | ||
1986 | return 0; | ||
1987 | } | ||
1988 | |||
1989 | rxon_assoc.flags = priv->staging_rxon.flags; | ||
1990 | rxon_assoc.filter_flags = priv->staging_rxon.filter_flags; | ||
1991 | rxon_assoc.ofdm_basic_rates = priv->staging_rxon.ofdm_basic_rates; | ||
1992 | rxon_assoc.cck_basic_rates = priv->staging_rxon.cck_basic_rates; | ||
1993 | rxon_assoc.reserved = 0; | ||
1994 | |||
1995 | rc = iwl_send_cmd_sync(priv, &cmd); | ||
1996 | if (rc) | ||
1997 | return rc; | ||
1998 | |||
1999 | res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; | ||
2000 | if (res->hdr.flags & IWL_CMD_FAILED_MSK) { | ||
2001 | IWL_ERR(priv, "Bad return from REPLY_RXON_ASSOC command\n"); | ||
2002 | rc = -EIO; | ||
2003 | } | ||
2004 | |||
2005 | priv->alloc_rxb_skb--; | ||
2006 | dev_kfree_skb_any(cmd.meta.u.skb); | ||
2007 | |||
2008 | return rc; | ||
2009 | } | ||
2010 | |||
1967 | /* will add 3945 channel switch cmd handling later */ | 2011 | /* will add 3945 channel switch cmd handling later */ |
1968 | int iwl3945_hw_channel_switch(struct iwl_priv *priv, u16 channel) | 2012 | int iwl3945_hw_channel_switch(struct iwl_priv *priv, u16 channel) |
1969 | { | 2013 | { |
@@ -2729,6 +2773,10 @@ static int iwl3945_load_bsm(struct iwl_priv *priv) | |||
2729 | return 0; | 2773 | return 0; |
2730 | } | 2774 | } |
2731 | 2775 | ||
2776 | static struct iwl_hcmd_ops iwl3945_hcmd = { | ||
2777 | .rxon_assoc = iwl3945_send_rxon_assoc, | ||
2778 | }; | ||
2779 | |||
2732 | static struct iwl_lib_ops iwl3945_lib = { | 2780 | static struct iwl_lib_ops iwl3945_lib = { |
2733 | .txq_attach_buf_to_tfd = iwl3945_hw_txq_attach_buf_to_tfd, | 2781 | .txq_attach_buf_to_tfd = iwl3945_hw_txq_attach_buf_to_tfd, |
2734 | .txq_free_tfd = iwl3945_hw_txq_free_tfd, | 2782 | .txq_free_tfd = iwl3945_hw_txq_free_tfd, |
@@ -2758,6 +2806,7 @@ static struct iwl_lib_ops iwl3945_lib = { | |||
2758 | }, | 2806 | }, |
2759 | .send_tx_power = iwl3945_send_tx_power, | 2807 | .send_tx_power = iwl3945_send_tx_power, |
2760 | .is_valid_rtc_data_addr = iwl3945_hw_valid_rtc_data_addr, | 2808 | .is_valid_rtc_data_addr = iwl3945_hw_valid_rtc_data_addr, |
2809 | .post_associate = iwl3945_post_associate, | ||
2761 | }; | 2810 | }; |
2762 | 2811 | ||
2763 | static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { | 2812 | static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { |
@@ -2767,6 +2816,7 @@ static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { | |||
2767 | 2816 | ||
2768 | static struct iwl_ops iwl3945_ops = { | 2817 | static struct iwl_ops iwl3945_ops = { |
2769 | .lib = &iwl3945_lib, | 2818 | .lib = &iwl3945_lib, |
2819 | .hcmd = &iwl3945_hcmd, | ||
2770 | .utils = &iwl3945_hcmd_utils, | 2820 | .utils = &iwl3945_hcmd_utils, |
2771 | }; | 2821 | }; |
2772 | 2822 | ||