亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? skcsum.c

?? 移植好的楊創(chuàng)utu2440F ARM9 的uboot1.1.4代碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
 *	maximum IP header length is 15 * 4 = 60 bytes. * *	Checksum1 - The first 16-bit Internet Checksum calculated by the *	hardware starting at the offset returned by SkCsSetReceiveFlags(). * *	Checksum2 - The second 16-bit Internet Checksum calculated by the *	hardware starting at the offset returned by SkCsSetReceiveFlags(). * * Returns: *	SKCS_STATUS_UNKNOWN_IP_VERSION - Not an IP v4 frame. *	SKCS_STATUS_IP_CSUM_ERROR - IP checksum error. *	SKCS_STATUS_IP_CSUM_ERROR_TCP - IP checksum error in TCP frame. *	SKCS_STATUS_IP_CSUM_ERROR_UDP - IP checksum error in UDP frame *	SKCS_STATUS_IP_FRAGMENT - IP fragment (IP checksum ok). *	SKCS_STATUS_IP_CSUM_OK - IP checksum ok (not a TCP or UDP frame). *	SKCS_STATUS_TCP_CSUM_ERROR - TCP checksum error (IP checksum ok). *	SKCS_STATUS_UDP_CSUM_ERROR - UDP checksum error (IP checksum ok). *	SKCS_STATUS_TCP_CSUM_OK - IP and TCP checksum ok. *	SKCS_STATUS_UDP_CSUM_OK - IP and UDP checksum ok. *	SKCS_STATUS_IP_CSUM_OK_NO_UDP - IP checksum OK and no UDP checksum. * *	Note: If SKCS_OVERWRITE_STATUS is defined, the SKCS_STATUS_XXX values *	returned here can be defined in some header file by the module using CSUM. *	In this way, the calling module can assign return values for its own needs, *	e.g. by assigning bit flags to the individual protocols. */SKCS_STATUS SkCsGetReceiveInfo(SK_AC		*pAc,		/* Adapter context struct. */void		*pIpHeader,	/* IP header. */unsigned	Checksum1,	/* Hardware checksum 1. */unsigned	Checksum2,	/* Hardware checksum 2. */int			NetNumber)	/* Net number */{	/* Internet Header Version found in IP header. */	unsigned InternetHeaderVersion;	/* Length of the IP header as found in IP header. */	unsigned IpHeaderLength;	/* Length of IP data portion. */	unsigned IpDataLength;	/* IP header checksum. */	unsigned IpHeaderChecksum;	/* IP header options checksum, if any. */	unsigned IpOptionsChecksum;	/* IP data checksum, i.e. TCP/UDP checksum. */	unsigned IpDataChecksum;	/* Next level protocol identifier found in IP header. */	unsigned NextLevelProtocol;	/* The checksum of the "next level protocol", i.e. TCP or UDP. */	unsigned long NextLevelProtocolChecksum;	/* Pointer to next level protocol statistics structure. */	SKCS_PROTO_STATS *NextLevelProtoStats;	/* Temporary variable. */	unsigned Tmp;	Tmp = *(SK_U8 *)		SKCS_IDX(pIpHeader, SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH);	/* Get the Internet Header Version (IHV). */	/* Note: The IHV is stored in the upper four bits. */	InternetHeaderVersion = Tmp >> 4;	/* Check the Internet Header Version. */	/* Note: We currently only support IP version 4. */	if (InternetHeaderVersion != 4) {	/* IPv4? */		SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX,			("Rx: Unknown Internet Header Version %u.\n",			InternetHeaderVersion));		pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxUnableCts++;		return (SKCS_STATUS_UNKNOWN_IP_VERSION);	}	/* Get the IP header length (IHL). */	/*	 * Note: The IHL is stored in the lower four bits as the number of	 * 4-byte words.	 */	IpHeaderLength = (Tmp & 0xf) * 4;	/* Check the IP header length. */	/* 04-Aug-1998 sw - Really check the IHL? Necessary? */	if (IpHeaderLength < 5*4) {		SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX,			("Rx: Invalid IP Header Length %u.\n", IpHeaderLength));		pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++;		return (SKCS_STATUS_IP_CSUM_ERROR);	}	/* This is an IPv4 frame with a header of valid length. */	/* Get the IP header and data checksum. */	IpDataChecksum = Checksum2;	/*	 * The IP header checksum is calculated as follows:	 *	 *	IpHeaderChecksum = Checksum1 - Checksum2	 */	SKCS_OC_SUB(IpHeaderChecksum, Checksum1, Checksum2);	/* Check if any IP header options. */	if (IpHeaderLength > SKCS_IP_HEADER_SIZE) {		/* Get the IP options checksum. */		IpOptionsChecksum = SkCsCalculateChecksum(			SKCS_IDX(pIpHeader, SKCS_IP_HEADER_SIZE),			IpHeaderLength - SKCS_IP_HEADER_SIZE);		/* Adjust the IP header and IP data checksums. */		SKCS_OC_ADD(IpHeaderChecksum, IpHeaderChecksum, IpOptionsChecksum);		SKCS_OC_SUB(IpDataChecksum, IpDataChecksum, IpOptionsChecksum);	}	/*	 * Check if the IP header checksum is ok.	 *	 * NOTE: We must check the IP header checksum even if the caller just wants	 * us to check upper-layer checksums, because we cannot do any further	 * processing of the packet without a valid IP checksum.	 */	/* Get the next level protocol identifier. */	NextLevelProtocol = *(SK_U8 *)		SKCS_IDX(pIpHeader, SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL);	if (IpHeaderChecksum != 0xFFFF) {		pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++;		/* the NDIS tester wants to know the upper level protocol too */		if (NextLevelProtocol == SKCS_PROTO_ID_TCP) {			return(SKCS_STATUS_IP_CSUM_ERROR_TCP);		}		else if (NextLevelProtocol == SKCS_PROTO_ID_UDP) {			return(SKCS_STATUS_IP_CSUM_ERROR_UDP);		}		return (SKCS_STATUS_IP_CSUM_ERROR);	}	/*	 * Check if this is a TCP or UDP frame and if we should calculate the	 * TCP/UDP pseudo header checksum.	 *	 * Also clear all protocol bit flags of protocols not present in the	 * frame.	 */	if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_TCP) != 0 &&		NextLevelProtocol == SKCS_PROTO_ID_TCP) {		/* TCP/IP frame. */		NextLevelProtoStats =			&pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP];	}	else if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_UDP) != 0 &&		NextLevelProtocol == SKCS_PROTO_ID_UDP) {		/* UDP/IP frame. */		NextLevelProtoStats =			&pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP];	}	else {		/*		 * Either not a TCP or UDP frame and/or TCP/UDP processing not		 * specified.		 */		return (SKCS_STATUS_IP_CSUM_OK);	}	/* Check if this is an IP fragment. */	/*	 * Note: An IP fragment has a non-zero "Fragment Offset" field and/or	 * the "More Fragments" bit set. Thus, if both the "Fragment Offset"	 * and the "More Fragments" are zero, it is *not* a fragment. We can	 * easily check both at the same time since they are in the same 16-bit	 * word.	 */	if ((*(SK_U16 *)		SKCS_IDX(pIpHeader, SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET) &		~SKCS_IP_DONT_FRAGMENT) != 0) {		/* IP fragment; ignore all other protocols. */		NextLevelProtoStats->RxUnableCts++;		return (SKCS_STATUS_IP_FRAGMENT);	}	/*	 * 08-May-2000 ra	 *	 * From RFC 768 (UDP)	 * If the computed checksum is zero, it is transmitted as all ones (the	 * equivalent in one's complement arithmetic).  An all zero transmitted	 * checksum value means that the transmitter generated no checksum (for	 * debugging or for higher level protocols that don't care).	 */	if (NextLevelProtocol == SKCS_PROTO_ID_UDP &&		*(SK_U16*)SKCS_IDX(pIpHeader, IpHeaderLength + 6) == 0x0000) {		NextLevelProtoStats->RxOkCts++;		return (SKCS_STATUS_IP_CSUM_OK_NO_UDP);	}	/*	 * Calculate the TCP/UDP checksum.	 */	/* Get total length of IP header and data. */	IpDataLength =		*(SK_U16 *) SKCS_IDX(pIpHeader, SKCS_OFS_IP_TOTAL_LENGTH);	/* Get length of IP data portion. */	IpDataLength = SKCS_NTOH16(IpDataLength) - IpHeaderLength;	NextLevelProtocolChecksum =		/* Calculate the pseudo header checksum. */		(unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,			SKCS_OFS_IP_SOURCE_ADDRESS + 0) +		(unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,			SKCS_OFS_IP_SOURCE_ADDRESS + 2) +		(unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,			SKCS_OFS_IP_DESTINATION_ADDRESS + 0) +		(unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,			SKCS_OFS_IP_DESTINATION_ADDRESS + 2) +		(unsigned long) SKCS_HTON16(NextLevelProtocol) +		(unsigned long) SKCS_HTON16(IpDataLength) +		/* Add the TCP/UDP header checksum. */		(unsigned long) IpDataChecksum;	/* Add-in any carries. */	SKCS_OC_ADD(NextLevelProtocolChecksum, NextLevelProtocolChecksum, 0);	/* Add-in any new carry. */	SKCS_OC_ADD(NextLevelProtocolChecksum, NextLevelProtocolChecksum, 0);	/* Check if the TCP/UDP checksum is ok. */	if ((unsigned) NextLevelProtocolChecksum == 0xFFFF) {		/* TCP/UDP checksum ok. */		NextLevelProtoStats->RxOkCts++;		return (NextLevelProtocol == SKCS_PROTO_ID_TCP ?			SKCS_STATUS_TCP_CSUM_OK : SKCS_STATUS_UDP_CSUM_OK);	}	/* TCP/UDP checksum error. */	NextLevelProtoStats->RxErrCts++;	return (NextLevelProtocol == SKCS_PROTO_ID_TCP ?		SKCS_STATUS_TCP_CSUM_ERROR : SKCS_STATUS_UDP_CSUM_ERROR);}	/* SkCsGetReceiveInfo */#endif/****************************************************************************** * *	SkCsSetReceiveFlags - set checksum receive flags * * Description: *	Use this function to set the various receive flags. According to the *	protocol flags set by the caller, the start offsets within received *	packets of the two hardware checksums are returned. These offsets must *	be stored in all receive descriptors. * * Arguments: *	pAc - Pointer to adapter context struct. * *	ReceiveFlags - Any combination of SK_PROTO_XXX flags of the protocols *	for which the caller wants checksum information on received frames. * *	pChecksum1Offset - The start offset of the first receive descriptor *	hardware checksum to be calculated for received frames is returned *	here. * *	pChecksum2Offset - The start offset of the second receive descriptor *	hardware checksum to be calculated for received frames is returned *	here. * * Returns: N/A *	Returns the two hardware checksum start offsets. */void SkCsSetReceiveFlags(SK_AC		*pAc,				/* Adapter context struct. */unsigned	ReceiveFlags,		/* New receive flags. */unsigned	*pChecksum1Offset,	/* Offset for hardware checksum 1. */unsigned	*pChecksum2Offset,	/* Offset for hardware checksum 2. */int			NetNumber){	/* Save the receive flags. */	pAc->Csum.ReceiveFlags[NetNumber] = ReceiveFlags;	/* First checksum start offset is the IP header. */	*pChecksum1Offset = SKCS_MAC_HEADER_SIZE;	/*	 * Second checksum start offset is the IP data. Note that this may vary	 * if there are any IP header options in the actual packet.	 */	*pChecksum2Offset = SKCS_MAC_HEADER_SIZE + SKCS_IP_HEADER_SIZE;}	/* SkCsSetReceiveFlags */#ifndef SkCsCalculateChecksum/****************************************************************************** * *	SkCsCalculateChecksum - calculate checksum for specified data * * Description: *	Calculate and return the 16-bit Internet Checksum for the specified *	data. * * Arguments: *	pData - Pointer to data for which the checksum shall be calculated. *	Note: The pointer should be aligned on a 16-bit boundary. * *	Length - Length in bytes of data to checksum. * * Returns: *	The 16-bit Internet Checksum for the specified data. * *	Note: The checksum is calculated in the machine's natural byte order, *	i.e. little vs. big endian. Thus, the resulting checksum is different *	for the same input data on little and big endian machines. * *	However, when written back to the network packet, the byte order is *	always in correct network order. */unsigned SkCsCalculateChecksum(void		*pData,		/* Data to checksum. */unsigned	Length)		/* Length of data. */{	SK_U16 *pU16;		/* Pointer to the data as 16-bit words. */	unsigned long Checksum;	/* Checksum; must be at least 32 bits. */	/* Sum up all 16-bit words. */	pU16 = (SK_U16 *) pData;	for (Checksum = 0; Length > 1; Length -= 2) {		Checksum += *pU16++;	}	/* If this is an odd number of bytes, add-in the last byte. */	if (Length > 0) {#ifdef SK_BIG_ENDIAN		/* Add the last byte as the high byte. */		Checksum += ((unsigned) *(SK_U8 *) pU16) << 8;#else	/* !SK_BIG_ENDIAN */		/* Add the last byte as the low byte. */		Checksum += *(SK_U8 *) pU16;#endif	/* !SK_BIG_ENDIAN */	}	/* Add-in any carries. */	SKCS_OC_ADD(Checksum, Checksum, 0);	/* Add-in any new carry. */	SKCS_OC_ADD(Checksum, Checksum, 0);	/* Note: All bits beyond the 16-bit limit are now zero. */	return ((unsigned) Checksum);}	/* SkCsCalculateChecksum */#endif /* SkCsCalculateChecksum *//****************************************************************************** * *	SkCsEvent - the CSUM event dispatcher * * Description: *	This is the event handler for the CSUM module. * * Arguments: *	pAc - Pointer to adapter context. * *	Ioc - I/O context. * *	Event -	 Event id. * *	Param - Event dependent parameter. * * Returns: *	The 16-bit Internet Checksum for the specified data. * *	Note: The checksum is calculated in the machine's natural byte order, *	i.e. little vs. big endian. Thus, the resulting checksum is different *	for the same input data on little and big endian machines. * *	However, when written back to the network packet, the byte order is *	always in correct network order. */int SkCsEvent(SK_AC		*pAc,	/* Pointer to adapter context. */SK_IOC		Ioc,	/* I/O context. */SK_U32		Event,	/* Event id. */SK_EVPARA	Param)	/* Event dependent parameter. */{	int ProtoIndex;	int	NetNumber;	switch (Event) {	/*	 * Clear protocol statistics.	 *	 * Param - Protocol index, or -1 for all protocols.	 *		 - Net number.	 */	case SK_CSUM_EVENT_CLEAR_PROTO_STATS:		ProtoIndex = (int)Param.Para32[1];		NetNumber = (int)Param.Para32[0];		if (ProtoIndex < 0) {	/* Clear for all protocols. */			if (NetNumber >= 0) {				memset(&pAc->Csum.ProtoStats[NetNumber][0], 0,					sizeof(pAc->Csum.ProtoStats[NetNumber]));			}		}		else {					/* Clear for individual protocol. */			memset(&pAc->Csum.ProtoStats[NetNumber][ProtoIndex], 0,				sizeof(pAc->Csum.ProtoStats[NetNumber][ProtoIndex]));		}		break;	default:		break;	}	return (0);	/* Success. */}	/* SkCsEvent */#endif	/* SK_USE_CSUM */#endif /* CONFIG_SK98 */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲一区在线观看| 亚洲欧美日韩久久精品| 欧美一级理论性理论a| 欧美无砖砖区免费| 欧美午夜视频网站| 欧美人伦禁忌dvd放荡欲情| 欧美日韩国产中文| 欧美顶级少妇做爰| 欧美一区二区性放荡片| 日韩欧美成人激情| 久久精品一二三| 久久精品视频免费| 综合亚洲深深色噜噜狠狠网站| 中文字幕一区免费在线观看| 中文字幕一区二区三区在线观看| 亚洲视频一区在线| 亚洲午夜久久久久| 日韩精品电影在线| 久久精品国产澳门| 国产精品66部| 91丝袜美女网| 欧美日韩你懂得| 欧美一区二区福利视频| 欧美精品一区二区三区蜜桃| 国产欧美日本一区视频| 亚洲视频中文字幕| 午夜精品一区二区三区三上悠亚| 免费在线观看一区二区三区| 韩国精品在线观看| 99久久精品免费观看| 欧美丝袜第三区| 精品国产乱码91久久久久久网站| 国产亚洲视频系列| 亚洲乱码日产精品bd| 日日噜噜夜夜狠狠视频欧美人| 久久福利资源站| 不卡视频一二三四| 欧美日韩国产三级| 久久久久国产精品人| 1024亚洲合集| 日韩制服丝袜av| 国产福利一区二区三区在线视频| av午夜一区麻豆| 9191国产精品| 亚洲国产精品v| 亚洲精品你懂的| 久草中文综合在线| 91女神在线视频| 欧美丝袜自拍制服另类| 日韩免费电影网站| 亚洲另类一区二区| 经典三级视频一区| 色999日韩国产欧美一区二区| 欧美一区二区三区免费观看视频| 国产精品美女一区二区在线观看| 亚洲va欧美va人人爽| 成人精品国产福利| 91精品欧美一区二区三区综合在 | 久久久一区二区三区捆绑**| 亚洲视频中文字幕| 国产福利精品一区| 制服丝袜激情欧洲亚洲| 日韩伦理av电影| 国产精品一级二级三级| 欧美理论片在线| 国产精品三级视频| 日韩国产精品久久| 成人h动漫精品一区二区| 欧美剧情电影在线观看完整版免费励志电影 | 91首页免费视频| 欧美久久久久久久久| 久久久久久久网| 亚洲图片欧美色图| 国产69精品一区二区亚洲孕妇| 欧美日韩国产区一| 中文字幕一区二区不卡| 亚洲成人动漫一区| 99国产精品国产精品毛片| 日韩一区二区不卡| 一区二区三区免费| 床上的激情91.| 精品日韩在线观看| 亚洲综合色噜噜狠狠| 国产综合色在线视频区| 欧美日韩国产综合久久| 国产精品萝li| 激情都市一区二区| 欧美日韩一区二区三区视频| 欧美激情一区二区三区全黄| 国产一区三区三区| 欧美一区二区三区公司| 夜夜爽夜夜爽精品视频| 成人a免费在线看| 精品国产91亚洲一区二区三区婷婷| 亚洲精品国产第一综合99久久 | 青青青爽久久午夜综合久久午夜| 波多野结衣亚洲一区| 久久亚洲二区三区| 日本不卡视频一二三区| 欧美色倩网站大全免费| 久久精品人人做人人综合 | 国产欧美在线观看一区| 美国十次综合导航| 欧美剧在线免费观看网站| 国产丝袜欧美中文另类| 粉嫩av一区二区三区在线播放 | 欧美一区二区视频免费观看| 一区二区高清在线| 色老汉av一区二区三区| 国产精品久久久久久久第一福利 | 欧美日韩精品欧美日韩精品 | 污片在线观看一区二区| 色婷婷久久久久swag精品| 国产精品福利在线播放| 国产毛片精品视频| 久久久久久久久久久99999| 国产自产2019最新不卡| 欧美成人国产一区二区| 美女精品一区二区| 久久久综合视频| 国产美女精品一区二区三区| 久久久三级国产网站| 国产精品性做久久久久久| 26uuu成人网一区二区三区| 久久99热国产| 久久一区二区三区四区| 成人综合日日夜夜| 中文字幕欧美一区| 一本久道久久综合中文字幕| 一区二区成人在线视频| 日本高清成人免费播放| 依依成人精品视频| 欧美视频在线观看一区| 亚洲大片精品永久免费| 精品女同一区二区| 国产成人在线免费| 国产精品国产三级国产| 91女神在线视频| 亚洲va欧美va天堂v国产综合| 538在线一区二区精品国产| 日韩精彩视频在线观看| 国产香蕉久久精品综合网| 顶级嫩模精品视频在线看| 1024成人网色www| 欧日韩精品视频| 奇米色一区二区三区四区| 久久久亚洲国产美女国产盗摄| 国产不卡视频一区二区三区| 亚洲小说欧美激情另类| 日韩一卡二卡三卡国产欧美| 国产激情偷乱视频一区二区三区| 中文字幕一区视频| 337p亚洲精品色噜噜| 国产在线视视频有精品| 最新欧美精品一区二区三区| 欧美日韩一区二区在线视频| 美女网站在线免费欧美精品| 欧美mv和日韩mv的网站| 成人av电影在线| 亚洲午夜在线观看视频在线| 欧美电影精品一区二区| 成人av先锋影音| 天天综合网天天综合色 | 日韩福利电影在线| 国产偷国产偷亚洲高清人白洁| 色婷婷av一区二区三区gif| 天天色 色综合| 国产精品毛片久久久久久| 欧美日韩亚洲国产综合| 国产成人免费视频网站 | 免费国产亚洲视频| 国产精品萝li| 欧美成人官网二区| 欧美午夜精品一区二区三区| 国产一区二区三区最好精华液| 亚洲精品乱码久久久久久 | 精品999久久久| 91在线国产福利| 韩国成人在线视频| 亚洲国产精品一区二区www| 国产清纯美女被跳蛋高潮一区二区久久w| 欧美专区亚洲专区| 成人av资源网站| 紧缚奴在线一区二区三区| 一级做a爱片久久| 国产亚洲美州欧州综合国| 欧美一区二区三区喷汁尤物| 日本精品免费观看高清观看| 国产精品一二三区在线| 免费在线观看一区二区三区| 亚洲精品免费看| 中文字幕不卡在线| 欧美大片一区二区| 欧洲一区在线电影| thepron国产精品| 国内精品在线播放| 久热成人在线视频| 午夜精品免费在线观看| 亚洲精品欧美综合四区| 欧美高清在线视频|