Patch unifies the add_station function for 3945 and iwlwifi drivers.
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>
                        IWL_DEBUG_RATE(priv, "LQ: ADD station %pm\n",
                                       hdr->addr1);
                        sta_id = iwl3945_add_station(priv,
-                                   hdr->addr1, 0, CMD_ASYNC);
+                                   hdr->addr1, 0, CMD_ASYNC, NULL);
                }
                if (sta_id != IWL_INVALID_STATION)
                        rs_sta->ibss_sta_added = 1;
 
        }
 
        /* Add the broadcast address so we can send broadcast frames */
-       if (priv->cfg->ops->smgmt->add_station(priv, iwl_bcast_addr, 0, 0) ==
+       if (priv->cfg->ops->smgmt->add_station(priv, iwl_bcast_addr, 0, 0, NULL) ==
            IWL_INVALID_STATION) {
                IWL_ERR(priv, "Error adding BROADCAST address for transmit.\n");
                return -EIO;
        if (iwl_is_associated(priv) &&
            (priv->iw_mode == NL80211_IFTYPE_STATION))
                if (priv->cfg->ops->smgmt->add_station(priv,
-                                       priv->active_rxon.bssid_addr, 1, 0)
+                                       priv->active_rxon.bssid_addr, 1, 0, NULL)
                    == IWL_INVALID_STATION) {
                        IWL_ERR(priv, "Error adding AP address for transmit\n");
                        return -EIO;
 
 extern int iwl3945_send_add_station(struct iwl_priv *priv,
                                struct iwl3945_addsta_cmd *sta, u8 flags);
 extern u8 iwl3945_add_station(struct iwl_priv *priv, const u8 *bssid,
-                         int is_ap, u8 flags);
+                         int is_ap, u8 flags, struct ieee80211_sta_ht_cap *ht_info);
 extern void iwl3945_clear_stations_table(struct iwl_priv *priv);
 extern int iwl3945_power_init_handle(struct iwl_priv *priv);
 extern int iwl3945_eeprom_init(struct iwl_priv *priv);
 
 }
 
 static struct iwl_station_mgmt_ops iwl4965_station_mgmt = {
-       .add_station_ht = iwl_add_station_flags,
+       .add_station = iwl_add_station_flags,
        .remove_station = iwl_remove_station,
        .find_station = iwl_find_station,
        .clear_station_table = iwl_clear_stations_table,
 
 }
 
 struct iwl_station_mgmt_ops iwl5000_station_mgmt = {
-       .add_station_ht = iwl_add_station_flags,
+       .add_station = iwl_add_station_flags,
        .remove_station = iwl_remove_station,
        .find_station = iwl_find_station,
        .clear_station_table = iwl_clear_stations_table,
 
                if (sta_id == IWL_INVALID_STATION) {
                        IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n",
                                       hdr->addr1);
-                       sta_id = priv->cfg->ops->smgmt->add_station_ht(priv,
+                       sta_id = priv->cfg->ops->smgmt->add_station(priv,
                                                hdr->addr1, 0,
                                                CMD_ASYNC, NULL);
                }
 
                if (sta_id == IWL_INVALID_STATION) {
                        IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n", sta->addr);
-                       sta_id = priv->cfg->ops->smgmt->add_station_ht(priv,
+                       sta_id = priv->cfg->ops->smgmt->add_station(priv,
                                                        sta->addr, 0,
                                                        CMD_ASYNC, NULL);
                }
 
 #define IWL_SKU_N       0x8
 
 struct iwl_station_mgmt_ops {
-       u8 (*add_station_ht)(struct iwl_priv *priv, const u8 *addr,
-                       int is_ap, u8 flags, struct ieee80211_sta_ht_cap *ht_info);
        u8 (*add_station)(struct iwl_priv *priv, const u8 *addr,
-                       int is_ap, u8 flags);
+                       int is_ap, u8 flags, struct ieee80211_sta_ht_cap *ht_info);
        int (*remove_station)(struct iwl_priv *priv, const u8 *addr,
                        int is_ap);
        u8 (*find_station)(struct iwl_priv *priv, const u8 *addr);
 
                rcu_read_unlock();
        }
 
-       sta_id = priv->cfg->ops->smgmt->add_station_ht(priv, addr, is_ap,
+       sta_id = priv->cfg->ops->smgmt->add_station(priv, addr, is_ap,
                                       0, cur_ht_config);
 
        /* Set up default rate scaling table in device's station table */
                        return sta_id;
 
                /* Create new station table entry */
-               sta_id = priv->cfg->ops->smgmt->add_station_ht(priv, hdr->addr1,
+               sta_id = priv->cfg->ops->smgmt->add_station(priv, hdr->addr1,
                                                   0, CMD_ASYNC, NULL);
 
                if (sta_id != IWL_INVALID_STATION)
 
 /**
  * iwl3945_add_station - Add station to station tables in driver and device
  */
-u8 iwl3945_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
+u8 iwl3945_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags, struct ieee80211_sta_ht_cap *ht_info)
 {
        int i;
        int index = IWL_INVALID_STATION;
                        return sta_id;
 
                sta_id = priv->cfg->ops->smgmt->add_station(priv,
-                               hdr->addr1, 0, CMD_ASYNC);
+                               hdr->addr1, 0, CMD_ASYNC, NULL);
 
                if (sta_id != IWL_INVALID_STATION)
                        return sta_id;
        priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
        iwlcore_commit_rxon(priv);
 
-       priv->cfg->ops->smgmt->add_station(priv, priv->bssid, 1, 0);
+       priv->cfg->ops->smgmt->add_station(priv, priv->bssid, 1, 0, NULL);
 
        spin_lock_irqsave(&priv->lock, flags);
        priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id);
        case NL80211_IFTYPE_ADHOC:
 
                priv->assoc_id = 1;
-               priv->cfg->ops->smgmt->add_station(priv, priv->bssid, 0, 0);
+               priv->cfg->ops->smgmt->add_station(priv, priv->bssid, 0, 0, NULL);
                iwl3945_sync_sta(priv, IWL_STA_ID,
                                 (priv->band == IEEE80211_BAND_5GHZ) ?
                                 IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP,
                /* restore RXON assoc */
                priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
                iwlcore_commit_rxon(priv);
-               priv->cfg->ops->smgmt->add_station(priv, iwl_bcast_addr, 0, 0);
+               priv->cfg->ops->smgmt->add_station(priv, iwl_bcast_addr, 0, 0, NULL);
        }
        iwl3945_send_beacon_cmd(priv);
 
                        rc = iwlcore_commit_rxon(priv);
                        if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc)
                                priv->cfg->ops->smgmt->add_station(priv,
-                                       priv->active_rxon.bssid_addr, 1, 0);
+                                       priv->active_rxon.bssid_addr, 1, 0, NULL);
                }
 
        } else {