aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax/i2400m/i2400m.h
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/i2400m.h
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/i2400m.h')
-rw-r--r--drivers/net/wimax/i2400m/i2400m.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h
index 5008cdb12b42..0c60d5c43007 100644
--- a/drivers/net/wimax/i2400m/i2400m.h
+++ b/drivers/net/wimax/i2400m/i2400m.h
@@ -585,6 +585,8 @@ unsigned i2400m_brh_get_signature(const struct i2400m_bootrom_header *hdr)
585 * Driver / device setup and internal functions 585 * Driver / device setup and internal functions
586 */ 586 */
587extern void i2400m_netdev_setup(struct net_device *net_dev); 587extern void i2400m_netdev_setup(struct net_device *net_dev);
588extern int i2400m_sysfs_setup(struct device_driver *);
589extern void i2400m_sysfs_release(struct device_driver *);
588extern int i2400m_tx_setup(struct i2400m *); 590extern int i2400m_tx_setup(struct i2400m *);
589extern void i2400m_wake_tx_work(struct work_struct *); 591extern void i2400m_wake_tx_work(struct work_struct *);
590extern void i2400m_tx_release(struct i2400m *); 592extern void i2400m_tx_release(struct i2400m *);
@@ -728,6 +730,7 @@ extern struct sk_buff *i2400m_get_device_info(struct i2400m *);
728extern int i2400m_firmware_check(struct i2400m *); 730extern int i2400m_firmware_check(struct i2400m *);
729extern int i2400m_set_init_config(struct i2400m *, 731extern int i2400m_set_init_config(struct i2400m *,
730 const struct i2400m_tlv_hdr **, size_t); 732 const struct i2400m_tlv_hdr **, size_t);
733extern int i2400m_set_idle_timeout(struct i2400m *, unsigned);
731 734
732static inline 735static inline
733struct usb_endpoint_descriptor *usb_get_epd(struct usb_interface *iface, int ep) 736struct usb_endpoint_descriptor *usb_get_epd(struct usb_interface *iface, int ep)
@@ -740,6 +743,32 @@ extern int i2400m_op_rfkill_sw_toggle(struct wimax_dev *,
740extern void i2400m_report_tlv_rf_switches_status( 743extern void i2400m_report_tlv_rf_switches_status(
741 struct i2400m *, const struct i2400m_tlv_rf_switches_status *); 744 struct i2400m *, const struct i2400m_tlv_rf_switches_status *);
742 745
746/*
747 * Helpers for firmware backwards compability
748 *
749 * As we aim to support at least the firmware version that was
750 * released with the previous kernel/driver release, some code will be
751 * conditionally executed depending on the firmware version. On each
752 * release, the code to support fw releases past the last two ones
753 * will be purged.
754 *
755 * By making it depend on this macros, it is easier to keep it a tab
756 * on what has to go and what not.
757 */
758static inline
759unsigned i2400m_le_v1_3(struct i2400m *i2400m)
760{
761 /* running fw is lower or v1.3 */
762 return i2400m->fw_version <= 0x00090001;
763}
764
765static inline
766unsigned i2400m_ge_v1_4(struct i2400m *i2400m)
767{
768 /* running fw is higher or v1.4 */
769 return i2400m->fw_version >= 0x00090002;
770}
771
743 772
744/* 773/*
745 * Do a millisecond-sleep for allowing wireshark to dump all the data 774 * Do a millisecond-sleep for allowing wireshark to dump all the data