lkml.org 
[lkml]   [2013]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 2/3] net/usb/r8152: enable tx checksum
Hello.

On 08/13/2013 11:28 AM, Hayes Wang wrote:

> Enable tx checksum.

> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
> drivers/net/usb/r8152.c | 63 +++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 58 insertions(+), 5 deletions(-)

> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index c6c5aa2..5d9d949 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
[...]
> @@ -964,6 +971,51 @@ err1:
> return -ENOMEM;
> }
>
> +static void
> +r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc, struct sk_buff *skb)
> +{
[...]
> + if (ip_protocol == IPPROTO_TCP) {
> + opts2 |= TCP_CS;
> + opts2 |= (skb_transport_offset(skb) & 0x7fff) << 17;
> + } else if (ip_protocol == IPPROTO_UDP) {
> + opts2 |= UDP_CS;
> + } else
> + WARN_ON_ONCE(1);

Stange, why *else if* branch has {} and *else* don't. It should, according
to Documentation/CodingStyle.

> +
> + desc->opts2 = cpu_to_le32(opts2);
> + }
> +}
> +

WBR, Sergei



\
 
 \ /
  Last update: 2013-08-13 17:01    [W:0.141 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site