aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2x00
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-12-04 16:25:15 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-04 16:25:15 -0500
commit8f56874bd7e8bee73ed6a1cf80dcec2753616262 (patch)
treeaebd15dea662ef5efd89402b8fd92fec540a98eb /drivers/net/wireless/ipw2x00
parent47e1c323069bcef0acb8a2b48921688573f5ca63 (diff)
parent159bcfeb9123c91f0dc885a42b6387a98192f896 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/ipw2x00')
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c11
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_module.c33
2 files changed, 33 insertions, 11 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 6c836c892e43..17a9cb3528fc 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6573,6 +6573,16 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
6573} 6573}
6574#endif 6574#endif
6575 6575
6576static void ipw2100_shutdown(struct pci_dev *pci_dev)
6577{
6578 struct ipw2100_priv *priv = pci_get_drvdata(pci_dev);
6579
6580 /* Take down the device; powers it off, etc. */
6581 ipw2100_down(priv);
6582
6583 pci_disable_device(pci_dev);
6584}
6585
6576#define IPW2100_DEV_ID(x) { PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, x } 6586#define IPW2100_DEV_ID(x) { PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, x }
6577 6587
6578static struct pci_device_id ipw2100_pci_id_table[] __devinitdata = { 6588static struct pci_device_id ipw2100_pci_id_table[] __devinitdata = {
@@ -6636,6 +6646,7 @@ static struct pci_driver ipw2100_pci_driver = {
6636 .suspend = ipw2100_suspend, 6646 .suspend = ipw2100_suspend,
6637 .resume = ipw2100_resume, 6647 .resume = ipw2100_resume,
6638#endif 6648#endif
6649 .shutdown = ipw2100_shutdown,
6639}; 6650};
6640 6651
6641/** 6652/**
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index e8a1ac5f8e11..bf21eb383dbd 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -248,17 +248,22 @@ u32 libipw_debug_level = 0;
248EXPORT_SYMBOL_GPL(libipw_debug_level); 248EXPORT_SYMBOL_GPL(libipw_debug_level);
249static struct proc_dir_entry *libipw_proc = NULL; 249static struct proc_dir_entry *libipw_proc = NULL;
250 250
251static int show_debug_level(char *page, char **start, off_t offset, 251static int debug_level_proc_show(struct seq_file *m, void *v)
252 int count, int *eof, void *data)
253{ 252{
254 return snprintf(page, count, "0x%08X\n", libipw_debug_level); 253 seq_printf(m, "0x%08X\n", libipw_debug_level);
254 return 0;
255} 255}
256 256
257static int store_debug_level(struct file *file, const char __user * buffer, 257static int debug_level_proc_open(struct inode *inode, struct file *file)
258 unsigned long count, void *data) 258{
259 return single_open(file, debug_level_proc_show, NULL);
260}
261
262static ssize_t debug_level_proc_write(struct file *file,
263 const char __user *buffer, size_t count, loff_t *pos)
259{ 264{
260 char buf[] = "0x00000000\n"; 265 char buf[] = "0x00000000\n";
261 unsigned long len = min((unsigned long)sizeof(buf) - 1, count); 266 size_t len = min(sizeof(buf) - 1, count);
262 unsigned long val; 267 unsigned long val;
263 268
264 if (copy_from_user(buf, buffer, len)) 269 if (copy_from_user(buf, buffer, len))
@@ -272,6 +277,15 @@ static int store_debug_level(struct file *file, const char __user * buffer,
272 277
273 return strnlen(buf, len); 278 return strnlen(buf, len);
274} 279}
280
281static const struct file_operations debug_level_proc_fops = {
282 .owner = THIS_MODULE,
283 .open = debug_level_proc_open,
284 .read = seq_read,
285 .llseek = seq_lseek,
286 .release = single_release,
287 .write = debug_level_proc_write,
288};
275#endif /* CONFIG_LIBIPW_DEBUG */ 289#endif /* CONFIG_LIBIPW_DEBUG */
276 290
277static int __init libipw_init(void) 291static int __init libipw_init(void)
@@ -286,16 +300,13 @@ static int __init libipw_init(void)
286 " proc directory\n"); 300 " proc directory\n");
287 return -EIO; 301 return -EIO;
288 } 302 }
289 e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR, 303 e = proc_create("debug_level", S_IRUGO | S_IWUSR, libipw_proc,
290 libipw_proc); 304 &debug_level_proc_fops);
291 if (!e) { 305 if (!e) {
292 remove_proc_entry(DRV_NAME, init_net.proc_net); 306 remove_proc_entry(DRV_NAME, init_net.proc_net);
293 libipw_proc = NULL; 307 libipw_proc = NULL;
294 return -EIO; 308 return -EIO;
295 } 309 }
296 e->read_proc = show_debug_level;
297 e->write_proc = store_debug_level;
298 e->data = NULL;
299#endif /* CONFIG_LIBIPW_DEBUG */ 310#endif /* CONFIG_LIBIPW_DEBUG */
300 311
301 printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n"); 312 printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");