Skip to content

Commit

Permalink
caif: Use RCU instead of spin-lock in caif_dev.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sjur.brandeland@stericsson.com authored and David S. Miller committed May 15, 2011
1 parent 0b1e973 commit bd30ce4
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 118 deletions.
10 changes: 10 additions & 0 deletions include/net/caif/cfcnfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */
Loading

0 comments on commit bd30ce4

Please sign in to comment.