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

Commit fe336150 authored by Dan Williams's avatar Dan Williams Committed by David S. Miller
Browse files

[PATCH] libertas: remove thread.h and make kthread usage clearer



Remove the thread.h abstractions and opencode kthread stuff
to make it clearer.

Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2ca10e6d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1134,7 +1134,7 @@ int libertas_prepare_and_send_command(wlan_private * priv,
		lbs_deb_cmd("PREP_CMD: No free cmdnode\n");

		/* Wake up main thread to execute next command */
		wake_up_interruptible(&priv->mainthread.waitq);
		wake_up_interruptible(&priv->waitq);
		ret = -1;
		goto done;
	}
@@ -1402,7 +1402,7 @@ int libertas_prepare_and_send_command(wlan_private * priv,

	libertas_queue_cmd(adapter, cmdnode, 1);
	adapter->nr_cmd_pending++;
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	if (wait_option & CMD_OPTION_WAITFORRSP) {
		lbs_deb_cmd("PREP_CMD: Wait for CMD response\n");
+13 −13
Original line number Diff line number Diff line
@@ -432,7 +432,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf,
	event->action = cpu_to_le16(CMD_ACT_GET);
	pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -496,7 +496,7 @@ static u16 libertas_get_events_bitmap(wlan_private *priv)
	event->action = cpu_to_le16(CMD_ACT_GET);
	pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -575,7 +575,7 @@ static ssize_t libertas_lowrssi_write(struct file *file,
	event->events = cpu_to_le16(event_bitmap);

	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -628,7 +628,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf,
	event->action = cpu_to_le16(CMD_ACT_GET);
	pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -727,7 +727,7 @@ static ssize_t libertas_lowsnr_write(struct file *file,
	event->events = cpu_to_le16(event_bitmap);

	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -781,7 +781,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf,
	event->action = cpu_to_le16(CMD_ACT_GET);
	pcmdptr->size =	cpu_to_le16(sizeof(*event) + S_DS_GEN);
	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -879,7 +879,7 @@ static ssize_t libertas_failcount_write(struct file *file,
	event->events = cpu_to_le16(event_bitmap);

	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -932,7 +932,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf,
	event->action = cpu_to_le16(CMD_ACT_GET);
	pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -1029,7 +1029,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file,
	event->events = cpu_to_le16(event_bitmap);

	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -1082,7 +1082,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf,
	event->action = cpu_to_le16(CMD_ACT_GET);
	pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -1181,7 +1181,7 @@ static ssize_t libertas_highrssi_write(struct file *file,
	event->events = cpu_to_le16(event_bitmap);

	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -1232,7 +1232,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf,
	event->action = cpu_to_le16(CMD_ACT_GET);
	pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
@@ -1331,7 +1331,7 @@ static ssize_t libertas_highsnr_write(struct file *file,
	event->events = cpu_to_le16(event_bitmap);

	libertas_queue_cmd(adapter, pcmdnode, 1);
	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	/* Sleep until response is generated by FW */
	wait_event_interruptible(pcmdnode->cmdwait_q,
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@

#include "defs.h"
#include "scan.h"
#include "thread.h"

extern struct ethtool_ops libertas_ethtool_ops;

@@ -146,7 +145,8 @@ struct _wlan_private {
	struct device *hotplug_device;

	/** thread to service interrupts */
	struct wlan_thread mainthread;
	struct task_struct *main_thread;
	wait_queue_head_t waitq;

	struct delayed_work assoc_work;
	struct workqueue_struct *assoc_thread;
+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ static void command_timer_fn(unsigned long data)
	lbs_deb_fw("re-sending same command because of timeout\n");
	libertas_queue_cmd(adapter, ptempnode, 0);

	wake_up_interruptible(&priv->mainthread.waitq);
	wake_up_interruptible(&priv->waitq);

	return;
}
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
		priv->dnld_sent = DNLD_RES_RECEIVED;
		/* Wake main thread if commands are pending */
		if (!adapter->cur_cmd)
			wake_up_interruptible(&priv->mainthread.waitq);
			wake_up_interruptible(&priv->waitq);
		if ((adapter->connect_status == LIBERTAS_CONNECTED)) {
			netif_wake_queue(dev);
			netif_wake_queue(priv->mesh_dev);
Loading