aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-rx.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-11-12 16:14:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-25 16:41:06 -0500
commit9f58671e8d4f4896acea30020308ce72bf94ec6e (patch)
tree8c8df09be1ed592ef0640e8f1b9a681e358c571c /drivers/net/wireless/iwlwifi/iwl-rx.c
parentcee53ddb46eb520079335d0868d0e81c8d311089 (diff)
iwlwifi: consolidate station management code
This patch moves code around and group most of the station management code into iwl-sta.c No functional changes (yet) Signed-off-by: Tomas Winkler <tomas.winkler@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-rx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 876afd4cab9e..8d2b73e194da 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -499,49 +499,6 @@ void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,
499} 499}
500EXPORT_SYMBOL(iwl_rx_missed_beacon_notif); 500EXPORT_SYMBOL(iwl_rx_missed_beacon_notif);
501 501
502int iwl_rx_agg_start(struct iwl_priv *priv, const u8 *addr, int tid, u16 ssn)
503{
504 unsigned long flags;
505 int sta_id;
506
507 sta_id = iwl_find_station(priv, addr);
508 if (sta_id == IWL_INVALID_STATION)
509 return -ENXIO;
510
511 spin_lock_irqsave(&priv->sta_lock, flags);
512 priv->stations[sta_id].sta.station_flags_msk = 0;
513 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_ADDBA_TID_MSK;
514 priv->stations[sta_id].sta.add_immediate_ba_tid = (u8)tid;
515 priv->stations[sta_id].sta.add_immediate_ba_ssn = cpu_to_le16(ssn);
516 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
517 spin_unlock_irqrestore(&priv->sta_lock, flags);
518
519 return iwl_send_add_sta(priv, &priv->stations[sta_id].sta,
520 CMD_ASYNC);
521}
522EXPORT_SYMBOL(iwl_rx_agg_start);
523
524int iwl_rx_agg_stop(struct iwl_priv *priv, const u8 *addr, int tid)
525{
526 unsigned long flags;
527 int sta_id;
528
529 sta_id = iwl_find_station(priv, addr);
530 if (sta_id == IWL_INVALID_STATION)
531 return -ENXIO;
532
533 spin_lock_irqsave(&priv->sta_lock, flags);
534 priv->stations[sta_id].sta.station_flags_msk = 0;
535 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_DELBA_TID_MSK;
536 priv->stations[sta_id].sta.remove_immediate_ba_tid = (u8)tid;
537 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
538 spin_unlock_irqrestore(&priv->sta_lock, flags);
539
540 return iwl_send_add_sta(priv, &priv->stations[sta_id].sta,
541 CMD_ASYNC);
542}
543EXPORT_SYMBOL(iwl_rx_agg_stop);
544
545 502
546/* Calculate noise level, based on measurements during network silence just 503/* Calculate noise level, based on measurements during network silence just
547 * before arriving beacon. This measurement can be done only if we know 504 * before arriving beacon. This measurement can be done only if we know
@@ -1017,38 +974,6 @@ static inline int iwl_calc_rssi(struct iwl_priv *priv,
1017} 974}
1018 975
1019 976
1020static void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id)
1021{
1022 unsigned long flags;
1023
1024 spin_lock_irqsave(&priv->sta_lock, flags);
1025 priv->stations[sta_id].sta.station_flags &= ~STA_FLG_PWR_SAVE_MSK;
1026 priv->stations[sta_id].sta.station_flags_msk = STA_FLG_PWR_SAVE_MSK;
1027 priv->stations[sta_id].sta.sta.modify_mask = 0;
1028 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
1029 spin_unlock_irqrestore(&priv->sta_lock, flags);
1030
1031 iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
1032}
1033
1034static void iwl_update_ps_mode(struct iwl_priv *priv, u16 ps_bit, u8 *addr)
1035{
1036 /* FIXME: need locking over ps_status ??? */
1037 u8 sta_id = iwl_find_station(priv, addr);
1038
1039 if (sta_id != IWL_INVALID_STATION) {
1040 u8 sta_awake = priv->stations[sta_id].
1041 ps_status == STA_PS_STATUS_WAKE;
1042
1043 if (sta_awake && ps_bit)
1044 priv->stations[sta_id].ps_status = STA_PS_STATUS_SLEEP;
1045 else if (!sta_awake && !ps_bit) {
1046 iwl_sta_modify_ps_wake(priv, sta_id);
1047 priv->stations[sta_id].ps_status = STA_PS_STATUS_WAKE;
1048 }
1049 }
1050}
1051
1052/* This is necessary only for a number of statistics, see the caller. */ 977/* This is necessary only for a number of statistics, see the caller. */
1053static int iwl_is_network_packet(struct iwl_priv *priv, 978static int iwl_is_network_packet(struct iwl_priv *priv,
1054 struct ieee80211_hdr *header) 979 struct ieee80211_hdr *header)