···737737 struct ieee80211_tx_control beacon_txctl;738738 bool beacon0_uploaded;739739 bool beacon1_uploaded;740740+ bool beacon_templates_virgin; /* Never wrote the templates? */740741 struct work_struct beacon_update_trigger;741742742743 /* The current QOS parameters for the 4 queues.
+54-16
drivers/net/wireless/b43/main.c
···15441544 kfree(probe_resp_data);15451545}1546154615471547+static void b43_upload_beacon0(struct b43_wldev *dev)15481548+{15491549+ struct b43_wl *wl = dev->wl;15501550+15511551+ if (wl->beacon0_uploaded)15521552+ return;15531553+ b43_write_beacon_template(dev, 0x68, 0x18);15541554+ /* FIXME: Probe resp upload doesn't really belong here,15551555+ * but we don't use that feature anyway. */15561556+ b43_write_probe_resp_template(dev, 0x268, 0x4A,15571557+ &__b43_ratetable[3]);15581558+ wl->beacon0_uploaded = 1;15591559+}15601560+15611561+static void b43_upload_beacon1(struct b43_wldev *dev)15621562+{15631563+ struct b43_wl *wl = dev->wl;15641564+15651565+ if (wl->beacon1_uploaded)15661566+ return;15671567+ b43_write_beacon_template(dev, 0x468, 0x1A);15681568+ wl->beacon1_uploaded = 1;15691569+}15701570+15471571static void handle_irq_beacon(struct b43_wldev *dev)15481572{15491573 struct b43_wl *wl = dev->wl;···15921568 return;15931569 }1594157015951595- if (!beacon0_valid) {15961596- if (!wl->beacon0_uploaded) {15971597- b43_write_beacon_template(dev, 0x68, 0x18);15981598- b43_write_probe_resp_template(dev, 0x268, 0x4A,15991599- &__b43_ratetable[3]);16001600- wl->beacon0_uploaded = 1;16011601- }15711571+ if (unlikely(wl->beacon_templates_virgin)) {15721572+ /* We never uploaded a beacon before.15731573+ * Upload both templates now, but only mark one valid. */15741574+ wl->beacon_templates_virgin = 0;15751575+ b43_upload_beacon0(dev);15761576+ b43_upload_beacon1(dev);16021577 cmd = b43_read32(dev, B43_MMIO_MACCMD);16031578 cmd |= B43_MACCMD_BEACON0_VALID;16041579 b43_write32(dev, B43_MMIO_MACCMD, cmd);16051605- } else if (!beacon1_valid) {16061606- if (!wl->beacon1_uploaded) {16071607- b43_write_beacon_template(dev, 0x468, 0x1A);16081608- wl->beacon1_uploaded = 1;15801580+ } else {15811581+ if (!beacon0_valid) {15821582+ b43_upload_beacon0(dev);15831583+ cmd = b43_read32(dev, B43_MMIO_MACCMD);15841584+ cmd |= B43_MACCMD_BEACON0_VALID;15851585+ b43_write32(dev, B43_MMIO_MACCMD, cmd);15861586+ } else if (!beacon1_valid) {15871587+ b43_upload_beacon1(dev);15881588+ cmd = b43_read32(dev, B43_MMIO_MACCMD);15891589+ cmd |= B43_MACCMD_BEACON1_VALID;15901590+ b43_write32(dev, B43_MMIO_MACCMD, cmd);16091591 }16101610- cmd = b43_read32(dev, B43_MMIO_MACCMD);16111611- cmd |= B43_MACCMD_BEACON1_VALID;16121612- b43_write32(dev, B43_MMIO_MACCMD, cmd);16131592 }16141593}16151594···41004073 wl->filter_flags = 0;41014074 wl->radiotap_enabled = 0;41024075 b43_qos_clear(wl);40764076+ wl->beacon0_uploaded = 0;40774077+ wl->beacon1_uploaded = 0;40784078+ wl->beacon_templates_virgin = 1;4103407941044080 /* First register RFkill.41054081 * LEDs that are registered later depend on it. */···42714241 goto out;42724242 }42734243 }42744274- out:42444244+out:42454245+ if (err)42464246+ wl->current_dev = NULL; /* Failed to init the dev. */42754247 mutex_unlock(&wl->mutex);42764248 if (err)42774249 b43err(wl, "Controller restart FAILED\n");···44144382 struct b43_wldev *wldev;44154383 struct b43_wl *wl;4416438443854385+ /* Do not cancel ieee80211-workqueue based work here.43864386+ * See comment in b43_remove(). */43874387+44174388 wldev = ssb_get_drvdata(dev);44184389 wl = wldev->wl;44194419- cancel_work_sync(&wldev->restart_work);44204390 b43_debugfs_remove_device(wldev);44214391 b43_wireless_core_detach(wldev);44224392 list_del(&wldev->list);···46024568{46034569 struct b43_wl *wl = ssb_get_devtypedata(dev);46044570 struct b43_wldev *wldev = ssb_get_drvdata(dev);45714571+45724572+ /* We must cancel any work here before unregistering from ieee80211,45734573+ * as the ieee80211 unreg will destroy the workqueue. */45744574+ cancel_work_sync(&wldev->restart_work);4605457546064576 B43_WARN_ON(!wl);46074577 if (wl->current_dev == wldev)
+1-2
drivers/net/wireless/iwlwifi/iwl-4965-rs.c
···1162116211631163 /* Higher rate not available, use the original */11641164 } else {11651165- new_rate = rate;11661165 break;11671166 }11681167 }···20082009 * 2) Not just finishing up a search20092010 * 3) Allowing a new search20102011 */20112011- if (!update_lq && !done_search && !lq_sta->stay_in_tbl) {20122012+ if (!update_lq && !done_search && !lq_sta->stay_in_tbl && window->counter) {20122013 /* Save current throughput to compare with "search" throughput*/20132014 lq_sta->last_tpt = current_tpt;20142015
+63-2
drivers/net/wireless/rndis_wlan.c
···116116#define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b)117117#define OID_802_11_ADD_KEY ccpu2(0x0d01011d)118118#define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e)119119+#define OID_802_11_ASSOCIATION_INFORMATION ccpu2(0x0d01011f)119120#define OID_802_11_PMKID ccpu2(0x0d010123)120121#define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203)121122#define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204)···270269 __le32 type;271270 __le32 value_offs;272271 __le32 value_length;272272+} __attribute__((packed));273273+274274+struct ndis_80211_assoc_info {275275+ __le32 length;276276+ __le16 req_ies;277277+ struct req_ie {278278+ __le16 capa;279279+ __le16 listen_interval;280280+ u8 cur_ap_address[6];281281+ } req_ie;282282+ __le32 req_ie_length;283283+ __le32 offset_req_ies;284284+ __le16 resp_ies;285285+ struct resp_ie {286286+ __le16 capa;287287+ __le16 status_code;288288+ __le16 assoc_id;289289+ } resp_ie;290290+ __le32 resp_ie_length;291291+ __le32 offset_resp_ies;273292} __attribute__((packed));274293275294/* these have to match what is in wpa_supplicant */···695674 return ret;696675}697676677677+static int get_association_info(struct usbnet *usbdev,678678+ struct ndis_80211_assoc_info *info, int len)679679+{680680+ return rndis_query_oid(usbdev, OID_802_11_ASSOCIATION_INFORMATION,681681+ info, &len);682682+}698683699684static int is_associated(struct usbnet *usbdev)700685{···22092182 struct usbnet *usbdev = priv->usbdev;22102183 union iwreq_data evt;22112184 unsigned char bssid[ETH_ALEN];22122212- int ret;21852185+ struct ndis_80211_assoc_info *info;21862186+ int assoc_size = sizeof(*info) + IW_CUSTOM_MAX + 32;21872187+ int ret, offset;2213218822142189 if (test_and_clear_bit(WORK_CONNECTION_EVENT, &priv->work_pending)) {22152215- ret = get_bssid(usbdev, bssid);21902190+ info = kzalloc(assoc_size, GFP_KERNEL);21912191+ if (!info)21922192+ goto get_bssid;2216219321942194+ /* Get association info IEs from device and send them back to21952195+ * userspace. */21962196+ ret = get_association_info(usbdev, info, assoc_size);21972197+ if (!ret) {21982198+ evt.data.length = le32_to_cpu(info->req_ie_length);21992199+ if (evt.data.length > 0) {22002200+ offset = le32_to_cpu(info->offset_req_ies);22012201+ wireless_send_event(usbdev->net,22022202+ IWEVASSOCREQIE, &evt,22032203+ (char *)info + offset);22042204+ }22052205+22062206+ evt.data.length = le32_to_cpu(info->resp_ie_length);22072207+ if (evt.data.length > 0) {22082208+ offset = le32_to_cpu(info->offset_resp_ies);22092209+ wireless_send_event(usbdev->net,22102210+ IWEVASSOCRESPIE, &evt,22112211+ (char *)info + offset);22122212+ }22132213+ }22142214+22152215+ kfree(info);22162216+22172217+get_bssid:22182218+ ret = get_bssid(usbdev, bssid);22172219 if (!ret) {22182220 evt.data.flags = 0;22192221 evt.data.length = 0;···24692413 priv->param_power_save = 0;24702414 else if (priv->param_power_save > 2)24712415 priv->param_power_save = 2;24162416+24172417+ if (priv->param_power_output < 0)24182418+ priv->param_power_output = 0;24192419+ else if (priv->param_power_output > 3)24202420+ priv->param_power_output = 3;2472242124732422 if (priv->param_roamtrigger < -80)24742423 priv->param_roamtrigger = -80;
+5
drivers/net/wireless/rt2x00/rt2x00.h
···328328 return DEFAULT_RSSI;329329}330330331331+static inline void rt2x00_reset_link_ant_rssi(struct link *link)332332+{333333+ link->ant.rssi_ant = 0;334334+}335335+331336static inline int rt2x00_get_link_ant_rssi_history(struct link *link,332337 enum antenna ant)333338{
···672672 if (params->vlan) {673673 sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);674674675675- if (sdata->vif.type != IEEE80211_IF_TYPE_VLAN ||675675+ if (sdata->vif.type != IEEE80211_IF_TYPE_VLAN &&676676 sdata->vif.type != IEEE80211_IF_TYPE_AP)677677 return -EINVAL;678678 } else···760760 if (params->vlan && params->vlan != sta->sdata->dev) {761761 vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);762762763763- if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN ||763763+ if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN &&764764 vlansdata->vif.type != IEEE80211_IF_TYPE_AP) {765765 rcu_read_unlock();766766 return -EINVAL;
+1-1
net/mac80211/main.c
···13131313 /*13141314 * Clear the TX filter mask for this STA when sending the next13151315 * packet. If the STA went to power save mode, this will happen13161316- * happen when it wakes up for the next time.13161316+ * when it wakes up for the next time.13171317 */13181318 sta->flags |= WLAN_STA_CLEAR_PS_FILT;13191319
+18-15
net/mac80211/mlme.c
···1325132513261326 /* prepare reordering buffer */13271327 tid_agg_rx->reorder_buf =13281328- kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC);13281328+ kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC);13291329 if (!tid_agg_rx->reorder_buf) {13301330 if (net_ratelimit())13311331 printk(KERN_ERR "can not allocate reordering buffer "···13341334 goto end;13351335 }13361336 memset(tid_agg_rx->reorder_buf, 0,13371337- buf_size * sizeof(struct sk_buf *));13371337+ buf_size * sizeof(struct sk_buff *));1338133813391339 if (local->ops->ampdu_action)13401340 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,···16141614 * only one argument, and both sta_info and TID are needed, so init16151615 * flow in sta_info_create gives the TID as data, while the timer_to_id16161616 * array gives the sta through container_of */16171617- u16 tid = *(int *)data;16171617+ u16 tid = *(u8 *)data;16181618 struct sta_info *temp_sta = container_of((void *)data,16191619 struct sta_info, timer_to_tid[tid]);16201620···16621662void sta_rx_agg_session_timer_expired(unsigned long data)16631663{16641664 /* not an elegant detour, but there is no choice as the timer passes16651665- * only one argument, and verious sta_info are needed here, so init16651665+ * only one argument, and various sta_info are needed here, so init16661666 * flow in sta_info_create gives the TID as data, while the timer_to_id16671667 * array gives the sta through container_of */16681668 u8 *ptid = (u8 *)data;···2478247824792479 ifsta->state = IEEE80211_IBSS_JOINED;24802480 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);24812481-24822482- ieee80211_rx_bss_put(dev, bss);2483248124842482 return res;24852483}···35213523 struct ieee80211_supported_band *sband;35223524 u8 bssid[ETH_ALEN], *pos;35233525 int i;35263526+ int ret;35243527 DECLARE_MAC_BUF(mac);3525352835263529#if 0···35663567 *pos++ = (u8) (rate / 5);35673568 }3568356935693569- return ieee80211_sta_join_ibss(dev, ifsta, bss);35703570+ ret = ieee80211_sta_join_ibss(dev, ifsta, bss);35713571+ ieee80211_rx_bss_put(dev, bss);35723572+ return ret;35703573}3571357435723575···36163615 (bss = ieee80211_rx_bss_get(dev, bssid,36173616 local->hw.conf.channel->center_freq,36183617 ifsta->ssid, ifsta->ssid_len))) {36183618+ int ret;36193619 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"36203620 " based on configured SSID\n",36213621 dev->name, print_mac(mac, bssid));36223622- return ieee80211_sta_join_ibss(dev, ifsta, bss);36223622+ ret = ieee80211_sta_join_ibss(dev, ifsta, bss);36233623+ ieee80211_rx_bss_put(dev, bss);36243624+ return ret;36233625 }36243626#ifdef CONFIG_MAC80211_IBSS_DEBUG36253627 printk(KERN_DEBUG " did not try to join ibss\n");···4099409541004096 memset(&iwe, 0, sizeof(iwe));41014097 iwe.cmd = SIOCGIWFREQ;41024102- iwe.u.freq.m = bss->freq;41034103- iwe.u.freq.e = 6;41044104- current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,41054105- IW_EV_FREQ_LEN);41064106-41074107- memset(&iwe, 0, sizeof(iwe));41084108- iwe.cmd = SIOCGIWFREQ;41094098 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq);41104099 iwe.u.freq.e = 0;41114100 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,41124101 IW_EV_FREQ_LEN);4113410241034103+ memset(&iwe, 0, sizeof(iwe));41044104+ iwe.cmd = SIOCGIWFREQ;41054105+ iwe.u.freq.m = bss->freq;41064106+ iwe.u.freq.e = 6;41074107+ current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,41084108+ IW_EV_FREQ_LEN);41144109 memset(&iwe, 0, sizeof(iwe));41154110 iwe.cmd = IWEVQUAL;41164111 iwe.u.qual.qual = bss->signal;