aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2006-07-08 16:02:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2006-07-27 18:19:18 -0400
commit58e5528ee464d38040b9489e10033c9387a10d56 (patch)
tree58023ac8bf79757e37a4d05ce7fa63fb3f2388b9 /drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
parent3234faa8abe0c3d6da12cc4a38ce790134c92564 (diff)
[PATCH] bcm43xx: init routine rewrite
Rewrite of the bcm43xx initialization routines. This fixes several issues: * up-down-up-down-up... stale data issue (May fix some DHCP issues) * Fix the init vs IRQ handler race (and remove the workaround) * Fix init for cards with multiple cores (APHY) As softmac has no internal PHY handling (unlike dscape), this adds the file "phymode" to sysfs. The active PHY can be selected by writing either a, b or g to this file. Current PHY can be determined by reading from it. * Fix the controller restart code. Controller restart can now also be triggered through echo 1 > /debug/bcm43xx/ethX/restart Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
index 2600ee4b803a..634d3d8093cf 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
@@ -316,6 +316,40 @@ static ssize_t txstat_read_file(struct file *file, char __user *userbuf,
316 return res; 316 return res;
317} 317}
318 318
319static ssize_t restart_write_file(struct file *file, const char __user *user_buf,
320 size_t count, loff_t *ppos)
321{
322 struct bcm43xx_private *bcm = file->private_data;
323 char *buf = really_big_buffer;
324 ssize_t buf_size;
325 ssize_t res;
326 unsigned long flags;
327
328 buf_size = min(count, sizeof (really_big_buffer) - 1);
329 down(&big_buffer_sem);
330 if (copy_from_user(buf, user_buf, buf_size)) {
331 res = -EFAULT;
332 goto out_up;
333 }
334 bcm43xx_lock_irqsafe(bcm, flags);
335 if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) {
336 printk(KERN_INFO PFX "debugfs: Board not initialized.\n");
337 res = -EFAULT;
338 goto out_unlock;
339 }
340 if (count > 0 && buf[0] == '1') {
341 bcm43xx_controller_restart(bcm, "manually restarted");
342 res = count;
343 } else
344 res = -EINVAL;
345
346out_unlock:
347 bcm43xx_unlock_irqsafe(bcm, flags);
348out_up:
349 up(&big_buffer_sem);
350 return res;
351}
352
319#undef fappend 353#undef fappend
320 354
321 355
@@ -349,6 +383,11 @@ static struct file_operations txstat_fops = {
349 .open = open_file_generic, 383 .open = open_file_generic,
350}; 384};
351 385
386static struct file_operations restart_fops = {
387 .write = restart_write_file,
388 .open = open_file_generic,
389};
390
352 391
353void bcm43xx_debugfs_add_device(struct bcm43xx_private *bcm) 392void bcm43xx_debugfs_add_device(struct bcm43xx_private *bcm)
354{ 393{
@@ -400,6 +439,10 @@ void bcm43xx_debugfs_add_device(struct bcm43xx_private *bcm)
400 bcm, &txstat_fops); 439 bcm, &txstat_fops);
401 if (!e->dentry_txstat) 440 if (!e->dentry_txstat)
402 printk(KERN_ERR PFX "debugfs: creating \"tx_status\" for \"%s\" failed!\n", devdir); 441 printk(KERN_ERR PFX "debugfs: creating \"tx_status\" for \"%s\" failed!\n", devdir);
442 e->dentry_restart = debugfs_create_file("restart", 0222, e->subdir,
443 bcm, &restart_fops);
444 if (!e->dentry_restart)
445 printk(KERN_ERR PFX "debugfs: creating \"restart\" for \"%s\" failed!\n", devdir);
403} 446}
404 447
405void bcm43xx_debugfs_remove_device(struct bcm43xx_private *bcm) 448void bcm43xx_debugfs_remove_device(struct bcm43xx_private *bcm)
@@ -415,6 +458,7 @@ void bcm43xx_debugfs_remove_device(struct bcm43xx_private *bcm)
415 debugfs_remove(e->dentry_devinfo); 458 debugfs_remove(e->dentry_devinfo);
416 debugfs_remove(e->dentry_tsf); 459 debugfs_remove(e->dentry_tsf);
417 debugfs_remove(e->dentry_txstat); 460 debugfs_remove(e->dentry_txstat);
461 debugfs_remove(e->dentry_restart);
418 debugfs_remove(e->subdir); 462 debugfs_remove(e->subdir);
419 kfree(e->xmitstatus_buffer); 463 kfree(e->xmitstatus_buffer);
420 kfree(e->xmitstatus_print_buffer); 464 kfree(e->xmitstatus_print_buffer);