Exemplo n.º 1
0
void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata)
{
	char buf[50];
	struct ieee80211_key *key;

	if (!sdata->debugfs.dir)
		return;

	lockdep_assert_held(&sdata->local->key_mtx);

	if (sdata->default_unicast_key) {
		key = sdata->default_unicast_key;
		sprintf(buf, "../keys/%d", key->debugfs.cnt);
		sdata->debugfs.default_unicast_key =
			debugfs_create_symlink("default_unicast_key",
					       sdata->debugfs.dir, buf);
	} else {
		debugfs_remove(sdata->debugfs.default_unicast_key);
		sdata->debugfs.default_unicast_key = NULL;
	}

	if (sdata->default_multicast_key) {
		key = sdata->default_multicast_key;
		sprintf(buf, "../keys/%d", key->debugfs.cnt);
		sdata->debugfs.default_multicast_key =
			debugfs_create_symlink("default_multicast_key",
					       sdata->debugfs.dir, buf);
	} else {
		debugfs_remove(sdata->debugfs.default_multicast_key);
		sdata->debugfs.default_multicast_key = NULL;
	}
}
Exemplo n.º 2
0
void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
{
	char buf[50];

	if (!sdata->debugfsdir)
		return;

	sprintf(buf, "../keys/%d", sdata->default_key->conf.keyidx);
	sdata->debugfs.default_key =
		debugfs_create_symlink("default_key", sdata->debugfsdir, buf);
}
Exemplo n.º 3
0
void ieee80211_debugfs_key_sta_link(struct ieee80211_key *key,
				    struct sta_info *sta)
{
	char buf[50];
	DECLARE_MAC_BUF(mac);

	if (!key->debugfs.dir)
		return;

	sprintf(buf, "../../stations/%s", print_mac(mac, sta->addr));
	key->debugfs.stalink =
		debugfs_create_symlink("station", key->debugfs.dir, buf);
}
Exemplo n.º 4
0
/* TODO: Locking */
void jz4740_clock_debugfs_update_parent(struct clk *clk)
{
	if (clk->debugfs_parent_entry)
		debugfs_remove(clk->debugfs_parent_entry);

	if (clk->parent) {
		char parent_path[100];
		snprintf(parent_path, 100, "../%s", clk->parent->name);
		clk->debugfs_parent_entry = debugfs_create_symlink("parent",
						clk->debugfs_entry,
						parent_path);
	} else {
		clk->debugfs_parent_entry = NULL;
	}
}
Exemplo n.º 5
0
void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
	struct dentry *dbgfs_dir = vif->debugfs_dir;
	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
	char buf[100];

	/*
	 * Check if debugfs directory already exist before creating it.
	 * This may happen when, for example, resetting hw or suspend-resume
	 */
	if (!dbgfs_dir || mvmvif->dbgfs_dir)
		return;

	mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir);
	mvmvif->mvm = mvm;

	if (!mvmvif->dbgfs_dir) {
		IWL_ERR(mvm, "Failed to create debugfs directory under %s\n",
			dbgfs_dir->d_name.name);
		return;
	}

	MVM_DEBUGFS_ADD_FILE_VIF(mac_params, mvmvif->dbgfs_dir,
				 S_IRUSR);

	/*
	 * Create symlink for convenience pointing to interface specific
	 * debugfs entries for the driver. For example, under
	 * /sys/kernel/debug/iwlwifi/0000\:02\:00.0/iwlmvm/
	 * find
	 * netdev:wlan0 -> ../../../ieee80211/phy0/netdev:wlan0/iwlmvm/
	 */
	snprintf(buf, 100, "../../../%s/%s/%s/%s",
		 dbgfs_dir->d_parent->d_parent->d_name.name,
		 dbgfs_dir->d_parent->d_name.name,
		 dbgfs_dir->d_name.name,
		 mvmvif->dbgfs_dir->d_name.name);

	mvmvif->dbgfs_slink = debugfs_create_symlink(dbgfs_dir->d_name.name,
						     mvm->debugfs_dir, buf);
	if (!mvmvif->dbgfs_slink)
		IWL_ERR(mvm, "Can't create debugfs symbolic link under %s\n",
			dbgfs_dir->d_name.name);
	return;
