aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/caif
diff options
context:
space:
mode:
authorsjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com>2011-05-13 02:44:00 +0000
committerDavid S. Miller <davem@davemloft.net>2011-05-15 17:45:54 -0400
commitbd30ce4bc0b7dc859c1d1cba7ad87e08642418b0 (patch)
treed5648773052baf985db8290774fea4907e558257 /include/net/caif
parentcaif: Use rcu_read_lock in CAIF mux layer. (diff)
downloadwireguard-linux-bd30ce4bc0b7dc859c1d1cba7ad87e08642418b0.tar.xz
wireguard-linux-bd30ce4bc0b7dc859c1d1cba7ad87e08642418b0.zip
caif: Use RCU instead of spin-lock in caif_dev.c
RCU read_lock and refcount is used to protect in-flight packets. Use RCU and counters to manage freeing lower part of the CAIF stack if CAIF-link layer is removed. Old solution based on delaying removal of device is removed. When CAIF link layer goes down the use of CAIF link layer is disabled (by calling caif_set_phy_state()), but removal and freeing of the lower part of the CAIF stack is done when Link layer is unregistered. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/caif')
-rw-r--r--include/net/caif/cfcnfg.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h
index f33d36341132..e0a1eb5d7eaf 100644
--- a/include/net/caif/cfcnfg.h
+++ b/include/net/caif/cfcnfg.h
@@ -145,4 +145,14 @@ struct dev_info *cfcnfg_get_phyid(struct cfcnfg *cnfg,
* @ifi: ifindex obtained from socket.c bindtodevice.
*/
int cfcnfg_get_id_from_ifi(struct cfcnfg *cnfg, int ifi);
+
+/**
+ * cfcnfg_set_phy_state() - Set the state of the physical interface device.
+ * @cnfg: Configuration object
+ * @phy_layer: Physical Layer representation
+ * @up: State of device
+ */
+int cfcnfg_set_phy_state(struct cfcnfg *cnfg, struct cflayer *phy_layer,
+ bool up);
+
#endif /* CFCNFG_H_ */