diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2011-01-31 13:48:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-04 16:29:49 -0500 |
commit | 4099e2f4404762add8ef2b0dadef3c5122117210 (patch) | |
tree | 269ae3d797b80a8f1e59e9cacb646c18c830219c /drivers/net/wireless/zd1211rw | |
parent | b91a515dbb4f824169755e071014230b57f0c1e1 (diff) |
zd1211rw: implement beacon fetching and handling ieee80211_get_buffered_bc()
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 1bd275bc6084..49ab3c357100 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -938,6 +938,34 @@ static int zd_op_config(struct ieee80211_hw *hw, u32 changed) | |||
938 | return zd_chip_set_channel(&mac->chip, conf->channel->hw_value); | 938 | return zd_chip_set_channel(&mac->chip, conf->channel->hw_value); |
939 | } | 939 | } |
940 | 940 | ||
941 | static void zd_beacon_done(struct zd_mac *mac) | ||
942 | { | ||
943 | struct sk_buff *skb, *beacon; | ||
944 | |||
945 | if (!mac->vif || mac->vif->type != NL80211_IFTYPE_AP) | ||
946 | return; | ||
947 | |||
948 | /* | ||
949 | * Send out buffered broad- and multicast frames. | ||
950 | */ | ||
951 | while (!ieee80211_queue_stopped(mac->hw, 0)) { | ||
952 | skb = ieee80211_get_buffered_bc(mac->hw, mac->vif); | ||
953 | if (!skb) | ||
954 | break; | ||
955 | zd_op_tx(mac->hw, skb); | ||
956 | } | ||
957 | |||
958 | /* | ||
959 | * Fetch next beacon so that tim_count is updated. | ||
960 | */ | ||
961 | beacon = ieee80211_beacon_get(mac->hw, mac->vif); | ||
962 | if (!beacon) | ||
963 | return; | ||
964 | |||
965 | zd_mac_config_beacon(mac->hw, beacon); | ||
966 | kfree_skb(beacon); | ||
967 | } | ||
968 | |||
941 | static void zd_process_intr(struct work_struct *work) | 969 | static void zd_process_intr(struct work_struct *work) |
942 | { | 970 | { |
943 | u16 int_status; | 971 | u16 int_status; |
@@ -948,10 +976,12 @@ static void zd_process_intr(struct work_struct *work) | |||
948 | int_status = le16_to_cpu(*(__le16 *)(mac->intr_buffer + 4)); | 976 | int_status = le16_to_cpu(*(__le16 *)(mac->intr_buffer + 4)); |
949 | spin_unlock_irqrestore(&mac->lock, flags); | 977 | spin_unlock_irqrestore(&mac->lock, flags); |
950 | 978 | ||
951 | if (int_status & INT_CFG_NEXT_BCN) | 979 | if (int_status & INT_CFG_NEXT_BCN) { |
952 | dev_dbg_f_limit(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n"); | 980 | /*dev_dbg_f_limit(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n");*/ |
953 | else | 981 | zd_beacon_done(mac); |
982 | } else { | ||
954 | dev_dbg_f(zd_mac_dev(mac), "Unsupported interrupt\n"); | 983 | dev_dbg_f(zd_mac_dev(mac), "Unsupported interrupt\n"); |
984 | } | ||
955 | 985 | ||
956 | zd_chip_enable_hwint(&mac->chip); | 986 | zd_chip_enable_hwint(&mac->chip); |
957 | } | 987 | } |
@@ -1135,7 +1165,8 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf) | |||
1135 | hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &mac->band; | 1165 | hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &mac->band; |
1136 | 1166 | ||
1137 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | | 1167 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | |
1138 | IEEE80211_HW_SIGNAL_UNSPEC; | 1168 | IEEE80211_HW_SIGNAL_UNSPEC | |
1169 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING; | ||
1139 | 1170 | ||
1140 | hw->wiphy->interface_modes = | 1171 | hw->wiphy->interface_modes = |
1141 | BIT(NL80211_IFTYPE_MESH_POINT) | | 1172 | BIT(NL80211_IFTYPE_MESH_POINT) | |