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

Commit 152a5992 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville
Browse files

rt2x00: Decrease association time for USB devices



When powersaving is enabled, assocaition times are very high
(for WPA2 networks, the time can easily be around the 3 seconds).

This is caused, because the flushing of the queues takes
too much time. Without the flushing callback mac80211 assumes
a timeout of 100ms while scanning. Limit all flush waiting
loops to the same maximum.

We can apply this maximum by passing the drop status to the
driver, which makes sure the driver performs extra actions
during the waiting for the queue to become empty.

After these changes, association times fall within the
healthy range of ~0.6 seconds with powersaving enabled.
The difference between association time between powersaving
enabled and disabled is now only ~0.1 second (which can also
be due to the measuring method).

Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f0187a19
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1740,6 +1740,7 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = {
	.start_queue		= rt2400pci_start_queue,
	.kick_queue		= rt2400pci_kick_queue,
	.stop_queue		= rt2400pci_stop_queue,
	.flush_queue		= rt2x00pci_flush_queue,
	.write_tx_desc		= rt2400pci_write_tx_desc,
	.write_beacon		= rt2400pci_write_beacon,
	.fill_rxdone		= rt2400pci_fill_rxdone,
+1 −0
Original line number Diff line number Diff line
@@ -2033,6 +2033,7 @@ static const struct rt2x00lib_ops rt2500pci_rt2x00_ops = {
	.start_queue		= rt2500pci_start_queue,
	.kick_queue		= rt2500pci_kick_queue,
	.stop_queue		= rt2500pci_stop_queue,
	.flush_queue		= rt2x00pci_flush_queue,
	.write_tx_desc		= rt2500pci_write_tx_desc,
	.write_beacon		= rt2500pci_write_beacon,
	.fill_rxdone		= rt2500pci_fill_rxdone,
+1 −0
Original line number Diff line number Diff line
@@ -1057,6 +1057,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
	.start_queue		= rt2800pci_start_queue,
	.kick_queue		= rt2800pci_kick_queue,
	.stop_queue		= rt2800pci_stop_queue,
	.flush_queue		= rt2x00pci_flush_queue,
	.write_tx_desc		= rt2800pci_write_tx_desc,
	.write_tx_data		= rt2800_write_tx_data,
	.write_beacon		= rt2800_write_beacon,
+1 −1
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ struct rt2x00lib_ops {
	void (*start_queue) (struct data_queue *queue);
	void (*kick_queue) (struct data_queue *queue);
	void (*stop_queue) (struct data_queue *queue);
	void (*flush_queue) (struct data_queue *queue);
	void (*flush_queue) (struct data_queue *queue, bool drop);
	void (*tx_dma_done) (struct queue_entry *entry);

	/*
+9 −0
Original line number Diff line number Diff line
@@ -99,6 +99,15 @@ bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
}
EXPORT_SYMBOL_GPL(rt2x00pci_rxdone);

void rt2x00pci_flush_queue(struct data_queue *queue, bool drop)
{
	unsigned int i;

	for (i = 0; !rt2x00queue_empty(queue) && i < 10; i++)
		msleep(10);
}
EXPORT_SYMBOL_GPL(rt2x00pci_flush_queue);

/*
 * Device initialization handlers.
 */
Loading