aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ray_cs.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-12-04 13:25:15 -0800
committerDavid S. Miller <davem@davemloft.net>2009-12-04 13:25:15 -0800
commit8f56874bd7e8bee73ed6a1cf80dcec2753616262 (patch)
treeaebd15dea662ef5efd89402b8fd92fec540a98eb /drivers/net/wireless/ray_cs.c
parenttcp: fix a timewait refcnt race (diff)
parentiwmc3200wifi: Enable wimax core through module parameter (diff)
downloadlinux-dev-8f56874bd7e8bee73ed6a1cf80dcec2753616262.tar.xz
linux-dev-8f56874bd7e8bee73ed6a1cf80dcec2753616262.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/ray_cs.c')
-rw-r--r--drivers/net/wireless/ray_cs.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 5ee9d2a19360..0366f5aeb914 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2865,18 +2865,8 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
/*===========================================================================*/
#ifdef CONFIG_PROC_FS
-static void raycs_write(const char *name, write_proc_t *w, void *data)
-{
- struct proc_dir_entry *entry =
- create_proc_entry(name, S_IFREG | S_IWUSR, NULL);
- if (entry) {
- entry->write_proc = w;
- entry->data = data;
- }
-}
-
-static int write_essid(struct file *file, const char __user *buffer,
- unsigned long count, void *data)
+static ssize_t ray_cs_essid_proc_write(struct file *file,
+ const char __user *buffer, size_t count, loff_t *pos)
{
static char proc_essid[33];
unsigned int len = count;
@@ -2890,8 +2880,13 @@ static int write_essid(struct file *file, const char __user *buffer,
return count;
}
-static int write_int(struct file *file, const char __user *buffer,
- unsigned long count, void *data)
+static const struct file_operations ray_cs_essid_proc_fops = {
+ .owner = THIS_MODULE,
+ .write = ray_cs_essid_proc_write,
+};
+
+static ssize_t int_proc_write(struct file *file, const char __user *buffer,
+ size_t count, loff_t *pos)
{
static char proc_number[10];
char *p;
@@ -2914,9 +2909,14 @@ static int write_int(struct file *file, const char __user *buffer,
nr = nr * 10 + c;
p++;
} while (--len);
- *(int *)data = nr;
+ *(int *)PDE(file->f_path.dentry->d_inode)->data = nr;
return count;
}
+
+static const struct file_operations int_proc_fops = {
+ .owner = THIS_MODULE,
+ .write = int_proc_write,
+};
#endif
static struct pcmcia_device_id ray_ids[] = {
@@ -2951,9 +2951,9 @@ static int __init init_ray_cs(void)
proc_mkdir("driver/ray_cs", NULL);
proc_create("driver/ray_cs/ray_cs", 0, NULL, &ray_cs_proc_fops);
- raycs_write("driver/ray_cs/essid", write_essid, NULL);
- raycs_write("driver/ray_cs/net_type", write_int, &net_type);
- raycs_write("driver/ray_cs/translate", write_int, &translate);
+ proc_create("driver/ray_cs/essid", S_IWUSR, NULL, &ray_cs_essid_proc_fops);
+ proc_create_data("driver/ray_cs/net_type", S_IWUSR, NULL, &int_proc_fops, &net_type);
+ proc_create_data("driver/ray_cs/translate", S_IWUSR, NULL, &int_proc_fops, &translate);
#endif
if (translate != 0)
translate = 1;