mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
net: qrtr: Add support for multiple nodes on a single ept
An ept can be associated with multiple node ids in network. The node tree should keep track of how to send to a specific node id where as the node list should keep track of all the adjacent nodes in the network. Use the node list to broadcast control messages to adjacent nodes. Change-Id: If0f4828da149b6e590525518a8410f497f5e3894 Signed-off-by: Chris Lew <clew@codeaurora.org>
This commit is contained in:
parent
33685bb27f
commit
162cff4d10
1 changed files with 12 additions and 5 deletions
|
|
@ -208,8 +208,12 @@ static void __qrtr_node_release(struct kref *kref)
|
|||
void __rcu **slot;
|
||||
|
||||
spin_lock_irqsave(&qrtr_nodes_lock, flags);
|
||||
if (node->nid != QRTR_EP_NID_AUTO)
|
||||
radix_tree_delete(&qrtr_nodes, node->nid);
|
||||
if (node->nid != QRTR_EP_NID_AUTO) {
|
||||
radix_tree_for_each_slot(slot, &qrtr_nodes, &iter, 0) {
|
||||
if (node == *slot)
|
||||
radix_tree_delete(&qrtr_nodes, iter.index);
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&qrtr_nodes_lock, flags);
|
||||
|
||||
list_del(&node->item);
|
||||
|
|
@ -446,12 +450,15 @@ static void qrtr_node_assign(struct qrtr_node *node, unsigned int nid)
|
|||
{
|
||||
unsigned long flags;
|
||||
|
||||
if (node->nid != QRTR_EP_NID_AUTO || nid == QRTR_EP_NID_AUTO)
|
||||
if (nid == node->nid || nid == QRTR_EP_NID_AUTO)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&qrtr_nodes_lock, flags);
|
||||
radix_tree_insert(&qrtr_nodes, nid, node);
|
||||
node->nid = nid;
|
||||
if (!radix_tree_lookup(&qrtr_nodes, nid))
|
||||
radix_tree_insert(&qrtr_nodes, nid, node);
|
||||
|
||||
if (node->nid == QRTR_EP_NID_AUTO)
|
||||
node->nid = nid;
|
||||
spin_unlock_irqrestore(&qrtr_nodes_lock, flags);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue