forked from mirrors/linux
		
	wifi: cfg80211: move scan done work to wiphy work
Move the scan done work to the new wiphy work to simplify the code a bit. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
		
							parent
							
								
									c88d717822
								
							
						
					
					
						commit
						fe0af9fe54
					
				
					 3 changed files with 7 additions and 14 deletions
				
			
		|  | @ -527,7 +527,7 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv, | ||||||
| 	spin_lock_init(&rdev->bss_lock); | 	spin_lock_init(&rdev->bss_lock); | ||||||
| 	INIT_LIST_HEAD(&rdev->bss_list); | 	INIT_LIST_HEAD(&rdev->bss_list); | ||||||
| 	INIT_LIST_HEAD(&rdev->sched_scan_req_list); | 	INIT_LIST_HEAD(&rdev->sched_scan_req_list); | ||||||
| 	INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); | 	wiphy_work_init(&rdev->scan_done_wk, __cfg80211_scan_done); | ||||||
| 	INIT_DELAYED_WORK(&rdev->dfs_update_channels_wk, | 	INIT_DELAYED_WORK(&rdev->dfs_update_channels_wk, | ||||||
| 			  cfg80211_dfs_channels_update_work); | 			  cfg80211_dfs_channels_update_work); | ||||||
| #ifdef CONFIG_CFG80211_WEXT | #ifdef CONFIG_CFG80211_WEXT | ||||||
|  | @ -1141,7 +1141,6 @@ void wiphy_unregister(struct wiphy *wiphy) | ||||||
| 	/* this has nothing to do now but make sure it's gone */ | 	/* this has nothing to do now but make sure it's gone */ | ||||||
| 	cancel_work_sync(&rdev->wiphy_work); | 	cancel_work_sync(&rdev->wiphy_work); | ||||||
| 
 | 
 | ||||||
| 	flush_work(&rdev->scan_done_wk); |  | ||||||
| 	cancel_work_sync(&rdev->conn_work); | 	cancel_work_sync(&rdev->conn_work); | ||||||
| 	flush_work(&rdev->event_work); | 	flush_work(&rdev->event_work); | ||||||
| 	cancel_delayed_work_sync(&rdev->dfs_update_channels_wk); | 	cancel_delayed_work_sync(&rdev->dfs_update_channels_wk); | ||||||
|  |  | ||||||
|  | @ -75,7 +75,7 @@ struct cfg80211_registered_device { | ||||||
| 	struct sk_buff *scan_msg; | 	struct sk_buff *scan_msg; | ||||||
| 	struct list_head sched_scan_req_list; | 	struct list_head sched_scan_req_list; | ||||||
| 	time64_t suspend_at; | 	time64_t suspend_at; | ||||||
| 	struct work_struct scan_done_wk; | 	struct wiphy_work scan_done_wk; | ||||||
| 
 | 
 | ||||||
| 	struct genl_info *cur_cmd_info; | 	struct genl_info *cur_cmd_info; | ||||||
| 
 | 
 | ||||||
|  | @ -441,7 +441,7 @@ bool cfg80211_valid_key_idx(struct cfg80211_registered_device *rdev, | ||||||
| int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | ||||||
| 				   struct key_params *params, int key_idx, | 				   struct key_params *params, int key_idx, | ||||||
| 				   bool pairwise, const u8 *mac_addr); | 				   bool pairwise, const u8 *mac_addr); | ||||||
| void __cfg80211_scan_done(struct work_struct *wk); | void __cfg80211_scan_done(struct wiphy *wiphy, struct wiphy_work *wk); | ||||||
| void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, | void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, | ||||||
| 			   bool send_message); | 			   bool send_message); | ||||||
| void cfg80211_add_sched_scan_req(struct cfg80211_registered_device *rdev, | void cfg80211_add_sched_scan_req(struct cfg80211_registered_device *rdev, | ||||||
|  |  | ||||||
|  | @ -1004,16 +1004,9 @@ void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, | ||||||
| 		nl80211_send_scan_msg(rdev, msg); | 		nl80211_send_scan_msg(rdev, msg); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void __cfg80211_scan_done(struct work_struct *wk) | void __cfg80211_scan_done(struct wiphy *wiphy, struct wiphy_work *wk) | ||||||
| { | { | ||||||
| 	struct cfg80211_registered_device *rdev; | 	___cfg80211_scan_done(wiphy_to_rdev(wiphy), true); | ||||||
| 
 |  | ||||||
| 	rdev = container_of(wk, struct cfg80211_registered_device, |  | ||||||
| 			    scan_done_wk); |  | ||||||
| 
 |  | ||||||
| 	wiphy_lock(&rdev->wiphy); |  | ||||||
| 	___cfg80211_scan_done(rdev, true); |  | ||||||
| 	wiphy_unlock(&rdev->wiphy); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cfg80211_scan_done(struct cfg80211_scan_request *request, | void cfg80211_scan_done(struct cfg80211_scan_request *request, | ||||||
|  | @ -1039,7 +1032,8 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	request->notified = true; | 	request->notified = true; | ||||||
| 	queue_work(cfg80211_wq, &wiphy_to_rdev(request->wiphy)->scan_done_wk); | 	wiphy_work_queue(request->wiphy, | ||||||
|  | 			 &wiphy_to_rdev(request->wiphy)->scan_done_wk); | ||||||
| } | } | ||||||
| EXPORT_SYMBOL(cfg80211_scan_done); | EXPORT_SYMBOL(cfg80211_scan_done); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Johannes Berg
						Johannes Berg