aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-04-08 14:26:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:42 -0400
commit40ace5b385ccf8a4d4d096b353b7f1baac1d014b (patch)
treedd3d71bcd2b6436033ad50d55190af2b0f277915 /drivers
parent79fa455a995057b6559fcd2a02e8b089b2e2e288 (diff)
iwl3945: replace station function with station ops
Patch replaces station function used in driver by station management ops in 3945. 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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c29
2 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index fb08295417f0..7c0c7992b596 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2114,7 +2114,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
2114 2114
2115 memcpy(active_rxon, staging_rxon, sizeof(*active_rxon)); 2115 memcpy(active_rxon, staging_rxon, sizeof(*active_rxon));
2116 2116
2117 iwl3945_clear_stations_table(priv); 2117 priv->cfg->ops->smgmt->clear_station_table(priv);
2118 2118
2119 /* If we issue a new RXON command which required a tune then we must 2119 /* If we issue a new RXON command which required a tune then we must
2120 * send a new TXPOWER command or we won't be able to Tx any frames */ 2120 * send a new TXPOWER command or we won't be able to Tx any frames */
@@ -2125,7 +2125,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
2125 } 2125 }
2126 2126
2127 /* Add the broadcast address so we can send broadcast frames */ 2127 /* Add the broadcast address so we can send broadcast frames */
2128 if (iwl3945_add_station(priv, iwl_bcast_addr, 0, 0) == 2128 if (priv->cfg->ops->smgmt->add_station(priv, iwl_bcast_addr, 0, 0) ==
2129 IWL_INVALID_STATION) { 2129 IWL_INVALID_STATION) {
2130 IWL_ERR(priv, "Error adding BROADCAST address for transmit.\n"); 2130 IWL_ERR(priv, "Error adding BROADCAST address for transmit.\n");
2131 return -EIO; 2131 return -EIO;
@@ -2135,8 +2135,8 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
2135 * add the IWL_AP_ID to the station rate table */ 2135 * add the IWL_AP_ID to the station rate table */
2136 if (iwl_is_associated(priv) && 2136 if (iwl_is_associated(priv) &&
2137 (priv->iw_mode == NL80211_IFTYPE_STATION)) 2137 (priv->iw_mode == NL80211_IFTYPE_STATION))
2138 if (iwl3945_add_station(priv, priv->active_rxon.bssid_addr, 2138 if (priv->cfg->ops->smgmt->add_station(priv,
2139 1, 0) 2139 priv->active_rxon.bssid_addr, 1, 0)
2140 == IWL_INVALID_STATION) { 2140 == IWL_INVALID_STATION) {
2141 IWL_ERR(priv, "Error adding AP address for transmit\n"); 2141 IWL_ERR(priv, "Error adding AP address for transmit\n");
2142 return -EIO; 2142 return -EIO;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 0ad89fb90d05..f5f39cc28102 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -588,7 +588,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
588 588
589 iwl_connection_init_rx_config(priv, mode); 589 iwl_connection_init_rx_config(priv, mode);
590 590
591 iwl3945_clear_stations_table(priv); 591 priv->cfg->ops->smgmt->clear_station_table(priv);
592 592
593 /* don't commit rxon if rf-kill is on*/ 593 /* don't commit rxon if rf-kill is on*/
594 if (!iwl_is_ready_rf(priv)) 594 if (!iwl_is_ready_rf(priv))
@@ -734,7 +734,7 @@ static int iwl3945_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
734 734
735 /* If we are an AP, then find the station, or use BCAST */ 735 /* If we are an AP, then find the station, or use BCAST */
736 case NL80211_IFTYPE_AP: 736 case NL80211_IFTYPE_AP:
737 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); 737 sta_id = priv->cfg->ops->smgmt->find_station(priv, hdr->addr1);
738 if (sta_id != IWL_INVALID_STATION) 738 if (sta_id != IWL_INVALID_STATION)
739 return sta_id; 739 return sta_id;
740 return priv->hw_params.bcast_sta_id; 740 return priv->hw_params.bcast_sta_id;
@@ -743,11 +743,12 @@ static int iwl3945_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
743 * or create a new station table entry */ 743 * or create a new station table entry */
744 case NL80211_IFTYPE_ADHOC: { 744 case NL80211_IFTYPE_ADHOC: {
745 /* Create new station table entry */ 745 /* Create new station table entry */
746 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); 746 sta_id = priv->cfg->ops->smgmt->find_station(priv, hdr->addr1);
747 if (sta_id != IWL_INVALID_STATION) 747 if (sta_id != IWL_INVALID_STATION)
748 return sta_id; 748 return sta_id;
749 749
750 sta_id = iwl3945_add_station(priv, hdr->addr1, 0, CMD_ASYNC); 750 sta_id = priv->cfg->ops->smgmt->add_station(priv,
751 hdr->addr1, 0, CMD_ASYNC);
751 752
752 if (sta_id != IWL_INVALID_STATION) 753 if (sta_id != IWL_INVALID_STATION)
753 return sta_id; 754 return sta_id;
@@ -1883,7 +1884,7 @@ static void iwl3945_error_recovery(struct iwl_priv *priv)
1883 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 1884 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
1884 iwlcore_commit_rxon(priv); 1885 iwlcore_commit_rxon(priv);
1885 1886
1886 iwl3945_add_station(priv, priv->bssid, 1, 0); 1887 priv->cfg->ops->smgmt->add_station(priv, priv->bssid, 1, 0);
1887 1888
1888 spin_lock_irqsave(&priv->lock, flags); 1889 spin_lock_irqsave(&priv->lock, flags);
1889 priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id); 1890 priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id);
@@ -2678,7 +2679,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
2678 goto restart; 2679 goto restart;
2679 } 2680 }
2680 2681
2681 iwl3945_clear_stations_table(priv); 2682 priv->cfg->ops->smgmt->clear_station_table(priv);
2682 2683
2683 rc = iwl_grab_nic_access(priv); 2684 rc = iwl_grab_nic_access(priv);
2684 if (rc) { 2685 if (rc) {
@@ -2783,7 +2784,7 @@ static void __iwl3945_down(struct iwl_priv *priv)
2783 set_bit(STATUS_EXIT_PENDING, &priv->status); 2784 set_bit(STATUS_EXIT_PENDING, &priv->status);
2784 2785
2785 iwl3945_led_unregister(priv); 2786 iwl3945_led_unregister(priv);
2786 iwl3945_clear_stations_table(priv); 2787 priv->cfg->ops->smgmt->clear_station_table(priv);
2787 2788
2788 /* Unblock any waiting calls */ 2789 /* Unblock any waiting calls */
2789 wake_up_interruptible_all(&priv->wait_command_queue); 2790 wake_up_interruptible_all(&priv->wait_command_queue);
@@ -2940,7 +2941,7 @@ static int __iwl3945_up(struct iwl_priv *priv)
2940 2941
2941 for (i = 0; i < MAX_HW_RESTARTS; i++) { 2942 for (i = 0; i < MAX_HW_RESTARTS; i++) {
2942 2943
2943 iwl3945_clear_stations_table(priv); 2944 priv->cfg->ops->smgmt->clear_station_table(priv);
2944 2945
2945 /* load bootstrap state machine, 2946 /* load bootstrap state machine,
2946 * load bootstrap program into processor's memory, 2947 * load bootstrap program into processor's memory,
@@ -3332,7 +3333,7 @@ void iwl3945_post_associate(struct iwl_priv *priv)
3332 case NL80211_IFTYPE_ADHOC: 3333 case NL80211_IFTYPE_ADHOC:
3333 3334
3334 priv->assoc_id = 1; 3335 priv->assoc_id = 1;
3335 iwl3945_add_station(priv, priv->bssid, 0, 0); 3336 priv->cfg->ops->smgmt->add_station(priv, priv->bssid, 0, 0);
3336 iwl3945_sync_sta(priv, IWL_STA_ID, 3337 iwl3945_sync_sta(priv, IWL_STA_ID,
3337 (priv->band == IEEE80211_BAND_5GHZ) ? 3338 (priv->band == IEEE80211_BAND_5GHZ) ?
3338 IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP, 3339 IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP,
@@ -3660,7 +3661,7 @@ static void iwl3945_config_ap(struct iwl_priv *priv)
3660 /* restore RXON assoc */ 3661 /* restore RXON assoc */
3661 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK; 3662 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
3662 iwlcore_commit_rxon(priv); 3663 iwlcore_commit_rxon(priv);
3663 iwl3945_add_station(priv, iwl_bcast_addr, 0, 0); 3664 priv->cfg->ops->smgmt->add_station(priv, iwl_bcast_addr, 0, 0);
3664 } 3665 }
3665 iwl3945_send_beacon_cmd(priv); 3666 iwl3945_send_beacon_cmd(priv);
3666 3667
@@ -3752,7 +3753,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
3752 else { 3753 else {
3753 rc = iwlcore_commit_rxon(priv); 3754 rc = iwlcore_commit_rxon(priv);
3754 if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc) 3755 if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc)
3755 iwl3945_add_station(priv, 3756 priv->cfg->ops->smgmt->add_station(priv,
3756 priv->active_rxon.bssid_addr, 1, 0); 3757 priv->active_rxon.bssid_addr, 1, 0);
3757 } 3758 }
3758 3759
@@ -3814,7 +3815,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3814 static_key = !iwl_is_associated(priv); 3815 static_key = !iwl_is_associated(priv);
3815 3816
3816 if (!static_key) { 3817 if (!static_key) {
3817 sta_id = iwl3945_hw_find_station(priv, addr); 3818 sta_id = priv->cfg->ops->smgmt->find_station(priv, addr);
3818 if (sta_id == IWL_INVALID_STATION) { 3819 if (sta_id == IWL_INVALID_STATION) {
3819 IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n", 3820 IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n",
3820 addr); 3821 addr);
@@ -4497,7 +4498,7 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
4497 mutex_init(&priv->mutex); 4498 mutex_init(&priv->mutex);
4498 4499
4499 /* Clear the driver's (not device's) station table */ 4500 /* Clear the driver's (not device's) station table */
4500 iwl3945_clear_stations_table(priv); 4501 priv->cfg->ops->smgmt->clear_station_table(priv);
4501 4502
4502 priv->data_retry_limit = -1; 4503 priv->data_retry_limit = -1;
4503 priv->ieee_channels = NULL; 4504 priv->ieee_channels = NULL;
@@ -4860,7 +4861,7 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
4860 iwl3945_hw_txq_ctx_free(priv); 4861 iwl3945_hw_txq_ctx_free(priv);
4861 4862
4862 iwl3945_unset_hw_params(priv); 4863 iwl3945_unset_hw_params(priv);
4863 iwl3945_clear_stations_table(priv); 4864 priv->cfg->ops->smgmt->clear_station_table(priv);
4864 4865
4865 /*netif_stop_queue(dev); */ 4866 /*netif_stop_queue(dev); */
4866 flush_workqueue(priv->workqueue); 4867 flush_workqueue(priv->workqueue);