mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
uwb: per-radio controller event thread and beacon cache
Use an event thread per-radio controller so processing events from one radio controller doesn't delay another. A radio controller shouldn't have information on devices seen by a different radio controller (they may be on different channels) so make the beacon cache per-radio controller. Signed-off-by: Stefano Panella <stefano.panella@csr.com> Signed-off-by: David Vrabel <david.vrabel@csr.com>
This commit is contained in:
parent
6d5a681dfb
commit
fec1a5932f
6 changed files with 100 additions and 122 deletions
|
@ -36,8 +36,6 @@
|
|||
#include <linux/etherdevice.h>
|
||||
#include <linux/usb.h>
|
||||
|
||||
#define D_LOCAL 1
|
||||
#include <linux/uwb/debug.h>
|
||||
#include "uwb-internal.h"
|
||||
|
||||
static int uwb_rc_index_match(struct device *dev, void *data)
|
||||
|
@ -83,7 +81,6 @@ static void uwb_rc_sys_release(struct device *dev)
|
|||
|
||||
uwb_rc_neh_destroy(rc);
|
||||
uwb_rc_ie_release(rc);
|
||||
d_printf(1, dev, "freed uwb_rc %p\n", rc);
|
||||
kfree(rc);
|
||||
}
|
||||
|
||||
|
@ -100,6 +97,8 @@ void uwb_rc_init(struct uwb_rc *rc)
|
|||
rc->scan_type = UWB_SCAN_DISABLED;
|
||||
INIT_LIST_HEAD(&rc->notifs_chain.list);
|
||||
mutex_init(&rc->notifs_chain.mutex);
|
||||
INIT_LIST_HEAD(&rc->uwb_beca.list);
|
||||
mutex_init(&rc->uwb_beca.mutex);
|
||||
uwb_drp_avail_init(rc);
|
||||
uwb_rc_ie_init(rc);
|
||||
uwb_rsv_init(rc);
|
||||
|
@ -250,6 +249,12 @@ int uwb_rc_add(struct uwb_rc *rc, struct device *parent_dev, void *priv)
|
|||
|
||||
rc->priv = priv;
|
||||
|
||||
init_waitqueue_head(&rc->uwbd.wq);
|
||||
INIT_LIST_HEAD(&rc->uwbd.event_list);
|
||||
spin_lock_init(&rc->uwbd.event_list_lock);
|
||||
|
||||
uwbd_start(rc);
|
||||
|
||||
result = rc->start(rc);
|
||||
if (result < 0)
|
||||
goto error_rc_start;
|
||||
|
@ -284,7 +289,7 @@ error_sys_add:
|
|||
error_dev_add:
|
||||
error_rc_setup:
|
||||
rc->stop(rc);
|
||||
uwbd_flush(rc);
|
||||
uwbd_stop(rc);
|
||||
error_rc_start:
|
||||
return result;
|
||||
}
|
||||
|
@ -315,16 +320,18 @@ void uwb_rc_rm(struct uwb_rc *rc)
|
|||
uwb_rc_reset(rc);
|
||||
|
||||
rc->stop(rc);
|
||||
uwbd_flush(rc);
|
||||
|
||||
uwbd_stop(rc);
|
||||
|
||||
uwb_dev_lock(&rc->uwb_dev);
|
||||
rc->priv = NULL;
|
||||
rc->cmd = NULL;
|
||||
uwb_dev_unlock(&rc->uwb_dev);
|
||||
mutex_lock(&uwb_beca.mutex);
|
||||
mutex_lock(&rc->uwb_beca.mutex);
|
||||
uwb_dev_for_each(rc, uwb_dev_offair_helper, NULL);
|
||||
__uwb_rc_sys_rm(rc);
|
||||
mutex_unlock(&uwb_beca.mutex);
|
||||
mutex_unlock(&rc->uwb_beca.mutex);
|
||||
uwb_beca_release(rc);
|
||||
uwb_dev_rm(&rc->uwb_dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(uwb_rc_rm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue