aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/dvi.c
diff options
context:
space:
mode:
authorBryan Ward <bcw@cs.unc.edu>2013-04-18 15:52:46 -0400
committerBryan Ward <bcw@cs.unc.edu>2013-04-18 15:52:46 -0400
commitcb71b522bb144a838b457304382d63b131695a8c (patch)
tree7f9fafb3feea4ab606944be09e6b1e83b2e251b7 /drivers/video/via/dvi.c
parent7ef4a793a624c6e66c16ca1051847f75161f5bec (diff)
Appears to be working.wip-nested-locking
Diffstat (limited to 'drivers/video/via/dvi.c')
0 files changed, 0 insertions, 0 deletions
>len); if (cscov == 0) /* Indicates that full coverage is required. */ ; else if (cscov < 8 || cscov > skb->len) { /* * Coverage length violates RFC 3828: log and discard silently. */ LIMIT_NETDEBUG(KERN_DEBUG "UDPLITE: bad csum coverage %d/%d\n", cscov, skb->len); return 1; } else if (cscov < skb->len) { UDP_SKB_CB(skb)->partial_cov = 1; UDP_SKB_CB(skb)->cscov = cscov; if (skb->ip_summed == CHECKSUM_COMPLETE) skb->ip_summed = CHECKSUM_NONE; } return 0; } static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) { int cscov = up->len; /* * Sender has set `partial coverage' option on UDP-Lite socket */ if (up->pcflag & UDPLITE_SEND_CC) { if (up->pcslen < up->len) { /* up->pcslen == 0 means that full coverage is required, * partial coverage only if 0 < up->pcslen < up->len */ if (0 < up->pcslen) { cscov = up->pcslen; } uh->len = htons(up->pcslen); } /* * NOTE: Causes for the error case `up->pcslen > up->len': * (i) Application error (will not be penalized). * (ii) Payload too big for send buffer: data is split * into several packets, each with its own header. * In this case (e.g. last segment), coverage may * exceed packet length. * Since packets with coverage length > packet length are * illegal, we fall back to the defaults here. */ } return cscov; } static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb) { int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb)); __wsum csum = 0; skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ skb_queue_walk(&sk->sk_write_queue, skb) { const int off = skb_transport_offset(skb); const int len = skb->len - off; csum = skb_checksum(skb, off, (cscov > len)? len : cscov, csum); if ((cscov -= len) <= 0) break; } return csum; } static inline __wsum udplite_csum(struct sk_buff *skb) { struct sock *sk = skb->sk; int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb)); const int off = skb_transport_offset(skb); const int len = skb->len - off; skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ return skb_checksum(skb, off, min(cscov, len), 0); } extern void udplite4_register(void); extern int udplite_get_port(struct sock *sk, unsigned short snum, int (*scmp)(const struct sock *, const struct sock *)); #endif /* _UDPLITE_H */