Commit 2b18ab36 authored by Arnd Bergmann's avatar Arnd Bergmann

net/wireless: use generic_file_llseek in debugfs

The default llseek operation is changing from
default_llseek to no_llseek, so all code relying on
the current behaviour needs to make that explicit.

The wireless driver infrastructure and some of the drivers
make use of generated debugfs files, so they cannot
be converted by our script that automatically determines
the right operation.

All these files use debugfs and they typically rely
on simple_read_from_buffer, so the best llseek operation
here is generic_file_llseek.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
parent dc880abe
...@@ -71,6 +71,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \ ...@@ -71,6 +71,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \
static const struct file_operations iwmct_dbgfs_##name##_ops = { \ static const struct file_operations iwmct_dbgfs_##name##_ops = { \
.read = iwmct_dbgfs_##name##_read, \ .read = iwmct_dbgfs_##name##_read, \
.open = iwmct_dbgfs_open_file_generic, \ .open = iwmct_dbgfs_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_WRITE_FILE_OPS(name) \ #define DEBUGFS_WRITE_FILE_OPS(name) \
...@@ -78,6 +79,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \ ...@@ -78,6 +79,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \
static const struct file_operations iwmct_dbgfs_##name##_ops = { \ static const struct file_operations iwmct_dbgfs_##name##_ops = { \
.write = iwmct_dbgfs_##name##_write, \ .write = iwmct_dbgfs_##name##_write, \
.open = iwmct_dbgfs_open_file_generic, \ .open = iwmct_dbgfs_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_READ_WRITE_FILE_OPS(name) \ #define DEBUGFS_READ_WRITE_FILE_OPS(name) \
...@@ -87,6 +89,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \ ...@@ -87,6 +89,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \
.write = iwmct_dbgfs_##name##_write, \ .write = iwmct_dbgfs_##name##_write, \
.read = iwmct_dbgfs_##name##_read, \ .read = iwmct_dbgfs_##name##_read, \
.open = iwmct_dbgfs_open_file_generic, \ .open = iwmct_dbgfs_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
......
...@@ -627,6 +627,7 @@ static ssize_t b43_debugfs_write(struct file *file, ...@@ -627,6 +627,7 @@ static ssize_t b43_debugfs_write(struct file *file,
.open = b43_debugfs_open, \ .open = b43_debugfs_open, \
.read = b43_debugfs_read, \ .read = b43_debugfs_read, \
.write = b43_debugfs_write, \ .write = b43_debugfs_write, \
.llseek = generic_file_llseek, \
}, \ }, \
.file_struct_offset = offsetof(struct b43_dfsentry, \ .file_struct_offset = offsetof(struct b43_dfsentry, \
file_##name), \ file_##name), \
......
...@@ -334,6 +334,7 @@ static ssize_t b43legacy_debugfs_write(struct file *file, ...@@ -334,6 +334,7 @@ static ssize_t b43legacy_debugfs_write(struct file *file,
.open = b43legacy_debugfs_open, \ .open = b43legacy_debugfs_open, \
.read = b43legacy_debugfs_read, \ .read = b43legacy_debugfs_read, \
.write = b43legacy_debugfs_write, \ .write = b43legacy_debugfs_write, \
.llseek = generic_file_llseek, \
}, \ }, \
.file_struct_offset = offsetof(struct b43legacy_dfsentry, \ .file_struct_offset = offsetof(struct b43legacy_dfsentry, \
file_##name), \ file_##name), \
......
...@@ -87,6 +87,7 @@ static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file) ...@@ -87,6 +87,7 @@ static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file)
static const struct file_operations iwl_dbgfs_##name##_ops = { \ static const struct file_operations iwl_dbgfs_##name##_ops = { \
.read = iwl_dbgfs_##name##_read, \ .read = iwl_dbgfs_##name##_read, \
.open = iwl_dbgfs_open_file_generic, \ .open = iwl_dbgfs_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_WRITE_FILE_OPS(name) \ #define DEBUGFS_WRITE_FILE_OPS(name) \
...@@ -94,6 +95,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \ ...@@ -94,6 +95,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
static const struct file_operations iwl_dbgfs_##name##_ops = { \ static const struct file_operations iwl_dbgfs_##name##_ops = { \
.write = iwl_dbgfs_##name##_write, \ .write = iwl_dbgfs_##name##_write, \
.open = iwl_dbgfs_open_file_generic, \ .open = iwl_dbgfs_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
...@@ -104,6 +106,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \ ...@@ -104,6 +106,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
.write = iwl_dbgfs_##name##_write, \ .write = iwl_dbgfs_##name##_write, \
.read = iwl_dbgfs_##name##_read, \ .read = iwl_dbgfs_##name##_read, \
.open = iwl_dbgfs_open_file_generic, \ .open = iwl_dbgfs_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
static ssize_t iwl_dbgfs_tx_statistics_read(struct file *file, static ssize_t iwl_dbgfs_tx_statistics_read(struct file *file,
......
...@@ -696,6 +696,7 @@ static ssize_t lbs_wrrf_write(struct file *file, ...@@ -696,6 +696,7 @@ static ssize_t lbs_wrrf_write(struct file *file,
.open = open_file_generic, \ .open = open_file_generic, \
.read = (fread), \ .read = (fread), \
.write = (fwrite), \ .write = (fwrite), \
.llseek = generic_file_llseek, \
} }
struct lbs_debugfs_files { struct lbs_debugfs_files {
......
...@@ -509,6 +509,7 @@ static const struct file_operations rt2x00debug_fop_##__name = {\ ...@@ -509,6 +509,7 @@ static const struct file_operations rt2x00debug_fop_##__name = {\
.write = rt2x00debug_write_##__name, \ .write = rt2x00debug_write_##__name, \
.open = rt2x00debug_file_open, \ .open = rt2x00debug_file_open, \
.release = rt2x00debug_file_release, \ .release = rt2x00debug_file_release, \
.llseek = generic_file_llseek, \
}; };
RT2X00DEBUGFS_OPS(csr, "0x%.8x\n", u32); RT2X00DEBUGFS_OPS(csr, "0x%.8x\n", u32);
......
...@@ -50,6 +50,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \ ...@@ -50,6 +50,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
static const struct file_operations name## _ops = { \ static const struct file_operations name## _ops = { \
.read = name## _read, \ .read = name## _read, \
.open = wl1251_open_file_generic, \ .open = wl1251_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_ADD(name, parent) \ #define DEBUGFS_ADD(name, parent) \
...@@ -86,6 +87,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \ ...@@ -86,6 +87,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \
static const struct file_operations sub## _ ##name## _ops = { \ static const struct file_operations sub## _ ##name## _ops = { \
.read = sub## _ ##name## _read, \ .read = sub## _ ##name## _read, \
.open = wl1251_open_file_generic, \ .open = wl1251_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_FWSTATS_ADD(sub, name) \ #define DEBUGFS_FWSTATS_ADD(sub, name) \
......
...@@ -51,6 +51,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \ ...@@ -51,6 +51,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
static const struct file_operations name## _ops = { \ static const struct file_operations name## _ops = { \
.read = name## _read, \ .read = name## _read, \
.open = wl1271_open_file_generic, \ .open = wl1271_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_ADD(name, parent) \ #define DEBUGFS_ADD(name, parent) \
...@@ -87,6 +88,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \ ...@@ -87,6 +88,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \
static const struct file_operations sub## _ ##name## _ops = { \ static const struct file_operations sub## _ ##name## _ops = { \
.read = sub## _ ##name## _read, \ .read = sub## _ ##name## _read, \
.open = wl1271_open_file_generic, \ .open = wl1271_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_FWSTATS_ADD(sub, name) \ #define DEBUGFS_FWSTATS_ADD(sub, name) \
......
...@@ -36,6 +36,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \ ...@@ -36,6 +36,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
static const struct file_operations name## _ops = { \ static const struct file_operations name## _ops = { \
.read = name## _read, \ .read = name## _read, \
.open = mac80211_open_file_generic, \ .open = mac80211_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_ADD(name) \ #define DEBUGFS_ADD(name) \
...@@ -346,6 +347,7 @@ static ssize_t stats_ ##name## _read(struct file *file, \ ...@@ -346,6 +347,7 @@ static ssize_t stats_ ##name## _read(struct file *file, \
static const struct file_operations stats_ ##name## _ops = { \ static const struct file_operations stats_ ##name## _ops = { \
.read = stats_ ##name## _read, \ .read = stats_ ##name## _read, \
.open = mac80211_open_file_generic, \ .open = mac80211_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
#define DEBUGFS_STATS_ADD(name, field) \ #define DEBUGFS_STATS_ADD(name, field) \
......
...@@ -32,6 +32,7 @@ static ssize_t key_##name##_read(struct file *file, \ ...@@ -32,6 +32,7 @@ static ssize_t key_##name##_read(struct file *file, \
static const struct file_operations key_ ##name## _ops = { \ static const struct file_operations key_ ##name## _ops = { \
.read = key_##name##_read, \ .read = key_##name##_read, \
.open = mac80211_open_file_generic, \ .open = mac80211_open_file_generic, \
.llseek = generic_file_llseek, \
} }
#define KEY_FILE(name, format) \ #define KEY_FILE(name, format) \
...@@ -46,6 +47,7 @@ static const struct file_operations key_ ##name## _ops = { \ ...@@ -46,6 +47,7 @@ static const struct file_operations key_ ##name## _ops = { \
static const struct file_operations key_ ##name## _ops = { \ static const struct file_operations key_ ##name## _ops = { \
.read = key_conf_##name##_read, \ .read = key_conf_##name##_read, \
.open = mac80211_open_file_generic, \ .open = mac80211_open_file_generic, \
.llseek = generic_file_llseek, \
} }
#define KEY_CONF_FILE(name, format) \ #define KEY_CONF_FILE(name, format) \
......
...@@ -121,6 +121,7 @@ static const struct file_operations name##_ops = { \ ...@@ -121,6 +121,7 @@ static const struct file_operations name##_ops = { \
.read = ieee80211_if_read_##name, \ .read = ieee80211_if_read_##name, \
.write = (_write), \ .write = (_write), \
.open = mac80211_open_file_generic, \ .open = mac80211_open_file_generic, \
.llseek = generic_file_llseek, \
} }
#define __IEEE80211_IF_FILE_W(name) \ #define __IEEE80211_IF_FILE_W(name) \
......
...@@ -36,6 +36,7 @@ static ssize_t sta_ ##name## _read(struct file *file, \ ...@@ -36,6 +36,7 @@ static ssize_t sta_ ##name## _read(struct file *file, \
static const struct file_operations sta_ ##name## _ops = { \ static const struct file_operations sta_ ##name## _ops = { \
.read = sta_##name##_read, \ .read = sta_##name##_read, \
.open = mac80211_open_file_generic, \ .open = mac80211_open_file_generic, \
.llseek = generic_file_llseek, \
} }
#define STA_OPS_RW(name) \ #define STA_OPS_RW(name) \
...@@ -43,6 +44,7 @@ static const struct file_operations sta_ ##name## _ops = { \ ...@@ -43,6 +44,7 @@ static const struct file_operations sta_ ##name## _ops = { \
.read = sta_##name##_read, \ .read = sta_##name##_read, \
.write = sta_##name##_write, \ .write = sta_##name##_write, \
.open = mac80211_open_file_generic, \ .open = mac80211_open_file_generic, \
.llseek = generic_file_llseek, \
} }
#define STA_FILE(name, field, format) \ #define STA_FILE(name, field, format) \
......
...@@ -34,6 +34,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \ ...@@ -34,6 +34,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
static const struct file_operations name## _ops = { \ static const struct file_operations name## _ops = { \
.read = name## _read, \ .read = name## _read, \
.open = cfg80211_open_file_generic, \ .open = cfg80211_open_file_generic, \
.llseek = generic_file_llseek, \
}; };
DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d", DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment