Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315298
b: refs/heads/master
c: cbbf472
h: refs/heads/master
v: v3
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Jul 9, 2012
1 parent c797bc7 commit e78c233
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d22ea1532ba5730b665343e513d813c108c84ff
refs/heads/master: cbbf472181bd5d6229decda96b34b0c2bbcb3050
13 changes: 0 additions & 13 deletions trunk/net/nfc/llcp/llcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,6 @@ int nfc_llcp_local_put(struct nfc_llcp_local *local)
return kref_put(&local->ref, local_release);
}

static void nfc_llcp_clear_sdp(struct nfc_llcp_local *local)
{
mutex_lock(&local->sdp_lock);

local->local_wks = 0;
local->local_sdp = 0;
local->local_sap = 0;

mutex_unlock(&local->sdp_lock);
}

static void nfc_llcp_timeout_work(struct work_struct *work)
{
struct nfc_llcp_local *local = container_of(work, struct nfc_llcp_local,
Expand Down Expand Up @@ -993,8 +982,6 @@ void nfc_llcp_mac_is_down(struct nfc_dev *dev)
if (local == NULL)
return;

nfc_llcp_clear_sdp(local);

/* Close and purge all existing sockets */
nfc_llcp_socket_release(local, true);
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/nfc/llcp/llcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ struct nfc_llcp_sock {
/* Is the remote peer ready to receive */
u8 remote_ready;

/* Reserved source SAP */
u8 reserved_ssap;

struct sk_buff_head tx_queue;
struct sk_buff_head tx_pending_queue;
struct sk_buff_head tx_backlog_queue;
Expand Down
9 changes: 8 additions & 1 deletion trunk/net/nfc/llcp/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
if (llcp_sock->ssap == LLCP_MAX_SAP)
goto put_dev;

llcp_sock->reserved_ssap = llcp_sock->ssap;

nfc_llcp_sock_link(&local->sockets, sk);

pr_debug("Socket bound to SAP %d\n", llcp_sock->ssap);
Expand Down Expand Up @@ -409,7 +411,8 @@ static int llcp_sock_release(struct socket *sock)
}
}

nfc_llcp_put_ssap(llcp_sock->local, llcp_sock->ssap);
if (llcp_sock->reserved_ssap < LLCP_SAP_MAX)
nfc_llcp_put_ssap(llcp_sock->local, llcp_sock->ssap);

release_sock(sk);

Expand Down Expand Up @@ -489,6 +492,9 @@ static int llcp_sock_connect(struct socket *sock, struct sockaddr *_addr,
ret = -ENOMEM;
goto put_dev;
}

llcp_sock->reserved_ssap = llcp_sock->ssap;

if (addr->service_name_len == 0)
llcp_sock->dsap = addr->dsap;
else
Expand Down Expand Up @@ -690,6 +696,7 @@ struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp)
llcp_sock->send_n = llcp_sock->send_ack_n = 0;
llcp_sock->recv_n = llcp_sock->recv_ack_n = 0;
llcp_sock->remote_ready = 1;
llcp_sock->reserved_ssap = LLCP_SAP_MAX;
skb_queue_head_init(&llcp_sock->tx_queue);
skb_queue_head_init(&llcp_sock->tx_pending_queue);
skb_queue_head_init(&llcp_sock->tx_backlog_queue);
Expand Down

0 comments on commit e78c233

Please sign in to comment.