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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? s2io.c

?? Linux Kernel 2.6.9 for OMAP1710
?? C
?? 第 1 頁 / 共 5 頁
字號:
/************************************************************************ * s2io.c: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC * Copyright(c) 2002-2005 S2IO Technologies * This software may be used and distributed according to the terms of * the GNU General Public License (GPL), incorporated herein by reference. * Drivers based on or derived from this code fall under the GPL and must * retain the authorship, copyright and license notice.  This file is not * a complete program and may only be used when the entire operating * system is licensed under the GPL. * See the file COPYING in this distribution for more information. * * Credits: * Jeff Garzik		: For pointing out the improper error condition  *			  check in the s2io_xmit routine and also some  * 			  issues in the Tx watch dog function. Also for *			  patiently answering all those innumerable  *			  questions regaring the 2.6 porting issues. * Stephen Hemminger	: Providing proper 2.6 porting mechanism for some *			  macros available only in 2.6 Kernel. * Francois Romieu	: For pointing out all code part that were  *			  deprecated and also styling related comments. * Grant Grundler	: For helping me get rid of some Architecture  *			  dependent code. * Christopher Hellwig	: Some more 2.6 specific issues in the driver. *			  	 * The module loadable parameters that are supported by the driver and a brief * explaination of all the variables. * ring_num : This can be used to program the number of receive rings used  * in the driver.  					 * frame_len: This is an array of size 8. Using this we can set the maximum  * size of the received frame that can be steered into the corrsponding  * receive ring. * ring_len: This defines the number of descriptors each ring can have. This  * is also an array of size 8. * fifo_num: This defines the number of Tx FIFOs thats used int the driver. * fifo_len: This too is an array of 8. Each element defines the number of  * Tx descriptors that can be associated with each corresponding FIFO. * latency_timer: This input is programmed into the Latency timer register * in PCI Configuration space. ************************************************************************/#include<linux/config.h>#include<linux/module.h>#include<linux/types.h>#include<linux/errno.h>#include<linux/ioport.h>#include<linux/pci.h>#include<linux/kernel.h>#include<linux/netdevice.h>#include<linux/etherdevice.h>#include<linux/skbuff.h>#include<linux/init.h>#include<linux/delay.h>#include<linux/stddef.h>#include<linux/ioctl.h>#include<linux/timex.h>#include<linux/sched.h>#include<linux/ethtool.h>#include<asm/system.h>#include<asm/uaccess.h>#include<linux/version.h>#include<asm/io.h>#include<linux/workqueue.h>/* local include */#include "s2io.h"#include "s2io-regs.h"/* S2io Driver name & version. */static char s2io_driver_name[] = "s2io";static char s2io_driver_version[] = "Version 1.0";#define LINK_IS_UP(val64) (!(val64 & (ADAPTER_STATUS_RMAC_REMOTE_FAULT | \				      ADAPTER_STATUS_RMAC_LOCAL_FAULT)))#define TASKLET_IN_USE test_and_set_bit(0, \				(unsigned long *)(&sp->tasklet_status))#define PANIC	1#define LOW	2static inline int rx_buffer_level(nic_t * sp, int rxb_size, int ring){	int level = 0;	if ((sp->pkt_cnt[ring] - rxb_size) > 128) {		level = LOW;		if (rxb_size < sp->pkt_cnt[ring] / 8)			level = PANIC;	}	return level;}/* Ethtool related variables and Macros. */static char s2io_gstrings[][ETH_GSTRING_LEN] = {	"Register test\t(offline)",	"Eeprom test\t(offline)",	"Link test\t(online)",	"RLDRAM test\t(offline)",	"BIST Test\t(offline)"};static char ethtool_stats_keys[][ETH_GSTRING_LEN] = {	"tmac_frms",	"tmac_data_octets",	"tmac_drop_frms",	"tmac_mcst_frms",	"tmac_bcst_frms",	"tmac_pause_ctrl_frms",	"tmac_any_err_frms",	"tmac_vld_ip_octets",	"tmac_vld_ip",	"tmac_drop_ip",	"tmac_icmp",	"tmac_rst_tcp",	"tmac_tcp",	"tmac_udp",	"rmac_vld_frms",	"rmac_data_octets",	"rmac_fcs_err_frms",	"rmac_drop_frms",	"rmac_vld_mcst_frms",	"rmac_vld_bcst_frms",	"rmac_in_rng_len_err_frms",	"rmac_long_frms",	"rmac_pause_ctrl_frms",	"rmac_discarded_frms",	"rmac_usized_frms",	"rmac_osized_frms",	"rmac_frag_frms",	"rmac_jabber_frms",	"rmac_ip",	"rmac_ip_octets",	"rmac_hdr_err_ip",	"rmac_drop_ip",	"rmac_icmp",	"rmac_tcp",	"rmac_udp",	"rmac_err_drp_udp",	"rmac_pause_cnt",	"rmac_accepted_ip",	"rmac_err_tcp",};#define S2IO_STAT_LEN sizeof(ethtool_stats_keys)/ ETH_GSTRING_LEN#define S2IO_STAT_STRINGS_LEN S2IO_STAT_LEN * ETH_GSTRING_LEN#define S2IO_TEST_LEN	sizeof(s2io_gstrings) / ETH_GSTRING_LEN#define S2IO_STRINGS_LEN	S2IO_TEST_LEN * ETH_GSTRING_LEN/* Constants to be programmed into the Xena's registers to configure * the XAUI. */#define SWITCH_SIGN	0xA5A5A5A5A5A5A5A5ULL#define	END_SIGN	0x0static u64 default_mdio_cfg[] = {	/* Reset PMA PLL */	0xC001010000000000ULL, 0xC0010100000000E0ULL,	0xC0010100008000E4ULL,	/* Remove Reset from PMA PLL */	0xC001010000000000ULL, 0xC0010100000000E0ULL,	0xC0010100000000E4ULL,	END_SIGN};static u64 default_dtx_cfg[] = {	0x8000051500000000ULL, 0x80000515000000E0ULL,	0x80000515D93500E4ULL, 0x8001051500000000ULL,	0x80010515000000E0ULL, 0x80010515001E00E4ULL,	0x8002051500000000ULL, 0x80020515000000E0ULL,	0x80020515F21000E4ULL,	/* Set PADLOOPBACKN */	0x8002051500000000ULL, 0x80020515000000E0ULL,	0x80020515B20000E4ULL, 0x8003051500000000ULL,	0x80030515000000E0ULL, 0x80030515B20000E4ULL,	0x8004051500000000ULL, 0x80040515000000E0ULL,	0x80040515B20000E4ULL, 0x8005051500000000ULL,	0x80050515000000E0ULL, 0x80050515B20000E4ULL,	SWITCH_SIGN,	/* Remove PADLOOPBACKN */	0x8002051500000000ULL, 0x80020515000000E0ULL,	0x80020515F20000E4ULL, 0x8003051500000000ULL,	0x80030515000000E0ULL, 0x80030515F20000E4ULL,	0x8004051500000000ULL, 0x80040515000000E0ULL,	0x80040515F20000E4ULL, 0x8005051500000000ULL,	0x80050515000000E0ULL, 0x80050515F20000E4ULL,	END_SIGN};/* Constants for Fixing the MacAddress problem seen mostly on * Alpha machines. */static u64 fix_mac[] = {	0x0060000000000000ULL, 0x0060600000000000ULL,	0x0040600000000000ULL, 0x0000600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0060600000000000ULL,	0x0020600000000000ULL, 0x0000600000000000ULL,	0x0040600000000000ULL, 0x0060600000000000ULL,	END_SIGN};/* Module Loadable parameters. */static u32 ring_num;static u32 frame_len[MAX_RX_RINGS];static u32 ring_len[MAX_RX_RINGS];static u32 fifo_num;static u32 fifo_len[MAX_TX_FIFOS];static u32 rx_prio;static u32 tx_prio;static u8 latency_timer = 0;/*  * S2IO device table. * This table lists all the devices that this driver supports.  */static struct pci_device_id s2io_tbl[] __devinitdata = {	{PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_WIN,	 PCI_ANY_ID, PCI_ANY_ID},	{PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_UNI,	 PCI_ANY_ID, PCI_ANY_ID},	{0,}};MODULE_DEVICE_TABLE(pci, s2io_tbl);static struct pci_driver s2io_driver = {      .name = "S2IO",      .id_table = s2io_tbl,      .probe = s2io_init_nic,      .remove = __devexit_p(s2io_rem_nic),};/*   *  Input Arguments:  *  Device private variable. *  Return Value:  *  SUCCESS on success and an appropriate -ve value on failure. *  Description:  *  The function allocates the all memory areas shared  *  between the NIC and the driver. This includes Tx descriptors,  *  Rx descriptors and the statistics block. */static int initSharedMem(struct s2io_nic *nic){	u32 size;	void *tmp_v_addr, *tmp_v_addr_next;	dma_addr_t tmp_p_addr, tmp_p_addr_next;	RxD_block_t *pre_rxd_blk = NULL;	int i, j, blk_cnt;	struct net_device *dev = nic->dev;	mac_info_t *mac_control;	struct config_param *config;	mac_control = &nic->mac_control;	config = &nic->config;	/* Allocation and initialization of TXDLs in FIOFs */	size = 0;	for (i = 0; i < config->TxFIFONum; i++) {		size += config->TxCfg[i].FifoLen;	}	if (size > MAX_AVAILABLE_TXDS) {		DBG_PRINT(ERR_DBG, "%s: Total number of Tx FIFOs ",			  dev->name);		DBG_PRINT(ERR_DBG, "exceeds the maximum value ");		DBG_PRINT(ERR_DBG, "that can be used\n");		return FAILURE;	}	size *= (sizeof(TxD_t) * config->MaxTxDs);	mac_control->txd_list_mem = pci_alloc_consistent	    (nic->pdev, size, &mac_control->txd_list_mem_phy);	if (!mac_control->txd_list_mem) {		return -ENOMEM;	}	mac_control->txd_list_mem_sz = size;	tmp_v_addr = mac_control->txd_list_mem;	tmp_p_addr = mac_control->txd_list_mem_phy;	memset(tmp_v_addr, 0, size);	DBG_PRINT(INIT_DBG, "%s:List Mem PHY: 0x%llx\n", dev->name,		  (unsigned long long) tmp_p_addr);	for (i = 0; i < config->TxFIFONum; i++) {		mac_control->txdl_start_phy[i] = tmp_p_addr;		mac_control->txdl_start[i] = (TxD_t *) tmp_v_addr;		mac_control->tx_curr_put_info[i].offset = 0;		mac_control->tx_curr_put_info[i].fifo_len =		    config->TxCfg[i].FifoLen - 1;		mac_control->tx_curr_get_info[i].offset = 0;		mac_control->tx_curr_get_info[i].fifo_len =		    config->TxCfg[i].FifoLen - 1;		tmp_p_addr +=		    (config->TxCfg[i].FifoLen * (sizeof(TxD_t)) *		     config->MaxTxDs);		tmp_v_addr +=		    (config->TxCfg[i].FifoLen * (sizeof(TxD_t)) *		     config->MaxTxDs);	}	/* Allocation and initialization of RXDs in Rings */	size = 0;	for (i = 0; i < config->RxRingNum; i++) {		if (config->RxCfg[i].NumRxd % (MAX_RXDS_PER_BLOCK + 1)) {			DBG_PRINT(ERR_DBG, "%s: RxD count of ", dev->name);			DBG_PRINT(ERR_DBG, "Ring%d is not a multiple of ",				  i);			DBG_PRINT(ERR_DBG, "RxDs per Block");			return FAILURE;		}		size += config->RxCfg[i].NumRxd;		nic->block_count[i] =		    config->RxCfg[i].NumRxd / (MAX_RXDS_PER_BLOCK + 1);		nic->pkt_cnt[i] =		    config->RxCfg[i].NumRxd - nic->block_count[i];	}	size = (size * (sizeof(RxD_t)));	mac_control->rxd_ring_mem_sz = size;	for (i = 0; i < config->RxRingNum; i++) {		mac_control->rx_curr_get_info[i].block_index = 0;		mac_control->rx_curr_get_info[i].offset = 0;		mac_control->rx_curr_get_info[i].ring_len =		    config->RxCfg[i].NumRxd - 1;		mac_control->rx_curr_put_info[i].block_index = 0;		mac_control->rx_curr_put_info[i].offset = 0;		mac_control->rx_curr_put_info[i].ring_len =		    config->RxCfg[i].NumRxd - 1;		blk_cnt =		    config->RxCfg[i].NumRxd / (MAX_RXDS_PER_BLOCK + 1);		/*  Allocating all the Rx blocks */		for (j = 0; j < blk_cnt; j++) {			size = (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t));			tmp_v_addr = pci_alloc_consistent(nic->pdev, size,							  &tmp_p_addr);			if (tmp_v_addr == NULL) {				/* In case of failure, freeSharedMem() 				 * is called, which should free any 				 * memory that was alloced till the 				 * failure happened.				 */				nic->rx_blocks[i][j].block_virt_addr =				    tmp_v_addr;				return -ENOMEM;			}			memset(tmp_v_addr, 0, size);			nic->rx_blocks[i][j].block_virt_addr = tmp_v_addr;			nic->rx_blocks[i][j].block_dma_addr = tmp_p_addr;		}		/* Interlinking all Rx Blocks */		for (j = 0; j < blk_cnt; j++) {			tmp_v_addr = nic->rx_blocks[i][j].block_virt_addr;			tmp_v_addr_next =			    nic->rx_blocks[i][(j + 1) %					      blk_cnt].block_virt_addr;			tmp_p_addr = nic->rx_blocks[i][j].block_dma_addr;			tmp_p_addr_next =			    nic->rx_blocks[i][(j + 1) %					      blk_cnt].block_dma_addr;			pre_rxd_blk = (RxD_block_t *) tmp_v_addr;			pre_rxd_blk->reserved_1 = END_OF_BLOCK;	/* last RxD 								 * marker.								 */			pre_rxd_blk->reserved_2_pNext_RxD_block =			    (unsigned long) tmp_v_addr_next;			pre_rxd_blk->pNext_RxD_Blk_physical =			    (u64) tmp_p_addr_next;		}	}	/* Allocation and initialization of Statistics block */	size = sizeof(StatInfo_t);	mac_control->stats_mem = pci_alloc_consistent	    (nic->pdev, size, &mac_control->stats_mem_phy);	if (!mac_control->stats_mem) {		/* In case of failure, freeSharedMem() is called, which 		 * should free any memory that was alloced till the 		 * failure happened.		 */		return -ENOMEM;	}	mac_control->stats_mem_sz = size;	tmp_v_addr = mac_control->stats_mem;	mac_control->StatsInfo = (StatInfo_t *) tmp_v_addr;	memset(tmp_v_addr, 0, size);	DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%llx\n", dev->name,		  (unsigned long long) tmp_p_addr);	return SUCCESS;}/*   *  Input Arguments:  *  Device peivate variable. *  Return Value:  *  NONE *  Description:  *  This function is to free all memory locations allocated by *  the initSharedMem() function and return it to the kernel. */static void freeSharedMem(struct s2io_nic *nic){	int i, j, blk_cnt, size;	void *tmp_v_addr;	dma_addr_t tmp_p_addr;	mac_info_t *mac_control;	struct config_param *config;	if (!nic)		return;	mac_control = &nic->mac_control;	config = &nic->config;	if (mac_control->txd_list_mem) {		pci_free_consistent(nic->pdev,				    mac_control->txd_list_mem_sz,				    mac_control->txd_list_mem,				    mac_control->txd_list_mem_phy);	}	size = (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t));	for (i = 0; i < config->RxRingNum; i++) {		blk_cnt = nic->block_count[i];		for (j = 0; j < blk_cnt; j++) {			tmp_v_addr = nic->rx_blocks[i][j].block_virt_addr;			tmp_p_addr = nic->rx_blocks[i][j].block_dma_addr;			if (tmp_v_addr == NULL)				break;			pci_free_consistent(nic->pdev, size,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区在线看| 亚洲丰满少妇videoshd| 九一九一国产精品| 国产69精品久久777的优势| 色综合久久88色综合天天免费| 欧美三级电影网| 亚洲国产精品成人久久综合一区 | 日日噜噜夜夜狠狠视频欧美人| 狠狠久久亚洲欧美| 日本精品视频一区二区| 国产无人区一区二区三区| 日韩黄色片在线观看| 色狠狠色狠狠综合| 国产精品黄色在线观看| 国内精品自线一区二区三区视频| 欧美三级资源在线| 亚洲乱码中文字幕| 成人丝袜18视频在线观看| 2019国产精品| 美日韩一区二区| 欧美福利视频一区| 亚洲已满18点击进入久久| 97成人超碰视| 国产精品福利一区二区三区| 国产麻豆精品95视频| 日韩欧美国产一区在线观看| 天天综合天天做天天综合| 欧美性xxxxxx少妇| 亚洲国产精品久久不卡毛片| 色悠悠亚洲一区二区| 18涩涩午夜精品.www| 成人国产在线观看| 中文字幕电影一区| 成人久久久精品乱码一区二区三区| 久久精品一级爱片| 国产乱码精品一区二区三| 久久中文字幕电影| 国产99久久久精品| 国产精品视频一区二区三区不卡| 成人小视频免费观看| 国产精品免费看片| 97se亚洲国产综合自在线不卡| 中文字幕日韩精品一区| 91在线小视频| 午夜激情一区二区| 欧美不卡视频一区| 国产高清成人在线| 最新国产成人在线观看| 一本久道久久综合中文字幕| 一区二区三区中文在线| 欧美另类一区二区三区| 久久精品国产亚洲一区二区三区 | 国产精品免费久久| 色欧美日韩亚洲| 午夜日韩在线观看| 26uuu亚洲| jiyouzz国产精品久久| 国产精品素人一区二区| 欧美三级一区二区| 久久国产精品99久久人人澡| 久久午夜国产精品| 91蝌蚪porny九色| 日本成人在线网站| 久久久久国产精品人| 99久久综合国产精品| 午夜视黄欧洲亚洲| 国产精品嫩草99a| 777a∨成人精品桃花网| 国模大尺度一区二区三区| 综合久久综合久久| 欧美大片日本大片免费观看| youjizz国产精品| 日本伊人午夜精品| 中文字幕视频一区二区三区久| 欧美浪妇xxxx高跟鞋交| 成人午夜av在线| 男女男精品视频| 自拍偷拍欧美精品| 久久精品一区蜜桃臀影院| 欧美三级韩国三级日本三斤| 懂色中文一区二区在线播放| 亚洲成a人v欧美综合天堂下载| 久久精品视频一区二区三区| 欧美日韩综合色| k8久久久一区二区三区 | 亚洲成人综合在线| 日本一二三四高清不卡| 欧美日韩国产片| 暴力调教一区二区三区| 国产一区二区在线观看免费| 午夜视频在线观看一区| 亚洲视频1区2区| 久久久久久久电影| 91麻豆精品国产91久久久更新时间| 成人午夜激情视频| 国产精品1区2区| 蜜臀久久久久久久| 午夜亚洲国产au精品一区二区| 国产精品麻豆视频| 国产亚洲1区2区3区| 日韩欧美精品在线| 欧美肥大bbwbbw高潮| 色屁屁一区二区| 色88888久久久久久影院按摩| 国产成人精品免费网站| 久久国产精品区| 韩国一区二区三区| 美女一区二区在线观看| 天天色天天操综合| 五月综合激情日本mⅴ| 亚洲精品ww久久久久久p站| 中文字幕一区在线| 中文字幕日韩av资源站| 中文字幕一区二区三区在线观看 | 日韩午夜三级在线| 欧美一区二区三区在线观看| 欧美日本韩国一区二区三区视频 | 亚洲一区日韩精品中文字幕| 国产精品美女久久福利网站| 国产精品三级在线观看| 国产精品伦一区| 亚洲天天做日日做天天谢日日欢| 国产三级精品三级在线专区| 国产欧美日韩另类一区| 国产精品无人区| 亚洲综合色噜噜狠狠| 亚洲在线免费播放| 视频一区中文字幕| 韩日av一区二区| 99热精品一区二区| 欧美日韩免费一区二区三区视频| 欧美丰满美乳xxx高潮www| 精品国产网站在线观看| 国产欧美1区2区3区| 中文字幕一区视频| 亚洲成人你懂的| 激情久久五月天| av福利精品导航| 欧美色欧美亚洲另类二区| 日韩亚洲电影在线| 国产精品伦理在线| 亚洲成av人在线观看| 久久99国产精品免费| 成人免费视频网站在线观看| 在线观看av一区二区| 欧美一区二区性放荡片| 久久久久国产一区二区三区四区| 中文字幕亚洲区| 免费久久99精品国产| 国产成人免费在线视频| 日本韩国视频一区二区| 欧美日韩一区二区三区在线| 精品美女在线观看| 国产精品欧美一区二区三区| 午夜精品一区二区三区电影天堂 | av一区二区三区| 91精品国产欧美一区二区成人| 久久久精品tv| 亚洲大片在线观看| 国产v综合v亚洲欧| 日韩一区二区高清| 亚洲欧美国产高清| 国产一区二区精品在线观看| 日本高清不卡视频| 国产欧美综合在线观看第十页| 性感美女极品91精品| 成人综合婷婷国产精品久久免费| 欧美精品1区2区3区| **欧美大码日韩| 国内精品国产成人国产三级粉色| 色哟哟国产精品| 久久精品夜夜夜夜久久| 美脚の诱脚舐め脚责91| 色偷偷88欧美精品久久久| 国产午夜亚洲精品理论片色戒| 日韩中文字幕不卡| 欧美亚洲动漫精品| 国产精品免费丝袜| 国产成人在线观看| 欧美成va人片在线观看| 日韩影院在线观看| 在线亚洲一区二区| 亚洲少妇最新在线视频| 国产精品一区二区果冻传媒| 欧美日本一道本在线视频| 亚洲欧美区自拍先锋| 成人高清视频免费观看| 中文字幕巨乱亚洲| 国产sm精品调教视频网站| 精品福利视频一区二区三区| 香蕉成人伊视频在线观看| 欧美综合一区二区| 亚洲黄一区二区三区| 色综合久久久网| 亚洲男人电影天堂| 一本到不卡免费一区二区| 亚洲狠狠丁香婷婷综合久久久| 91丝袜呻吟高潮美腿白嫩在线观看| 久久精品视频网| 国产成人日日夜夜|