X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fmac80211%2Fdebugfs_netdev.c;h=e3326d046944129d0b8f872591b27006cfb3f95f;hb=361833efac4d277d209008e1e0658e597bc1bdef;hp=107b0fe778d650d05333a3cad10b913aa5ec00a3;hpb=06802a819a0a2d31c952c0624cea6cd00e4e50da;p=linux-2.6 diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 107b0fe778..e3326d0469 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c @@ -17,7 +17,7 @@ #include #include #include "ieee80211_i.h" -#include "ieee80211_rate.h" +#include "rate.h" #include "debugfs.h" #include "debugfs_netdev.h" @@ -31,11 +31,13 @@ static ssize_t ieee80211_if_read( ssize_t ret = -EINVAL; read_lock(&dev_base_lock); - if (sdata->dev->reg_state == NETREG_REGISTERED) { + if (sdata->dev->reg_state == NETREG_REGISTERED) ret = (*format)(sdata, buf, sizeof(buf)); - ret = simple_read_from_buffer(userbuf, count, ppos, buf, ret); - } read_unlock(&dev_base_lock); + + if (ret != -EINVAL) + ret = simple_read_from_buffer(userbuf, count, ppos, buf, ret); + return ret; } @@ -51,13 +53,13 @@ static ssize_t ieee80211_if_write( memset(buf, 0x00, sizeof(buf)); buf_size = min(count, (sizeof(buf)-1)); - read_lock(&dev_base_lock); if (copy_from_user(buf, userbuf, buf_size)) - goto endwrite; + return count; + read_lock(&dev_base_lock); if (sdata->dev->reg_state == NETREG_REGISTERED) (*format)(sdata, buf); -endwrite: read_unlock(&dev_base_lock); + return count; } #endif @@ -222,7 +224,7 @@ IEEE80211_IF_WFILE(dot11MeshConfirmTimeout, IEEE80211_IF_WFILE(dot11MeshHoldingTimeout, u.sta.mshcfg.dot11MeshHoldingTimeout, DEC, u16); IEEE80211_IF_WFILE(dot11MeshTTL, u.sta.mshcfg.dot11MeshTTL, DEC, u8); -IEEE80211_IF_WFILE(auto_open_plinks, u.sta.mshcfg.auto_open_plinks, DEC, bool); +IEEE80211_IF_WFILE(auto_open_plinks, u.sta.mshcfg.auto_open_plinks, DEC, u8); IEEE80211_IF_WFILE(dot11MeshMaxPeerLinks, u.sta.mshcfg.dot11MeshMaxPeerLinks, DEC, u16); IEEE80211_IF_WFILE(dot11MeshHWMPactivePathTimeout, @@ -241,7 +243,7 @@ IEEE80211_IF_WFILE(min_discovery_timeout, #define DEBUGFS_ADD(name, type)\ - sdata->debugfs.type.name = debugfs_create_file(#name, 0444,\ + sdata->debugfs.type.name = debugfs_create_file(#name, 0400,\ sdata->debugfsdir, sdata, &name##_ops); static void add_sta_files(struct ieee80211_sub_if_data *sdata) @@ -296,7 +298,7 @@ static void add_monitor_files(struct ieee80211_sub_if_data *sdata) #ifdef CONFIG_MAC80211_MESH #define MESHSTATS_ADD(name)\ - sdata->mesh_stats.name = debugfs_create_file(#name, 0444,\ + sdata->mesh_stats.name = debugfs_create_file(#name, 0400,\ sdata->mesh_stats_dir, sdata, &name##_ops); static void add_mesh_stats(struct ieee80211_sub_if_data *sdata) @@ -310,7 +312,7 @@ static void add_mesh_stats(struct ieee80211_sub_if_data *sdata) } #define MESHPARAMS_ADD(name)\ - sdata->mesh_config.name = debugfs_create_file(#name, 0644,\ + sdata->mesh_config.name = debugfs_create_file(#name, 0600,\ sdata->mesh_config_dir, sdata, &name##_ops); static void add_mesh_config(struct ieee80211_sub_if_data *sdata)