All "agn" devices use the same hcmd functions, no need to call indirectly.
remove hcmd_ops
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
 
 static const struct iwl_ops iwl1000_ops = {
        .lib = &iwl1000_lib,
-       .hcmd = &iwlagn_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 
 
 static const struct iwl_ops iwl2000_ops = {
        .lib = &iwl2000_lib,
-       .hcmd = &iwlagn_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 static const struct iwl_ops iwl2030_ops = {
        .lib = &iwl2000_lib,
-       .hcmd = &iwlagn_bt_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 static const struct iwl_ops iwl105_ops = {
        .lib = &iwl2000_lib,
-       .hcmd = &iwlagn_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 static const struct iwl_ops iwl135_ops = {
        .lib = &iwl2000_lib,
-       .hcmd = &iwlagn_bt_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 
 
 static const struct iwl_ops iwl5000_ops = {
        .lib = &iwl5000_lib,
-       .hcmd = &iwlagn_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 static const struct iwl_ops iwl5150_ops = {
        .lib = &iwl5150_lib,
-       .hcmd = &iwlagn_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 
 
 static const struct iwl_ops iwl6000_ops = {
        .lib = &iwl6000_lib,
-       .hcmd = &iwlagn_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 static const struct iwl_ops iwl6050_ops = {
        .lib = &iwl6000_lib,
-       .hcmd = &iwlagn_hcmd,
        .utils = &iwlagn_hcmd_utils,
        .nic = &iwl6050_nic_ops,
 };
 
 static const struct iwl_ops iwl6150_ops = {
        .lib = &iwl6000_lib,
-       .hcmd = &iwlagn_hcmd,
        .utils = &iwlagn_hcmd_utils,
        .nic = &iwl6150_nic_ops,
 };
 
 static const struct iwl_ops iwl6030_ops = {
        .lib = &iwl6030_lib,
-       .hcmd = &iwlagn_bt_hcmd,
        .utils = &iwlagn_hcmd_utils,
 };
 
 
        return max_rssi - agc - IWLAGN_RSSI_OFFSET;
 }
 
-static int iwlagn_set_pan_params(struct iwl_priv *priv)
+int iwlagn_set_pan_params(struct iwl_priv *priv)
 {
        struct iwl_wipan_params_cmd cmd;
        struct iwl_rxon_context *ctx_bss, *ctx_pan;
        return ret;
 }
 
-struct iwl_hcmd_ops iwlagn_hcmd = {
-       .set_rxon_chain = iwlagn_set_rxon_chain,
-       .set_tx_ant = iwlagn_send_tx_ant_config,
-       .send_bt_config = iwl_send_bt_config,
-       .set_pan_params = iwlagn_set_pan_params,
-};
-
-struct iwl_hcmd_ops iwlagn_bt_hcmd = {
-       .set_rxon_chain = iwlagn_set_rxon_chain,
-       .set_tx_ant = iwlagn_send_tx_ant_config,
-       .send_bt_config = iwlagn_send_advance_bt_config,
-       .set_pan_params = iwlagn_set_pan_params,
-};
-
 struct iwl_hcmd_utils_ops iwlagn_hcmd_utils = {
        .build_addsta_hcmd = iwlagn_build_addsta_hcmd,
        .gain_computation = iwlagn_gain_computation,
 
        /* set scan bit here for PAN params */
        set_bit(STATUS_SCAN_HW, &priv->status);
 
-       if (priv->cfg->ops->hcmd->set_pan_params) {
-               ret = priv->cfg->ops->hcmd->set_pan_params(priv);
-               if (ret)
-                       return ret;
-       }
+       ret = iwlagn_set_pan_params(priv);
+       if (ret)
+               return ret;
 
        ret = iwl_send_cmd_sync(priv, &cmd);
        if (ret) {
                clear_bit(STATUS_SCAN_HW, &priv->status);
-               if (priv->cfg->ops->hcmd->set_pan_params)
-                       priv->cfg->ops->hcmd->set_pan_params(priv);
+               iwlagn_set_pan_params(priv);
        }
 
        return ret;
 
        if (ret)
                return ret;
 
-       if (priv->cfg->ops->hcmd->set_pan_params) {
-               ret = priv->cfg->ops->hcmd->set_pan_params(priv);
-               if (ret)
-                       return ret;
-       }
+       ret = iwlagn_set_pan_params(priv);
+       if (ret)
+               return ret;
 
        if (new_assoc)
                return iwlagn_rxon_connect(priv, ctx);
                 * set up the SM PS mode to OFF if an HT channel is
                 * configured.
                 */
-               if (priv->cfg->ops->hcmd->set_rxon_chain)
-                       for_each_context(priv, ctx)
-                               priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
+               for_each_context(priv, ctx)
+                       iwlagn_set_rxon_chain(priv, ctx);
        }
 
        if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
                iwl_set_rxon_ht(priv, &priv->current_ht_config);
        }
 
-       if (priv->cfg->ops->hcmd->set_rxon_chain)
-               priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
+       iwlagn_set_rxon_chain(priv, ctx);
 
        if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
                ctx->staging.flags |= RXON_FLG_TGG_PROTECT_MSK;
                if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
                        iwlagn_commit_rxon(priv, ctx);
 
-       if (priv->cfg->ops->hcmd->set_pan_params)
-               priv->cfg->ops->hcmd->set_pan_params(priv);
+       iwlagn_set_pan_params(priv);
 }
 
 {
        struct iwl_rxon_context *ctx;
 
-       if (priv->cfg->ops->hcmd->set_rxon_chain) {
-               for_each_context(priv, ctx) {
-                       priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
-                       if (ctx->active.rx_chain != ctx->staging.rx_chain)
-                               iwlagn_commit_rxon(priv, ctx);
-               }
+       for_each_context(priv, ctx) {
+               iwlagn_set_rxon_chain(priv, ctx);
+               if (ctx->active.rx_chain != ctx->staging.rx_chain)
+                       iwlagn_commit_rxon(priv, ctx);
        }
 }
 
         * to avoid 3-wire collisions
         */
        for_each_context(priv, ctx) {
-               if (priv->cfg->ops->hcmd->set_rxon_chain)
-                       priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
+               iwlagn_set_rxon_chain(priv, ctx);
                iwlagn_commit_rxon(priv, ctx);
        }
 
        priv->active_rate = IWL_RATES_MASK;
 
        /* Configure Tx antenna selection based on H/W config */
-       if (priv->cfg->ops->hcmd->set_tx_ant)
-               priv->cfg->ops->hcmd->set_tx_ant(priv, priv->cfg->valid_tx_ant);
+       iwlagn_send_tx_ant_config(priv, priv->cfg->valid_tx_ant);
 
        if (iwl_is_associated_ctx(ctx)) {
                struct iwl_rxon_cmd *active_rxon =
                for_each_context(priv, tmp)
                        iwl_connection_init_rx_config(priv, tmp);
 
-               if (priv->cfg->ops->hcmd->set_rxon_chain)
-                       priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
+               iwlagn_set_rxon_chain(priv, ctx);
        }
 
        iwl_reset_run_time_calib(priv);
        priv->rx_statistics_jiffies = jiffies;
 
        /* Choose which receivers/antennas to use */
-       if (priv->cfg->ops->hcmd->set_rxon_chain)
-               priv->cfg->ops->hcmd->set_rxon_chain(priv,
-                                       &priv->contexts[IWL_RXON_CTX_BSS]);
+       iwlagn_set_rxon_chain(priv, &priv->contexts[IWL_RXON_CTX_BSS]);
 
        iwl_init_scan_params(priv);
 
 
 /* hcmd */
 int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant);
 int iwlagn_send_beacon_cmd(struct iwl_priv *priv);
+int iwlagn_set_pan_params(struct iwl_priv *priv);
 
 /* bt coex */
 void iwlagn_send_advance_bt_config(struct iwl_priv *priv);
 
                rxon->flags |= RXON_FLG_CHANNEL_MODE_LEGACY;
        }
 
-       if (priv->cfg->ops->hcmd->set_rxon_chain)
-               priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
+       iwlagn_set_rxon_chain(priv, ctx);
 
        IWL_DEBUG_ASSOC(priv, "rxon flags 0x%X operation mode :0x%X "
                        "extension channel offset 0x%x\n",
 {
        iwl_connection_init_rx_config(priv, ctx);
 
-       if (priv->cfg->ops->hcmd->set_rxon_chain)
-               priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
+       iwlagn_set_rxon_chain(priv, ctx);
 
        return iwlagn_commit_rxon(priv, ctx);
 }
 
 
 #define IWL_CMD(x) case x: return #x
 
-struct iwl_hcmd_ops {
-       void (*set_rxon_chain)(struct iwl_priv *priv,
-                              struct iwl_rxon_context *ctx);
-       int (*set_tx_ant)(struct iwl_priv *priv, u8 valid_tx_ant);
-       void (*send_bt_config)(struct iwl_priv *priv);
-       int (*set_pan_params)(struct iwl_priv *priv);
-};
-
 struct iwl_hcmd_utils_ops {
        u16 (*build_addsta_hcmd)(const struct iwl_addsta_cmd *cmd, u8 *data);
        void (*gain_computation)(struct iwl_priv *priv,
 
 struct iwl_ops {
        const struct iwl_lib_ops *lib;
-       const struct iwl_hcmd_ops *hcmd;
        const struct iwl_hcmd_utils_ops *utils;
        const struct iwl_nic_ops *nic;
 };