diff options
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_hw.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 8e7000fd4414..507ab99eef4e 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
39 | #include <linux/etherdevice.h> | 39 | #include <linux/etherdevice.h> |
40 | #include <linux/proc_fs.h> | 40 | #include <linux/proc_fs.h> |
41 | #include <linux/seq_file.h> | ||
41 | #include <linux/if_arp.h> | 42 | #include <linux/if_arp.h> |
42 | #include <linux/delay.h> | 43 | #include <linux/delay.h> |
43 | #include <linux/random.h> | 44 | #include <linux/random.h> |
@@ -129,8 +130,7 @@ static void prism2_check_sta_fw_version(local_info_t *local); | |||
129 | 130 | ||
130 | #ifdef PRISM2_DOWNLOAD_SUPPORT | 131 | #ifdef PRISM2_DOWNLOAD_SUPPORT |
131 | /* hostap_download.c */ | 132 | /* hostap_download.c */ |
132 | static int prism2_download_aux_dump(struct net_device *dev, | 133 | static const struct file_operations prism2_download_aux_dump_proc_fops; |
133 | unsigned int addr, int len, u8 *buf); | ||
134 | static u8 * prism2_read_pda(struct net_device *dev); | 134 | static u8 * prism2_read_pda(struct net_device *dev); |
135 | static int prism2_download(local_info_t *local, | 135 | static int prism2_download(local_info_t *local, |
136 | struct prism2_download_param *param); | 136 | struct prism2_download_param *param); |
@@ -2894,19 +2894,12 @@ static void hostap_tick_timer(unsigned long data) | |||
2894 | 2894 | ||
2895 | 2895 | ||
2896 | #ifndef PRISM2_NO_PROCFS_DEBUG | 2896 | #ifndef PRISM2_NO_PROCFS_DEBUG |
2897 | static int prism2_registers_proc_read(char *page, char **start, off_t off, | 2897 | static int prism2_registers_proc_show(struct seq_file *m, void *v) |
2898 | int count, int *eof, void *data) | ||
2899 | { | 2898 | { |
2900 | char *p = page; | 2899 | local_info_t *local = m->private; |
2901 | local_info_t *local = (local_info_t *) data; | ||
2902 | |||
2903 | if (off != 0) { | ||
2904 | *eof = 1; | ||
2905 | return 0; | ||
2906 | } | ||
2907 | 2900 | ||
2908 | #define SHOW_REG(n) \ | 2901 | #define SHOW_REG(n) \ |
2909 | p += sprintf(p, #n "=%04x\n", hfa384x_read_reg(local->dev, HFA384X_##n##_OFF)) | 2902 | seq_printf(m, #n "=%04x\n", hfa384x_read_reg(local->dev, HFA384X_##n##_OFF)) |
2910 | 2903 | ||
2911 | SHOW_REG(CMD); | 2904 | SHOW_REG(CMD); |
2912 | SHOW_REG(PARAM0); | 2905 | SHOW_REG(PARAM0); |
@@ -2952,8 +2945,21 @@ p += sprintf(p, #n "=%04x\n", hfa384x_read_reg(local->dev, HFA384X_##n##_OFF)) | |||
2952 | SHOW_REG(PCI_M1_CTL); | 2945 | SHOW_REG(PCI_M1_CTL); |
2953 | #endif /* PRISM2_PCI */ | 2946 | #endif /* PRISM2_PCI */ |
2954 | 2947 | ||
2955 | return (p - page); | 2948 | return 0; |
2956 | } | 2949 | } |
2950 | |||
2951 | static int prism2_registers_proc_open(struct inode *inode, struct file *file) | ||
2952 | { | ||
2953 | return single_open(file, prism2_registers_proc_show, PDE_DATA(inode)); | ||
2954 | } | ||
2955 | |||
2956 | static const struct file_operations prism2_registers_proc_fops = { | ||
2957 | .open = prism2_registers_proc_open, | ||
2958 | .read = seq_read, | ||
2959 | .llseek = seq_lseek, | ||
2960 | .release = seq_release, | ||
2961 | }; | ||
2962 | |||
2957 | #endif /* PRISM2_NO_PROCFS_DEBUG */ | 2963 | #endif /* PRISM2_NO_PROCFS_DEBUG */ |
2958 | 2964 | ||
2959 | 2965 | ||
@@ -3128,7 +3134,7 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, | |||
3128 | local->func->reset_port = prism2_reset_port; | 3134 | local->func->reset_port = prism2_reset_port; |
3129 | local->func->schedule_reset = prism2_schedule_reset; | 3135 | local->func->schedule_reset = prism2_schedule_reset; |
3130 | #ifdef PRISM2_DOWNLOAD_SUPPORT | 3136 | #ifdef PRISM2_DOWNLOAD_SUPPORT |
3131 | local->func->read_aux = prism2_download_aux_dump; | 3137 | local->func->read_aux_fops = &prism2_download_aux_dump_proc_fops; |
3132 | local->func->download = prism2_download; | 3138 | local->func->download = prism2_download; |
3133 | #endif /* PRISM2_DOWNLOAD_SUPPORT */ | 3139 | #endif /* PRISM2_DOWNLOAD_SUPPORT */ |
3134 | local->func->tx = prism2_tx_80211; | 3140 | local->func->tx = prism2_tx_80211; |
@@ -3274,8 +3280,8 @@ static int hostap_hw_ready(struct net_device *dev) | |||
3274 | } | 3280 | } |
3275 | hostap_init_proc(local); | 3281 | hostap_init_proc(local); |
3276 | #ifndef PRISM2_NO_PROCFS_DEBUG | 3282 | #ifndef PRISM2_NO_PROCFS_DEBUG |
3277 | create_proc_read_entry("registers", 0, local->proc, | 3283 | proc_create_data("registers", 0, local->proc, |
3278 | prism2_registers_proc_read, local); | 3284 | &prism2_registers_proc_fops, local); |
3279 | #endif /* PRISM2_NO_PROCFS_DEBUG */ | 3285 | #endif /* PRISM2_NO_PROCFS_DEBUG */ |
3280 | hostap_init_ap_proc(local); | 3286 | hostap_init_ap_proc(local); |
3281 | return 0; | 3287 | return 0; |