Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6de3f7e9 authored by John W. Linville's avatar John W. Linville
Browse files
parents 33dd7699 40503f7b
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -487,16 +487,13 @@ static inline void iwl_dvm_set_pmi(struct iwl_priv *priv, bool state)
}
}


#ifdef CONFIG_IWLWIFI_DEBUGFS
#ifdef CONFIG_IWLWIFI_DEBUGFS
int iwl_dbgfs_register(struct iwl_priv *priv, const char *name);
int iwl_dbgfs_register(struct iwl_priv *priv, struct dentry *dbgfs_dir);
void iwl_dbgfs_unregister(struct iwl_priv *priv);
#else
#else
static inline int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
static inline int iwl_dbgfs_register(struct iwl_priv *priv,
				     struct dentry *dbgfs_dir)
{
{
	return 0;
	return 0;
}
}
static inline void iwl_dbgfs_unregister(struct iwl_priv *priv)
{
}
#endif /* CONFIG_IWLWIFI_DEBUGFS */
#endif /* CONFIG_IWLWIFI_DEBUGFS */


#ifdef CONFIG_IWLWIFI_DEBUG
#ifdef CONFIG_IWLWIFI_DEBUG
+28 −28
Original line number Original line Diff line number Diff line
@@ -2349,24 +2349,19 @@ DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled);
 * Create the debugfs files and directories
 * Create the debugfs files and directories
 *
 *
 */
 */
int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
int iwl_dbgfs_register(struct iwl_priv *priv, struct dentry *dbgfs_dir)
{
{
	struct dentry *phyd = priv->hw->wiphy->debugfsdir;
	struct dentry *dir_data, *dir_rf, *dir_debug;
	struct dentry *dir_drv, *dir_data, *dir_rf, *dir_debug;


	dir_drv = debugfs_create_dir(name, phyd);
	priv->debugfs_dir = dbgfs_dir;
	if (!dir_drv)
		return -ENOMEM;

	priv->debugfs_dir = dir_drv;


	dir_data = debugfs_create_dir("data", dir_drv);
	dir_data = debugfs_create_dir("data", dbgfs_dir);
	if (!dir_data)
	if (!dir_data)
		goto err;
		goto err;
	dir_rf = debugfs_create_dir("rf", dir_drv);
	dir_rf = debugfs_create_dir("rf", dbgfs_dir);
	if (!dir_rf)
	if (!dir_rf)
		goto err;
		goto err;
	dir_debug = debugfs_create_dir("debug", dir_drv);
	dir_debug = debugfs_create_dir("debug", dbgfs_dir);
	if (!dir_debug)
	if (!dir_debug)
		goto err;
		goto err;


@@ -2412,25 +2407,30 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
	/* Calibrations disabled/enabled status*/
	/* Calibrations disabled/enabled status*/
	DEBUGFS_ADD_FILE(calib_disabled, dir_rf, S_IWUSR | S_IRUSR);
	DEBUGFS_ADD_FILE(calib_disabled, dir_rf, S_IWUSR | S_IRUSR);


	if (iwl_trans_dbgfs_register(priv->trans, dir_debug))
	/*
	 * Create a symlink with mac80211. This is not very robust, as it does
	 * not remove the symlink created. The implicit assumption is that
	 * when the opmode exits, mac80211 will also exit, and will remove
	 * this symlink as part of its cleanup.
	 */
	if (priv->mac80211_registered) {
		char buf[100];
		struct dentry *mac80211_dir, *dev_dir, *root_dir;

		dev_dir = dbgfs_dir->d_parent;
		root_dir = dev_dir->d_parent;
		mac80211_dir = priv->hw->wiphy->debugfsdir;

		snprintf(buf, 100, "../../%s/%s", root_dir->d_name.name,
			 dev_dir->d_name.name);

		if (!debugfs_create_symlink("iwlwifi", mac80211_dir, buf))
			goto err;
			goto err;
	}

	return 0;
	return 0;


err:
err:
	IWL_ERR(priv, "Can't create the debugfs directory\n");
	IWL_ERR(priv, "failed to create the dvm debugfs entries\n");
	iwl_dbgfs_unregister(priv);
	return -ENOMEM;
	return -ENOMEM;
}
}

/**
 * Remove the debugfs files and directories
 *
 */
void iwl_dbgfs_unregister(struct iwl_priv *priv)
{
	if (!priv->debugfs_dir)
		return;

	debugfs_remove_recursive(priv->debugfs_dir);
	priv->debugfs_dir = NULL;
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -195,7 +195,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
			ARRAY_SIZE(iwlagn_iface_combinations_dualmode);
			ARRAY_SIZE(iwlagn_iface_combinations_dualmode);
	}
	}


	hw->wiphy->max_remain_on_channel_duration = 1000;
	hw->wiphy->max_remain_on_channel_duration = 500;


	hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY |
	hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY |
			    WIPHY_FLAG_DISABLE_BEACON_HINTS |
			    WIPHY_FLAG_DISABLE_BEACON_HINTS |
+16 −8
Original line number Original line Diff line number Diff line
@@ -862,6 +862,7 @@ void iwl_down(struct iwl_priv *priv)
	 * No race since we hold the mutex here and a new one
	 * No race since we hold the mutex here and a new one
	 * can't come in at this time.
	 * can't come in at this time.
	 */
	 */
	if (priv->ucode_loaded && priv->cur_ucode != IWL_UCODE_INIT)
		ieee80211_remain_on_channel_expired(priv->hw);
		ieee80211_remain_on_channel_expired(priv->hw);


	exit_pending =
	exit_pending =
@@ -994,7 +995,11 @@ static void iwl_bg_restart(struct work_struct *data)
		iwlagn_prepare_restart(priv);
		iwlagn_prepare_restart(priv);
		mutex_unlock(&priv->mutex);
		mutex_unlock(&priv->mutex);
		iwl_cancel_deferred_work(priv);
		iwl_cancel_deferred_work(priv);
		if (priv->mac80211_registered)
			ieee80211_restart_hw(priv->hw);
			ieee80211_restart_hw(priv->hw);
		else
			IWL_ERR(priv,
				"Cannot request restart before registrating with mac80211");
	} else {
	} else {
		WARN_ON(1);
		WARN_ON(1);
	}
	}
@@ -1222,7 +1227,8 @@ static int iwl_eeprom_init_hw_params(struct iwl_priv *priv)


static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
						 const struct iwl_cfg *cfg,
						 const struct iwl_cfg *cfg,
						 const struct iwl_fw *fw)
						 const struct iwl_fw *fw,
						 struct dentry *dbgfs_dir)
{
{
	struct iwl_priv *priv;
	struct iwl_priv *priv;
	struct ieee80211_hw *hw;
	struct ieee80211_hw *hw;
@@ -1466,13 +1472,17 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	if (iwlagn_mac_setup_register(priv, &fw->ucode_capa))
	if (iwlagn_mac_setup_register(priv, &fw->ucode_capa))
		goto out_destroy_workqueue;
		goto out_destroy_workqueue;


	if (iwl_dbgfs_register(priv, DRV_NAME))
	if (iwl_dbgfs_register(priv, dbgfs_dir))
		IWL_ERR(priv,
		goto out_mac80211_unregister;
			"failed to create debugfs files. Ignoring error\n");


	return op_mode;
	return op_mode;


out_mac80211_unregister:
	iwlagn_mac_unregister(priv);
out_destroy_workqueue:
out_destroy_workqueue:
	iwl_tt_exit(priv);
	iwl_testmode_free(priv);
	iwl_cancel_deferred_work(priv);
	destroy_workqueue(priv->workqueue);
	destroy_workqueue(priv->workqueue);
	priv->workqueue = NULL;
	priv->workqueue = NULL;
	iwl_uninit_drv(priv);
	iwl_uninit_drv(priv);
@@ -1493,8 +1503,6 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)


	IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n");
	IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n");


	iwl_dbgfs_unregister(priv);

	iwl_testmode_free(priv);
	iwl_testmode_free(priv);
	iwlagn_mac_unregister(priv);
	iwlagn_mac_unregister(priv);


+1 −1
Original line number Original line Diff line number Diff line
@@ -150,7 +150,7 @@ int iwl_send_add_sta(struct iwl_priv *priv,
		       sta_id, sta->sta.addr, flags & CMD_ASYNC ?  "a" : "");
		       sta_id, sta->sta.addr, flags & CMD_ASYNC ?  "a" : "");


	if (!(flags & CMD_ASYNC)) {
	if (!(flags & CMD_ASYNC)) {
		cmd.flags |= CMD_WANT_SKB;
		cmd.flags |= CMD_WANT_SKB | CMD_WANT_HCMD;
		might_sleep();
		might_sleep();
	}
	}


Loading