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

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

?? lcs.c

?? 優龍2410linux2.6.8內核源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* *  linux/drivers/s390/net/lcs.c * *  Linux for S/390 Lan Channel Station Network Driver * *  Copyright (C)  1999-2001 IBM Deutschland Entwicklung GmbH, *			     IBM Corporation *    Author(s): Original Code written by *			  DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) *		 Rewritten by *			  Frank Pavlic (pavlic@de.ibm.com) and *		 	  Martin Schwidefsky <schwidefsky@de.ibm.com> * *    $Revision: 1.85 $	 $Date: 2004/08/04 11:05:43 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */#include <linux/module.h>#include <linux/if.h>#include <linux/netdevice.h>#include <linux/etherdevice.h>#include <linux/trdevice.h>#include <linux/fddidevice.h>#include <linux/inetdevice.h>#include <linux/in.h>#include <linux/igmp.h>#include <linux/delay.h>#include <net/arp.h>#include <net/ip.h>#include <asm/debug.h>#include <asm/idals.h>#include <asm/timex.h>#include <linux/device.h>#include <asm/ccwgroup.h>#include "lcs.h"#include "cu3088.h"#if !defined(CONFIG_NET_ETHERNET) && \    !defined(CONFIG_TR) && !defined(CONFIG_FDDI)#error Cannot compile lcs.c without some net devices switched on.#endif/** * initialization string for output */#define VERSION_LCS_C  "$Revision: 1.85 $"static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")";static char debug_buffer[255];/** * Some prototypes. */static void lcs_tasklet(unsigned long);static void lcs_start_kernel_thread(struct lcs_card *card);static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *);/** * Debug Facility Stuff */static debug_info_t *lcs_dbf_setup;static debug_info_t *lcs_dbf_trace;/** *  LCS Debug Facility functions */static voidlcs_unregister_debug_facility(void){	if (lcs_dbf_setup)		debug_unregister(lcs_dbf_setup);	if (lcs_dbf_trace)		debug_unregister(lcs_dbf_trace);}static intlcs_register_debug_facility(void){	lcs_dbf_setup = debug_register("lcs_setup", 1, 1, 8);	lcs_dbf_trace = debug_register("lcs_trace", 1, 2, 8);	if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) {		PRINT_ERR("Not enough memory for debug facility.\n");		lcs_unregister_debug_facility();		return -ENOMEM;	}	debug_register_view(lcs_dbf_setup, &debug_hex_ascii_view);	debug_set_level(lcs_dbf_setup, 2);	debug_register_view(lcs_dbf_trace, &debug_hex_ascii_view);	debug_set_level(lcs_dbf_trace, 2);	return 0;}/** * Allocate io buffers. */static intlcs_alloc_channel(struct lcs_channel *channel){	int cnt;	LCS_DBF_TEXT(2, setup, "ichalloc");	for (cnt = 0; cnt < LCS_NUM_BUFFS; cnt++) {		/* alloc memory fo iobuffer */		channel->iob[cnt].data = (void *)			kmalloc(LCS_IOBUFFERSIZE, GFP_DMA | GFP_KERNEL);		if (channel->iob[cnt].data == NULL)			break;		memset(channel->iob[cnt].data, 0, LCS_IOBUFFERSIZE);		channel->iob[cnt].state = BUF_STATE_EMPTY;	}	if (cnt < LCS_NUM_BUFFS) {		/* Not all io buffers could be allocated. */		LCS_DBF_TEXT(2, setup, "echalloc");		while (cnt-- > 0)			kfree(channel->iob[cnt].data);		return -ENOMEM;	}	return 0;}/** * Free io buffers. */static voidlcs_free_channel(struct lcs_channel *channel){	int cnt;	LCS_DBF_TEXT(2, setup, "ichfree");	for (cnt = 0; cnt < LCS_NUM_BUFFS; cnt++) {		if (channel->iob[cnt].data != NULL)			kfree(channel->iob[cnt].data);		channel->iob[cnt].data = NULL;	}}/* * Cleanup channel. */static voidlcs_cleanup_channel(struct lcs_channel *channel){	LCS_DBF_TEXT(3, setup, "cleanch");	/* Kill write channel tasklets. */	tasklet_kill(&channel->irq_tasklet);	/* Free channel buffers. */	lcs_free_channel(channel);}/** * LCS free memory for card and channels. */static voidlcs_free_card(struct lcs_card *card){	LCS_DBF_TEXT(2, setup, "remcard");	LCS_DBF_HEX(2, setup, &card, sizeof(void*));	kfree(card);}/** * LCS alloc memory for card and channels */static struct lcs_card *lcs_alloc_card(void){	struct lcs_card *card;	int rc;	LCS_DBF_TEXT(2, setup, "alloclcs");	card = kmalloc(sizeof(struct lcs_card), GFP_KERNEL | GFP_DMA);	if (card == NULL)		return NULL;	memset(card, 0, sizeof(struct lcs_card));	card->lan_type = LCS_FRAME_TYPE_AUTO;	card->lancmd_timeout = LCS_LANCMD_TIMEOUT_DEFAULT;	/* Allocate io buffers for the read channel. */	rc = lcs_alloc_channel(&card->read);	if (rc){		LCS_DBF_TEXT(2, setup, "iccwerr");		lcs_free_card(card);		return NULL;	}	/* Allocate io buffers for the write channel. */	rc = lcs_alloc_channel(&card->write);	if (rc) {		LCS_DBF_TEXT(2, setup, "iccwerr");		lcs_cleanup_channel(&card->read);		lcs_free_card(card);		return NULL;	}#ifdef CONFIG_IP_MULTICAST	INIT_LIST_HEAD(&card->ipm_list);#endif	LCS_DBF_HEX(2, setup, &card, sizeof(void*));	return card;}/* * Setup read channel. */static voidlcs_setup_read_ccws(struct lcs_card *card){	int cnt;	LCS_DBF_TEXT(2, setup, "ireadccw");	/* Setup read ccws. */	memset(card->read.ccws, 0, sizeof (struct ccw1) * (LCS_NUM_BUFFS + 1));	for (cnt = 0; cnt < LCS_NUM_BUFFS; cnt++) {		card->read.ccws[cnt].cmd_code = LCS_CCW_READ;		card->read.ccws[cnt].count = LCS_IOBUFFERSIZE;		card->read.ccws[cnt].flags =			CCW_FLAG_CC | CCW_FLAG_SLI | CCW_FLAG_PCI;		/*		 * Note: we have allocated the buffer with GFP_DMA, so		 * we do not need to do set_normalized_cda.		 */		card->read.ccws[cnt].cda =			(__u32) __pa(card->read.iob[cnt].data);		((struct lcs_header *)		 card->read.iob[cnt].data)->offset = LCS_ILLEGAL_OFFSET;		card->read.iob[cnt].callback = lcs_get_frames_cb;		card->read.iob[cnt].state = BUF_STATE_READY;		card->read.iob[cnt].count = LCS_IOBUFFERSIZE;	}	card->read.ccws[0].flags &= ~CCW_FLAG_PCI;	card->read.ccws[LCS_NUM_BUFFS - 1].flags &= ~CCW_FLAG_PCI;	card->read.ccws[LCS_NUM_BUFFS - 1].flags |= CCW_FLAG_SUSPEND;	/* Last ccw is a tic (transfer in channel). */	card->read.ccws[LCS_NUM_BUFFS].cmd_code = LCS_CCW_TRANSFER;	card->read.ccws[LCS_NUM_BUFFS].cda =		(__u32) __pa(card->read.ccws);	/* Setg initial state of the read channel. */	card->read.state = CH_STATE_INIT;	card->read.io_idx = 0;	card->read.buf_idx = 0;}static voidlcs_setup_read(struct lcs_card *card){	LCS_DBF_TEXT(3, setup, "initread");	lcs_setup_read_ccws(card);	/* Initialize read channel tasklet. */	card->read.irq_tasklet.data = (unsigned long) &card->read;	card->read.irq_tasklet.func = lcs_tasklet;	/* Initialize waitqueue. */	init_waitqueue_head(&card->read.wait_q);}/* * Setup write channel. */static voidlcs_setup_write_ccws(struct lcs_card *card){	int cnt;	LCS_DBF_TEXT(3, setup, "iwritccw");	/* Setup write ccws. */	memset(card->write.ccws, 0, sizeof(struct ccw1) * LCS_NUM_BUFFS + 1);	for (cnt = 0; cnt < LCS_NUM_BUFFS; cnt++) {		card->write.ccws[cnt].cmd_code = LCS_CCW_WRITE;		card->write.ccws[cnt].count = 0;		card->write.ccws[cnt].flags =			CCW_FLAG_SUSPEND | CCW_FLAG_CC | CCW_FLAG_SLI;		/*		 * Note: we have allocated the buffer with GFP_DMA, so		 * we do not need to do set_normalized_cda.		 */		card->write.ccws[cnt].cda =			(__u32) __pa(card->write.iob[cnt].data);	}	/* Last ccw is a tic (transfer in channel). */	card->write.ccws[LCS_NUM_BUFFS].cmd_code = LCS_CCW_TRANSFER;	card->write.ccws[LCS_NUM_BUFFS].cda =		(__u32) __pa(card->write.ccws);	/* Set initial state of the write channel. */	card->read.state = CH_STATE_INIT;	card->write.io_idx = 0;	card->write.buf_idx = 0;}static voidlcs_setup_write(struct lcs_card *card){	LCS_DBF_TEXT(3, setup, "initwrit");	lcs_setup_write_ccws(card);	/* Initialize write channel tasklet. */	card->write.irq_tasklet.data = (unsigned long) &card->write;	card->write.irq_tasklet.func = lcs_tasklet;	/* Initialize waitqueue. */	init_waitqueue_head(&card->write.wait_q);}/** * Initialize channels,card and state machines. */static voidlcs_setup_card(struct lcs_card *card){	LCS_DBF_TEXT(2, setup, "initcard");	LCS_DBF_HEX(2, setup, &card, sizeof(void*));	lcs_setup_read(card);	lcs_setup_write(card);	/* Set cards initial state. */	card->state = DEV_STATE_DOWN;	card->tx_buffer = NULL;	card->tx_emitted = 0;	/* Initialize kernel thread task used for LGW commands. */	INIT_WORK(&card->kernel_thread_starter,		  (void *)lcs_start_kernel_thread,card);	card->thread_mask = 0;	spin_lock_init(&card->lock);	spin_lock_init(&card->ipm_lock);#ifdef CONFIG_IP_MULTICAST	INIT_LIST_HEAD(&card->ipm_list);#endif	INIT_LIST_HEAD(&card->lancmd_waiters);}/** * Cleanup channels,card and state machines. */static voidlcs_cleanup_card(struct lcs_card *card){	struct list_head *l, *n;	struct lcs_ipm_list *ipm_list;	LCS_DBF_TEXT(3, setup, "cleancrd");	LCS_DBF_HEX(2,setup,&card,sizeof(void*));#ifdef	CONFIG_IP_MULTICAST	/* Free multicast list. */	list_for_each_safe(l, n, &card->ipm_list) {		ipm_list = list_entry(l, struct lcs_ipm_list, list);		list_del(&ipm_list->list);		kfree(ipm_list);	}#endif	if (card->dev != NULL)		free_netdev(card->dev);	/* Cleanup channels. */	lcs_cleanup_channel(&card->write);	lcs_cleanup_channel(&card->read);}/** * Start channel. */static intlcs_start_channel(struct lcs_channel *channel){	unsigned long flags;	int rc;	LCS_DBF_TEXT_(4,trace,"ssch%s", channel->ccwdev->dev.bus_id);	spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);	rc = ccw_device_start(channel->ccwdev,			      channel->ccws + channel->io_idx, 0, 0,			      DOIO_DENY_PREFETCH | DOIO_ALLOW_SUSPEND);	if (rc == 0)		channel->state = CH_STATE_RUNNING;	spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);	if (rc) {		LCS_DBF_TEXT_(4,trace,"essh%s", channel->ccwdev->dev.bus_id);		PRINT_ERR("Error in starting channel, rc=%d!\n", rc);	}	return rc;}static intlcs_clear_channel(struct lcs_channel *channel){	unsigned long flags;	int rc;	LCS_DBF_TEXT(4,trace,"clearch");	LCS_DBF_TEXT_(4,trace,"%s", channel->ccwdev->dev.bus_id);	spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);	rc = ccw_device_clear(channel->ccwdev, (addr_t) channel);	spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);	if (rc) {		LCS_DBF_TEXT_(4,trace,"ecsc%s", channel->ccwdev->dev.bus_id);		return rc;	}	wait_event(channel->wait_q, (channel->state == CH_STATE_CLEARED));	channel->state = CH_STATE_STOPPED;	return rc;}/** * Stop channel. */static intlcs_stop_channel(struct lcs_channel *channel){	unsigned long flags;	int rc;	if (channel->state == CH_STATE_STOPPED)		return 0;	LCS_DBF_TEXT(4,trace,"haltsch");	LCS_DBF_TEXT_(4,trace,"%s", channel->ccwdev->dev.bus_id);	spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);	rc = ccw_device_halt(channel->ccwdev, (addr_t) channel);	spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);	if (rc) {		LCS_DBF_TEXT_(4,trace,"ehsc%s", channel->ccwdev->dev.bus_id);		return rc;	}	/* Asynchronous halt initialted. Wait for its completion. */	wait_event(channel->wait_q, (channel->state == CH_STATE_HALTED));	lcs_clear_channel(channel);	return 0;}/** * start read and write channel */static intlcs_start_channels(struct lcs_card *card){	int rc;	LCS_DBF_TEXT(2, trace, "chstart");	/* start read channel */	rc = lcs_start_channel(&card->read);	if (rc)		return rc;	/* start write channel */	rc = lcs_start_channel(&card->write);	if (rc)		lcs_stop_channel(&card->read);	return rc;}/** * stop read and write channel */static intlcs_stop_channels(struct lcs_card *card){	LCS_DBF_TEXT(2, trace, "chhalt");	lcs_stop_channel(&card->read);	lcs_stop_channel(&card->write);	return 0;}/** * Get empty buffer. */static struct lcs_buffer *__lcs_get_buffer(struct lcs_channel *channel){	int index;	LCS_DBF_TEXT(5, trace, "_getbuff");	index = channel->io_idx;	do {		if (channel->iob[index].state == BUF_STATE_EMPTY) {			channel->iob[index].state = BUF_STATE_LOCKED;			return channel->iob + index;		}		index = (index + 1) & (LCS_NUM_BUFFS - 1);	} while (index != channel->io_idx);	return NULL;}static struct lcs_buffer *lcs_get_buffer(struct lcs_channel *channel){	struct lcs_buffer *buffer;	unsigned long flags;	LCS_DBF_TEXT(5, trace, "getbuff");	spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);	buffer = __lcs_get_buffer(channel);	spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);	return buffer;}/** * Resume channel program if the channel is suspended. */static int__lcs_resume_channel(struct lcs_channel *channel){	int rc;	if (channel->state != CH_STATE_SUSPENDED)		return 0;	if (channel->ccws[channel->io_idx].flags & CCW_FLAG_SUSPEND)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本韩国欧美在线| 日韩毛片一二三区| 亚洲摸摸操操av| 久久精品国产网站| 欧美亚洲动漫精品| 国产精品女同一区二区三区| 日本vs亚洲vs韩国一区三区二区| 91热门视频在线观看| 久久久亚洲国产美女国产盗摄| 亚洲五码中文字幕| 日本道精品一区二区三区| 久久久精品欧美丰满| 麻豆成人av在线| 欧美自拍偷拍一区| 亚洲乱码中文字幕| 成人av午夜电影| 欧美激情一区二区三区蜜桃视频| 青草国产精品久久久久久| 欧美亚洲综合久久| 亚洲精品成a人| av欧美精品.com| 国产精品视频免费看| 国产一区二三区好的| 精品对白一区国产伦| 蜜桃一区二区三区在线| 在线综合+亚洲+欧美中文字幕| 亚洲高清视频的网址| 欧美视频中文字幕| 亚洲黄色录像片| 日本韩国一区二区三区| 亚洲一区二区在线免费看| 91欧美激情一区二区三区成人| 亚洲三级免费电影| 在线一区二区视频| 亚洲二区视频在线| 欧美老年两性高潮| 麻豆成人久久精品二区三区红 | 亚洲第一主播视频| 欧美性受极品xxxx喷水| 亚洲一区影音先锋| 91精品国产麻豆国产自产在线 | 国产白丝精品91爽爽久久| 久久婷婷久久一区二区三区| 国产精品一级在线| 国产精品成人免费在线| 色88888久久久久久影院按摩| 一级日本不卡的影视| 欧美日韩国产一区| 久久精品国产秦先生| 久久久久国产精品厨房| 99精品热视频| 日精品一区二区| 2023国产一二三区日本精品2022| 国产成人精品一区二区三区四区 | 久久久久久免费毛片精品| 国产91高潮流白浆在线麻豆| 国产欧美精品一区二区三区四区 | 欧美一区二区三区视频在线| 国产一区二区0| 亚洲少妇30p| 欧美日韩mp4| 国产ts人妖一区二区| 国产一区不卡精品| 综合久久久久久| 欧美一区二区三区日韩视频| 国产91丝袜在线播放九色| 亚洲激情中文1区| 精品国产91乱码一区二区三区| 成人性生交大片| 亚洲成人你懂的| 久久精品一区八戒影视| 欧美自拍偷拍一区| 国产成人在线视频免费播放| 五月天久久比比资源色| 亚洲国产成人私人影院tom| 欧美日韩亚洲综合一区 | 中文字幕成人网| 欧美四级电影在线观看| 懂色av一区二区在线播放| 香蕉影视欧美成人| 亚洲欧美在线观看| 91精品国产欧美一区二区| 91在线观看视频| 国产精品一区二区三区四区| 日韩成人午夜电影| 亚洲素人一区二区| 久久嫩草精品久久久久| 欧美精品久久99| 色欧美日韩亚洲| 成人一区二区三区中文字幕| 久久精品av麻豆的观看方式| 亚洲国产一区在线观看| 国产精品午夜久久| 久久久久国产精品厨房| 日韩精品最新网址| 69堂国产成人免费视频| 在线观看日韩精品| 一本久道久久综合中文字幕| 成人午夜视频福利| 精彩视频一区二区| 另类欧美日韩国产在线| 天涯成人国产亚洲精品一区av| 一区二区三区色| 亚洲天堂av一区| 最新热久久免费视频| 国产精品视频在线看| 国产欧美日韩另类一区| 国产亚洲制服色| 国产日韩欧美精品一区| 国产亚洲女人久久久久毛片| 久久久99精品免费观看不卡| 久久亚洲二区三区| 久久综合久久鬼色中文字| 日韩一级免费观看| 精品福利一区二区三区| 久久久久国产精品人| 国产色产综合色产在线视频| 久久久不卡影院| 国产目拍亚洲精品99久久精品| 欧美国产一区视频在线观看| 国产精品福利一区| 亚洲精选视频免费看| 一区二区三区自拍| 视频一区二区三区在线| 久久91精品国产91久久小草| 韩国三级在线一区| 成人免费视频网站在线观看| 972aa.com艺术欧美| 在线观看网站黄不卡| 欧美人牲a欧美精品| 欧美xxx久久| 国产精品国产三级国产有无不卡| 亚洲欧洲一区二区三区| 亚洲.国产.中文慕字在线| 男人的天堂亚洲一区| 国产精品一区2区| 日本韩国欧美一区二区三区| 欧美一级免费大片| 国产视频一区在线播放| 一区二区三区美女| 欧美a级一区二区| 成人一区二区三区视频在线观看| 91黄色免费版| 欧美va亚洲va| 亚洲欧美经典视频| 捆绑调教美女网站视频一区| 成人app在线| 欧美一区二区成人6969| 欧美精彩视频一区二区三区| 亚洲成人精品一区| 国产伦精品一区二区三区免费| 99久久99久久精品免费看蜜桃| 在线不卡一区二区| 亚洲国产精品精华液2区45| 亚洲午夜精品一区二区三区他趣| 老司机精品视频在线| 色拍拍在线精品视频8848| 精品国产乱码久久久久久闺蜜 | 97超碰欧美中文字幕| 7777女厕盗摄久久久| 国产精品免费视频观看| 无码av免费一区二区三区试看 | 国产综合久久久久久鬼色| 91丝袜美腿高跟国产极品老师| 欧美成人精品福利| 亚洲精品国久久99热| 国产69精品久久久久毛片| 欧美一区二区三区在线观看| 亚洲视频资源在线| 国产一区二区成人久久免费影院| 欧美乱妇23p| 亚洲综合免费观看高清在线观看| 国产一区二区三区av电影 | 在线精品视频免费观看| 国产女人18毛片水真多成人如厕 | 亚洲3atv精品一区二区三区| 99热99精品| 国产午夜亚洲精品理论片色戒| 日韩中文字幕不卡| 日本电影欧美片| 国产精品美女久久久久久久网站| 精品无人码麻豆乱码1区2区 | 91蜜桃婷婷狠狠久久综合9色| 日韩女优制服丝袜电影| 石原莉奈一区二区三区在线观看| 一本久久精品一区二区| 国产精品国产三级国产三级人妇| 狠狠色丁香婷婷综合| 欧美一级欧美三级| 日本视频一区二区| 91精品国产综合久久精品麻豆| 亚洲午夜久久久| 欧美综合一区二区三区| 一区二区三区四区av| 一本一道波多野结衣一区二区| 国产精品卡一卡二| 9i看片成人免费高清| 亚洲日本在线天堂| 色综合 综合色| 一区二区三区小说|