minor changes and cleanup
Subsystems (2)
cover minor changes and cleanup
This patch set includes some renames, I'm not sure it's appropriate to do this type of thing. :-)
Zhao, Gang (12):
mac80211: unify debug function
mac80211: remove config option check
mac80211: minor changes of ieee80211_reconfig()
mac80211: return bool instead of numbers in yes/no function
mac80211: remove unnecessary BUG_ON()
cfg80211: some workqueue improvements
cfg80211: change pointer name
cfg80211: change function name
cfg80211: change return value of notifier function
mac80211: change return value of notifier function cfg80211/mac80211: rename cfg80211_chandef_dfs_required() cfg80211/mac80211: change variable name
include/net/cfg80211.h | 10 +- net/mac80211/cfg.c | 6 +- net/mac80211/chan.c | 6 +- net/mac80211/ibss.c | 54 +++---- net/mac80211/iface.c | 11 +- net/mac80211/main.c | 12 +- net/mac80211/mesh.c | 20 +-- net/mac80211/mlme.c | 12 +- net/mac80211/rate.c | 4 +- net/mac80211/rx.c | 25 +-- net/mac80211/sta_info.c | 3 +- net/mac80211/tx.c | 6 +- net/mac80211/util.c | 23 ++- net/wireless/chan.c | 47 +++--- net/wireless/core.c | 26 +-- net/wireless/core.h | 6 +- net/wireless/ethtool.c | 10 +- net/wireless/ibss.c | 12 +- net/wireless/mlme.c | 24 +-- net/wireless/nl80211.c | 396 ++++++++++++++++++++++----------------------- net/wireless/reg.c | 4 + net/wireless/scan.c | 146 ++++++++--------- net/wireless/sme.c | 39 ++--- net/wireless/trace.h | 2 +- net/wireless/util.c | 2 +- net/wireless/wext-compat.c | 32 ++-- net/wireless/wext-sme.c | 10 +- 27 files changed, 474 insertions(+), 474 deletions(-)
Signature · 1 line
1.9.0
PATCH 1/12 mac80211: unify debug function
Both wiphy_debug() and wiphy_dbg() are used in mac80211. Change wiphy_debug() to wiphy_dbg() so all the debug messages can be dynamically controled whether to be generated or not.
--- net/mac80211/cfg.c | 6 +++--- net/mac80211/main.c | 8 ++++---- net/mac80211/mlme.c | 10 +++++----- net/mac80211/rate.c | 4 ++-- net/mac80211/rx.c | 6 +++--- net/mac80211/tx.c | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-)
net/mac80211/cfg.c +3 -3
@@ -2106,9 +2106,9 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy, sdata->tx_conf[params->ac] = p;if (drv_conf_tx (local, sdata, params->ac, &p)) { -wiphy_debug (local->hw.wiphy, -"failed to set TX queue parameters for AC %d\n" , - params->ac); +wiphy_dbg (local->hw.wiphy, +"failed to set TX queue parameters for AC %d\n" , + params->ac);return -EINVAL ; }
net/mac80211/main.c +4 -4
@@ -994,8 +994,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) result =ieee80211_wep_init (local);if (result <0 ) -wiphy_debug (local->hw.wiphy,"Failed to initialize wep: %d\n" , - result); +wiphy_dbg (local->hw.wiphy,"Failed to initialize wep: %d\n" , + result); local->hw.conf.flags =IEEE80211_CONF_IDLE ;
@@ -1006,8 +1006,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) result =ieee80211_init_rate_ctrl_alg (local, hw->rate_control_algorithm);if (result <0 ) { -wiphy_debug (local->hw.wiphy, -"Failed to initialize rate control algorithm\n" ); +wiphy_dbg (local->hw.wiphy, +"Failed to initialize rate control algorithm\n" ); goto fail_rate; }
net/mac80211/mlme.c +5 -5
@@ -3523,11 +3523,11 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)* We actually lost the connection ... or did we? * Let's make sure! */ -wiphy_debug (local->hw.wiphy, -"%s: No probe response from AP %pM" -" after %dms, disconnecting.\n" , - sdata->name, - bssid, probe_wait_ms); +wiphy_dbg (local->hw.wiphy, +"%s: No probe response from AP %pM" +" after %dms, disconnecting.\n" , + sdata->name, + bssid, probe_wait_ms);ieee80211_sta_connection_lost (sdata, bssid,WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY , false);
net/mac80211/rate.c +2 -2
@@ -739,8 +739,8 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,WARN_ON (local->rate_ctrl); local->rate_ctrl = ref; -wiphy_debug (local->hw.wiphy,"Selected rate control algorithm '%s'\n" , - ref->ops->name); +wiphy_dbg (local->hw.wiphy,"Selected rate control algorithm '%s'\n" , + ref->ops->name);return 0 ; }
net/mac80211/rx.c +3 -3
@@ -3176,9 +3176,9 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx, skb =skb_copy (skb,GFP_ATOMIC );if (!skb) {if (net_ratelimit ()) -wiphy_debug (local->hw.wiphy, -"failed to copy skb for %s\n" , - sdata->name); +wiphy_dbg (local->hw.wiphy, +"failed to copy skb for %s\n" , + sdata->name);return true; }
net/mac80211/tx.c +2 -2
@@ -1483,8 +1483,8 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata,return 0 ;if (pskb_expand_head (skb, head_need, tail_need,GFP_ATOMIC )) { -wiphy_debug (local->hw.wiphy, -"failed to reallocate TX buffer\n" ); +wiphy_dbg (local->hw.wiphy, +"failed to reallocate TX buffer\n" );return -ENOMEM ; }
Signature · 1 line
1.9.0
PATCH 2/12 mac80211: remove config option check
In reply to Zhao, GangSanity check and error handling code shouldn't be put into CONFIG_MAC80211_VERBOSE_DEBUG block, since verbose debug option is used to control whether to print debug messages.
--- net/mac80211/tx.c | 2 -- 1 file changed, 2 deletions(-)
net/mac80211/tx.c +0 -2
@@ -1205,13 +1205,11 @@ static bool ieee80211_tx_frags(struct ieee80211_local *local,struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);int q = info->hw_queue; -#ifdef CONFIG_MAC80211_VERBOSE_DEBUG if (WARN_ON_ONCE (q >= local->hw.queues)) {__skb_unlink (skb, skbs);ieee80211_free_txskb (&local->hw, skb);continue ; } -#endif spin_lock_irqsave (&local->queue_stop_reason_lock, flags); if (local->queue_stop_reasons[q] ||
Signature · 1 line
1.9.0
PATCH 3/12 mac80211: minor changes of ieee80211_reconfig()
In reply to Zhao, GangTry to update chanctx only if local->use_chanctx is true.
P2P_DEVICE doesn't support ieee80211_bss_info_change_notify() for now, so it's not needed to set changed flags for P2P_DEVICE.
--- net/mac80211/util.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-)
net/mac80211/util.c +10 -13
@@ -1565,17 +1565,17 @@ int ieee80211_reconfig(struct ieee80211_local *local)list_for_each_entry (ctx, &local->chanctx_list, list)WARN_ON (drv_add_chanctx (local, ctx));mutex_unlock (&local->chanctx_mtx); - } -list_for_each_entry (sdata, &local->interfaces, list) { -if (!ieee80211_sdata_running (sdata)) -continue ; -ieee80211_assign_chanctx (local, sdata); - } +list_for_each_entry (sdata, &local->interfaces, list) { +if (!ieee80211_sdata_running (sdata)) +continue ; +ieee80211_assign_chanctx (local, sdata); + } - sdata =rtnl_dereference (local->monitor_sdata); -if (sdata &&ieee80211_sdata_running (sdata)) -ieee80211_assign_chanctx (local, sdata); + sdata =rtnl_dereference (local->monitor_sdata); +if (sdata &&ieee80211_sdata_running (sdata)) +ieee80211_assign_chanctx (local, sdata); + }/* add STAs back */ mutex_lock (&local->sta_mtx);
@@ -1671,13 +1671,10 @@ int ieee80211_reconfig(struct ieee80211_local *local) }break ;case NL80211_IFTYPE_WDS : -break ;case NL80211_IFTYPE_AP_VLAN :case NL80211_IFTYPE_MONITOR : -/* ignore virtual */ -break ;case NL80211_IFTYPE_P2P_DEVICE : - changed =BSS_CHANGED_IDLE ; +/* nothing to do */ break ;case NL80211_IFTYPE_UNSPECIFIED :case NUM_NL80211_IFTYPES :
Signature · 1 line
1.9.0
PATCH 4/12 mac80211: return bool instead of numbers in yes/no function
In reply to Zhao, GangAnd some code style changes in the function, and correct a typo in comment.
--- net/mac80211/rx.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
net/mac80211/rx.c +10 -9
@@ -54,24 +54,25 @@ static struct sk_buff *remove_monitor_info(struct ieee80211_local *local,return skb; } -static inline int should_drop_frame (struct sk_buff *skb,int present_fcs_len) +static inline bool should_drop_frame (struct sk_buff *skb,int present_fcs_len) {struct ieee80211_rx_status *status =IEEE80211_SKB_RXCB (skb); -struct ieee80211_hdr *hdr; - - hdr = (void *)(skb->data); +struct ieee80211_hdr *hdr = (void *)skb->data;if (status->flag & (RX_FLAG_FAILED_FCS_CRC |RX_FLAG_FAILED_PLCP_CRC |RX_FLAG_AMPDU_IS_ZEROLEN )) -return 1 ; +return true; +if (unlikely (skb->len <16 + present_fcs_len)) -return 1 ; +return true; +if (ieee80211_is_ctl (hdr->frame_control) && !ieee80211_is_pspoll (hdr->frame_control) && !ieee80211_is_back_req (hdr->frame_control)) -return 1 ; -return 0 ; +return true; + +return false; } static int
@@ -3190,7 +3191,7 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx, }/* -* This is the actual Rx frames handler. as it blongs to Rx path it must +* This is the actual Rx frames handler. as it belongs to Rx path it must * be called with rcu_read_lock protection. */ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
Signature · 1 line
1.9.0
PATCH 5/12 mac80211: remove unnecessary BUG_ON()
In reply to Zhao, GangThe BUG_ON(!err) can't be triggered in the code path, so remove it.
--- net/mac80211/sta_info.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/mac80211/sta_info.c +1 -2
@@ -552,7 +552,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)int sta_info_insert_rcu (struct sta_info *sta)__acquires (RCU ) {struct ieee80211_local *local = sta->local; -int err =0 ; +int err;might_sleep ();
@@ -570,7 +570,6 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU)return 0 ; out_free: -BUG_ON (!err);sta_info_free (local, sta);return err; }
Signature · 1 line
1.9.0
PATCH 6/12 cfg80211: some workqueue improvements
In reply to Zhao, GangWorks rdev->rfkill_sync and rdev->sched_scan_results_wk are safely stopped when unregistering wiphy.
Work reg_regdb_work is safely stopped in regulatory_exit(), if related config option is enabled.
Queue work cfg80211_disconnect_work to workqueue cfg80211_wq, since it's a work owned by cfg80211, and so it can be safely stopped in destroy_workqueue(cfg80211_wq) in cfg80211_exit().
Change flush_work() to more robust cancel_work_sync().
--- net/wireless/core.c | 6 ++++-- net/wireless/reg.c | 4 ++++ net/wireless/sme.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-)
net/wireless/core.c +4 -2
@@ -711,9 +711,11 @@ void wiphy_unregister(struct wiphy *wiphy)rtnl_unlock (); -flush_work (&rdev->scan_done_wk); +cancel_work_sync (&rdev->rfkill_sync); +cancel_work_sync (&rdev->scan_done_wk); +cancel_work_sync (&rdev->sched_scan_results_wk);cancel_work_sync (&rdev->conn_work); -flush_work (&rdev->event_work); +cancel_work_sync (&rdev->event_work);cancel_delayed_work_sync (&rdev->dfs_update_channels_wk);flush_work (&rdev->destroy_work);
net/wireless/reg.c +4 -0
@@ -2765,6 +2765,10 @@ void regulatory_exit(void)cancel_work_sync (®_work);cancel_delayed_work_sync (®_timeout); +#ifdef CONFIG_CFG80211_INTERNAL_REGDB +cancel_work_sync (®_regdb_work); +#endif +/* Lock to suppress warnings */ rtnl_lock ();reset_regdomains (true,NULL );
net/wireless/sme.c +1 -1
@@ -872,7 +872,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, wdev->wext.connect.ssid_len =0 ;#endif -schedule_work (&cfg80211_disconnect_work); +queue_work (cfg80211_wq, &cfg80211_disconnect_work); } void cfg80211_disconnected(struct net_device *dev, u16 reason,
Signature · 1 line
1.9.0
PATCH 7/12 cfg80211: change pointer name
In reply to Zhao, GangName "dev" is too common and ambiguous, let all the pointer name pointing to struct cfg80211_registered_device be "rdev". This can improve code readability and consistency(since other places have already called it rdev).
--- net/wireless/core.h | 4 +- net/wireless/nl80211.c | 258 ++++++++++++++++++++++++------------------------- net/wireless/scan.c | 130 ++++++++++++------------- 3 files changed, 196 insertions(+), 196 deletions(-)
net/wireless/core.h +2 -2
@@ -251,8 +251,8 @@ int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,void ieee80211_set_bitrate_flags (struct wiphy *wiphy); -void cfg80211_bss_expire (struct cfg80211_registered_device *dev); -void cfg80211_bss_age (struct cfg80211_registered_device *dev, +void cfg80211_bss_expire (struct cfg80211_registered_device *rdev); +void cfg80211_bss_age (struct cfg80211_registered_device *rdev,unsigned long age_secs);/* IBSS */
net/wireless/nl80211.c +129 -129
659 lines not on this page · raw message
net/wireless/scan.c +65 -65
349 lines not on this page · raw message
Signature · 1 line
1.9.0
PATCH 8/12 cfg80211: change function name
In reply to Zhao, GangName wiphy_to_rdev is more accurate to describe what the function does, i.e., return a pointer pointing to struct cfg80211_registered_device.
--- net/wireless/chan.c | 2 +- net/wireless/core.c | 16 ++++++------ net/wireless/core.h | 2 +- net/wireless/ethtool.c | 10 ++++---- net/wireless/ibss.c | 12 ++++----- net/wireless/mlme.c | 24 ++++++++--------- net/wireless/nl80211.c | 64 +++++++++++++++++++++++----------------------- net/wireless/scan.c | 24 ++++++++--------- net/wireless/sme.c | 37 ++++++++++++++------------- net/wireless/util.c | 2 +- net/wireless/wext-compat.c | 32 +++++++++++------------ net/wireless/wext-sme.c | 10 ++++---- 12 files changed, 118 insertions(+), 117 deletions(-)
net/wireless/chan.c +1 -1
@@ -761,7 +761,7 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,struct cfg80211_chan_def *chandef, enum nl80211_iftype iftype) { - struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);bool res;u32 prohibited_flags =IEEE80211_CHAN_DISABLED |IEEE80211_CHAN_RADAR ;
net/wireless/core.c +8 -8
@@ -69,7 +69,7 @@ struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx)int get_wiphy_idx (struct wiphy *wiphy) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);return rdev->wiphy_idx; }
@@ -475,7 +475,7 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)int wiphy_register (struct wiphy *wiphy) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);int res;enum ieee80211_band band;struct ieee80211_supported_band *sband;
@@ -656,7 +656,7 @@ EXPORT_SYMBOL(wiphy_register);void wiphy_rfkill_start_polling (struct wiphy *wiphy) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);if (!rdev->ops->rfkill_poll)return ;
@@ -667,7 +667,7 @@ EXPORT_SYMBOL(wiphy_rfkill_start_polling);void wiphy_rfkill_stop_polling (struct wiphy *wiphy) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);rfkill_pause_polling (rdev->rfkill); }
@@ -675,7 +675,7 @@ EXPORT_SYMBOL(wiphy_rfkill_stop_polling);void wiphy_unregister (struct wiphy *wiphy) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy); wait_event(rdev->dev_wait, ({ int __count;
@@ -750,7 +750,7 @@ EXPORT_SYMBOL(wiphy_free);void wiphy_rfkill_set_hw_state (struct wiphy *wiphy,bool blocked) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);if (rfkill_set_hw_state (rdev->rfkill, blocked))schedule_work (&rdev->rfkill_sync);
@@ -759,7 +759,7 @@ EXPORT_SYMBOL(wiphy_rfkill_set_hw_state);void cfg80211_unregister_wdev (struct wireless_dev *wdev) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);ASSERT_RTNL ();
@@ -843,7 +843,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,if (!wdev)return NOTIFY_DONE ; - rdev =wiphy_to_dev (wdev->wiphy); + rdev =wiphy_to_rdev (wdev->wiphy);WARN_ON (wdev->iftype ==NL80211_IFTYPE_UNSPECIFIED );
net/wireless/core.h +1 -1
@@ -90,7 +90,7 @@ struct cfg80211_registered_device { };static inline -struct cfg80211_registered_device *wiphy_to_dev (struct wiphy *wiphy) +struct cfg80211_registered_device *wiphy_to_rdev (struct wiphy *wiphy) {BUG_ON (!wiphy); return container_of(wiphy, struct cfg80211_registered_device, wiphy);
net/wireless/ethtool.c +5 -5
@@ -43,7 +43,7 @@ static void cfg80211_get_ringparam(struct net_device *dev, struct ethtool_ringparam *rp) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);memset (rp,0 ,sizeof (*rp));
@@ -56,7 +56,7 @@ static int cfg80211_set_ringparam(struct net_device *dev, struct ethtool_ringparam *rp) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);if (rp->rx_mini_pending !=0 || rp->rx_jumbo_pending !=0 )return -EINVAL ;
@@ -70,7 +70,7 @@ static int cfg80211_set_ringparam(struct net_device *dev,static int cfg80211_get_sset_count (struct net_device *dev,int sset) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);if (rdev->ops->get_et_sset_count)return rdev_get_et_sset_count (rdev, dev, sset);return -EOPNOTSUPP ;
@@ -80,7 +80,7 @@ static void cfg80211_get_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);if (rdev->ops->get_et_stats)rdev_get_et_stats (rdev, dev, stats, data); }
@@ -88,7 +88,7 @@ static void cfg80211_get_stats(struct net_device *dev,static void cfg80211_get_strings (struct net_device *dev,u32 sset,u8 *data) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);if (rdev->ops->get_et_strings)rdev_get_et_strings (rdev, dev, sset, data); }
net/wireless/ibss.c +6 -6
@@ -45,7 +45,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,cfg80211_upload_connect_keys (wdev); -nl80211_send_ibss_bssid (wiphy_to_dev (wdev->wiphy), dev, bssid, +nl80211_send_ibss_bssid (wiphy_to_rdev (wdev->wiphy), dev, bssid,GFP_KERNEL );#ifdef CONFIG_CFG80211_WEXT memset (&wrqu,0 ,sizeof (wrqu));
@@ -58,7 +58,7 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, struct ieee80211_channel *channel, gfp_t gfp) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_event *ev;unsigned long flags;
@@ -156,7 +156,7 @@ int cfg80211_join_ibss(struct cfg80211_registered_device *rdev,static void __cfg80211_clear_ibss (struct net_device *dev,bool nowext) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);int i;ASSERT_WDEV_LOCK (wdev);
@@ -311,7 +311,7 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev, struct iw_freq *wextfreq, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct ieee80211_channel *chan =NULL ;int err, freq;
@@ -396,7 +396,7 @@ int cfg80211_ibss_wext_siwessid(struct net_device *dev, struct iw_point *data, char *ssid) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);size_t len = data->length;int err;
@@ -463,7 +463,7 @@ int cfg80211_ibss_wext_siwap(struct net_device *dev, struct sockaddr *ap_addr, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);u8 *bssid = ap_addr->sa_data;int err;
net/wireless/mlme.c +12 -12
@@ -23,7 +23,7 @@ void cfg80211_rx_assoc_resp(struct net_device *dev, struct cfg80211_bss *bss, {struct wireless_dev *wdev = dev->ieee80211_ptr;struct wiphy *wiphy = wdev->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf;u8 *ie = mgmt->u.assoc_resp.variable; int ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
@@ -54,7 +54,7 @@ EXPORT_SYMBOL(cfg80211_rx_assoc_resp);static void cfg80211_process_auth (struct wireless_dev *wdev,const u8 *buf,size_t len) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);nl80211_send_rx_auth (rdev, wdev->netdev, buf, len,GFP_KERNEL );cfg80211_sme_rx_auth (wdev, buf, len);
@@ -63,7 +63,7 @@ static void cfg80211_process_auth(struct wireless_dev *wdev,static void cfg80211_process_deauth (struct wireless_dev *wdev,const u8 *buf,size_t len) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf;const u8 *bssid = mgmt->bssid;u16 reason_code =le16_to_cpu (mgmt->u.deauth.reason_code);
@@ -82,7 +82,7 @@ static void cfg80211_process_deauth(struct wireless_dev *wdev,static void cfg80211_process_disassoc (struct wireless_dev *wdev,const u8 *buf,size_t len) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf;const u8 *bssid = mgmt->bssid;u16 reason_code =le16_to_cpu (mgmt->u.disassoc.reason_code);
@@ -123,7 +123,7 @@ void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr) {struct wireless_dev *wdev = dev->ieee80211_ptr;struct wiphy *wiphy = wdev->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);trace_cfg80211_send_auth_timeout (dev, addr);
@@ -136,7 +136,7 @@ void cfg80211_assoc_timeout(struct net_device *dev, struct cfg80211_bss *bss) {struct wireless_dev *wdev = dev->ieee80211_ptr;struct wiphy *wiphy = wdev->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);trace_cfg80211_send_assoc_timeout (dev, bss->bssid);
@@ -172,7 +172,7 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, const u8 *tsc, gfp_t gfp) { struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);#ifdef CONFIG_CFG80211_WEXT union iwreq_data wrqu;char *buf =kmalloc (128 , gfp);
@@ -402,7 +402,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid, int match_len) {struct wiphy *wiphy = wdev->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);struct cfg80211_mgmt_registration *reg, *nreg;int err =0 ;u16 mgmt_type;
@@ -461,7 +461,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,void cfg80211_mlme_unregister_socket (struct wireless_dev *wdev,u32 nlportid) {struct wiphy *wiphy = wdev->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);struct cfg80211_mgmt_registration *reg, *tmp;spin_lock_bh (&wdev->mgmt_registrations_lock);
@@ -608,7 +608,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, const u8 *buf, size_t len, u32 flags, gfp_t gfp) { struct wiphy *wiphy = wdev->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);struct cfg80211_mgmt_registration *reg;const struct ieee80211_txrx_stypes *stypes = &wiphy->mgmt_stypes[wdev->iftype];
@@ -727,7 +727,7 @@ void cfg80211_radar_event(struct wiphy *wiphy, struct cfg80211_chan_def *chandef, gfp_t gfp) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);unsigned long timeout;trace_cfg80211_radar_event (wiphy, chandef);
@@ -752,7 +752,7 @@ void cfg80211_cac_event(struct net_device *netdev, {struct wireless_dev *wdev = netdev->ieee80211_ptr;struct wiphy *wiphy = wdev->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);unsigned long timeout;trace_cfg80211_cac_event (netdev, event);
net/wireless/nl80211.c +32 -32
250 lines not on this page · raw message
net/wireless/scan.c +12 -12
@@ -238,11 +238,11 @@ void __cfg80211_scan_done(struct work_struct *wk)void cfg80211_scan_done (struct cfg80211_scan_request *request,bool aborted) {trace_cfg80211_scan_done (request, aborted); -WARN_ON (request !=wiphy_to_dev (request->wiphy)->scan_req); +WARN_ON (request !=wiphy_to_rdev (request->wiphy)->scan_req); request->aborted = aborted; request->notified = true; -queue_work (cfg80211_wq, &wiphy_to_dev (request->wiphy)->scan_done_wk); +queue_work (cfg80211_wq, &wiphy_to_rdev (request->wiphy)->scan_done_wk); }EXPORT_SYMBOL (cfg80211_scan_done);
@@ -278,15 +278,15 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy) {trace_cfg80211_sched_scan_results (wiphy);/* ignore if we're not scanning */ -if (wiphy_to_dev (wiphy)->sched_scan_req) +if (wiphy_to_rdev (wiphy)->sched_scan_req)queue_work (cfg80211_wq, - &wiphy_to_dev (wiphy)->sched_scan_results_wk); + &wiphy_to_rdev (wiphy)->sched_scan_results_wk); }EXPORT_SYMBOL (cfg80211_sched_scan_results);void cfg80211_sched_scan_stopped (struct wiphy *wiphy) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);trace_cfg80211_sched_scan_stopped (wiphy);
@@ -526,7 +526,7 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, const u8 *ssid, size_t ssid_len, u16 capa_mask, u16 capa_val) { - struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);struct cfg80211_internal_bss *bss, *res =NULL ;unsigned long now = jiffies;
@@ -919,7 +919,7 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,rcu_assign_pointer (tmp.pub.beacon_ies, ies);rcu_assign_pointer (tmp.pub.ies, ies); - res =cfg80211_bss_update (wiphy_to_dev (wiphy), &tmp, + res =cfg80211_bss_update (wiphy_to_rdev (wiphy), &tmp, rx_channel == channel);if (!res)return NULL ;
@@ -991,7 +991,7 @@ cfg80211_inform_bss_width_frame(struct wiphy *wiphy, tmp.pub.beacon_interval =le16_to_cpu (mgmt->u.probe_resp.beacon_int); tmp.pub.capability =le16_to_cpu (mgmt->u.probe_resp.capab_info); - res =cfg80211_bss_update (wiphy_to_dev (wiphy), &tmp, + res =cfg80211_bss_update (wiphy_to_rdev (wiphy), &tmp, rx_channel == channel);if (!res)return NULL ;
@@ -1007,7 +1007,7 @@ EXPORT_SYMBOL(cfg80211_inform_bss_width_frame);void cfg80211_ref_bss (struct wiphy *wiphy,struct cfg80211_bss *pub) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);struct cfg80211_internal_bss *bss;if (!pub)
@@ -1023,7 +1023,7 @@ EXPORT_SYMBOL(cfg80211_ref_bss);void cfg80211_put_bss (struct wiphy *wiphy,struct cfg80211_bss *pub) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);struct cfg80211_internal_bss *bss;if (!pub)
@@ -1039,7 +1039,7 @@ EXPORT_SYMBOL(cfg80211_put_bss);void cfg80211_unlink_bss (struct wiphy *wiphy,struct cfg80211_bss *pub) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);struct cfg80211_internal_bss *bss;if (WARN_ON (!pub))
@@ -1069,7 +1069,7 @@ cfg80211_get_dev_from_ifindex(struct net *net, int ifindex)if (!dev)return ERR_PTR (-ENODEV );if (dev->ieee80211_ptr) - rdev =wiphy_to_dev (dev->ieee80211_ptr->wiphy); + rdev =wiphy_to_rdev (dev->ieee80211_ptr->wiphy);else rdev =ERR_PTR (-ENODEV );dev_put (dev);
net/wireless/sme.c +19 -18
@@ -59,7 +59,7 @@ static void cfg80211_sme_free(struct wireless_dev *wdev)static int cfg80211_conn_scan (struct wireless_dev *wdev) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_scan_request *request;int n_channels, err;
@@ -130,7 +130,7 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)static int cfg80211_conn_do_work (struct wireless_dev *wdev) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_connect_params *params;struct cfg80211_assoc_request req = {};int err;
@@ -245,7 +245,7 @@ void cfg80211_conn_work(struct work_struct *work)/* Returned bss is reference counted and must be cleaned up appropriately. */ static struct cfg80211_bss *cfg80211_get_conn_bss (struct wireless_dev *wdev) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_bss *bss;u16 capa =WLAN_CAPABILITY_ESS ;
@@ -275,7 +275,7 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)static void __cfg80211_sme_scan_done (struct net_device *dev) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_bss *bss;ASSERT_WDEV_LOCK (wdev);
@@ -306,7 +306,7 @@ void cfg80211_sme_scan_done(struct net_device *dev)void cfg80211_sme_rx_auth (struct wireless_dev *wdev,const u8 *buf,size_t len) {struct wiphy *wiphy = wdev->wiphy; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf;u16 status_code =le16_to_cpu (mgmt->u.auth.status_code);
@@ -352,7 +352,7 @@ void cfg80211_sme_rx_auth(struct wireless_dev *wdev, const u8 *buf, size_t len)bool cfg80211_sme_rx_assoc_resp (struct wireless_dev *wdev,u16 status) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);if (!wdev->conn)return false;
@@ -386,7 +386,7 @@ void cfg80211_sme_deauth(struct wireless_dev *wdev)void cfg80211_sme_auth_timeout (struct wireless_dev *wdev) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);if (!wdev->conn)return ;
@@ -397,7 +397,7 @@ void cfg80211_sme_auth_timeout(struct wireless_dev *wdev)void cfg80211_sme_disassoc (struct wireless_dev *wdev) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);if (!wdev->conn)return ;
@@ -408,7 +408,7 @@ void cfg80211_sme_disassoc(struct wireless_dev *wdev)void cfg80211_sme_assoc_timeout (struct wireless_dev *wdev) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);if (!wdev->conn)return ;
@@ -421,7 +421,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev,struct cfg80211_connect_params *connect, const u8 *prev_bssid) { - struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);struct cfg80211_bss *bss;int err;
@@ -505,7 +505,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev,static int cfg80211_sme_disconnect (struct wireless_dev *wdev,u16 reason) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);int err;if (!wdev->conn)
@@ -593,7 +593,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,return ; } -nl80211_send_connect_result (wiphy_to_dev (wdev->wiphy), dev, +nl80211_send_connect_result (wiphy_to_rdev (wdev->wiphy), dev, bssid, req_ie, req_ie_len, resp_ie, resp_ie_len, status,GFP_KERNEL );
@@ -624,7 +624,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,#endif if (!bss && (status ==WLAN_STATUS_SUCCESS )) { -WARN_ON_ONCE (!wiphy_to_dev (wdev->wiphy)->ops->connect); +WARN_ON_ONCE (!wiphy_to_rdev (wdev->wiphy)->ops->connect); bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, wdev->ssid, wdev->ssid_len, WLAN_CAPABILITY_ESS,
@@ -686,7 +686,7 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, u16 status, gfp_t gfp) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_event *ev;unsigned long flags;
@@ -741,7 +741,8 @@ void __cfg80211_roamed(struct wireless_dev *wdev,cfg80211_hold_bss (bss_from_pub (bss)); wdev->current_bss =bss_from_pub (bss); -nl80211_send_roamed (wiphy_to_dev (wdev->wiphy), wdev->netdev, bss->bssid, +nl80211_send_roamed (wiphy_to_rdev (wdev->wiphy), + wdev->netdev, bss->bssid, req_ie, req_ie_len, resp_ie, resp_ie_len,GFP_KERNEL );
@@ -800,7 +801,7 @@ void cfg80211_roamed_bss(struct net_device *dev, size_t resp_ie_len, gfp_t gfp) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_event *ev;unsigned long flags;
@@ -833,7 +834,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, size_t ie_len, u16 reason, bool from_ap) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);int i;#ifdef CONFIG_CFG80211_WEXT union iwreq_data wrqu;
@@ -879,7 +880,7 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, u8 *ie, size_t ie_len, gfp_t gfp) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_event *ev;unsigned long flags;
net/wireless/util.c +1 -1
@@ -770,7 +770,7 @@ EXPORT_SYMBOL(ieee80211_bss_get_ie);void cfg80211_upload_connect_keys (struct wireless_dev *wdev) { -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct net_device *dev = wdev->netdev;int i;
net/wireless/wext-compat.c +16 -16
@@ -73,7 +73,7 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,struct vif_params vifparams;enum nl80211_iftype type; - rdev =wiphy_to_dev (wdev->wiphy); + rdev =wiphy_to_rdev (wdev->wiphy);switch (*mode) {case IW_MODE_INFRA :
@@ -286,7 +286,7 @@ int cfg80211_wext_siwrts(struct net_device *dev, struct iw_param *rts, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);u32 orts = wdev->wiphy->rts_threshold;int err;
@@ -324,7 +324,7 @@ int cfg80211_wext_siwfrag(struct net_device *dev, struct iw_param *frag, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);u32 ofrag = wdev->wiphy->frag_threshold;int err;
@@ -364,7 +364,7 @@ static int cfg80211_wext_siwretry(struct net_device *dev, struct iw_param *retry, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);u32 changed =0 ;u8 olong = wdev->wiphy->retry_long;u8 oshort = wdev->wiphy->retry_short;
@@ -587,7 +587,7 @@ static int cfg80211_wext_siwencode(struct net_device *dev, struct iw_point *erq, char *keybuf) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);int idx, err;bool remove = false;struct key_params params;
@@ -647,7 +647,7 @@ static int cfg80211_wext_siwencodeext(struct net_device *dev, struct iw_point *erq, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;const u8 *addr;int idx;
@@ -775,7 +775,7 @@ static int cfg80211_wext_siwfreq(struct net_device *dev, struct iw_freq *wextfreq, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_chan_def chandef = { .width =NL80211_CHAN_WIDTH_20_NOHT , };
@@ -818,7 +818,7 @@ static int cfg80211_wext_giwfreq(struct net_device *dev, struct iw_freq *freq, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_chan_def chandef;int ret;
@@ -847,7 +847,7 @@ static int cfg80211_wext_siwtxpower(struct net_device *dev, union iwreq_data *data, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);enum nl80211_tx_power_setting type;int dbm =0 ;
@@ -899,7 +899,7 @@ static int cfg80211_wext_giwtxpower(struct net_device *dev, union iwreq_data *data, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);int err, val;if ((data->txpower.flags &IW_TXPOW_TYPE ) !=IW_TXPOW_DBM )
@@ -1119,7 +1119,7 @@ static int cfg80211_wext_siwpower(struct net_device *dev, struct iw_param *wrq, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);bool ps = wdev->ps;int timeout = wdev->ps_timeout;int err;
@@ -1177,7 +1177,7 @@ static int cfg80211_wds_wext_siwap(struct net_device *dev, struct sockaddr *addr, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);int err;if (WARN_ON (wdev->iftype !=NL80211_IFTYPE_WDS ))
@@ -1221,7 +1221,7 @@ static int cfg80211_wext_siwrate(struct net_device *dev, struct iw_param *rate, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_bitrate_mask mask;u32 fixed, maxrate;struct ieee80211_supported_band *sband;
@@ -1272,7 +1272,7 @@ static int cfg80211_wext_giwrate(struct net_device *dev, struct iw_param *rate, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);/* we are under RTNL - globally locked - so can use a static struct */ static struct station_info sinfo;u8 addr[ETH_ALEN ];
@@ -1310,7 +1310,7 @@ static int cfg80211_wext_giwrate(struct net_device *dev,static struct iw_statistics *cfg80211_wireless_stats (struct net_device *dev) {struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);/* we are under RTNL - globally locked - so can use static structs */ static struct iw_statistics wstats;static struct station_info sinfo;
@@ -1449,7 +1449,7 @@ static int cfg80211_wext_siwpmksa(struct net_device *dev, struct iw_point *data, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct cfg80211_pmksa cfg_pmksa;struct iw_pmksa *pmksa = (struct iw_pmksa *)extra;
net/wireless/wext-sme.c +5 -5
@@ -67,7 +67,7 @@ int cfg80211_mgd_wext_siwfreq(struct net_device *dev, struct iw_freq *wextfreq, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);struct ieee80211_channel *chan =NULL ;int err, freq;
@@ -169,7 +169,7 @@ int cfg80211_mgd_wext_siwessid(struct net_device *dev, struct iw_point *data, char *ssid) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);size_t len = data->length;int err;
@@ -260,7 +260,7 @@ int cfg80211_mgd_wext_siwap(struct net_device *dev, struct sockaddr *ap_addr, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);u8 *bssid = ap_addr->sa_data;int err;
@@ -333,7 +333,7 @@ int cfg80211_wext_siwgenie(struct net_device *dev, struct iw_point *data, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; -struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy); +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy);u8 *ie = extra;int ie_len = data->length, err;
@@ -390,7 +390,7 @@ int cfg80211_wext_siwmlme(struct net_device *dev,if (!wdev)return -EOPNOTSUPP ; - rdev =wiphy_to_dev (wdev->wiphy); + rdev =wiphy_to_rdev (wdev->wiphy);if (wdev->iftype !=NL80211_IFTYPE_STATION )return -EINVAL ;
Signature · 1 line
1.9.0
PATCH 9/12 cfg80211: change return value of notifier function
In reply to Zhao, GangReturn NOTIFY_DONE if we don't care this time's notification, return NOTIFY_OK if we successfully handled this time's notification. That's the formal way to do it.
--- net/wireless/core.c | 4 +++- net/wireless/nl80211.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-)
net/wireless/core.c +3 -1
@@ -1004,9 +1004,11 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,if (rfkill_blocked (rdev->rfkill))return notifier_from_errno (-ERFKILL );break ; +default : +return NOTIFY_DONE ; } -return NOTIFY_DONE ; +return NOTIFY_OK ; }static struct notifier_block cfg80211_netdev_notifier = {
net/wireless/nl80211.c +1 -1
@@ -11672,7 +11672,7 @@ static int nl80211_netlink_notify(struct notifier_block * nb,rcu_read_unlock (); -return NOTIFY_DONE ; +return NOTIFY_OK ; }static struct notifier_block nl80211_netlink_notifier = {
Signature · 1 line
1.9.0
PATCH 10/12 mac80211: change return value of notifier function
In reply to Zhao, GangReturn NOTIFY_DONE if we don't care this time's notification, return NOTIFY_OK if we successfully handled this time's notification. That's the formal way to do it.
--- net/mac80211/iface.c | 11 +++++------ net/mac80211/main.c | 4 ++-- net/mac80211/mlme.c | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-)
net/mac80211/iface.c +5 -6
@@ -1785,20 +1785,19 @@ static int netdev_notify(struct notifier_block *nb,struct ieee80211_sub_if_data *sdata;if (state !=NETDEV_CHANGENAME ) -return 0 ; +return NOTIFY_DONE ;if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) -return 0 ; +return NOTIFY_DONE ;if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid) -return 0 ; +return NOTIFY_DONE ; sdata =IEEE80211_DEV_TO_SUB_IF (dev); -memcpy (sdata->name, dev->name,IFNAMSIZ ); -ieee80211_debugfs_rename_netdev (sdata); -return 0 ; + +return NOTIFY_OK ; }static struct notifier_block mac80211_netdev_notifier = {
net/mac80211/main.c +2 -2
@@ -338,7 +338,7 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,sdata_unlock (sdata); - return NOTIFY_DONE; + return NOTIFY_OK; }#endif
@@ -369,7 +369,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb,drv_ipv6_addr_change (local, sdata, idev); - return NOTIFY_DONE; + return NOTIFY_OK; }#endif
net/mac80211/mlme.c +1 -1
@@ -3701,7 +3701,7 @@ int ieee80211_max_network_latency(struct notifier_block *nb,ieee80211_recalc_ps (local, latency_usec);mutex_unlock (&local->iflist_mtx); -return 0 ; +return NOTIFY_OK ; } static u8 ieee80211_ht_vht_rx_chains(struct ieee80211_sub_if_data *sdata,
Signature · 1 line
1.9.0
PATCH 11/12 cfg80211/mac80211: rename cfg80211_chandef_dfs_required()
In reply to Zhao, GangChange the name to cfg80211_chandef_dfs_check to emphasize that the function isn't a bool function, its return value must be fully checked.
Also rename the helper function's name tocfg80211_do_chandef_dfs_check for consistency.
Variable width in cfg80211_chandef_dfs_check() needn't to be checked for sanity, since above cfg80211_chandef_valid() already checked the sanity of chandef->width.
Since cfg80211.h is touched, also correct a typo in comment.
--- include/net/cfg80211.h | 10 +++++----- net/mac80211/chan.c | 6 +++--- net/mac80211/ibss.c | 22 +++++++++++----------- net/mac80211/mesh.c | 6 +++--- net/wireless/chan.c | 45 +++++++++++++++++++++------------------------ net/wireless/nl80211.c | 10 +++++----- net/wireless/trace.h | 2 +- 7 files changed, 49 insertions(+), 52 deletions(-)
include/net/cfg80211.h +5 -5
@@ -443,16 +443,16 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, u32 prohibited_flags);/** -* cfg80211_chandef_dfs_required - checks if radar detection is required +* cfg80211_chandef_dfs_check - checks if radar detection is required * @wiphy: the wiphy to validate against * @chandef: the channel definition to check * @iftype: the interface type as specified in &enum nl80211_iftype * Returns: * 1 if radar detection is required, 0 if it is not, < 0 on error */ -int cfg80211_chandef_dfs_required (struct wiphy *wiphy, -const struct cfg80211_chan_def *chandef, -enum nl80211_iftype ); +int cfg80211_chandef_dfs_check (struct wiphy *wiphy, +const struct cfg80211_chan_def *chandef, +enum nl80211_iftype );/** * ieee80211_chandef_rate_flags - returns rate flags for a channel
@@ -1625,7 +1625,7 @@ struct cfg80211_assoc_request {* @ie_len: Length of ie buffer in octets * @reason_code: The reason code for the deauthentication * @local_state_change: if set, change local state only and -* do not set a deauth frame +* do not send a deauth frame */ struct cfg80211_deauth_request {const u8 *bssid;
net/mac80211/chan.c +3 -3
@@ -558,9 +558,9 @@ int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,mutex_lock (&local->chanctx_mtx); - ret =cfg80211_chandef_dfs_required (local->hw.wiphy, - chandef, - sdata->wdev.iftype); + ret =cfg80211_chandef_dfs_check (local->hw.wiphy, + chandef, + sdata->wdev.iftype);if (ret <0 ) goto out;if (ret >0 )
net/mac80211/ibss.c +11 -11
@@ -283,8 +283,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, } } - err =cfg80211_chandef_dfs_required (sdata->local->hw.wiphy, - &chandef,NL80211_IFTYPE_ADHOC ); + err =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, + &chandef,NL80211_IFTYPE_ADHOC );if (err <0 ) {sdata_info (sdata,"Failed to join IBSS, invalid chandef\n" );
@@ -775,9 +775,9 @@ static void ieee80211_ibss_csa_mark_radar(struct ieee80211_sub_if_data *sdata)/* if the current channel is a DFS channel, mark the channel as * unavailable. */ - err =cfg80211_chandef_dfs_required (sdata->local->hw.wiphy, - &ifibss->chandef, -NL80211_IFTYPE_ADHOC ); + err =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, + &ifibss->chandef, +NL80211_IFTYPE_ADHOC );if (err >0 )cfg80211_radar_event (sdata->local->hw.wiphy, &ifibss->chandef,GFP_ATOMIC );
@@ -875,9 +875,9 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata, goto disconnect; } - err =cfg80211_chandef_dfs_required (sdata->local->hw.wiphy, - ¶ms.chandef, -NL80211_IFTYPE_ADHOC ); + err =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, + ¶ms.chandef, +NL80211_IFTYPE_ADHOC );if (err <0 ) goto disconnect;if (err >0 && !ifibss->userspace_handles_dfs) {
@@ -1645,9 +1645,9 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,int i;int ret; - ret =cfg80211_chandef_dfs_required (local->hw.wiphy, - ¶ms->chandef, - sdata->wdev.iftype); + ret =cfg80211_chandef_dfs_check (local->hw.wiphy, + ¶ms->chandef, + sdata->wdev.iftype);if (ret <0 )return ret;
net/mac80211/mesh.c +3 -3
@@ -902,9 +902,9 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,return false; } - err =cfg80211_chandef_dfs_required (sdata->local->hw.wiphy, - ¶ms.chandef, -NL80211_IFTYPE_MESH_POINT ); + err =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, + ¶ms.chandef, +NL80211_IFTYPE_MESH_POINT );if (err <0 )return false;if (err >0 )
net/wireless/chan.c +21 -24
93 lines not on this page · raw message
net/wireless/nl80211.c +5 -5
@@ -5790,8 +5790,8 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,if (wdev->cac_started)return -EBUSY ; - err =cfg80211_chandef_dfs_required (wdev->wiphy, &chandef, -NL80211_IFTYPE_UNSPECIFIED ); + err =cfg80211_chandef_dfs_check (wdev->wiphy, &chandef, +NL80211_IFTYPE_UNSPECIFIED );if (err <0 )return err;
@@ -5921,9 +5921,9 @@ skip_beacons: wdev->iftype))return -EINVAL ; - err =cfg80211_chandef_dfs_required (wdev->wiphy, - ¶ms.chandef, - wdev->iftype); + err =cfg80211_chandef_dfs_check (wdev->wiphy, + ¶ms.chandef, + wdev->iftype);if (err <0 )return err;
net/wireless/trace.h +1 -1
@@ -2210,7 +2210,7 @@ TRACE_EVENT(cfg80211_reg_can_beacon, WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->iftype) ); -TRACE_EVENT(cfg80211_chandef_dfs_required, +TRACE_EVENT(cfg80211_chandef_dfs_check, TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef), TP_ARGS(wiphy, chandef), TP_STRUCT__entry(
Signature · 1 line
1.9.0
PATCH 12/12 cfg80211/mac80211: change variable name
In reply to Zhao, GangChange "err" to "ret", since return value isn't zero doesn't always mean error occured, sometimes it means success.
if (err)
/* do things if function successfully returned */
looks strange to me, so change it.
This change related to the functions which call cfg80211_chandef_dfs_check(), since cfg80211_chandef_dfs_check() returns 1 means dfs is required.
--- net/mac80211/ibss.c | 38 ++++++++++++++--------------- net/mac80211/mesh.c | 16 ++++++------ net/wireless/nl80211.c | 66 +++++++++++++++++++++++++------------------------- 3 files changed, 60 insertions(+), 60 deletions(-)
net/mac80211/ibss.c +19 -19
@@ -229,7 +229,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,enum nl80211_bss_scan_width scan_width;bool have_higher_than_11mbit;bool radar_required; -int err; +int ret;sdata_assert_lock (sdata);
@@ -283,20 +283,20 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, } } - err =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, + ret =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, &chandef,NL80211_IFTYPE_ADHOC ); -if (err <0 ) { +if (ret <0 ) {sdata_info (sdata,"Failed to join IBSS, invalid chandef\n" );return ; } -if (err >0 && !ifibss->userspace_handles_dfs) { +if (ret >0 && !ifibss->userspace_handles_dfs) {sdata_info (sdata,"Failed to join IBSS, DFS channel without control program\n" );return ; } - radar_required = err; + radar_required = ret;mutex_lock (&local->mtx); if (ieee80211_vif_use_channel(sdata, &chandef,
@@ -360,8 +360,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, sdata->vif.bss_conf.ibss_joined = true; sdata->vif.bss_conf.ibss_creator = creator; - err =drv_join_ibss (local, sdata); -if (err) { + ret =drv_join_ibss (local, sdata); +if (ret) { sdata->vif.bss_conf.ibss_joined = false; sdata->vif.bss_conf.ibss_creator = false; sdata->vif.bss_conf.enable_beacon = false;
@@ -372,7 +372,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,ieee80211_vif_release_channel (sdata);mutex_unlock (&local->mtx);sdata_info (sdata,"Failed to join IBSS, driver failure: %d\n" , - err); + ret);return ; }
@@ -770,15 +770,15 @@ static void ieee80211_csa_connection_drop_work(struct work_struct *work)static void ieee80211_ibss_csa_mark_radar (struct ieee80211_sub_if_data *sdata) {struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; -int err; +int ret;/* if the current channel is a DFS channel, mark the channel as * unavailable. */ - err =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, + ret =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, &ifibss->chandef,NL80211_IFTYPE_ADHOC ); -if (err >0 ) +if (ret >0 )cfg80211_radar_event (sdata->local->hw.wiphy, &ifibss->chandef,GFP_ATOMIC ); }
@@ -792,7 +792,7 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,struct ieee80211_csa_ie csa_ie;struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;enum nl80211_channel_type ch_type; -int err; +int ret;u32 sta_flags;sdata_assert_lock (sdata);
@@ -813,15 +813,15 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,memset (¶ms,0 ,sizeof (params));memset (&csa_ie,0 ,sizeof (csa_ie)); - err =ieee80211_parse_ch_switch_ie (sdata, elems, beacon, + ret =ieee80211_parse_ch_switch_ie (sdata, elems, beacon, ifibss->chandef.chan->band, sta_flags, ifibss->bssid, &csa_ie);/* can't switch to destination channel, fail */ -if (err <0 ) +if (ret <0 ) goto disconnect;/* did not contain a CSA */ -if (err) +if (ret)return false;/* channel switch is not supported, disconnect */
@@ -875,17 +875,17 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata, goto disconnect; } - err =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, + ret =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, ¶ms.chandef,NL80211_IFTYPE_ADHOC ); -if (err <0 ) +if (ret <0 ) goto disconnect; -if (err >0 && !ifibss->userspace_handles_dfs) { +if (ret >0 && !ifibss->userspace_handles_dfs) {/* IBSS-DFS only allowed with a control program */ goto disconnect; } - params.radar_required = err; + params.radar_required = ret;if (cfg80211_chandef_identical (¶ms.chandef, &sdata->vif.bss_conf.chandef)) {
net/mac80211/mesh.c +8 -8
@@ -861,7 +861,7 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,struct ieee80211_csa_ie csa_ie;struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;enum ieee80211_band band =ieee80211_get_sdata_band (sdata); -int err; +int ret;u32 sta_flags;sdata_assert_lock (sdata);
@@ -879,12 +879,12 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,memset (¶ms,0 ,sizeof (params));memset (&csa_ie,0 ,sizeof (csa_ie)); - err =ieee80211_parse_ch_switch_ie (sdata, elems, beacon, band, + ret =ieee80211_parse_ch_switch_ie (sdata, elems, beacon, band, sta_flags, sdata->vif.addr, &csa_ie); -if (err <0 ) +if (ret <0 )return false; -if (err) +if (ret)return false; params.chandef = csa_ie.chandef;
@@ -902,16 +902,16 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,return false; } - err =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, + ret =cfg80211_chandef_dfs_check (sdata->local->hw.wiphy, ¶ms.chandef,NL80211_IFTYPE_MESH_POINT ); -if (err <0 ) +if (ret <0 )return false; -if (err >0 ) +if (ret >0 )/* TODO: DFS not (yet) supported */ return false; - params.radar_required = err; + params.radar_required = ret;if (cfg80211_chandef_identical (¶ms.chandef, &sdata->vif.bss_conf.chandef)) {
net/wireless/nl80211.c +33 -33
143 lines not on this page · raw message
Signature · 1 line
1.9.0
Johannes Berg
maintainerRe: [PATCH 02/12] mac80211: remove config option check
In reply to Zhao, GangQuoted 3 lines · Gang
Sanity check and error handling code shouldn't be put into
CONFIG_MAC80211_VERBOSE_DEBUGblock, since verbose debug option is used to control whether to print debug messages.
It's in the hotpath though, so we don't always want it, it's mostly for development that this matters.
I don't think I want to apply this patch.
johannes
Johannes Berg
maintainerRe: [PATCH 01/12] mac80211: unify debug function
In reply to Zhao, GangQuoted 3 lines · Gang
Both
wiphy_debug()andwiphy_dbg()are used in mac80211. Changewiphy_debug()towiphy_dbg()so all the debug messages can be dynamically controled whether to be generated or not.
But this means these messages go away by default now, why would we want that?
johannes
Johannes Berg
maintainerRe: [PATCH 03/12] mac80211: minor changes of ieee80211_reconfig()
In reply to Zhao, GangQuoted 1 line · Gang
Try to update chanctx only if
local->use_chanctxis true.
I'm not convinced this part is correct, since the internal channel context handling also has an effect when the driver doesn't use it.
Have you really thought this through?
johannes
Johannes Berg
maintainerRe: [PATCH 06/12] cfg80211: some workqueue improvements
In reply to Zhao, GangQuoted 9 lines · Gang
Works
rdev->rfkill_syncandrdev->sched_scan_results_wkare safely stopped when unregistering wiphy.Work
reg_regdb_workis safely stopped inregulatory_exit(), if related config option is enabled.Queue work
cfg80211_disconnect_workto workqueuecfg80211_wq, since it's a work owned by cfg80211, and so it can be safely stopped indestroy_workqueue(cfg80211_wq)incfg80211_exit().
Nope ... think about locking.
Quoted 1 line
Change
flush_work()to more robustcancel_work_sync().
These are not equivalent.
johannes
Johannes Berg
maintainerRe: [PATCH 11/12] cfg80211/mac80211: rename cfg80211_chandef_dfs_required()
In reply to Zhao, GangQuoted 4 lines · Gang
Change the name to
cfg80211_chandef_dfs_checkto emphasize that the function isn't a bool function, its return value must be fully checked.
Quoted 8 lines
Also rename the helper function's name to
cfg80211_do_chandef_dfs_checkfor consistency.Variable width in
cfg80211_chandef_dfs_check()needn't to be checked for sanity, since abovecfg80211_chandef_valid()already checked the sanity ofchandef->width.Since
cfg80211.his touched, also correct a typo in comment.
I think there's too much work ongoing in this area to safely apply this.
johannes
Johannes Berg
maintainerRe: [PATCH 12/12] cfg80211/mac80211: change variable name
In reply to Zhao, GangQuoted 11 lines · Gang
Change "err" to "ret", since return value isn't zero doesn't always mean error occured, sometimes it means success.
if (err)
/* do things if function successfully returned */looks strange to me, so change it.
This change related to the functions which call
cfg80211_chandef_dfs_check(), sincecfg80211_chandef_dfs_check()returns 1 means dfs is required.
Same here, there's a lot of work ongoing with CSA around the code, I don't want to disrupt all that.
johannes
Re: [PATCH 03/12] mac80211: minor changes of ieee80211_reconfig()
In reply to Johannes BergQuoted 5 lines · Johannes Berg
Quoted 1 line · Gang
Try to update chanctx only if
local->use_chanctxis true.I'm not convinced this part is correct, since the internal channel context handling also has an effect when the driver doesn't use it.
Actually ieee80211_assign_chanctx() checks if local->use_chanctx is true, so this patch doesn't change the logic. I should mentioned it in the commit log.
Quoted 3 lines
Have you really thought this through?
johannes
Johannes Berg
maintainerRe: [PATCH 03/12] mac80211: minor changes of ieee80211_reconfig()
Quoted 10 lines · Gang
Quoted 5 lines · Johannes Berg
Quoted 1 line · Gang
Try to update chanctx only if
local->use_chanctxis true.I'm not convinced this part is correct, since the internal channel context handling also has an effect when the driver doesn't use it.
Actually
ieee80211_assign_chanctx()checks iflocal->use_chanctxis true, so this patch doesn't change the logic. I should mentioned it in the commit log.
Oh, you're right. Please also split the patch into two.
johannes
Johannes Berg
maintainerRe: [PATCH 10/12] mac80211: change return value of notifier function
In reply to Zhao, GangQuoted 3 lines · Gang
Return
NOTIFY_DONEif we don't care this time's notification, returnNOTIFY_OKif we successfully handled this time's notification. That's the formal way to do it.
Same here.
johannes
Johannes Berg
maintainerRe: [PATCH 09/12] cfg80211: change return value of notifier function
In reply to Zhao, GangQuoted 3 lines · Gang
Return
NOTIFY_DONEif we don't care this time's notification, returnNOTIFY_OKif we successfully handled this time's notification. That's the formal way to do it.
That's really quite pointless, but I'll apply it anyway.
johannes
Re: [PATCH 07/12] cfg80211: change pointer name
In reply to Zhao, GangQuoted 4 lines · Gang
Name "dev" is too common and ambiguous, let all the pointer name pointing to struct
cfg80211_registered_devicebe "rdev". This can improve code readability and consistency(since other places have already called it rdev).
Applied.
johannes
Re: [PATCH 08/12] cfg80211: change function name
In reply to Zhao, GangQuoted 3 lines · Gang
Name
wiphy_to_rdevis more accurate to describe what the function does, i.e., return a pointer pointing to structcfg80211_registered_device.
Applied.
johannes
Re: [PATCH 04/12] mac80211: return bool instead of numbers in yes/no function
In reply to Zhao, GangQuoted 2 lines · Gang
And some code style changes in the function, and correct a typo in comment.
Applied, thanks.
johannes
Re: [PATCH 05/12] mac80211: remove unnecessary BUG_ON()
In reply to Zhao, GangQuoted 2 lines · Gang
The
BUG_ON(!err)can't be triggered in the code path, so remove it.
Applied.
Btw, it was a bit confusing that you sent your older patches in this patchset again, please avoid that or at least tell me you did that.
johannes
PATCH 1/2 mac80211: beautify the code
In reply to Johannes Bergieee80211_assign_chanctx() checks if local->use_chanctx is true, so the two code block related to ieee80211_assign_chanctx() can be moved into above if clause, emphasize that these code are executed only if local->use_chanctx is true.
--- net/mac80211/util.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
net/mac80211/util.c +9 -9
@@ -1565,17 +1565,17 @@ int ieee80211_reconfig(struct ieee80211_local *local)list_for_each_entry (ctx, &local->chanctx_list, list)WARN_ON (drv_add_chanctx (local, ctx));mutex_unlock (&local->chanctx_mtx); - } -list_for_each_entry (sdata, &local->interfaces, list) { -if (!ieee80211_sdata_running (sdata)) -continue ; -ieee80211_assign_chanctx (local, sdata); - } +list_for_each_entry (sdata, &local->interfaces, list) { +if (!ieee80211_sdata_running (sdata)) +continue ; +ieee80211_assign_chanctx (local, sdata); + } - sdata =rtnl_dereference (local->monitor_sdata); -if (sdata &&ieee80211_sdata_running (sdata)) -ieee80211_assign_chanctx (local, sdata); + sdata =rtnl_dereference (local->monitor_sdata); +if (sdata &&ieee80211_sdata_running (sdata)) +ieee80211_assign_chanctx (local, sdata); + }/* add STAs back */ mutex_lock (&local->sta_mtx);
Signature · 1 line
1.9.0
PATCH 2/2 mac80211: remove unnecessary assignment
P2P_DEVICE doesn't support ieee80211_bss_info_change_notify() for now, so it's not needed to set changed flags for P2P_DEVICE.
--- net/mac80211/util.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/mac80211/util.c +1 -4
@@ -1671,13 +1671,10 @@ int ieee80211_reconfig(struct ieee80211_local *local) }break ;case NL80211_IFTYPE_WDS : -break ;case NL80211_IFTYPE_AP_VLAN :case NL80211_IFTYPE_MONITOR : -/* ignore virtual */ -break ;case NL80211_IFTYPE_P2P_DEVICE : - changed =BSS_CHANGED_IDLE ; +/* nothing to do */ break ;case NL80211_IFTYPE_UNSPECIFIED :case NUM_NL80211_IFTYPES :
Signature · 1 line
1.9.0
Re: [PATCH 05/12] mac80211: remove unnecessary BUG_ON()
In reply to Johannes BergQuoted 8 lines · Johannes Berg
Quoted 2 lines · Gang
The
BUG_ON(!err)can't be triggered in the code path, so remove it.Applied.
Btw, it was a bit confusing that you sent your older patches in this patchset again, please avoid that or at least tell me you did that.
Sure. I thought previous sending failed due to network problem, but it succeeded. Will check carefully.
Quoted 1 line
johannes
Johannes Berg
maintainerRe: [PATCH 1/2] mac80211: beautify the code
In reply to Zhao, GangApplied both.
johannes