Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198584
b: refs/heads/master
c: ca6a09f
h: refs/heads/master
v: v3
  • Loading branch information
Sjur Braendeland authored and David S. Miller committed May 24, 2010
1 parent d6bd0d7 commit 2854f51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 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: 638e628a600a5c542d46dfb06771cf9c229ef5f3
refs/heads/master: ca6a09f25cde1d2d86f8e821cf69f4f650c30dbf
21 changes: 6 additions & 15 deletions trunk/net/caif/caif_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void caif_flow_ctrl(struct sock *sk, int mode)
{
struct caifsock *cf_sk;
cf_sk = container_of(sk, struct caifsock, sk);
if (cf_sk->layer.dn)
if (cf_sk->layer.dn && cf_sk->layer.dn->modemcmd)
cf_sk->layer.dn->modemcmd(cf_sk->layer.dn, mode);
}

Expand All @@ -162,9 +162,8 @@ int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
atomic_read(&cf_sk->sk.sk_rmem_alloc),
sk_rcvbuf_lowwater(cf_sk));
set_rx_flow_off(cf_sk);
if (cf_sk->layer.dn)
cf_sk->layer.dn->modemcmd(cf_sk->layer.dn,
CAIF_MODEMCMD_FLOW_OFF_REQ);
dbfs_atomic_inc(&cnt.num_rx_flow_off);
caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ);
}

err = sk_filter(sk, skb);
Expand All @@ -175,9 +174,8 @@ int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
trace_printk("CAIF: %s():"
" sending flow OFF due to rmem_schedule\n",
__func__);
if (cf_sk->layer.dn)
cf_sk->layer.dn->modemcmd(cf_sk->layer.dn,
CAIF_MODEMCMD_FLOW_OFF_REQ);
dbfs_atomic_inc(&cnt.num_rx_flow_off);
caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ);
}
skb->dev = NULL;
skb_set_owner_r(skb, sk);
Expand Down Expand Up @@ -285,16 +283,13 @@ static void caif_check_flow_release(struct sock *sk)
{
struct caifsock *cf_sk = container_of(sk, struct caifsock, sk);

if (cf_sk->layer.dn == NULL || cf_sk->layer.dn->modemcmd == NULL)
return;
if (rx_flow_is_on(cf_sk))
return;

if (atomic_read(&sk->sk_rmem_alloc) <= sk_rcvbuf_lowwater(cf_sk)) {
dbfs_atomic_inc(&cnt.num_rx_flow_on);
set_rx_flow_on(cf_sk);
cf_sk->layer.dn->modemcmd(cf_sk->layer.dn,
CAIF_MODEMCMD_FLOW_ON_REQ);
caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_ON_REQ);
}
}
/*
Expand Down Expand Up @@ -1018,10 +1013,6 @@ static unsigned int caif_poll(struct file *file,
(sk->sk_shutdown & RCV_SHUTDOWN))
mask |= POLLIN | POLLRDNORM;

/* Connection-based need to check for termination and startup */
if (sk->sk_state == CAIF_DISCONNECTED)
mask |= POLLHUP;

/*
* we set writable also when the other side has shut down the
* connection. This prevents stuck sockets.
Expand Down

0 comments on commit 2854f51

Please sign in to comment.