rt2x00 update
cover rt2x00 update
Hi John,
2 small patches for on top of the pull request from a few days ago, minor bugfix and a small optimization which is mostly important for rt2800 later on but is usable for rt61pci and rt73usb as well.
Ivo
PATCH 1/2 rt2x00: Block all unsupported modes
It was possible for unsupported operating modes to be accepted by the add_interface callback function. This patch will block those modes until proper support has been implemented for them.
--- drivers/net/wireless/rt2x00/rt2x00mac.c | 54 +++++++++++++++++++++---------- 1 files changed, 37 insertions(+), 17 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +37 -17
@@ -210,23 +210,43 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, !test_bit(DEVICE_STARTED, &rt2x00dev->flags))return -ENODEV ; -/* -* We don't support mixed combinations of sta and ap virtual -* interfaces. We can only add this interface when the rival -* interface count is 0. -*/ -if ((conf->type ==IEEE80211_IF_TYPE_AP && rt2x00dev->intf_sta_count) || - (conf->type !=IEEE80211_IF_TYPE_AP && rt2x00dev->intf_ap_count)) -return -ENOBUFS ; - -/* -* Check if we exceeded the maximum amount of supported interfaces. -*/ -if ((conf->type ==IEEE80211_IF_TYPE_AP && - rt2x00dev->intf_ap_count >= rt2x00dev->ops->max_ap_intf) || - (conf->type !=IEEE80211_IF_TYPE_AP && - rt2x00dev->intf_sta_count >= rt2x00dev->ops->max_sta_intf)) -return -ENOBUFS ; +switch (conf->type) { +case IEEE80211_IF_TYPE_AP : +/* +* We don't support mixed combinations of +* sta and ap interfaces. +*/ +if (rt2x00dev->intf_sta_count) +return -ENOBUFS ; + +/* +* Check if we exceeded the maximum amount +* of supported interfaces. +*/ +if (rt2x00dev->intf_ap_count >= rt2x00dev->ops->max_ap_intf) +return -ENOBUFS ; + +break ; +case IEEE80211_IF_TYPE_STA : +case IEEE80211_IF_TYPE_IBSS : +/* +* We don't support mixed combinations of +* sta and ap interfaces. +*/ +if (rt2x00dev->intf_ap_count) +return -ENOBUFS ; + +/* +* Check if we exceeded the maximum amount +* of supported interfaces. +*/ +if (rt2x00dev->intf_sta_count >= rt2x00dev->ops->max_sta_intf) +return -ENOBUFS ; + +break ; +default : +return -EINVAL ; + }/* * Loop through all beacon queues to find a free
Signature · 1 line
1.5.6.1
PATCH 2/2 rt2x00: Move lna_gain calculation to config() callback
We can optimize lna calculation in IRQ context by calculating most of the value during the config() callback when most of the value is actually influenced.
This will be required later by rt2800pci and rt2800usb as well, since they need the lna_gain value during config().
--- drivers/net/wireless/rt2x00/rt2x00.h | 5 +++ drivers/net/wireless/rt2x00/rt61pci.c | 48 +++++++++++++++++++++----------- drivers/net/wireless/rt2x00/rt73usb.c | 41 ++++++++++++++++++--------- 3 files changed, 63 insertions(+), 31 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +5 -0
@@ -804,6 +804,11 @@ struct rt2x00_dev {u32 *rf;/* +* LNA gain +*/ +short lna_gain; + +/* * USB Max frame size (for rt2500usb & rt73usb). */ u16 usb_maxpacket;
drivers/net/wireless/rt2x00/rt61pci.c +31 -17
83 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt73usb.c +27 -14
74 lines not on this page · raw message
Signature · 1 line
1.5.6.1