aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ray_cs.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-11-25 02:12:20 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-28 15:04:53 -0500
commit83daee06adeed7b294802c998d5e03ea7d856aa1 (patch)
tree6d536a555635e7b6f6c8f1ae51515cbee0e06150 /drivers/net/wireless/ray_cs.c
parent94db29368a658b13a088db87c7b0bf59b1a7492d (diff)
ray_cs: convert to proc_fops
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
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)
2865 2865
2866/*===========================================================================*/ 2866/*===========================================================================*/
2867#ifdef CONFIG_PROC_FS 2867#ifdef CONFIG_PROC_FS
2868static void raycs_write(const char *name, write_proc_t *w, void *data) 2868static ssize_t ray_cs_essid_proc_write(struct file *file,
2869{ 2869 const char __user *buffer, size_t count, loff_t *pos)
2870 struct proc_dir_entry *entry =
2871 create_proc_entry(name, S_IFREG | S_IWUSR, NULL);
2872 if (entry) {
2873 entry->write_proc = w;
2874 entry->data = data;
2875 }
2876}
2877
2878static int write_essid(struct file *file, const char __user *buffer,
2879 unsigned long count, void *data)
2880{ 2870{
2881 static char proc_essid[33]; 2871 static char proc_essid[33];
2882 unsigned int len = count; 2872 unsigned int len = count;
@@ -2890,8 +2880,13 @@ static int write_essid(struct file *file, const char __user *buffer,
2890 return count; 2880 return count;
2891} 2881}
2892 2882
2893static int write_int(struct file *file, const char __user *buffer, 2883static const struct file_operations ray_cs_essid_proc_fops = {
2894 unsigned long count, void *data) 2884 .owner = THIS_MODULE,
2885 .write = ray_cs_essid_proc_write,
2886};
2887
2888static ssize_t int_proc_write(struct file *file, const char __user *buffer,
2889 size_t count, loff_t *pos)
2895{ 2890{
2896 static char proc_number[10]; 2891 static char proc_number[10];
2897 char *p; 2892 char *p;
@@ -2914,9 +2909,14 @@ static int write_int(struct file *file, const char __user *buffer,
2914 nr = nr * 10 + c; 2909 nr = nr * 10 + c;
2915 p++; 2910 p++;
2916 } while (--len); 2911 } while (--len);
2917 *(int *)data = nr; 2912 *(int *)PDE(file->f_path.dentry->d_inode)->data = nr;
2918 return count; 2913 return count;
2919} 2914}
2915
2916static const struct file_operations int_proc_fops = {
2917 .owner = THIS_MODULE,
2918 .write = int_proc_write,
2919};
2920#endif 2920#endif
2921 2921
2922static struct pcmcia_device_id ray_ids[] = { 2922static struct pcmcia_device_id ray_ids[] = {
@@ -2951,9 +2951,9 @@ static int __init init_ray_cs(void)
2951 proc_mkdir("driver/ray_cs", NULL); 2951 proc_mkdir("driver/ray_cs", NULL);
2952 2952
2953 proc_create("driver/ray_cs/ray_cs", 0, NULL, &ray_cs_proc_fops); 2953 proc_create("driver/ray_cs/ray_cs", 0, NULL, &ray_cs_proc_fops);
2954 raycs_write("driver/ray_cs/essid", write_essid, NULL); 2954 proc_create("driver/ray_cs/essid", S_IWUSR, NULL, &ray_cs_essid_proc_fops);
2955 raycs_write("driver/ray_cs/net_type", write_int, &net_type); 2955 proc_create_data("driver/ray_cs/net_type", S_IWUSR, NULL, &int_proc_fops, &net_type);
2956 raycs_write("driver/ray_cs/translate", write_int, &translate); 2956 proc_create_data("driver/ray_cs/translate", S_IWUSR, NULL, &int_proc_fops, &translate);
2957#endif 2957#endif
2958 if (translate != 0) 2958 if (translate != 0)
2959 translate = 1; 2959 translate = 1;