aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax/i2400m/driver.c
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-02-28 18:42:50 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-02 06:10:25 -0500
commit8987691a4aa6622a1b58bb12c56abaf3d2098fad (patch)
tree92da0abdf6a29aa60ec5aff6250b1937d4c264d6 /drivers/net/wimax/i2400m/driver.c
parent6a0f7ab8305cb60a43a6c4a548f57adab784e6cd (diff)
wimax/i2400m: allow control of the base-station idle mode timeout
For power saving reasons, WiMAX links can be put in idle mode while connected after a certain time of the link not being used for tx or rx. In this mode, the device pages the base-station regularly and when data is ready to be transmitted, the link is revived. This patch allows the user to control the time the device has to be idle before it decides to go to idle mode from a sysfs interace. It also updates the initialization code to acknowledge the module variable 'idle_mode_disabled' when the firmware is a newer version (upcoming 1.4 vs 2.6.29's v1.3). The method for setting the idle mode timeout in the older firmwares is much more limited and can be only done at initialization time. Thus, the sysfs file will return -ENOSYS on older ones. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wimax/i2400m/driver.c')
-rw-r--r--drivers/net/wimax/i2400m/driver.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c
index 69a816e7c5db..f988771bfae0 100644
--- a/drivers/net/wimax/i2400m/driver.c
+++ b/drivers/net/wimax/i2400m/driver.c
@@ -662,6 +662,11 @@ int i2400m_setup(struct i2400m *i2400m, enum i2400m_bri bm_flags)
662 wimax_state_change(wimax_dev, WIMAX_ST_UNINITIALIZED); 662 wimax_state_change(wimax_dev, WIMAX_ST_UNINITIALIZED);
663 663
664 /* Now setup all that requires a registered net and wimax device. */ 664 /* Now setup all that requires a registered net and wimax device. */
665 result = sysfs_create_group(&net_dev->dev.kobj, &i2400m_dev_attr_group);
666 if (result < 0) {
667 dev_err(dev, "cannot setup i2400m's sysfs: %d\n", result);
668 goto error_sysfs_setup;
669 }
665 result = i2400m_debugfs_add(i2400m); 670 result = i2400m_debugfs_add(i2400m);
666 if (result < 0) { 671 if (result < 0) {
667 dev_err(dev, "cannot setup i2400m's debugfs: %d\n", result); 672 dev_err(dev, "cannot setup i2400m's debugfs: %d\n", result);
@@ -671,6 +676,9 @@ int i2400m_setup(struct i2400m *i2400m, enum i2400m_bri bm_flags)
671 return result; 676 return result;
672 677
673error_debugfs_setup: 678error_debugfs_setup:
679 sysfs_remove_group(&i2400m->wimax_dev.net_dev->dev.kobj,
680 &i2400m_dev_attr_group);
681error_sysfs_setup:
674 wimax_dev_rm(&i2400m->wimax_dev); 682 wimax_dev_rm(&i2400m->wimax_dev);
675error_wimax_dev_add: 683error_wimax_dev_add:
676 i2400m_dev_stop(i2400m); 684 i2400m_dev_stop(i2400m);
@@ -702,6 +710,8 @@ void i2400m_release(struct i2400m *i2400m)
702 netif_stop_queue(i2400m->wimax_dev.net_dev); 710 netif_stop_queue(i2400m->wimax_dev.net_dev);
703 711
704 i2400m_debugfs_rm(i2400m); 712 i2400m_debugfs_rm(i2400m);
713 sysfs_remove_group(&i2400m->wimax_dev.net_dev->dev.kobj,
714 &i2400m_dev_attr_group);
705 wimax_dev_rm(&i2400m->wimax_dev); 715 wimax_dev_rm(&i2400m->wimax_dev);
706 i2400m_dev_stop(i2400m); 716 i2400m_dev_stop(i2400m);
707 unregister_netdev(i2400m->wimax_dev.net_dev); 717 unregister_netdev(i2400m->wimax_dev.net_dev);