err:
	IWL_ERR(mvm, "Can't create debugfs entity\n");
}
Exemplo n.º 6
0
static int fs_debugfs_add_dst(struct fs_base *base)
{
	struct mlx5_flow_rule *dst;

	fs_get_obj(dst, base);

	dst->debugfs.type = debugfs_create_file("dest_type", 0400,
						base->debugfs.dir, dst,
						&fops_dst_type);
	if (!dst->debugfs.type)
		return -ENOMEM;

	if (dst->dest_attr.type ==
	    MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE) {
		char *path = kcalloc(1024, sizeof(char), GFP_KERNEL);

		if (!path)
			return -ENOMEM;

		/*We need the path to the pointed flow table,
		 *we need go back 7 directories:
		 *dest directory->destinations->entry->
		 *entries->group->groups->flow table->flow tables
		 */
		snprintf(path, 1024, "../../../../../../../%s",
			 dst->dest_attr.ft->base.debugfs.dir->d_name.name);
		dst->debugfs.ft = debugfs_create_symlink("flow_table",
							 base->debugfs.dir,
							 path);
		if (!dst->debugfs.ft) {
			kfree(path);
			return -ENOMEM;
		}
		kfree(path);
	} else if (dst->dest_attr.type ==
		   MLX5_FLOW_DESTINATION_TYPE_TIR) {
		dst->debugfs.tir = debugfs_create_file("tir", 0400,
							base->debugfs.dir, dst,
							&fs_dst_tir);
		if (!dst->debugfs.tir)
			return -ENOMEM;
	}
	return 0;
}
Exemplo n.º 7
0
void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata)
{
	char buf[50];
	struct ieee80211_key *key;

	if (!sdata->debugfsdir)
		return;

	

	key = sdata->default_mgmt_key;
	if (key) {
		sprintf(buf, "../keys/%d", key->debugfs.cnt);
		sdata->common_debugfs.default_mgmt_key =
			debugfs_create_symlink("default_mgmt_key",
					       sdata->debugfsdir, buf);
	} else
		ieee80211_debugfs_key_remove_mgmt_default(sdata);
}
Exemplo n.º 8
0
void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
{
	char buf[50];
	struct ieee80211_key *key;

	if (!sdata->debugfs.dir)
		return;

	/* this is running under the key lock */

	key = sdata->default_key;
	if (key) {
		sprintf(buf, "../keys/%d", key->debugfs.cnt);
		sdata->debugfs.default_key =
			debugfs_create_symlink("default_key",
					       sdata->debugfs.dir, buf);
	} else
		ieee80211_debugfs_key_remove_default(sdata);
}
Exemplo n.º 9
0
void jz4740_clock_debugfs_add_clk(struct clk *clk)
{
	if (!jz4740_clock_debugfs)
		return;

	clk->debugfs_entry = debugfs_create_dir(clk->name, jz4740_clock_debugfs);
	debugfs_create_file("rate", S_IWUGO | S_IRUGO, clk->debugfs_entry, clk,
				&jz4740_clock_debugfs_ops_rate);
	debugfs_create_file("enabled", S_IRUGO, clk->debugfs_entry, clk,
				&jz4740_clock_debugfs_ops_enabled);

	if (clk->parent) {
		char parent_path[100];
		snprintf(parent_path, 100, "../%s", clk->parent->name);
		clk->debugfs_parent_entry = debugfs_create_symlink("parent",
						clk->debugfs_entry,
						parent_path);
	}
}
Exemplo n.º 10
0
void ieee80211_debugfs_key_add(struct ieee80211_key *key)
  {
	static int keycount;
	char buf[50];
	struct sta_info *sta;

	if (!key->local->debugfs.keys)
		return;

	sprintf(buf, "%d", keycount);
	key->debugfs.cnt = keycount;
	keycount++;
	key->debugfs.dir = debugfs_create_dir(buf,
					key->local->debugfs.keys);

	if (!key->debugfs.dir)
		return;

	rcu_read_lock();
	sta = rcu_dereference(key->sta);
	if (sta)
		sprintf(buf, "../../stations/%pM", sta->sta.addr);
	rcu_read_unlock();

	
	if (sta)
		key->debugfs.stalink =
			debugfs_create_symlink("station", key->debugfs.dir, buf);

	DEBUGFS_ADD(keylen);
	DEBUGFS_ADD(flags);
	DEBUGFS_ADD(keyidx);
	DEBUGFS_ADD(hw_key_idx);
	DEBUGFS_ADD(tx_rx_count);
	DEBUGFS_ADD(algorithm);
	DEBUGFS_ADD(tx_spec);
	DEBUGFS_ADD(rx_spec);
	DEBUGFS_ADD(replays);
	DEBUGFS_ADD(icverrors);
	DEBUGFS_ADD(key);
	DEBUGFS_ADD(ifindex);
};
Exemplo n.º 11
0
static int dp_debugfs_init(struct data_path *dp)
{
	char buf[256];
	char path[256];

	dp->dentry = debugfs_create_dir(dp->name ? dp->name : "dp",
		dp_debugfs_root_dir);
	if (!dp->dentry)
		return -ENOMEM;

	snprintf(path, sizeof(path), "../../../%s",
		dentry_path_raw(dp->rbctl->rbdir, buf, sizeof(buf)));

	if (IS_ERR_OR_NULL(debugfs_create_symlink(
				"shm", dp->dentry, path)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_file(
				"tx_q", S_IRUGO, dp->dentry,
				dp, &fops_tx_q)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_file(
				"stat", S_IRUGO, dp->dentry,
				dp, &fops_stat)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_file(
				"wm", S_IRUGO | S_IWUSR, dp->dentry,
				dp, &fops_wm)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_bool(
				"enable_piggyback", S_IRUGO | S_IWUSR,
				dp->dentry, &dp->enable_piggyback)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_bool(
				"is_tx_stopped", S_IRUGO | S_IWUSR,
				dp->dentry, &dp->is_tx_stopped)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_u32(
				"tx_q_max_len", S_IRUGO | S_IWUSR,
				dp->dentry, &dp->tx_q_max_len)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_u16(
				"max_tx_shots", S_IRUGO | S_IWUSR,
				dp->dentry, &dp->max_tx_shots)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_u16(
				"max_rx_shots", S_IRUGO | S_IWUSR,
				dp->dentry, &dp->max_rx_shots)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_u16(
				"tx_sched_delay_in_ms", S_IRUGO | S_IWUSR,
				dp->dentry, &dp->tx_sched_delay_in_ms)))
		goto error;

	if (IS_ERR_OR_NULL(debugfs_create_u16(
				"tx_q_min_sched_len", S_IRUGO | S_IWUSR,
				dp->dentry, &dp->tx_q_min_sched_len)))
		goto error;

	return 0;

error:
	debugfs_remove_recursive(dp->dentry);
	dp->dentry = NULL;
	return -1;
}
Exemplo n.º 12
0
int ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
{
	char name[100];
	int err = -ENOMEM;

	dout("ceph_fs_debugfs_init\n");
	BUG_ON(!fsc->client->debugfs_dir);
	fsc->debugfs_congestion_kb =
		debugfs_create_file("writeback_congestion_kb",
				    0600,
				    fsc->client->debugfs_dir,
				    fsc,
				    &congestion_kb_fops);
	if (!fsc->debugfs_congestion_kb)
		goto out;

	snprintf(name, sizeof(name), "../../bdi/%s",
		 dev_name(fsc->sb->s_bdi->dev));
	fsc->debugfs_bdi =
		debugfs_create_symlink("bdi",
				       fsc->client->debugfs_dir,
				       name);
	if (!fsc->debugfs_bdi)
		goto out;

	fsc->debugfs_mdsmap = debugfs_create_file("mdsmap",
					0400,
					fsc->client->debugfs_dir,
					fsc,
					&mdsmap_show_fops);
	if (!fsc->debugfs_mdsmap)
		goto out;

	fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions",
					0400,
					fsc->client->debugfs_dir,
					fsc,
					&mds_sessions_show_fops);
	if (!fsc->debugfs_mds_sessions)
		goto out;

	fsc->debugfs_mdsc = debugfs_create_file("mdsc",
						0400,
						fsc->client->debugfs_dir,
						fsc,
						&mdsc_show_fops);
	if (!fsc->debugfs_mdsc)
		goto out;

	fsc->debugfs_caps = debugfs_create_file("caps",
						   0400,
						   fsc->client->debugfs_dir,
						   fsc,
						   &caps_show_fops);
	if (!fsc->debugfs_caps)
		goto out;

	return 0;

out:
	ceph_fs_debugfs_cleanup(fsc);
	return err;
}