/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007-2009 Myricom, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef lint
static const char __idstring[] =
"@(#)$Id: myri10ge_lro.c,v 1.7 2009-06-29 13:47:22 gallatin Exp $";
#endif
#include "myri10ge_var.h"
/*
* Assume len is a multiple of 4. Note that "raw" must be
* suitably aligned. In practice, it will always enter algned on
* at least a 4 bytes bounday, due to the alignment of our rx buffers.
*/
{
csum = 0;
while (len > 0) {
raw++;
raw++;
len -= 4;
}
}
static uint16_t
myri10ge_in_pseudo(unsigned int a, unsigned int b,
unsigned int c)
{
}
void
struct myri10ge_mblk_list *mbl)
{
if (lro->append_cnt) {
/*
* incorporate the new len into the ip header and
* re-calculate the checksum
*/
/* incorporate the latest ack into the tcp header */
/* incorporate latest timestamp into the tcp header */
}
/*
* update checksum in tcp header by re-calculating the
* tcp pseudoheader checksum, and adding it to the checksum
* of the tcp payload data
*/
}
lro->append_cnt = 0;
}
int
{
return (EINVAL);
return (EINVAL);
/* ensure there are no options */
return (EINVAL);
/* .. and the packet is not fragmented */
return (EINVAL);
/* verify that the IP header checksum is correct */
return (EINVAL);
}
/* find the TCP header */
/* ensure no bits set besides ack or psh */
return (EINVAL);
/*
* check for timestamps. Since the only option we handle are
* timestamps, we only have to handle the simple case of
* aligned timestamps
*/
if (opt_bytes != 0) {
return (EINVAL);
}
/*
* If frame is padded beyond the end of the IP packet,
* then we must trim the extra bytes off the end.
*/
if (trim != 0) {
if (trim < 0) {
/* truncated packet */
return (EINVAL);
}
}
/* Verify TCP checksum */
if (tmp_csum != 0xffff) {
return (EINVAL);
}
/* Try to append it */
/* out of order packet */
} else {
}
return (EINVAL);
}
if (opt_bytes) {
/* make sure timestamp values are increasing */
*(ts_ptr + 2) == 0)) {
return (-8);
}
}
lro->append_cnt++;
if (tcp_data_len == 0) {
return (0);
}
/*
* subtract off the checksum of the tcp header
* from the hardware checksum, and add it to
* the stored tcp data checksum. Byteswap
* the checksum if the total length so far is
* odd
*/
/* Odd number of bytes so far, flip bytes */
}
/*
* adjust mblk so that rptr points to
* the first byte of the payload
*/
/* append mbuf chain */
/* advance the last pointer */
/* flush packet if required */
} else {
}
}
return (0);
}
}
return (ENOMEM);
/* start a new chain */
/*
* save the checksum of just the TCP payload by
* subtracting off the checksum of the TCP header from
* the entire hardware checksum
* Since IP header checksum is correct, checksum over
* the IP header is -0. Substracting -0 is unnecessary.
*/
/* record timestamp if it is present */
if (opt_bytes) {
}
return (0);
}
/*
* This file uses MyriGE driver indentation.
*
* Local Variables:
* c-file-style:"sun"
* tab-width:8
* End:
*/