diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-05-04 17:04:19 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-06-04 21:34:28 +0200 |
commit | a69f32af86e389dd232b1bb2269e202c1bfcc60f (patch) | |
tree | 8639421ba70c67ac09f72323a4e5dca2b71e37e7 /net/nfc/llcp/llcp.h | |
parent | c7aa12252f5142b9eee2f6e34ca8870a8e7e048c (diff) | |
download | linux-a69f32af86e389dd232b1bb2269e202c1bfcc60f.tar.bz2 |
NFC: Socket linked list
Simplify the LLCP sockets structure by putting all the connected ones
into a single linked list.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/llcp/llcp.h')
-rw-r--r-- | net/nfc/llcp/llcp.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/nfc/llcp/llcp.h b/net/nfc/llcp/llcp.h index bc619553821b..705330470062 100644 --- a/net/nfc/llcp/llcp.h +++ b/net/nfc/llcp/llcp.h @@ -40,6 +40,11 @@ enum llcp_state { struct nfc_llcp_sock; +struct llcp_sock_list { + struct hlist_head head; + rwlock_t lock; +}; + struct nfc_llcp_local { struct list_head list; struct nfc_dev *dev; @@ -47,7 +52,6 @@ struct nfc_llcp_local { struct kref ref; struct mutex sdp_lock; - struct mutex socket_lock; struct timer_list link_timer; struct sk_buff_head tx_queue; @@ -82,12 +86,12 @@ struct nfc_llcp_local { u8 remote_rw; /* sockets array */ - struct nfc_llcp_sock *sockets[LLCP_MAX_SAP]; + struct llcp_sock_list sockets; + struct llcp_sock_list connecting_sockets; }; struct nfc_llcp_sock { struct sock sk; - struct list_head list; struct nfc_dev *dev; struct nfc_llcp_local *local; u32 target_idx; @@ -166,6 +170,8 @@ struct nfc_llcp_sock { #define LLCP_DM_REJ 0x03 +void nfc_llcp_sock_link(struct llcp_sock_list *l, struct sock *s); +void nfc_llcp_sock_unlink(struct llcp_sock_list *l, struct sock *s); struct nfc_llcp_local *nfc_llcp_find_local(struct nfc_dev *dev); struct nfc_llcp_local *nfc_llcp_local_get(struct nfc_llcp_local *local); int nfc_llcp_local_put(struct nfc_llcp_local *local); |