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

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

?? s2io.c

?? Linux Kernel 2.6.9 for OMAP1710
?? C
?? 第 1 頁 / 共 5 頁
字號:
			/* Updating the statistics block */			nic->stats.tx_packets++;			nic->stats.tx_bytes += skb->len;#if DEBUG_ON			nic->txpkt_bytes += skb->len;			cnt++;#endif			dev_kfree_skb_irq(skb);			offset_info.offset++;			offset_info.offset %= offset_info.fifo_len + 1;			txdlp = mac_control->txdl_start[i] +			    (config->MaxTxDs * offset_info.offset);			mac_control->tx_curr_get_info[i].offset =			    offset_info.offset;		}#if DEBUG_ON		DBG_PRINT(INTR_DBG, "%s: freed %d Tx Pkts\n", dev->name,			  cnt);#endif	}	spin_lock(&nic->tx_lock);	if (netif_queue_stopped(dev))		netif_wake_queue(dev);	spin_unlock(&nic->tx_lock);}/*   *  Input Arguments:  *  device private variable *  Return Value:  *  NONE *  Description:  *  If the interrupt was neither because of Rx packet or Tx  *  complete, this function is called. If the interrupt was to indicate a loss *  of link, the OSM link status handler is invoked for any other alarm  *  interrupt the block that raised the interrupt is displayed and a H/W reset  *  is issued. */static void alarmIntrHandler(struct s2io_nic *nic){	struct net_device *dev = (struct net_device *) nic->dev;	XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0;	register u64 val64 = 0, err_reg = 0;	/* Handling link status change error Intr */	err_reg = readq(&bar0->mac_rmac_err_reg);	if (err_reg & RMAC_LINK_STATE_CHANGE_INT) {		schedule_work(&nic->set_link_task);	}	/* Handling SERR errors by stopping device Xmit queue and forcing 	 * a H/W reset.	 */	val64 = readq(&bar0->serr_source);	if (val64 & SERR_SOURCE_ANY) {		DBG_PRINT(ERR_DBG, "%s: Device indicates ", dev->name);		DBG_PRINT(ERR_DBG, "serious error!!\n");		netif_stop_queue(dev);	}/* Other type of interrupts are not being handled now,  TODO*/}/* *  Input Argument:  *  sp - private member of the device structure, which is a pointer to the  *   	s2io_nic structure. *  Return value: *   SUCCESS on success and FAILURE on failure. *  Description: *   Function that waits for a command to Write into RMAC ADDR DATA registers  *   to be completed and returns either success or error depending on whether  *   the command was complete or not.  */int waitForCmdComplete(nic_t * sp){	XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0;	int ret = FAILURE, cnt = 0;	u64 val64;	while (TRUE) {		val64 =		    RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD		    | RMAC_ADDR_CMD_MEM_OFFSET(0);		writeq(val64, &bar0->rmac_addr_cmd_mem);		val64 = readq(&bar0->rmac_addr_cmd_mem);		if (!val64) {			ret = SUCCESS;			break;		}		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(HZ / 20);		if (cnt++ > 10)			break;	}	return ret;}/* *  Input Argument:  *  sp - private member of the device structure, which is a pointer to the  *   	s2io_nic structure. *  Return value: *   void. *  Description: *   Function to Reset the card. This function then also restores the previously *   saved PCI configuration space registers as the card reset also resets the *   Configration space. */void s2io_reset(nic_t * sp){	XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0;	u64 val64;	u16 subid;	val64 = SW_RESET_ALL;	writeq(val64, &bar0->sw_reset);	/* At this stage, if the PCI write is indeed completed, the 	 * card is reset and so is the PCI Config space of the device. 	 * So a read cannot be issued at this stage on any of the 	 * registers to ensure the write into "sw_reset" register	 * has gone through.	 * Question: Is there any system call that will explicitly force	 * all the write commands still pending on the bus to be pushed	 * through?	 * As of now I'am just giving a 250ms delay and hoping that the	 * PCI write to sw_reset register is done by this time.	 */	set_current_state(TASK_UNINTERRUPTIBLE);	schedule_timeout(HZ / 4);	/* Restore the PCI state saved during initializarion. */	pci_restore_state(sp->pdev, sp->config_space);	s2io_init_pci(sp);	set_current_state(TASK_UNINTERRUPTIBLE);	schedule_timeout(HZ / 4);	/* SXE-002: Configure link and activity LED to turn it off */	subid = sp->pdev->subsystem_device;	if ((subid & 0xFF) >= 0x07) {		val64 = readq(&bar0->gpio_control);		val64 |= 0x0000800000000000ULL;		writeq(val64, &bar0->gpio_control);		val64 = 0x0411040400000000ULL;		writeq(val64, (void *) ((u8 *) bar0 + 0x2700));	}	sp->device_enabled_once = FALSE;}/* *  Input Argument:  *  sp - private member of the device structure, which is a pointer to the  *   	s2io_nic structure. *  Return value: *  SUCCESS on success and FAILURE on failure. *  Description: * Function to set the swapper control on the card correctly depending on the * 'endianness' of the system. */int s2io_set_swapper(nic_t * sp){	struct net_device *dev = sp->dev;	XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0;	u64 val64;/*  Set proper endian settings and verify the same by reading the PIF  *  Feed-back register. */#ifdef  __BIG_ENDIAN/* The device by default set to a big endian format, so a big endian  * driver need not set anything. */	writeq(0xffffffffffffffffULL, &bar0->swapper_ctrl);	val64 = (SWAPPER_CTRL_PIF_R_FE |		 SWAPPER_CTRL_PIF_R_SE |		 SWAPPER_CTRL_PIF_W_FE |		 SWAPPER_CTRL_PIF_W_SE |		 SWAPPER_CTRL_TXP_FE |		 SWAPPER_CTRL_TXP_SE |		 SWAPPER_CTRL_TXD_R_FE |		 SWAPPER_CTRL_TXD_W_FE |		 SWAPPER_CTRL_TXF_R_FE |		 SWAPPER_CTRL_RXD_R_FE |		 SWAPPER_CTRL_RXD_W_FE |		 SWAPPER_CTRL_RXF_W_FE |		 SWAPPER_CTRL_XMSI_FE |		 SWAPPER_CTRL_XMSI_SE |		 SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);	writeq(val64, &bar0->swapper_ctrl);#else/* Initially we enable all bits to make it accessible by the driver, * then we selectively enable only those bits that we want to set. */	writeq(0xffffffffffffffffULL, &bar0->swapper_ctrl);	val64 = (SWAPPER_CTRL_PIF_R_FE |		 SWAPPER_CTRL_PIF_R_SE |		 SWAPPER_CTRL_PIF_W_FE |		 SWAPPER_CTRL_PIF_W_SE |		 SWAPPER_CTRL_TXP_FE |		 SWAPPER_CTRL_TXP_SE |		 SWAPPER_CTRL_TXD_R_FE |		 SWAPPER_CTRL_TXD_R_SE |		 SWAPPER_CTRL_TXD_W_FE |		 SWAPPER_CTRL_TXD_W_SE |		 SWAPPER_CTRL_TXF_R_FE |		 SWAPPER_CTRL_RXD_R_FE |		 SWAPPER_CTRL_RXD_R_SE |		 SWAPPER_CTRL_RXD_W_FE |		 SWAPPER_CTRL_RXD_W_SE |		 SWAPPER_CTRL_RXF_W_FE |		 SWAPPER_CTRL_XMSI_FE |		 SWAPPER_CTRL_XMSI_SE |		 SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);	writeq(val64, &bar0->swapper_ctrl);#endif/*  Verifying if endian settings are accurate by reading a feedback *  register. */	val64 = readq(&bar0->pif_rd_swapper_fb);	if (val64 != 0x0123456789ABCDEFULL) {		/* Endian settings are incorrect, calls for another dekko. */		DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ",			  dev->name);		DBG_PRINT(ERR_DBG, "feedback read %llx\n",			  (unsigned long long) val64);		return FAILURE;	}	return SUCCESS;}/* ********************************************************* * * Functions defined below concern the OS part of the driver * * ********************************************************* *//* *  Input Argument:  *  dev - pointer to the device structure. *  Return value: *  '0' on success and an appropriate (-)ve integer as defined in errno.h *   file on failure. *  Description: *  This function is the open entry point of the driver. It mainly calls a *  function to allocate Rx buffers and inserts them into the buffer *  descriptors and then enables the Rx part of the NIC.  */int s2io_open(struct net_device *dev){	nic_t *sp = dev->priv;	int i, ret = 0, err = 0;	mac_info_t *mac_control;	struct config_param *config;/* Make sure you have link off by default every time Nic is initialized*/	netif_carrier_off(dev);	sp->last_link_state = LINK_DOWN;/*  Initialize the H/W I/O registers */	if (initNic(sp) != 0) {		DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",			  dev->name);		return -ENODEV;	}/*  After proper initialization of H/W, register ISR */	err =	    request_irq((int) sp->irq, s2io_isr, SA_SHIRQ, sp->name, dev);	if (err) {		s2io_reset(sp);		DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",			  dev->name);		return err;	}	if (s2io_set_mac_addr(dev, dev->dev_addr) == FAILURE) {		DBG_PRINT(ERR_DBG, "Set Mac Address Failed\n");		s2io_reset(sp);		return -ENODEV;	}/*  Setting its receive mode */	s2io_set_multicast(dev);/*  Initializing the Rx buffers. For now we are considering only 1 Rx ring * and initializing buffers into 1016 RxDs or 8 Rx blocks */	mac_control = &sp->mac_control;	config = &sp->config;	for (i = 0; i < config->RxRingNum; i++) {		if ((ret = fill_rx_buffers(sp, i))) {			DBG_PRINT(ERR_DBG, "%s: Out of memory in Open\n",				  dev->name);			s2io_reset(sp);			free_irq(dev->irq, dev);			freeRxBuffers(sp);			return -ENOMEM;		}		DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i,			  atomic_read(&sp->rx_bufs_left[i]));	}/*  Enable tasklet for the device */	tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev);/*  Enable Rx Traffic and interrupts on the NIC */	if (startNic(sp)) {		DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name);		tasklet_kill(&sp->task);		s2io_reset(sp);		free_irq(dev->irq, dev);		freeRxBuffers(sp);		return -ENODEV;	}	sp->device_close_flag = FALSE;	/* Device is up and running. */	netif_start_queue(dev);	return 0;}/* *  Input Argument/s:  *  dev - device pointer. *  Return value: *  '0' on success and an appropriate (-)ve integer as defined in errno.h *  file on failure. *  Description: *  This is the stop entry point of the driver. It needs to undo exactly *  whatever was done by the open entry point, thus it's usually referred to *  as the close function. Among other things this function mainly stops the *  Rx side of the NIC and frees all the Rx buffers in the Rx rings. */int s2io_close(struct net_device *dev){	nic_t *sp = dev->priv;	XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0;	register u64 val64 = 0;	u16 cnt = 0;	spin_lock(&sp->isr_lock);	netif_stop_queue(dev);/* disable Tx and Rx traffic on the NIC */	stopNic(sp);	spin_unlock(&sp->isr_lock);/* If the device tasklet is running, wait till its done before killing it */	while (atomic_read(&(sp->tasklet_status))) {		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(HZ / 10);	}	tasklet_kill(&sp->task);/* Check if the device is Quiescent and then Reset the NIC */	do {		val64 = readq(&bar0->adapter_status);		if (verify_xena_quiescence(val64, sp->device_enabled_once)) {			break;		}		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(HZ / 20);		cnt++;		if (cnt == 10) {			DBG_PRINT(ERR_DBG,				  "s2io_close:Device not Quiescent ");			DBG_PRINT(ERR_DBG, "adaper status reads 0x%llx\n",				  (unsigned long long) val64);			break;		}	} while (1);	s2io_reset(sp);/*  Free the Registered IRQ */	free_irq(dev->irq, dev);/* Free all Tx Buffers waiting for transmission */	freeTxBuffers(sp);/*  Free all Rx buffers allocated by host */	freeRxBuffers(sp);	sp->device_close_flag = TRUE;	/* Device is shut down. */	return 0;}/* *  Input Argument/s:  *  skb - the socket buffer containing the Tx data. *  dev - device pointer. *  Return value: *  '0' on success & 1 on failure.  *  NOTE: when device cant queue the pkt, just the trans_start variable will *  not be upadted. *  Description: *  This function is the Tx entry point of the driver. S2IO NIC supports *  certain protocol assist features on Tx side, namely  CSO, S/G, LSO. */int s2io_xmit(struct sk_buff *skb, struct net_device *dev){	nic_t *sp = dev->priv;	u16 off, txd_len, frg_cnt, frg_len, i, queue, off1, queue_len;	register u64 val64;	TxD_t *txdp;	TxFIFO_element_t *tx_fifo;	unsigned long flags;#ifdef NETIF_F_TSO	int mss;#endif	mac_info_t *mac_control;	struct config_param *config;	mac_control = &sp->mac_control;	config = &sp->config;	DBG_PRINT(TX_DBG, "%s: In S2IO Tx routine\n", dev->name);	spin_lock_irqsave(&sp->tx_lock, flags);	queue = 0;	/* Multi FIFO Tx is disabled for now. */	if (!queue && tx_prio) {		u8 x = (skb->data)[5];		queue = x % config->TxFIFONum;	}	off = (u16) mac_control->tx_curr_put_info[queue].offset;	off1 = (u16) mac_control->tx_curr_get_info[queue].offset;	txd_len = mac_control->txdl_len;	txdp = mac_control->txdl_start[queue] + (config->MaxTxDs * off);	queue_len = mac_control->tx_curr_put_info[queue].fifo_len + 1;	/* Avoid "put" pointer going beyond "get" pointer */	if (txdp->Host_Control || (((off + 1) % queue_len) == off1)) {		DBG_PRINT(ERR_DBG, "Error in xmit, No free TXDs.\n");		netif_stop_queue(dev);		dev_kfree_skb(skb);		spin_unlock_irqres

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99久久99| 欧洲av在线精品| 在线亚洲人成电影网站色www| 欧美日韩一级视频| 国产亚洲人成网站| 日韩高清不卡在线| 99久久精品免费看国产| 精品女同一区二区| 日韩高清不卡一区二区三区| 91小视频免费观看| 国产午夜精品久久久久久免费视 | 久久久五月婷婷| 日日夜夜免费精品视频| 色一情一乱一乱一91av| 国产网站一区二区三区| 免费高清不卡av| 欧美视频在线不卡| 亚洲视频免费在线| 高清在线成人网| 久久综合狠狠综合久久综合88| 亚洲午夜激情av| 色婷婷亚洲综合| 亚洲欧美另类在线| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 国产欧美精品一区二区色综合 | 依依成人精品视频| 99国产精品久久久久久久久久| 日韩精品中文字幕在线不卡尤物| 亚洲h动漫在线| 欧美日韩免费一区二区三区| 亚洲精品综合在线| 日本福利一区二区| 一区二区欧美视频| 欧美色图在线观看| 五月婷婷久久综合| 欧美日韩免费观看一区二区三区| 亚洲最大的成人av| 在线91免费看| 麻豆一区二区99久久久久| 欧美一区二区三区免费观看视频| 日韩在线观看一区二区| 欧美一区二区三区在线| 极品少妇xxxx精品少妇偷拍| 欧美精品一区二区三| 国产精品资源网| 亚洲欧美在线观看| 欧美在线观看视频一区二区 | 免费一区二区视频| 精品国产露脸精彩对白| 国产福利91精品一区| 亚洲视频一二三区| 欧美丰满嫩嫩电影| 美腿丝袜亚洲三区| 国产精品久久久久久亚洲毛片 | 欧美一区二区三区在线观看视频 | 99re这里都是精品| 亚洲bt欧美bt精品777| 欧美一区二区免费观在线| 久久成人综合网| 国产精品美女久久久久久久| 一本久久综合亚洲鲁鲁五月天 | 欧美一卡二卡三卡四卡| 国产最新精品免费| 亚洲免费观看在线视频| 日韩一区二区三区四区 | 中文乱码免费一区二区| 91蝌蚪国产九色| 久久不见久久见中文字幕免费| 国产精品美女www爽爽爽| 欧美亚洲一区二区在线观看| 理论电影国产精品| 一区二区三区四区不卡在线| 日韩欧美色综合网站| 一本大道综合伊人精品热热| 男男gaygay亚洲| 1024国产精品| 精品国产乱码久久久久久蜜臀 | 91精品欧美综合在线观看最新| 国产成人亚洲综合a∨婷婷图片| 亚洲永久免费视频| 国产欧美精品一区二区色综合朱莉| 欧美中文字幕久久| 国产成人免费视| 日本免费新一区视频| 亚洲免费在线观看| 中文字幕国产精品一区二区| 欧美一区二区三区免费大片 | 懂色av中文一区二区三区| 亚洲国产视频在线| 国产精品久久久久久久蜜臀| 日韩三级在线观看| 欧美日韩一级片网站| www.66久久| 国产精品99久久久久久宅男| 天天综合色天天综合| 亚洲人成网站在线| 中文在线一区二区| 久久精品男人的天堂| 日韩精品影音先锋| 91精品国产91久久久久久一区二区 | 国产欧美日韩亚州综合| 日韩欧美成人激情| 91精品国产一区二区三区蜜臀| 91蝌蚪porny| 91在线国内视频| 成人av资源在线| 成人美女视频在线看| 国产一区视频导航| 蜜桃精品视频在线观看| 午夜精品成人在线视频| 亚洲一卡二卡三卡四卡五卡| 亚洲欧美日韩在线| 亚洲三级在线观看| 一区二区三区在线高清| 亚洲男同1069视频| 一区二区三区欧美亚洲| 亚洲欧美色图小说| 亚洲最新视频在线观看| 亚洲一区av在线| 肉色丝袜一区二区| 毛片av一区二区| 国产真实乱子伦精品视频| 国产精品一区一区三区| 国产精品一区专区| 成年人国产精品| 色婷婷久久99综合精品jk白丝| 在线免费观看视频一区| 欧美午夜电影一区| 欧美一级午夜免费电影| 精品精品国产高清一毛片一天堂| 精品国产一区二区三区不卡 | 99国产精品久| 欧美亚日韩国产aⅴ精品中极品| 欧美在线观看18| 6080yy午夜一二三区久久| 日韩精品一区二区三区在线播放 | 欧美一区二区三区四区视频| 欧美一级爆毛片| 久久久久一区二区三区四区| 国产日韩欧美不卡在线| 最新高清无码专区| 亚洲成人综合网站| 国产麻豆成人传媒免费观看| 99精品黄色片免费大全| 欧美挠脚心视频网站| 欧美电影免费观看高清完整版在线| 久久精品人人做人人爽人人| 一区二区三区在线免费| 久久av资源站| 91啪亚洲精品| 日韩欧美专区在线| 综合久久国产九一剧情麻豆| 青青草伊人久久| 9色porny自拍视频一区二区| 欧美剧情片在线观看| 中文字幕的久久| 秋霞影院一区二区| 97精品电影院| 久久婷婷色综合| 亚洲激情男女视频| 国产精品中文字幕一区二区三区| 色综合天天综合在线视频| 日韩亚洲国产中文字幕欧美| 亚洲视频免费在线观看| 激情欧美一区二区| 欧美日韩一区二区三区四区五区| 2021久久国产精品不只是精品| 亚洲久本草在线中文字幕| 国产乱子轮精品视频| 欧美日韩亚洲国产综合| 国产精品乱码久久久久久| 麻豆久久一区二区| 欧美色精品在线视频| 中文字幕一区二区三区四区不卡| 精品伊人久久久久7777人| 91福利在线播放| 国产精品蜜臀av| 国产精品伊人色| 精品免费国产一区二区三区四区| 一区二区三区波多野结衣在线观看| 国产成人精品免费| 亚洲精品在线电影| 人人精品人人爱| 欧美日韩一级黄| 亚洲一区二区综合| 91在线国内视频| 国产精品丝袜在线| 国产福利一区二区三区视频| 欧美一区二区在线观看| 天天影视网天天综合色在线播放| 91农村精品一区二区在线| 国产精品视频免费| 国产69精品久久99不卡| 国产欧美va欧美不卡在线| 国产美女一区二区三区| 久久日韩粉嫩一区二区三区| 蜜桃免费网站一区二区三区| 日韩丝袜美女视频| 精品系列免费在线观看| 欧美哺乳videos|