Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c4df6da authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

[PATCH] softmac: convert to use global workqueue



Convert softmac to use global workqueue instead of private one...

Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 45867e6a
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -177,9 +177,6 @@ struct ieee80211softmac_device {
	u8 scanning:1, /* protects scanning from being done multiple times at once */
	u8 scanning:1, /* protects scanning from being done multiple times at once */
	   associated:1;
	   associated:1;
	
	
	/* workquere for scannning, ... */
	struct workqueue_struct	*workqueue;

	struct ieee80211softmac_scaninfo *scaninfo;
	struct ieee80211softmac_scaninfo *scaninfo;
	struct ieee80211softmac_assoc_info associnfo;
	struct ieee80211softmac_assoc_info associnfo;


+2 −2
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft


	/* Set a timer for timeout */
	/* Set a timer for timeout */
	/* FIXME: make timeout configurable */
	/* FIXME: make timeout configurable */
	queue_delayed_work(mac->workqueue, &mac->associnfo.timeout, 5 * HZ);
	schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ);
}
}


void
void
@@ -324,7 +324,7 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev,
				network->authenticated = 0;
				network->authenticated = 0;
				/* we don't want to do this more than once ... */
				/* we don't want to do this more than once ... */
				network->auth_desynced_once = 1;
				network->auth_desynced_once = 1;
				queue_work(mac->workqueue, &mac->associnfo.work);
				schedule_work(&mac->associnfo.work);
				break;
				break;
			}
			}
		default:
		default:
+3 −3
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,


	/* add to list */
	/* add to list */
	list_add_tail(&auth->list, &mac->auth_queue);
	list_add_tail(&auth->list, &mac->auth_queue);
	queue_work(mac->workqueue, &auth->work);
	schedule_work(&auth->work);
	spin_unlock_irqrestore(&mac->lock, flags);
	spin_unlock_irqrestore(&mac->lock, flags);
	
	
	return 0;
	return 0;
@@ -67,7 +67,7 @@ ieee80211softmac_auth_queue(void *data)
		net->authenticated = 0;
		net->authenticated = 0;
		net->authenticating = 1;
		net->authenticating = 1;
		/* add a timeout call so we eventually give up waiting for an auth reply */
		/* add a timeout call so we eventually give up waiting for an auth reply */
		queue_delayed_work(mac->workqueue, &auth->work, IEEE80211SOFTMAC_AUTH_TIMEOUT);
		schedule_delayed_work(&auth->work, IEEE80211SOFTMAC_AUTH_TIMEOUT);
		auth->retry--;
		auth->retry--;
		spin_unlock_irqrestore(&mac->lock, flags);
		spin_unlock_irqrestore(&mac->lock, flags);
		if (ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state))
		if (ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state))
@@ -279,7 +279,7 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac,
	kfree(net);
	kfree(net);
	
	
	/* let's try to re-associate */
	/* let's try to re-associate */
	queue_work(mac->workqueue, &mac->associnfo.work);
	schedule_work(&mac->associnfo.work);
	spin_unlock_irqrestore(&mac->lock, flags);
	spin_unlock_irqrestore(&mac->lock, flags);
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -118,7 +118,7 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve
			if ((eventptr->event_type == event || eventptr->event_type == -1)
			if ((eventptr->event_type == event || eventptr->event_type == -1)
				&& (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) {
				&& (eventptr->event_context == NULL || eventptr->event_context == event_ctx)) {
				list_del(&eventptr->list);
				list_del(&eventptr->list);
				queue_work(mac->workqueue, &eventptr->work);
				schedule_work(&eventptr->work);
			}
			}
		}
		}
}
}
+1 −6
Original line number Original line Diff line number Diff line
@@ -22,10 +22,6 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
	 *	 (once they're written)
	 *	 (once they're written)
	 */
	 */


	softmac->workqueue = create_workqueue("80211softmac");
	if (!softmac->workqueue)
		goto err_free_ieee80211;

	INIT_LIST_HEAD(&softmac->auth_queue);
	INIT_LIST_HEAD(&softmac->auth_queue);
	INIT_LIST_HEAD(&softmac->network_list);
	INIT_LIST_HEAD(&softmac->network_list);
	INIT_LIST_HEAD(&softmac->events);
	INIT_LIST_HEAD(&softmac->events);
@@ -90,7 +86,7 @@ ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm)
		cancel_delayed_work(&eventptr->work);
		cancel_delayed_work(&eventptr->work);


	spin_unlock_irqrestore(&sm->lock, flags);
	spin_unlock_irqrestore(&sm->lock, flags);
	flush_workqueue(sm->workqueue);
	flush_scheduled_work();


	// now we should be save and no longer need locking...
	// now we should be save and no longer need locking...
	spin_lock_irqsave(&sm->lock, flags);
	spin_lock_irqsave(&sm->lock, flags);
@@ -121,7 +117,6 @@ void free_ieee80211softmac(struct net_device *dev)
{
{
	struct ieee80211softmac_device *sm = ieee80211_priv(dev);
	struct ieee80211softmac_device *sm = ieee80211_priv(dev);
	ieee80211softmac_clear_pending_work(sm);	
	ieee80211softmac_clear_pending_work(sm);	
	destroy_workqueue(sm->workqueue);
	kfree(sm->scaninfo);
	kfree(sm->scaninfo);
	kfree(sm->wpa.IE);
	kfree(sm->wpa.IE);
	free_ieee80211(dev);
	free_ieee80211(dev);
Loading