···737 struct ieee80211_tx_control beacon_txctl;738 bool beacon0_uploaded;739 bool beacon1_uploaded;0740 struct work_struct beacon_update_trigger;741742 /* The current QOS parameters for the 4 queues.
···737 struct ieee80211_tx_control beacon_txctl;738 bool beacon0_uploaded;739 bool beacon1_uploaded;740+ bool beacon_templates_virgin; /* Never wrote the templates? */741 struct work_struct beacon_update_trigger;742743 /* The current QOS parameters for the 4 queues.
···1544 kfree(probe_resp_data);1545}15461547+static void b43_upload_beacon0(struct b43_wldev *dev)1548+{1549+ struct b43_wl *wl = dev->wl;1550+1551+ if (wl->beacon0_uploaded)1552+ return;1553+ b43_write_beacon_template(dev, 0x68, 0x18);1554+ /* FIXME: Probe resp upload doesn't really belong here,1555+ * but we don't use that feature anyway. */1556+ b43_write_probe_resp_template(dev, 0x268, 0x4A,1557+ &__b43_ratetable[3]);1558+ wl->beacon0_uploaded = 1;1559+}1560+1561+static void b43_upload_beacon1(struct b43_wldev *dev)1562+{1563+ struct b43_wl *wl = dev->wl;1564+1565+ if (wl->beacon1_uploaded)1566+ return;1567+ b43_write_beacon_template(dev, 0x468, 0x1A);1568+ wl->beacon1_uploaded = 1;1569+}1570+1571static void handle_irq_beacon(struct b43_wldev *dev)1572{1573 struct b43_wl *wl = dev->wl;···1568 return;1569 }15701571+ if (unlikely(wl->beacon_templates_virgin)) {1572+ /* We never uploaded a beacon before.1573+ * Upload both templates now, but only mark one valid. */1574+ wl->beacon_templates_virgin = 0;1575+ b43_upload_beacon0(dev);1576+ b43_upload_beacon1(dev);01577 cmd = b43_read32(dev, B43_MMIO_MACCMD);1578 cmd |= B43_MACCMD_BEACON0_VALID;1579 b43_write32(dev, B43_MMIO_MACCMD, cmd);1580+ } else {1581+ if (!beacon0_valid) {1582+ b43_upload_beacon0(dev);1583+ cmd = b43_read32(dev, B43_MMIO_MACCMD);1584+ cmd |= B43_MACCMD_BEACON0_VALID;1585+ b43_write32(dev, B43_MMIO_MACCMD, cmd);1586+ } else if (!beacon1_valid) {1587+ b43_upload_beacon1(dev);1588+ cmd = b43_read32(dev, B43_MMIO_MACCMD);1589+ cmd |= B43_MACCMD_BEACON1_VALID;1590+ b43_write32(dev, B43_MMIO_MACCMD, cmd);1591 }0001592 }1593}1594···4073 wl->filter_flags = 0;4074 wl->radiotap_enabled = 0;4075 b43_qos_clear(wl);4076+ wl->beacon0_uploaded = 0;4077+ wl->beacon1_uploaded = 0;4078+ wl->beacon_templates_virgin = 1;40794080 /* First register RFkill.4081 * LEDs that are registered later depend on it. */···4241 goto out;4242 }4243 }4244+out:4245+ if (err)4246+ wl->current_dev = NULL; /* Failed to init the dev. */4247 mutex_unlock(&wl->mutex);4248 if (err)4249 b43err(wl, "Controller restart FAILED\n");···4382 struct b43_wldev *wldev;4383 struct b43_wl *wl;43844385+ /* Do not cancel ieee80211-workqueue based work here.4386+ * See comment in b43_remove(). */4387+4388 wldev = ssb_get_drvdata(dev);4389 wl = wldev->wl;04390 b43_debugfs_remove_device(wldev);4391 b43_wireless_core_detach(wldev);4392 list_del(&wldev->list);···4568{4569 struct b43_wl *wl = ssb_get_devtypedata(dev);4570 struct b43_wldev *wldev = ssb_get_drvdata(dev);4571+4572+ /* We must cancel any work here before unregistering from ieee80211,4573+ * as the ieee80211 unreg will destroy the workqueue. */4574+ cancel_work_sync(&wldev->restart_work);45754576 B43_WARN_ON(!wl);4577 if (wl->current_dev == wldev)
+1-2
drivers/net/wireless/iwlwifi/iwl-4965-rs.c
···11621163 /* Higher rate not available, use the original */1164 } else {1165- new_rate = rate;1166 break;1167 }1168 }···2008 * 2) Not just finishing up a search2009 * 3) Allowing a new search2010 */2011- if (!update_lq && !done_search && !lq_sta->stay_in_tbl) {2012 /* Save current throughput to compare with "search" throughput*/2013 lq_sta->last_tpt = current_tpt;2014
···11621163 /* Higher rate not available, use the original */1164 } else {01165 break;1166 }1167 }···2009 * 2) Not just finishing up a search2010 * 3) Allowing a new search2011 */2012+ if (!update_lq && !done_search && !lq_sta->stay_in_tbl && window->counter) {2013 /* Save current throughput to compare with "search" throughput*/2014 lq_sta->last_tpt = current_tpt;2015
+63-2
drivers/net/wireless/rndis_wlan.c
···116#define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b)117#define OID_802_11_ADD_KEY ccpu2(0x0d01011d)118#define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e)0119#define OID_802_11_PMKID ccpu2(0x0d010123)120#define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203)121#define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204)···270 __le32 type;271 __le32 value_offs;272 __le32 value_length;00000000000000000000273} __attribute__((packed));274275/* these have to match what is in wpa_supplicant */···695 return ret;696}697000000698699static int is_associated(struct usbnet *usbdev)700{···2209 struct usbnet *usbdev = priv->usbdev;2210 union iwreq_data evt;2211 unsigned char bssid[ETH_ALEN];2212- int ret;0022132214 if (test_and_clear_bit(WORK_CONNECTION_EVENT, &priv->work_pending)) {2215- ret = get_bssid(usbdev, bssid);00221600000000000000000000000002217 if (!ret) {2218 evt.data.flags = 0;2219 evt.data.length = 0;···2469 priv->param_power_save = 0;2470 else if (priv->param_power_save > 2)2471 priv->param_power_save = 2;0000024722473 if (priv->param_roamtrigger < -80)2474 priv->param_roamtrigger = -80;
···116#define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b)117#define OID_802_11_ADD_KEY ccpu2(0x0d01011d)118#define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e)119+#define OID_802_11_ASSOCIATION_INFORMATION ccpu2(0x0d01011f)120#define OID_802_11_PMKID ccpu2(0x0d010123)121#define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203)122#define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204)···269 __le32 type;270 __le32 value_offs;271 __le32 value_length;272+} __attribute__((packed));273+274+struct ndis_80211_assoc_info {275+ __le32 length;276+ __le16 req_ies;277+ struct req_ie {278+ __le16 capa;279+ __le16 listen_interval;280+ u8 cur_ap_address[6];281+ } req_ie;282+ __le32 req_ie_length;283+ __le32 offset_req_ies;284+ __le16 resp_ies;285+ struct resp_ie {286+ __le16 capa;287+ __le16 status_code;288+ __le16 assoc_id;289+ } resp_ie;290+ __le32 resp_ie_length;291+ __le32 offset_resp_ies;292} __attribute__((packed));293294/* these have to match what is in wpa_supplicant */···674 return ret;675}676677+static int get_association_info(struct usbnet *usbdev,678+ struct ndis_80211_assoc_info *info, int len)679+{680+ return rndis_query_oid(usbdev, OID_802_11_ASSOCIATION_INFORMATION,681+ info, &len);682+}683684static int is_associated(struct usbnet *usbdev)685{···2182 struct usbnet *usbdev = priv->usbdev;2183 union iwreq_data evt;2184 unsigned char bssid[ETH_ALEN];2185+ struct ndis_80211_assoc_info *info;2186+ int assoc_size = sizeof(*info) + IW_CUSTOM_MAX + 32;2187+ int ret, offset;21882189 if (test_and_clear_bit(WORK_CONNECTION_EVENT, &priv->work_pending)) {2190+ info = kzalloc(assoc_size, GFP_KERNEL);2191+ if (!info)2192+ goto get_bssid;21932194+ /* Get association info IEs from device and send them back to2195+ * userspace. */2196+ ret = get_association_info(usbdev, info, assoc_size);2197+ if (!ret) {2198+ evt.data.length = le32_to_cpu(info->req_ie_length);2199+ if (evt.data.length > 0) {2200+ offset = le32_to_cpu(info->offset_req_ies);2201+ wireless_send_event(usbdev->net,2202+ IWEVASSOCREQIE, &evt,2203+ (char *)info + offset);2204+ }2205+2206+ evt.data.length = le32_to_cpu(info->resp_ie_length);2207+ if (evt.data.length > 0) {2208+ offset = le32_to_cpu(info->offset_resp_ies);2209+ wireless_send_event(usbdev->net,2210+ IWEVASSOCRESPIE, &evt,2211+ (char *)info + offset);2212+ }2213+ }2214+2215+ kfree(info);2216+2217+get_bssid:2218+ ret = get_bssid(usbdev, bssid);2219 if (!ret) {2220 evt.data.flags = 0;2221 evt.data.length = 0;···2413 priv->param_power_save = 0;2414 else if (priv->param_power_save > 2)2415 priv->param_power_save = 2;2416+2417+ if (priv->param_power_output < 0)2418+ priv->param_power_output = 0;2419+ else if (priv->param_power_output > 3)2420+ priv->param_power_output = 3;24212422 if (priv->param_roamtrigger < -80)2423 priv->param_roamtrigger = -80;
+5
drivers/net/wireless/rt2x00/rt2x00.h
···328 return DEFAULT_RSSI;329}33000000331static inline int rt2x00_get_link_ant_rssi_history(struct link *link,332 enum antenna ant)333{
···328 return DEFAULT_RSSI;329}330331+static inline void rt2x00_reset_link_ant_rssi(struct link *link)332+{333+ link->ant.rssi_ant = 0;334+}335+336static inline int rt2x00_get_link_ant_rssi_history(struct link *link,337 enum antenna ant)338{
···1313 /*1314 * Clear the TX filter mask for this STA when sending the next1315 * packet. If the STA went to power save mode, this will happen1316- * happen when it wakes up for the next time.1317 */1318 sta->flags |= WLAN_STA_CLEAR_PS_FILT;1319
···1313 /*1314 * Clear the TX filter mask for this STA when sending the next1315 * packet. If the STA went to power save mode, this will happen1316+ * when it wakes up for the next time.1317 */1318 sta->flags |= WLAN_STA_CLEAR_PS_FILT;1319
+18-15
net/mac80211/mlme.c
···13251326 /* prepare reordering buffer */1327 tid_agg_rx->reorder_buf =1328- kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC);1329 if (!tid_agg_rx->reorder_buf) {1330 if (net_ratelimit())1331 printk(KERN_ERR "can not allocate reordering buffer "···1334 goto end;1335 }1336 memset(tid_agg_rx->reorder_buf, 0,1337- buf_size * sizeof(struct sk_buf *));13381339 if (local->ops->ampdu_action)1340 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,···1614 * only one argument, and both sta_info and TID are needed, so init1615 * flow in sta_info_create gives the TID as data, while the timer_to_id1616 * array gives the sta through container_of */1617- u16 tid = *(int *)data;1618 struct sta_info *temp_sta = container_of((void *)data,1619 struct sta_info, timer_to_tid[tid]);1620···1662void sta_rx_agg_session_timer_expired(unsigned long data)1663{1664 /* not an elegant detour, but there is no choice as the timer passes1665- * only one argument, and verious sta_info are needed here, so init1666 * flow in sta_info_create gives the TID as data, while the timer_to_id1667 * array gives the sta through container_of */1668 u8 *ptid = (u8 *)data;···24782479 ifsta->state = IEEE80211_IBSS_JOINED;2480 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);2481-2482- ieee80211_rx_bss_put(dev, bss);24832484 return res;2485}···3521 struct ieee80211_supported_band *sband;3522 u8 bssid[ETH_ALEN], *pos;3523 int i;03524 DECLARE_MAC_BUF(mac);35253526#if 0···3566 *pos++ = (u8) (rate / 5);3567 }35683569- return ieee80211_sta_join_ibss(dev, ifsta, bss);003570}35713572···3616 (bss = ieee80211_rx_bss_get(dev, bssid,3617 local->hw.conf.channel->center_freq,3618 ifsta->ssid, ifsta->ssid_len))) {03619 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"3620 " based on configured SSID\n",3621 dev->name, print_mac(mac, bssid));3622- return ieee80211_sta_join_ibss(dev, ifsta, bss);003623 }3624#ifdef CONFIG_MAC80211_IBSS_DEBUG3625 printk(KERN_DEBUG " did not try to join ibss\n");···40994100 memset(&iwe, 0, sizeof(iwe));4101 iwe.cmd = SIOCGIWFREQ;4102- iwe.u.freq.m = bss->freq;4103- iwe.u.freq.e = 6;4104- current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,4105- IW_EV_FREQ_LEN);4106-4107- memset(&iwe, 0, sizeof(iwe));4108- iwe.cmd = SIOCGIWFREQ;4109 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq);4110 iwe.u.freq.e = 0;4111 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,4112 IW_EV_FREQ_LEN);41130000004114 memset(&iwe, 0, sizeof(iwe));4115 iwe.cmd = IWEVQUAL;4116 iwe.u.qual.qual = bss->signal;
···13251326 /* prepare reordering buffer */1327 tid_agg_rx->reorder_buf =1328+ kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC);1329 if (!tid_agg_rx->reorder_buf) {1330 if (net_ratelimit())1331 printk(KERN_ERR "can not allocate reordering buffer "···1334 goto end;1335 }1336 memset(tid_agg_rx->reorder_buf, 0,1337+ buf_size * sizeof(struct sk_buff *));13381339 if (local->ops->ampdu_action)1340 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,···1614 * only one argument, and both sta_info and TID are needed, so init1615 * flow in sta_info_create gives the TID as data, while the timer_to_id1616 * array gives the sta through container_of */1617+ u16 tid = *(u8 *)data;1618 struct sta_info *temp_sta = container_of((void *)data,1619 struct sta_info, timer_to_tid[tid]);1620···1662void sta_rx_agg_session_timer_expired(unsigned long data)1663{1664 /* not an elegant detour, but there is no choice as the timer passes1665+ * only one argument, and various sta_info are needed here, so init1666 * flow in sta_info_create gives the TID as data, while the timer_to_id1667 * array gives the sta through container_of */1668 u8 *ptid = (u8 *)data;···24782479 ifsta->state = IEEE80211_IBSS_JOINED;2480 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);0024812482 return res;2483}···3523 struct ieee80211_supported_band *sband;3524 u8 bssid[ETH_ALEN], *pos;3525 int i;3526+ int ret;3527 DECLARE_MAC_BUF(mac);35283529#if 0···3567 *pos++ = (u8) (rate / 5);3568 }35693570+ ret = ieee80211_sta_join_ibss(dev, ifsta, bss);3571+ ieee80211_rx_bss_put(dev, bss);3572+ return ret;3573}35743575···3615 (bss = ieee80211_rx_bss_get(dev, bssid,3616 local->hw.conf.channel->center_freq,3617 ifsta->ssid, ifsta->ssid_len))) {3618+ int ret;3619 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"3620 " based on configured SSID\n",3621 dev->name, print_mac(mac, bssid));3622+ ret = ieee80211_sta_join_ibss(dev, ifsta, bss);3623+ ieee80211_rx_bss_put(dev, bss);3624+ return ret;3625 }3626#ifdef CONFIG_MAC80211_IBSS_DEBUG3627 printk(KERN_DEBUG " did not try to join ibss\n");···40954096 memset(&iwe, 0, sizeof(iwe));4097 iwe.cmd = SIOCGIWFREQ;00000004098 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq);4099 iwe.u.freq.e = 0;4100 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,4101 IW_EV_FREQ_LEN);41024103+ memset(&iwe, 0, sizeof(iwe));4104+ iwe.cmd = SIOCGIWFREQ;4105+ iwe.u.freq.m = bss->freq;4106+ iwe.u.freq.e = 6;4107+ current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,4108+ IW_EV_FREQ_LEN);4109 memset(&iwe, 0, sizeof(iwe));4110 iwe.cmd = IWEVQUAL;4111 iwe.u.qual.qual = bss->signal;