iwlwifi: use iwl_sta_id() for TKIP key update
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-sta.c
index 8fec0263f01673020416a4fed2856d365bd5fd8c..b8053e7f16ac033995edcf1c16b47d89868810f5 100644 (file)
@@ -1012,18 +1012,23 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
 
 void iwl_update_tkip_key(struct iwl_priv *priv,
                        struct ieee80211_key_conf *keyconf,
-                       const u8 *addr, u32 iv32, u16 *phase1key)
+                       struct ieee80211_sta *sta, u32 iv32, u16 *phase1key)
 {
-       u8 sta_id = IWL_INVALID_STATION;
+       u8 sta_id;
        unsigned long flags;
        int i;
 
-       sta_id = iwl_find_station(priv, addr);
-       if (sta_id == IWL_INVALID_STATION) {
-               IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n",
-                                  addr);
-               return;
-       }
+       if (sta) {
+               sta_id = iwl_sta_id(sta);
+
+               if (sta_id == IWL_INVALID_STATION) {
+                       IWL_DEBUG_MAC80211(priv, "leave - %pM not initialised.\n",
+                                          sta->addr);
+                       return;
+               }
+       } else
+               sta_id = priv->hw_params.bcast_sta_id;
+
 
        if (iwl_scan_cancel(priv)) {
                /* cancel scan failed, just live w/ bad key and rely
This page took 0.037928 seconds and 5 git commands to generate.