aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-04-08 14:26:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:42 -0400
commitf5d3026683da45e00c49a24999ad0d256e4651d5 (patch)
tree116db4a7834d40cd76561d6afa7003daf5e83719 /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent06fd3d86a426848dbd8db27b7257a4eb4be8cfae (diff)
iwl3945: use iwl_get_sta_id from iwlwifi
iwl3945 can now use iwl_get_sta_id. 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/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c61
1 files changed, 1 insertions, 60 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 56691456910..7f35017d9df 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -712,65 +712,6 @@ static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv,
712 tx->next_frame_len = 0; 712 tx->next_frame_len = 0;
713} 713}
714 714
715/**
716 * iwl3945_get_sta_id - Find station's index within station table
717 */
718static int iwl3945_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
719{
720 int sta_id;
721 u16 fc = le16_to_cpu(hdr->frame_control);
722
723 /* If this frame is broadcast or management, use broadcast station id */
724 if (((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) ||
725 is_multicast_ether_addr(hdr->addr1))
726 return priv->hw_params.bcast_sta_id;
727
728 switch (priv->iw_mode) {
729
730 /* If we are a client station in a BSS network, use the special
731 * AP station entry (that's the only station we communicate with) */
732 case NL80211_IFTYPE_STATION:
733 return IWL_AP_ID;
734
735 /* If we are an AP, then find the station, or use BCAST */
736 case NL80211_IFTYPE_AP:
737 sta_id = priv->cfg->ops->smgmt->find_station(priv, hdr->addr1);
738 if (sta_id != IWL_INVALID_STATION)
739 return sta_id;
740 return priv->hw_params.bcast_sta_id;
741
742 /* If this frame is going out to an IBSS network, find the station,
743 * or create a new station table entry */
744 case NL80211_IFTYPE_ADHOC: {
745 /* Create new station table entry */
746 sta_id = priv->cfg->ops->smgmt->find_station(priv, hdr->addr1);
747 if (sta_id != IWL_INVALID_STATION)
748 return sta_id;
749
750 sta_id = priv->cfg->ops->smgmt->add_station(priv,
751 hdr->addr1, 0, CMD_ASYNC, NULL);
752
753 if (sta_id != IWL_INVALID_STATION)
754 return sta_id;
755
756 IWL_DEBUG_DROP(priv, "Station %pM not in station map. "
757 "Defaulting to broadcast...\n",
758 hdr->addr1);
759 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
760 return priv->hw_params.bcast_sta_id;
761 }
762 /* If we are in monitor mode, use BCAST. This is required for
763 * packet injection. */
764 case NL80211_IFTYPE_MONITOR:
765 return priv->hw_params.bcast_sta_id;
766
767 default:
768 IWL_WARN(priv, "Unknown mode of operation: %d\n",
769 priv->iw_mode);
770 return priv->hw_params.bcast_sta_id;
771 }
772}
773
774/* 715/*
775 * start REPLY_TX command process 716 * start REPLY_TX command process
776 */ 717 */
@@ -836,7 +777,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
836 hdr_len = ieee80211_hdrlen(fc); 777 hdr_len = ieee80211_hdrlen(fc);
837 778
838 /* Find (or create) index into station table for destination station */ 779 /* Find (or create) index into station table for destination station */
839 sta_id = iwl3945_get_sta_id(priv, hdr); 780 sta_id = iwl_get_sta_id(priv, hdr);
840 if (sta_id == IWL_INVALID_STATION) { 781 if (sta_id == IWL_INVALID_STATION) {
841 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", 782 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
842 hdr->addr1); 783 hdr->addr1);