···39823982 struct brcmf_fil_af_params_le *af_params;39833983 bool ack;39843984 s32 chan_nr;39853985+ u32 freq;3985398639863987 brcmf_dbg(TRACE, "Enter\n");39873988···39943993 brcmf_err("Driver only allows MGMT packet type\n");39953994 return -EPERM;39963995 }39963996+39973997+ vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev);3997399839983999 if (ieee80211_is_probe_resp(mgmt->frame_control)) {39994000 /* Right now the only reason to get a probe response */···40124009 ie_offset = DOT11_MGMT_HDR_LEN +40134010 DOT11_BCN_PRB_FIXED_LEN;40144011 ie_len = len - ie_offset;40154015- vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev);40164012 if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif)40174013 vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;40184014 err = brcmf_vif_set_mgmt_ie(vif,···40354033 memcpy(&af_params->bssid[0], &mgmt->bssid[0], ETH_ALEN);40364034 /* Add the length exepted for 802.11 header */40374035 action_frame->len = cpu_to_le16(len - DOT11_MGMT_HDR_LEN);40384038- /* Add the channel */40394039- chan_nr = ieee80211_frequency_to_channel(chan->center_freq);40364036+ /* Add the channel. Use the one specified as parameter if any or40374037+ * the current one (got from the firmware) otherwise40384038+ */40394039+ if (chan)40404040+ freq = chan->center_freq;40414041+ else40424042+ brcmf_fil_cmd_int_get(vif->ifp, BRCMF_C_GET_CHANNEL,40434043+ &freq);40444044+ chan_nr = ieee80211_frequency_to_channel(freq);40404045 af_params->channel = cpu_to_le32(chan_nr);4041404640424047 memcpy(action_frame->data, &buf[DOT11_MGMT_HDR_LEN],
···146146#define IEEE80211_MAX_RTS_THRESHOLD 2353147147#define IEEE80211_MAX_AID 2007148148#define IEEE80211_MAX_TIM_LEN 251149149+#define IEEE80211_MAX_MESH_PEERINGS 63149150/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section150151 6.2.1.1.2.151152
+53-62
include/net/cfg80211.h
···11241124 * setting for new peer links.11251125 * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake11261126 * after transmitting its beacon.11271127+ * @plink_timeout: If no tx activity is seen from a STA we've established11281128+ * peering with for longer than this time (in seconds), then remove it11291129+ * from the STA's list of peers. Default is 30 minutes.11271130 */11281131struct mesh_config {11291132 u16 dot11MeshRetryTimeout;···11561153 u16 dot11MeshHWMPconfirmationInterval;11571154 enum nl80211_mesh_power_mode power_mode;11581155 u16 dot11MeshAwakeWindowDuration;11561156+ u32 plink_timeout;11591157};1160115811611159/**···11761172 * @dtim_period: DTIM period to use11771173 * @beacon_interval: beacon interval to use11781174 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]11751175+ * @basic_rates: basic rates to use when creating the mesh11791176 *11801177 * These parameters are fixed when the mesh is created.11811178 */···11961191 u8 dtim_period;11971192 u16 beacon_interval;11981193 int mcast_rate[IEEE80211_NUM_BANDS];11941194+ u32 basic_rates;11991195};1200119612011197/**···26602654 u32 hw_version;2661265526622656#ifdef CONFIG_PM26632663- struct wiphy_wowlan_support wowlan;26572657+ const struct wiphy_wowlan_support *wowlan;26642658 struct cfg80211_wowlan *wowlan_config;26652659#endif26662660···28592853 * @current_bss: (private) Used by the internal configuration code28602854 * @channel: (private) Used by the internal configuration code to track28612855 * the user-set AP, monitor and WDS channel28622862- * @preset_chan: (private) Used by the internal configuration code to28562856+ * @preset_chandef: (private) Used by the internal configuration code to28632857 * track the channel to be used for AP later28642858 * @bssid: (private) Used by the internal configuration code28652859 * @ssid: (private) Used by the internal configuration code···28812875 * @p2p_started: true if this is a P2P Device that has been started28822876 * @cac_started: true if DFS channel availability check has been started28832877 * @cac_start_time: timestamp (jiffies) when the dfs state was entered.28782878+ * @ps: powersave mode is enabled28792879+ * @ps_timeout: dynamic powersave timeout28802880+ * @ap_unexpected_nlportid: (private) netlink port ID of application28812881+ * registered for unexpected class 3 frames (AP mode)28822882+ * @conn: (private) cfg80211 software SME connection state machine data28832883+ * @connect_keys: (private) keys to set after connection is established28842884+ * @ibss_fixed: (private) IBSS is using fixed BSSID28852885+ * @event_list: (private) list for internal event processing28862886+ * @event_lock: (private) lock for event list28842887 */28852888struct wireless_dev {28862889 struct wiphy *wiphy;···29132898 /* currently used for IBSS and SME - might be rearranged later */29142899 u8 ssid[IEEE80211_MAX_SSID_LEN];29152900 u8 ssid_len, mesh_id_len, mesh_id_up_len;29162916- enum {29172917- CFG80211_SME_IDLE,29182918- CFG80211_SME_CONNECTING,29192919- CFG80211_SME_CONNECTED,29202920- } sme_state;29212901 struct cfg80211_conn *conn;29222902 struct cfg80211_cached_keys *connect_keys;29232903···34423432void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);3443343334443434/**34453445- * cfg80211_send_rx_auth - notification of processed authentication34353435+ * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame34463436 * @dev: network device34473437 * @buf: authentication frame (header + body)34483438 * @len: length of the frame data34493439 *34503450- * This function is called whenever an authentication has been processed in34513451- * station mode. The driver is required to call either this function or34523452- * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth()34533453- * call. This function may sleep. The caller must hold the corresponding wdev's34543454- * mutex.34403440+ * This function is called whenever an authentication, disassociation or34413441+ * deauthentication frame has been received and processed in station mode.34423442+ * After being asked to authenticate via cfg80211_ops::auth() the driver must34433443+ * call either this function or cfg80211_auth_timeout().34443444+ * After being asked to associate via cfg80211_ops::assoc() the driver must34453445+ * call either this function or cfg80211_auth_timeout().34463446+ * While connected, the driver must calls this for received and processed34473447+ * disassociation and deauthentication frames. If the frame couldn't be used34483448+ * because it was unprotected, the driver must call the function34493449+ * cfg80211_rx_unprot_mlme_mgmt() instead.34503450+ *34513451+ * This function may sleep. The caller must hold the corresponding wdev's mutex.34553452 */34563456-void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);34533453+void cfg80211_rx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len);3457345434583455/**34593459- * cfg80211_send_auth_timeout - notification of timed out authentication34563456+ * cfg80211_auth_timeout - notification of timed out authentication34603457 * @dev: network device34613458 * @addr: The MAC address of the device with which the authentication timed out34623459 *34633460 * This function may sleep. The caller must hold the corresponding wdev's34643461 * mutex.34653462 */34663466-void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);34633463+void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr);3467346434683465/**34693469- * cfg80211_send_rx_assoc - notification of processed association34663466+ * cfg80211_rx_assoc_resp - notification of processed association response34703467 * @dev: network device34713471- * @bss: the BSS struct association was requested for, the struct reference34723472- * is owned by cfg80211 after this call34733473- * @buf: (re)association response frame (header + body)34683468+ * @bss: the BSS that association was requested with, ownership of the pointer34693469+ * moves to cfg80211 in this call34703470+ * @buf: authentication frame (header + body)34743471 * @len: length of the frame data34753472 *34763476- * This function is called whenever a (re)association response has been34773477- * processed in station mode. The driver is required to call either this34783478- * function or cfg80211_send_assoc_timeout() to indicate the result of34793479- * cfg80211_ops::assoc() call. This function may sleep. The caller must hold34803480- * the corresponding wdev's mutex.34733473+ * After being asked to associate via cfg80211_ops::assoc() the driver must34743474+ * call either this function or cfg80211_auth_timeout().34753475+ *34763476+ * This function may sleep. The caller must hold the corresponding wdev's mutex.34813477 */34823482-void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,34783478+void cfg80211_rx_assoc_resp(struct net_device *dev,34793479+ struct cfg80211_bss *bss,34833480 const u8 *buf, size_t len);3484348134853482/**34863486- * cfg80211_send_assoc_timeout - notification of timed out association34833483+ * cfg80211_assoc_timeout - notification of timed out association34873484 * @dev: network device34883485 * @addr: The MAC address of the device with which the association timed out34893486 *34903487 * This function may sleep. The caller must hold the corresponding wdev's mutex.34913488 */34923492-void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);34893489+void cfg80211_assoc_timeout(struct net_device *dev, const u8 *addr);3493349034943491/**34953495- * cfg80211_send_deauth - notification of processed deauthentication34923492+ * cfg80211_tx_mlme_mgmt - notification of transmitted deauth/disassoc frame34963493 * @dev: network device34973497- * @buf: deauthentication frame (header + body)34943494+ * @buf: 802.11 frame (header + body)34983495 * @len: length of the frame data34993496 *35003497 * This function is called whenever deauthentication has been processed in···35093492 * locally generated ones. This function may sleep. The caller must hold the35103493 * corresponding wdev's mutex.35113494 */35123512-void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);34953495+void cfg80211_tx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len);3513349635143497/**35153515- * cfg80211_send_disassoc - notification of processed disassociation35163516- * @dev: network device35173517- * @buf: disassociation response frame (header + body)35183518- * @len: length of the frame data35193519- *35203520- * This function is called whenever disassociation has been processed in35213521- * station mode. This includes both received disassociation frames and locally35223522- * generated ones. This function may sleep. The caller must hold the35233523- * corresponding wdev's mutex.35243524- */35253525-void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);35263526-35273527-/**35283528- * cfg80211_send_unprot_deauth - notification of unprotected deauthentication34983498+ * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame35293499 * @dev: network device35303500 * @buf: deauthentication frame (header + body)35313501 * @len: length of the frame data35323502 *35333533- * This function is called whenever a received Deauthentication frame has been35343534- * dropped in station mode because of MFP being used but the Deauthentication35033503+ * This function is called whenever a received deauthentication or dissassoc35043504+ * frame has been dropped in station mode because of MFP being used but the35353505 * frame was not protected. This function may sleep.35363506 */35373537-void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf,35383538- size_t len);35393539-35403540-/**35413541- * cfg80211_send_unprot_disassoc - notification of unprotected disassociation35423542- * @dev: network device35433543- * @buf: disassociation frame (header + body)35443544- * @len: length of the frame data35453545- *35463546- * This function is called whenever a received Disassociation frame has been35473547- * dropped in station mode because of MFP being used but the Disassociation35483548- * frame was not protected. This function may sleep.35493549- */35503550-void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,35513551- size_t len);35073507+void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev,35083508+ const u8 *buf, size_t len);3552350935533510/**35543511 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
+7-4
include/net/mac80211.h
···217217 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface218218 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)219219 * changed (currently only in P2P client mode, GO mode will be later)220220- * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when221221- * it becomes valid, managed mode only)220220+ * @BSS_CHANGED_BEACON_INFO: Data from the AP's beacon became available:221221+ * currently dtim_period only is under consideration.222222 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed,223223 * note that this is only called when it changes after the channel224224 * context had been assigned.···244244 BSS_CHANGED_PS = 1<<17,245245 BSS_CHANGED_TXPOWER = 1<<18,246246 BSS_CHANGED_P2P_PS = 1<<19,247247- BSS_CHANGED_DTIM_PERIOD = 1<<20,247247+ BSS_CHANGED_BEACON_INFO = 1<<20,248248 BSS_CHANGED_BANDWIDTH = 1<<21,249249250250 /* when adding here, make sure to change ieee80211_reconfig */···288288 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag289289 * @dtim_period: num of beacons before the next DTIM, for beaconing,290290 * valid in station mode only if after the driver was notified291291- * with the %BSS_CHANGED_DTIM_PERIOD flag, will be non-zero then.291291+ * with the %BSS_CHANGED_BEACON_INFO flag, will be non-zero then.292292 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old293293 * as it may have been received during scanning long ago). If the294294 * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can···460460 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it461461 * would be fragmented by size (this is optional, only used for462462 * monitor injection).463463+ * @IEEE80211_TX_CTL_PS_RESPONSE: This frame is a response to a poll464464+ * frame (PS-Poll or uAPSD).463465 *464466 * Note: If you have to add new flags to the enumeration, then don't465467 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.···497495 IEEE80211_TX_STATUS_EOSP = BIT(28),498496 IEEE80211_TX_CTL_USE_MINRATE = BIT(29),499497 IEEE80211_TX_CTL_DONTFRAG = BIT(30),498498+ IEEE80211_TX_CTL_PS_RESPONSE = BIT(31),500499};501500502501#define IEEE80211_TX_CTL_STBC_SHIFT 23
+9
include/uapi/linux/nl80211.h
···25772577 *25782578 * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)25792579 *25802580+ * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've25812581+ * established peering with for longer than this time (in seconds), then25822582+ * remove it from the STA's list of peers. Default is 30 minutes.25832583+ *25802584 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use25812585 */25822586enum nl80211_meshconf_params {···26122608 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,26132609 NL80211_MESHCONF_POWER_MODE,26142610 NL80211_MESHCONF_AWAKE_WINDOW,26112611+ NL80211_MESHCONF_PLINK_TIMEOUT,2615261226162613 /* keep last */26172614 __NL80211_MESHCONF_ATTR_AFTER_LAST,···35843579 * Peering Management entity which may be implemented by registering for35853580 * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is35863581 * still generated by the driver.35823582+ * @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor35833583+ * interface. An active monitor interface behaves like a normal monitor35843584+ * interface, but gets added to the driver. It ensures that incoming35853585+ * unicast packets directed at the configured interface address get ACKed.35873586 */35883587enum nl80211_feature_flags {35893588 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
+17-3
net/mac80211/cfg.c
···17591759 /* mcast rate setting in Mesh Node */17601760 memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate,17611761 sizeof(setup->mcast_rate));17621762+ sdata->vif.bss_conf.basic_rates = setup->basic_rates;1762176317631764 sdata->vif.bss_conf.beacon_int = setup->beacon_interval;17641765 sdata->vif.bss_conf.dtim_period = setup->dtim_period;···18721871 if (_chg_mesh_attr(NL80211_MESHCONF_AWAKE_WINDOW, mask))18731872 conf->dot11MeshAwakeWindowDuration =18741873 nconf->dot11MeshAwakeWindowDuration;18741874+ if (_chg_mesh_attr(NL80211_MESHCONF_PLINK_TIMEOUT, mask))18751875+ conf->plink_timeout = nconf->plink_timeout;18751876 ieee80211_mbss_info_change_notify(sdata, BSS_CHANGED_BEACON);18761877 return 0;18771878}···28412838 return -EOPNOTSUPP;28422839 }2843284028412841+ /* configurations requiring offchan cannot work if no channel has been28422842+ * specified28432843+ */28442844+ if (need_offchan && !chan)28452845+ return -EINVAL;28462846+28442847 mutex_lock(&local->mtx);2845284828462849 /* Check if the operating channel is the requested channel */···28562847 rcu_read_lock();28572848 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);2858284928592859- if (chanctx_conf)28602860- need_offchan = chan != chanctx_conf->def.chan;28612861- else28502850+ if (chanctx_conf) {28512851+ need_offchan = chan && (chan != chanctx_conf->def.chan);28522852+ } else if (!chan) {28532853+ ret = -EINVAL;28542854+ rcu_read_unlock();28552855+ goto out_unlock;28562856+ } else {28622857 need_offchan = true;28582858+ }28632859 rcu_read_unlock();28642860 }28652861
···517517 ieee80211_mps_frame_release(sta, elems);518518out:519519 rcu_read_unlock();520520- sdata_lock(sdata);521520 ieee80211_mbss_info_change_notify(sdata, changed);522522- sdata_unlock(sdata);523521}524522525523static void mesh_plink_timer(unsigned long data)···1068107010691071 rcu_read_unlock();1070107210711071- if (changed) {10721072- sdata_lock(sdata);10731073+ if (changed)10731074 ieee80211_mbss_info_change_notify(sdata, changed);10741074- sdata_unlock(sdata);10751075- }10761075}
+47-51
net/mac80211/mlme.c
···880880881881 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT |882882 IEEE80211_TX_INTFL_OFFCHAN_TX_OK;883883+884884+ if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)885885+ IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;886886+883887 if (ifmgd->flags & (IEEE80211_STA_BEACON_POLL |884888 IEEE80211_STA_CONNECTION_POLL))885889 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_USE_MINRATE;···13601356 IEEE80211_STA_CONNECTION_POLL))13611357 return false;1362135813631363- if (!sdata->vif.bss_conf.dtim_period)13591359+ if (!mgd->have_beacon)13641360 return false;1365136113661362 rcu_read_lock();···1771176717721768 ieee80211_led_assoc(local, 1);1773176917741774- if (sdata->u.mgd.assoc_data->have_beacon) {17701770+ if (sdata->u.mgd.have_beacon) {17751771 /*17761772 * If the AP is buggy we may get here with no DTIM period17771773 * known, so assume it's 1 which is the only safe assumption···17791775 * probably just won't work at all.17801776 */17811777 bss_conf->dtim_period = sdata->u.mgd.dtim_period ?: 1;17821782- bss_info_changed |= BSS_CHANGED_DTIM_PERIOD;17781778+ bss_info_changed |= BSS_CHANGED_BEACON_INFO;17831779 } else {17841780 bss_conf->dtim_period = 0;17851781 }···19031899 del_timer_sync(&sdata->u.mgd.chswitch_timer);1904190019051901 sdata->vif.bss_conf.dtim_period = 0;19021902+ ifmgd->have_beacon = false;1906190319071904 ifmgd->flags = 0;19081905 ieee80211_vif_release_channel(sdata);···21562151 IEEE80211_MAX_QUEUE_MAP,21572152 IEEE80211_QUEUE_STOP_REASON_CSA);2158215321592159- cfg80211_send_deauth(sdata->dev, frame_buf, IEEE80211_DEAUTH_FRAME_LEN);21542154+ cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,21552155+ IEEE80211_DEAUTH_FRAME_LEN);21602156 sdata_unlock(sdata);21612157}21622158···23042298 sdata_info(sdata, "%pM denied authentication (status %d)\n",23052299 mgmt->sa, status_code);23062300 ieee80211_destroy_auth_data(sdata, false);23072307- cfg80211_send_rx_auth(sdata->dev, (u8 *)mgmt, len);23012301+ cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len);23082302 return;23092303 }23102304···23392333 * Report auth frame to user space for processing since another23402334 * round of Authentication frames is still needed.23412335 */23422342- cfg80211_send_rx_auth(sdata->dev, (u8 *)mgmt, len);23362336+ cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len);23432337 return;23442338 }23452339···23562350 }23572351 mutex_unlock(&sdata->local->sta_mtx);2358235223592359- cfg80211_send_rx_auth(sdata->dev, (u8 *)mgmt, len);23532353+ cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len);23602354 return;23612355 out_err:23622356 mutex_unlock(&sdata->local->sta_mtx);···2389238323902384 ieee80211_set_disassoc(sdata, 0, 0, false, NULL);2391238523922392- cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, len);23862386+ cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len);23932387}2394238823952389···2415240924162410 ieee80211_set_disassoc(sdata, 0, 0, false, NULL);2417241124182418- cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, len);24122412+ cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len);24192413}2420241424212415static void ieee80211_get_rates(struct ieee80211_supported_band *sband,···27132707 /* oops -- internal error -- send timeout for now */27142708 ieee80211_destroy_assoc_data(sdata, false);27152709 cfg80211_put_bss(sdata->local->hw.wiphy, bss);27162716- cfg80211_send_assoc_timeout(sdata->dev, mgmt->bssid);27102710+ cfg80211_assoc_timeout(sdata->dev, mgmt->bssid);27172711 return;27182712 }27192713 sdata_info(sdata, "associated\n");···27262720 ieee80211_destroy_assoc_data(sdata, true);27272721 }2728272227292729- cfg80211_send_rx_assoc(sdata->dev, bss, (u8 *)mgmt, len);27232723+ cfg80211_rx_assoc_resp(sdata->dev, bss, (u8 *)mgmt, len);27302724}2731272527322726static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,···27382732 int freq;27392733 struct ieee80211_bss *bss;27402734 struct ieee80211_channel *channel;27412741- bool need_ps = false;2742273527432736 sdata_assert_lock(sdata);27442744-27452745- if ((sdata->u.mgd.associated &&27462746- ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) ||27472747- (sdata->u.mgd.assoc_data &&27482748- ether_addr_equal(mgmt->bssid,27492749- sdata->u.mgd.assoc_data->bss->bssid))) {27502750- /* not previously set so we may need to recalc */27512751- need_ps = sdata->u.mgd.associated && !sdata->u.mgd.dtim_period;27522752-27532753- if (elems->tim && !elems->parse_error) {27542754- const struct ieee80211_tim_ie *tim_ie = elems->tim;27552755- sdata->u.mgd.dtim_period = tim_ie->dtim_period;27562756- }27572757- }2758273727592738 if (elems->ds_params)27602739 freq = ieee80211_channel_to_frequency(elems->ds_params[0],···27602769 if (!sdata->u.mgd.associated ||27612770 !ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid))27622771 return;27632763-27642764- if (need_ps) {27652765- mutex_lock(&local->iflist_mtx);27662766- ieee80211_recalc_ps(local, -1);27672767- mutex_unlock(&local->iflist_mtx);27682768- }2769277227702773 ieee80211_sta_process_chanswitch(sdata, rx_status->mactime,27712774 elems, true);···28742889 len - baselen, false, &elems);2875289028762891 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems);28772877- ifmgd->assoc_data->have_beacon = true;28922892+ if (elems.tim && !elems.parse_error) {28932893+ const struct ieee80211_tim_ie *tim_ie = elems.tim;28942894+ ifmgd->dtim_period = tim_ie->dtim_period;28952895+ }28962896+ ifmgd->have_beacon = true;28782897 ifmgd->assoc_data->need_beacon = false;28792898 if (local->hw.flags & IEEE80211_HW_TIMING_BEACON_ONLY) {28802899 sdata->vif.bss_conf.sync_tsf =···30603071 * If we haven't had a beacon before, tell the driver about the30613072 * DTIM period (and beacon timing if desired) now.30623073 */30633063- if (!bss_conf->dtim_period) {30743074+ if (!ifmgd->have_beacon) {30643075 /* a few bogus AP send dtim_period = 0 or no TIM IE */30653076 if (elems.tim)30663077 bss_conf->dtim_period = elems.tim->dtim_period ?: 1;···30793090 sdata->vif.bss_conf.sync_dtim_count = 0;30803091 }3081309230823082- changed |= BSS_CHANGED_DTIM_PERIOD;30933093+ changed |= BSS_CHANGED_BEACON_INFO;30943094+ ifmgd->have_beacon = true;30953095+30963096+ mutex_lock(&local->iflist_mtx);30973097+ ieee80211_recalc_ps(local, -1);30983098+ mutex_unlock(&local->iflist_mtx);30993099+30833100 ieee80211_recalc_ps_vif(sdata);30843101 }30853102···31083113 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,31093114 WLAN_REASON_DEAUTH_LEAVING,31103115 true, deauth_buf);31113111- cfg80211_send_deauth(sdata->dev, deauth_buf,31123112- sizeof(deauth_buf));31163116+ cfg80211_tx_mlme_mgmt(sdata->dev, deauth_buf,31173117+ sizeof(deauth_buf));31133118 return;31143119 }31153120···32273232 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason,32283233 tx, frame_buf);3229323432303230- cfg80211_send_deauth(sdata->dev, frame_buf, IEEE80211_DEAUTH_FRAME_LEN);32353235+ cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,32363236+ IEEE80211_DEAUTH_FRAME_LEN);32313237}3232323832333239static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata)···3419342334203424 ieee80211_destroy_auth_data(sdata, false);3421342534223422- cfg80211_send_auth_timeout(sdata->dev, bssid);34263426+ cfg80211_auth_timeout(sdata->dev, bssid);34233427 }34243428 } else if (ifmgd->auth_data && ifmgd->auth_data->timeout_started)34253429 run_again(sdata, ifmgd->auth_data->timeout);3426343034273431 if (ifmgd->assoc_data && ifmgd->assoc_data->timeout_started &&34283432 time_after(jiffies, ifmgd->assoc_data->timeout)) {34293429- if ((ifmgd->assoc_data->need_beacon &&34303430- !ifmgd->assoc_data->have_beacon) ||34333433+ if ((ifmgd->assoc_data->need_beacon && !ifmgd->have_beacon) ||34313434 ieee80211_do_assoc(sdata)) {34323435 u8 bssid[ETH_ALEN];34333436···3434343934353440 ieee80211_destroy_assoc_data(sdata, false);3436344134373437- cfg80211_send_assoc_timeout(sdata->dev, bssid);34423442+ cfg80211_assoc_timeout(sdata->dev, bssid);34383443 }34393444 } else if (ifmgd->assoc_data && ifmgd->assoc_data->timeout_started)34403445 run_again(sdata, ifmgd->assoc_data->timeout);···39833988 WLAN_REASON_UNSPECIFIED,39843989 false, frame_buf);3985399039863986- cfg80211_send_deauth(sdata->dev, frame_buf,39873987- sizeof(frame_buf));39913991+ cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,39923992+ sizeof(frame_buf));39883993 }3989399439903995 sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid);···40464051 WLAN_REASON_UNSPECIFIED,40474052 false, frame_buf);4048405340494049- cfg80211_send_deauth(sdata->dev, frame_buf,40504050- sizeof(frame_buf));40544054+ cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,40554055+ sizeof(frame_buf));40514056 }4052405740534058 if (ifmgd->auth_data && !ifmgd->auth_data->done) {···4194419941954200 ifmgd->assoc_data = assoc_data;41964201 ifmgd->dtim_period = 0;42024202+ ifmgd->have_beacon = false;4197420341984204 err = ieee80211_prep_connection(sdata, req->bss, true);41994205 if (err)···42264230 ifmgd->dtim_period = tim->dtim_period;42274231 dtim_count = tim->dtim_count;42284232 }42294229- assoc_data->have_beacon = true;42334233+ ifmgd->have_beacon = true;42304234 assoc_data->timeout = jiffies;42314235 assoc_data->timeout_started = true;42324236···4301430543024306 out:43034307 if (report_frame)43044304- cfg80211_send_deauth(sdata->dev, frame_buf,43054305- IEEE80211_DEAUTH_FRAME_LEN);43084308+ cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,43094309+ IEEE80211_DEAUTH_FRAME_LEN);4306431043074311 return 0;43084312}···43324336 req->reason_code, !req->local_state_change,43334337 frame_buf);4334433843354335- cfg80211_send_disassoc(sdata->dev, frame_buf,43364336- IEEE80211_DEAUTH_FRAME_LEN);43394339+ cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,43404340+ IEEE80211_DEAUTH_FRAME_LEN);4337434143384342 return 0;43394343}
+10-16
net/mac80211/rx.c
···17471747 if (unlikely(!ieee80211_has_protected(fc) &&17481748 ieee80211_is_unicast_robust_mgmt_frame(rx->skb) &&17491749 rx->key)) {17501750- if (ieee80211_is_deauth(fc))17511751- cfg80211_send_unprot_deauth(rx->sdata->dev,17521752- rx->skb->data,17531753- rx->skb->len);17541754- else if (ieee80211_is_disassoc(fc))17551755- cfg80211_send_unprot_disassoc(rx->sdata->dev,17561756- rx->skb->data,17571757- rx->skb->len);17501750+ if (ieee80211_is_deauth(fc) ||17511751+ ieee80211_is_disassoc(fc))17521752+ cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev,17531753+ rx->skb->data,17541754+ rx->skb->len);17581755 return -EACCES;17591756 }17601757 /* BIP does not use Protected field, so need to check MMIE */17611758 if (unlikely(ieee80211_is_multicast_robust_mgmt_frame(rx->skb) &&17621759 ieee80211_get_mmie_keyidx(rx->skb) < 0)) {17631763- if (ieee80211_is_deauth(fc))17641764- cfg80211_send_unprot_deauth(rx->sdata->dev,17651765- rx->skb->data,17661766- rx->skb->len);17671767- else if (ieee80211_is_disassoc(fc))17681768- cfg80211_send_unprot_disassoc(rx->sdata->dev,17691769- rx->skb->data,17701770- rx->skb->len);17601760+ if (ieee80211_is_deauth(fc) ||17611761+ ieee80211_is_disassoc(fc))17621762+ cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev,17631763+ rx->skb->data,17641764+ rx->skb->len);17711765 return -EACCES;17721766 }17731767 /*
+3-1
net/mac80211/sta_info.c
···11321132 * ends the poll/service period.11331133 */11341134 info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER |11351135+ IEEE80211_TX_CTL_PS_RESPONSE |11351136 IEEE80211_TX_STATUS_EOSP |11361137 IEEE80211_TX_CTL_REQ_TX_STATUS;11371138···12701269 * STA may still remain is PS mode after this frame12711270 * exchange.12721271 */12731273- info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;12721272+ info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER |12731273+ IEEE80211_TX_CTL_PS_RESPONSE;1274127412751275 /*12761276 * Use MoreData flag to indicate whether there are
+3
net/mac80211/sta_info.h
···297297 * @rcu_head: RCU head used for freeing this station struct298298 * @cur_max_bandwidth: maximum bandwidth to use for TX to the station,299299 * taken from HT/VHT capabilities or VHT operating mode notification300300+ * @chains: chains ever used for RX from this station301301+ * @chain_signal_last: last signal (per chain)302302+ * @chain_signal_avg: signal average (per chain)300303 */301304struct sta_info {302305 /* General information, mostly static */
-6
net/mac80211/tx.c
···17901790 break;17911791#ifdef CONFIG_MAC80211_MESH17921792 case NL80211_IFTYPE_MESH_POINT:17931793- if (!sdata->u.mesh.mshcfg.dot11MeshTTL) {17941794- /* Do not send frames with mesh_ttl == 0 */17951795- sdata->u.mesh.mshstats.dropped_frames_ttl++;17961796- goto fail_rcu;17971797- }17981798-17991793 if (!is_multicast_ether_addr(skb->data)) {18001794 struct sta_info *next_hop;18011795 bool mpp_lookup = true;
+3-2
net/mac80211/util.c
···15841584 BSS_CHANGED_ARP_FILTER |15851585 BSS_CHANGED_PS;1586158615871587- if (sdata->u.mgd.dtim_period)15881588- changed |= BSS_CHANGED_DTIM_PERIOD;15871587+ /* Re-send beacon info report to the driver */15881588+ if (sdata->u.mgd.have_beacon)15891589+ changed |= BSS_CHANGED_BEACON_INFO;1589159015901591 sdata_lock(sdata);15911592 ieee80211_bss_info_change_notify(sdata, changed);
+23-24
net/wireless/core.c
···301301 return NULL;302302 }303303304304+ /* atomic_inc_return makes it start at 1, make it start at 0 */305305+ rdev->wiphy_idx--;306306+304307 /* give it a proper name */305308 dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx);306309···452449 u16 ifmodes = wiphy->interface_modes;453450454451#ifdef CONFIG_PM455455- if (WARN_ON((wiphy->wowlan.flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&456456- !(wiphy->wowlan.flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY)))452452+ if (WARN_ON(wiphy->wowlan &&453453+ (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&454454+ !(wiphy->wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY)))455455+ return -EINVAL;456456+ if (WARN_ON(wiphy->wowlan &&457457+ !wiphy->wowlan->flags && !wiphy->wowlan->n_patterns &&458458+ !wiphy->wowlan->tcp))457459 return -EINVAL;458460#endif459461···548540 }549541550542#ifdef CONFIG_PM551551- if (rdev->wiphy.wowlan.n_patterns) {552552- if (WARN_ON(!rdev->wiphy.wowlan.pattern_min_len ||553553- rdev->wiphy.wowlan.pattern_min_len >554554- rdev->wiphy.wowlan.pattern_max_len))555555- return -EINVAL;556556- }543543+ if (WARN_ON(rdev->wiphy.wowlan && rdev->wiphy.wowlan->n_patterns &&544544+ (!rdev->wiphy.wowlan->pattern_min_len ||545545+ rdev->wiphy.wowlan->pattern_min_len >546546+ rdev->wiphy.wowlan->pattern_max_len)))547547+ return -EINVAL;557548#endif558549559550 /* check and set up bitrates */560551 ieee80211_set_bitrate_flags(wiphy);561552562562- rtnl_lock();563553564554 res = device_add(&rdev->wiphy.dev);555555+ if (res)556556+ return res;557557+558558+ res = rfkill_register(rdev->rfkill);565559 if (res) {566566- rtnl_unlock();560560+ device_del(&rdev->wiphy.dev);567561 return res;568562 }569563564564+ rtnl_lock();570565 /* set up regulatory info */571566 wiphy_regulatory_register(wiphy);572567···595584 }596585597586 cfg80211_debugfs_rdev_add(rdev);598598-599599- res = rfkill_register(rdev->rfkill);600600- if (res) {601601- device_del(&rdev->wiphy.dev);602602-603603- debugfs_remove_recursive(rdev->wiphy.debugfsdir);604604- list_del_rcu(&rdev->list);605605- wiphy_regulatory_deregister(wiphy);606606- rtnl_unlock();607607- return res;608608- }609587610588 rdev->wiphy.registered = true;611589 rtnl_unlock();···632632 rtnl_unlock();633633 __count == 0; }));634634635635+ rfkill_unregister(rdev->rfkill);636636+635637 rtnl_lock();636638 rdev->wiphy.registered = false;637637-638638- rfkill_unregister(rdev->rfkill);639639640640 BUG_ON(!list_empty(&rdev->wdev_list));641641···817817 pr_err("failed to add phy80211 symlink to netdev!\n");818818 }819819 wdev->netdev = dev;820820- wdev->sme_state = CFG80211_SME_IDLE;821820#ifdef CONFIG_CFG80211_WEXT822821 wdev->wext.default_key = -1;823822 wdev->wext.default_mgmt_key = -1;