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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stallion.c

?? powerpc內(nèi)核mpc8241linux系統(tǒng)下char驅(qū)動程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*****************************************************************************//* *	stallion.c  -- stallion multiport serial driver. * *	Copyright (C) 1996-1999  Stallion Technologies (support@stallion.oz.au). *	Copyright (C) 1994-1996  Greg Ungerer (gerg@stallion.oz.au). * *	This code is loosely based on the Linux serial driver, written by *	Linus Torvalds, Theodore T'so and others. * *	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 of the License, 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/config.h>#include <linux/module.h>#include <linux/malloc.h>#include <linux/interrupt.h>#include <linux/tty_flip.h>#include <linux/serial.h>#include <linux/cd1400.h>#include <linux/sc26198.h>#include <linux/comstats.h>#include <linux/stallion.h>#include <linux/ioport.h>#include <linux/init.h>#include <linux/smp_lock.h>#include <asm/io.h>#include <asm/uaccess.h>#ifdef CONFIG_PCI#include <linux/pci.h>#endif/*****************************************************************************//* *	Define different board types. Use the standard Stallion "assigned" *	board numbers. Boards supported in this driver are abbreviated as *	EIO = EasyIO and ECH = EasyConnection 8/32. */#define	BRD_EASYIO	20#define	BRD_ECH		21#define	BRD_ECHMC	22#define	BRD_ECHPCI	26#define	BRD_ECH64PCI	27#define	BRD_EASYIOPCI	28/* *	Define a configuration structure to hold the board configuration. *	Need to set this up in the code (for now) with the boards that are *	to be configured into the system. This is what needs to be modified *	when adding/removing/modifying boards. Each line entry in the *	stl_brdconf[] array is a board. Each line contains io/irq/memory *	ranges for that board (as well as what type of board it is). *	Some examples: *		{ BRD_EASYIO, 0x2a0, 0, 0, 10, 0 }, *	This line would configure an EasyIO board (4 or 8, no difference), *	at io address 2a0 and irq 10. *	Another example: *		{ BRD_ECH, 0x2a8, 0x280, 0, 12, 0 }, *	This line will configure an EasyConnection 8/32 board at primary io *	address 2a8, secondary io address 280 and irq 12. *	Enter as many lines into this array as you want (only the first 4 *	will actually be used!). Any combination of EasyIO and EasyConnection *	boards can be specified. EasyConnection 8/32 boards can share their *	secondary io addresses between each other. * *	NOTE: there is no need to put any entries in this table for PCI *	boards. They will be found automatically by the driver - provided *	PCI BIOS32 support is compiled into the kernel. */typedef struct {	int		brdtype;	int		ioaddr1;	int		ioaddr2;	unsigned long	memaddr;	int		irq;	int		irqtype;} stlconf_t;static stlconf_t	stl_brdconf[] = {	/*{ BRD_EASYIO, 0x2a0, 0, 0, 10, 0 },*/};static int	stl_nrbrds = sizeof(stl_brdconf) / sizeof(stlconf_t);/*****************************************************************************//* *	Define some important driver characteristics. Device major numbers *	allocated as per Linux Device Registry. */#ifndef	STL_SIOMEMMAJOR#define	STL_SIOMEMMAJOR		28#endif#ifndef	STL_SERIALMAJOR#define	STL_SERIALMAJOR		24#endif#ifndef	STL_CALLOUTMAJOR#define	STL_CALLOUTMAJOR	25#endif#define	STL_DRVTYPSERIAL	1#define	STL_DRVTYPCALLOUT	2/* *	Set the TX buffer size. Bigger is better, but we don't want *	to chew too much memory with buffers! */#define	STL_TXBUFLOW		512#define	STL_TXBUFSIZE		4096/*****************************************************************************//* *	Define our local driver identity first. Set up stuff to deal with *	all the local structures required by a serial tty driver. */static char	*stl_drvtitle = "Stallion Multiport Serial Driver";static char	*stl_drvname = "stallion";static char	*stl_drvversion = "5.5.1";static char	*stl_serialname = "ttyE";static char	*stl_calloutname = "cue";static struct tty_driver	stl_serial;static struct tty_driver	stl_callout;static struct tty_struct	*stl_ttys[STL_MAXDEVS];static struct termios		*stl_termios[STL_MAXDEVS];static struct termios		*stl_termioslocked[STL_MAXDEVS];static int			stl_refcount = 0;/* *	We will need to allocate a temporary write buffer for chars that *	come direct from user space. The problem is that a copy from user *	space might cause a page fault (typically on a system that is *	swapping!). All ports will share one buffer - since if the system *	is already swapping a shared buffer won't make things any worse. */static char			*stl_tmpwritebuf;static struct semaphore		stl_tmpwritesem = MUTEX;/* *	Define a local default termios struct. All ports will be created *	with this termios initially. Basically all it defines is a raw port *	at 9600, 8 data bits, 1 stop bit. */static struct termios		stl_deftermios = {	0,	0,	(B9600 | CS8 | CREAD | HUPCL | CLOCAL),	0,	0,	INIT_C_CC};/* *	Define global stats structures. Not used often, and can be *	re-used for each stats call. */static comstats_t	stl_comstats;static combrd_t		stl_brdstats;static stlbrd_t		stl_dummybrd;static stlport_t	stl_dummyport;/* *	Define global place to put buffer overflow characters. */static char		stl_unwanted[SC26198_RXFIFOSIZE];/* *	Keep track of what interrupts we have requested for us. *	We don't need to request an interrupt twice if it is being *	shared with another Stallion board. */static int	stl_gotintrs[STL_MAXBRDS];static int	stl_numintrs = 0;/*****************************************************************************/static stlbrd_t		*stl_brds[STL_MAXBRDS];/* *	Per board state flags. Used with the state field of the board struct. *	Not really much here! */#define	BRD_FOUND	0x1/* *	Define the port structure istate flags. These set of flags are *	modified at interrupt time - so setting and reseting them needs *	to be atomic. Use the bit clear/setting routines for this. */#define	ASYI_TXBUSY	1#define	ASYI_TXLOW	2#define	ASYI_DCDCHANGE	3#define	ASYI_TXFLOWED	4/* *	Define an array of board names as printable strings. Handy for *	referencing boards when printing trace and stuff. */static char	*stl_brdnames[] = {	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	(char *) NULL,	"EasyIO",	"EC8/32-AT",	"EC8/32-MC",	(char *) NULL,	(char *) NULL,	(char *) NULL,	"EC8/32-PCI",	"EC8/64-PCI",	"EasyIO-PCI",};/*****************************************************************************/#ifdef MODULE/* *	Define some string labels for arguments passed from the module *	load line. These allow for easy board definitions, and easy *	modification of the io, memory and irq resoucres. */static char	*board0[4];static char	*board1[4];static char	*board2[4];static char	*board3[4];static char	**stl_brdsp[] = {	(char **) &board0,	(char **) &board1,	(char **) &board2,	(char **) &board3};/* *	Define a set of common board names, and types. This is used to *	parse any module arguments. */typedef struct stlbrdtype {	char	*name;	int	type;} stlbrdtype_t;static stlbrdtype_t	stl_brdstr[] = {	{ "easyio", BRD_EASYIO },	{ "eio", BRD_EASYIO },	{ "20", BRD_EASYIO },	{ "ec8/32", BRD_ECH },	{ "ec8/32-at", BRD_ECH },	{ "ec8/32-isa", BRD_ECH },	{ "ech", BRD_ECH },	{ "echat", BRD_ECH },	{ "21", BRD_ECH },	{ "ec8/32-mc", BRD_ECHMC },	{ "ec8/32-mca", BRD_ECHMC },	{ "echmc", BRD_ECHMC },	{ "echmca", BRD_ECHMC },	{ "22", BRD_ECHMC },	{ "ec8/32-pc", BRD_ECHPCI },	{ "ec8/32-pci", BRD_ECHPCI },	{ "26", BRD_ECHPCI },	{ "ec8/64-pc", BRD_ECH64PCI },	{ "ec8/64-pci", BRD_ECH64PCI },	{ "ech-pci", BRD_ECH64PCI },	{ "echpci", BRD_ECH64PCI },	{ "echpc", BRD_ECH64PCI },	{ "27", BRD_ECH64PCI },	{ "easyio-pc", BRD_EASYIOPCI },	{ "easyio-pci", BRD_EASYIOPCI },	{ "eio-pci", BRD_EASYIOPCI },	{ "eiopci", BRD_EASYIOPCI },	{ "28", BRD_EASYIOPCI },};/* *	Define the module agruments. */MODULE_AUTHOR("Greg Ungerer");MODULE_DESCRIPTION("Stallion Multiport Serial Driver");MODULE_PARM(board0, "1-4s");MODULE_PARM_DESC(board0, "Board 0 config -> name[,ioaddr[,ioaddr2][,irq]]");MODULE_PARM(board1, "1-4s");MODULE_PARM_DESC(board1, "Board 1 config -> name[,ioaddr[,ioaddr2][,irq]]");MODULE_PARM(board2, "1-4s");MODULE_PARM_DESC(board2, "Board 2 config -> name[,ioaddr[,ioaddr2][,irq]]");MODULE_PARM(board3, "1-4s");MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,ioaddr2][,irq]]");#endif/*****************************************************************************//* *	Hardware ID bits for the EasyIO and ECH boards. These defines apply *	to the directly accessible io ports of these boards (not the uarts - *	they are in cd1400.h and sc26198.h). */#define	EIO_8PORTRS	0x04#define	EIO_4PORTRS	0x05#define	EIO_8PORTDI	0x00#define	EIO_8PORTM	0x06#define	EIO_MK3		0x03#define	EIO_IDBITMASK	0x07#define	EIO_BRDMASK	0xf0#define	ID_BRD4		0x10#define	ID_BRD8		0x20#define	ID_BRD16	0x30#define	EIO_INTRPEND	0x08#define	EIO_INTEDGE	0x00#define	EIO_INTLEVEL	0x08#define	EIO_0WS		0x10#define	ECH_ID		0xa0#define	ECH_IDBITMASK	0xe0#define	ECH_BRDENABLE	0x08#define	ECH_BRDDISABLE	0x00#define	ECH_INTENABLE	0x01#define	ECH_INTDISABLE	0x00#define	ECH_INTLEVEL	0x02#define	ECH_INTEDGE	0x00#define	ECH_INTRPEND	0x01#define	ECH_BRDRESET	0x01#define	ECHMC_INTENABLE	0x01#define	ECHMC_BRDRESET	0x02#define	ECH_PNLSTATUS	2#define	ECH_PNL16PORT	0x20#define	ECH_PNLIDMASK	0x07#define	ECH_PNLXPID	0x40#define	ECH_PNLINTRPEND	0x80#define	ECH_ADDR2MASK	0x1e0/* *	Define the vector mapping bits for the programmable interrupt board *	hardware. These bits encode the interrupt for the board to use - it *	is software selectable (except the EIO-8M). */static unsigned char	stl_vecmap[] = {	0xff, 0xff, 0xff, 0x04, 0x06, 0x05, 0xff, 0x07,	0xff, 0xff, 0x00, 0x02, 0x01, 0xff, 0xff, 0x03};/* *	Set up enable and disable macros for the ECH boards. They require *	the secondary io address space to be activated and deactivated. *	This way all ECH boards can share their secondary io region. *	If this is an ECH-PCI board then also need to set the page pointer *	to point to the correct page. */#define	BRDENABLE(brdnr,pagenr)						\	if (stl_brds[(brdnr)]->brdtype == BRD_ECH)			\		outb((stl_brds[(brdnr)]->ioctrlval | ECH_BRDENABLE),	\			stl_brds[(brdnr)]->ioctrl);			\	else if (stl_brds[(brdnr)]->brdtype == BRD_ECHPCI)		\		outb((pagenr), stl_brds[(brdnr)]->ioctrl);#define	BRDDISABLE(brdnr)						\	if (stl_brds[(brdnr)]->brdtype == BRD_ECH)			\		outb((stl_brds[(brdnr)]->ioctrlval | ECH_BRDDISABLE),	\			stl_brds[(brdnr)]->ioctrl);#define	STL_CD1400MAXBAUD	230400#define	STL_SC26198MAXBAUD	460800#define	STL_BAUDBASE		115200#define	STL_CLOSEDELAY		(5 * HZ / 10)/*****************************************************************************/#ifdef CONFIG_PCI/* *	Define the Stallion PCI vendor and device IDs. */#ifndef	PCI_VENDOR_ID_STALLION#define	PCI_VENDOR_ID_STALLION		0x124d#endif#ifndef PCI_DEVICE_ID_ECHPCI832#define	PCI_DEVICE_ID_ECHPCI832		0x0000#endif#ifndef PCI_DEVICE_ID_ECHPCI864#define	PCI_DEVICE_ID_ECHPCI864		0x0002#endif#ifndef PCI_DEVICE_ID_EIOPCI#define	PCI_DEVICE_ID_EIOPCI		0x0003#endif/* *	Define structure to hold all Stallion PCI boards. */typedef struct stlpcibrd {	unsigned short		vendid;	unsigned short		devid;	int			brdtype;} stlpcibrd_t;static stlpcibrd_t	stl_pcibrds[] = {	{ PCI_VENDOR_ID_STALLION, PCI_DEVICE_ID_ECHPCI864, BRD_ECH64PCI },	{ PCI_VENDOR_ID_STALLION, PCI_DEVICE_ID_EIOPCI, BRD_EASYIOPCI },	{ PCI_VENDOR_ID_STALLION, PCI_DEVICE_ID_ECHPCI832, BRD_ECHPCI },	{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87410, BRD_ECHPCI },};static int	stl_nrpcibrds = sizeof(stl_pcibrds) / sizeof(stlpcibrd_t);#endif/*****************************************************************************//* *	Define macros to extract a brd/port number from a minor number. */#define	MINOR2BRD(min)		(((min) & 0xc0) >> 6)#define	MINOR2PORT(min)		((min) & 0x3f)/* *	Define a baud rate table that converts termios baud rate selector *	into the actual baud rate value. All baud rate calculations are *	based on the actual baud rate required. */static unsigned int	stl_baudrates[] = {	0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,	9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600};/* *	Define some handy local macros... */#undef	MIN#define	MIN(a,b)	(((a) <= (b)) ? (a) : (b))#undef	TOLOWER#define	TOLOWER(x)	((((x) >= 'A') && ((x) <= 'Z')) ? ((x) + 0x20) : (x))/*****************************************************************************//* *	Declare all those functions in this driver! */#ifdef MODULEint		init_module(void);void		cleanup_module(void);static void	stl_argbrds(void);static int	stl_parsebrd(stlconf_t *confp, char **argp);static unsigned long stl_atol(char *str);#endifint		stl_init(void);static int	stl_open(struct tty_struct *tty, struct file *filp);static void	stl_close(struct tty_struct *tty, struct file *filp);static int	stl_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91国在线观看| 国产激情91久久精品导航| 色偷偷久久人人79超碰人人澡| 欧美国产日韩a欧美在线观看| 国产一区免费电影| 久久精品在线观看| 成人一区二区三区视频在线观看| 亚洲国产精品激情在线观看| 99久久精品国产网站| 综合在线观看色| 在线观看av不卡| 日韩国产精品大片| 久久久久亚洲蜜桃| av亚洲产国偷v产偷v自拍| 亚洲最大色网站| 欧美一级片在线看| 国产精品一级二级三级| 国产精品美女视频| 在线免费观看日本一区| 视频一区欧美日韩| 久久久91精品国产一区二区三区| 成熟亚洲日本毛茸茸凸凹| 国产福利一区在线观看| 91精品一区二区三区久久久久久| 麻豆精品视频在线| 国产精品美女久久久久久久久久久| 色国产精品一区在线观看| 性做久久久久久| 精品国产91洋老外米糕| jlzzjlzz国产精品久久| 日韩和欧美一区二区三区| 国产亚洲欧洲997久久综合| 色综合久久久久久久久| 精彩视频一区二区三区| 国产精品久久久久久久久果冻传媒 | 欧美日韩国产综合一区二区三区| 精一区二区三区| 亚洲欧洲精品天堂一级| 欧美一区二区三区在线电影| 国产盗摄一区二区三区| 天堂影院一区二区| 亚洲欧洲成人精品av97| 精品国产伦一区二区三区观看方式| 97久久超碰国产精品电影| 免费成人美女在线观看.| 亚洲欧美国产三级| www国产成人免费观看视频 深夜成人网 | 久久美女艺术照精彩视频福利播放| www.性欧美| 精品亚洲免费视频| 亚洲一区在线观看视频| 中文字幕乱码日本亚洲一区二区 | 99久久久久久| 精品一二三四在线| 亚洲成a人在线观看| 亚洲品质自拍视频| 久久久蜜桃精品| 日韩美女在线视频 | 麻豆91在线观看| 亚洲一区二区高清| 中文字幕视频一区二区三区久| 欧美tickling网站挠脚心| 欧美亚洲动漫精品| 色婷婷综合久色| 99久久精品99国产精品| 国产精品亚洲一区二区三区在线 | 成人av动漫在线| 国产精品一区二区在线观看网站| 日本不卡123| 日本视频免费一区| 日韩专区在线视频| 丝袜美腿高跟呻吟高潮一区| 天堂久久一区二区三区| 亚欧色一区w666天堂| 亚洲国产中文字幕在线视频综合| 亚洲色图色小说| 亚洲卡通欧美制服中文| 亚洲视频一区在线| 中文字幕字幕中文在线中不卡视频| 日本一区二区视频在线| 中文字幕欧美区| 亚洲视频免费观看| 亚洲另类春色校园小说| 亚洲欧美激情视频在线观看一区二区三区 | 国产精品综合久久| 国产盗摄女厕一区二区三区| 国产一区二区三区观看| 国产精品资源在线| 国产白丝精品91爽爽久久| 从欧美一区二区三区| 99re在线精品| 91麻豆123| 欧美日本视频在线| 日韩欧美一级精品久久| 日韩精品一区在线观看| 久久久91精品国产一区二区精品| 日本一区二区三区国色天香| 亚洲天堂成人网| 亚洲成人综合视频| 捆绑变态av一区二区三区| 久久精品理论片| 粗大黑人巨茎大战欧美成人| 色婷婷久久久亚洲一区二区三区 | 99久久99久久精品免费看蜜桃| 99久久99久久精品免费观看| 欧美日韩一区三区| 久久综合久久综合久久综合| 欧美国产日韩一二三区| 亚洲狠狠丁香婷婷综合久久久| 丝袜美腿一区二区三区| 国产精品一区二区视频| 91麻豆精品在线观看| 欧美另类一区二区三区| 91香蕉国产在线观看软件| 欧美日韩国产综合视频在线观看 | 成人涩涩免费视频| 欧美日韩国产在线观看| 久久亚洲免费视频| 亚洲黄网站在线观看| 国产一区二区三区免费播放| 色综合久久88色综合天天6| 日韩欧美国产精品| 亚洲久草在线视频| 麻豆精品在线播放| 91美女在线观看| 精品国产一区二区三区四区四| 中文字幕字幕中文在线中不卡视频| 午夜精品久久久久久久| 高清免费成人av| 日韩一区二区三区在线观看| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 成人晚上爱看视频| 在线成人高清不卡| 中文字幕一区在线观看| 狂野欧美性猛交blacked| 99久久伊人久久99| 日韩一区二区三区在线视频| 亚洲男人天堂一区| 粉嫩aⅴ一区二区三区四区五区| 欧美视频一区二| 国产精品欧美一区二区三区| 免费看欧美女人艹b| 色狠狠av一区二区三区| 亚洲国产精品高清| 久久电影网站中文字幕| 欧美精品丝袜中出| 一片黄亚洲嫩模| 成人深夜在线观看| 国产亚洲一区二区三区在线观看| 日韩va欧美va亚洲va久久| 色哟哟一区二区| 国产精品久久久久久久久免费桃花 | 夜夜夜精品看看| 99精品视频在线观看| 久久久久久久久97黄色工厂| 欧美a级一区二区| 欧美日韩精品电影| 一区二区三区成人在线视频| 波多野结衣中文字幕一区| 国产日韩欧美高清在线| 精品一区在线看| 日韩一区二区三区精品视频| 夜夜揉揉日日人人青青一国产精品| 国产不卡视频在线播放| 日韩精品一区二区在线| 麻豆成人在线观看| 欧美xxx久久| 久久99久久久久| 日韩欧美在线123| 蜜桃91丨九色丨蝌蚪91桃色| 日韩一二三区不卡| 日本成人中文字幕| 日韩女优av电影| 久久国产精品色| 久久影音资源网| 丁香婷婷深情五月亚洲| 国产精品欧美一区喷水| 色婷婷综合五月| 婷婷综合五月天| 91精品国产一区二区三区| 麻豆国产欧美日韩综合精品二区| 日韩欧美中文字幕一区| 精品亚洲成a人| 中文字幕精品综合| 色综合天天天天做夜夜夜夜做| 亚洲综合久久久久| 欧美日韩色一区| 久久电影网电视剧免费观看| 欧美精品一区二区三区很污很色的 | 五月天亚洲精品| 日韩精品一区二区三区中文不卡 | 欧洲av一区二区嗯嗯嗯啊| 香港成人在线视频| 337p粉嫩大胆噜噜噜噜噜91av| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 成人黄色免费短视频| 亚洲国产综合在线| 精品国产三级电影在线观看| 9色porny自拍视频一区二区| 天天操天天综合网|