moxaDriver->name = "ttya"; 
moxaDriver->name = "ttyMX"; 
static int __init moxa_init(void){	int i, numBoards;	struct moxa_str *ch;	printk(KERN_INFO "MOXA Intellio family driver version %s\n", MOXA_VERSION);	moxaDriver = alloc_tty_driver(MAX_PORTS + 1);	if (!moxaDriver)		return -ENOMEM;	init_MUTEX(&moxaBuffSem);	moxaDriver->owner = THIS_MODULE;	moxaDriver->name = "ttya";	moxaDriver->devfs_name = "tts/a";	moxaDriver->major = ttymajor;	moxaDriver->minor_start = 0;	moxaDriver->type = TTY_DRIVER_TYPE_SERIAL;	moxaDriver->subtype = SERIAL_TYPE_NORMAL;	moxaDriver->init_termios = tty_std_termios;	moxaDriver->init_termios.c_iflag = 0;	moxaDriver->init_termios.c_oflag = 0;	moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;	moxaDriver->init_termios.c_lflag = 0;	moxaDriver->flags = TTY_DRIVER_REAL_RAW;	tty_set_operations(moxaDriver, &moxa_ops);	moxaXmitBuff = NULL;	for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) {		ch->type = PORT_16550A;		ch->port = i;		INIT_WORK(&ch->tqueue, do_moxa_softint, ch);		ch->tty = NULL;		ch->close_delay = 5 * HZ / 10;		ch->closing_wait = 30 * HZ;		ch->count = 0;		ch->blocked_open = 0;		ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;		init_waitqueue_head(&ch->open_wait);		init_waitqueue_head(&ch->close_wait);	}	for (i = 0; i < MAX_BOARDS; i++) {		moxa_boards[i].boardType = 0;		moxa_boards[i].numPorts = 0;		moxa_boards[i].baseAddr = 0;		moxa_boards[i].busType = 0;		moxa_boards[i].pciInfo.busNum = 0;		moxa_boards[i].pciInfo.devNum = 0;	}	MoxaDriverInit();	printk("Tty devices major number = %d\n", ttymajor);	if (tty_register_driver(moxaDriver)) {		printk(KERN_ERR "Couldn't install MOXA Smartio family driver !\n");		put_tty_driver(moxaDriver);		return -1;	}	for (i = 0; i < MAX_PORTS; i++) {		init_timer(&moxaEmptyTimer[i]);		moxaEmptyTimer[i].function = check_xmit_empty;		moxaEmptyTimer[i].data = (unsigned long) & moxaChannels[i];		moxaEmptyTimer_on[i] = 0;	}	init_timer(&moxaTimer);	moxaTimer.function = moxa_poll;	moxaTimer.expires = jiffies + (HZ / 50);	moxaTimer_on = 1;	add_timer(&moxaTimer);	/* Find the boards defined in source code */	numBoards = 0;	for (i = 0; i < MAX_BOARDS; i++) {		if ((moxa_isa_boards[i].boardType == MOXA_BOARD_C218_ISA) ||		 (moxa_isa_boards[i].boardType == MOXA_BOARD_C320_ISA)) {			moxa_boards[numBoards].boardType = moxa_isa_boards[i].boardType;			if (moxa_isa_boards[i].boardType == MOXA_BOARD_C218_ISA)				moxa_boards[numBoards].numPorts = 8;			else				moxa_boards[numBoards].numPorts = moxa_isa_boards[i].numPorts;			moxa_boards[numBoards].busType = MOXA_BUS_TYPE_ISA;			moxa_boards[numBoards].baseAddr = moxa_isa_boards[i].baseAddr;			if (verbose)				printk("Board %2d: %s board(baseAddr=%lx)\n",				       numBoards + 1,				       moxa_brdname[moxa_boards[numBoards].boardType - 1],				       moxa_boards[numBoards].baseAddr);			numBoards++;		}	}	/* Find the boards defined form module args. */#ifdef MODULE	for (i = 0; i < MAX_BOARDS; i++) {		if ((type[i] == MOXA_BOARD_C218_ISA) ||		    (type[i] == MOXA_BOARD_C320_ISA)) {			if (verbose)				printk("Board %2d: %s board(baseAddr=%lx)\n",				       numBoards + 1,				       moxa_brdname[type[i] - 1],				       (unsigned long) baseaddr[i]);			if (numBoards >= MAX_BOARDS) {				if (verbose)					printk("More than %d MOXA Intellio family boards found. Board is ignored.", MAX_BOARDS);				continue;			}			moxa_boards[numBoards].boardType = type[i];			if (moxa_isa_boards[i].boardType == MOXA_BOARD_C218_ISA)				moxa_boards[numBoards].numPorts = 8;			else				moxa_boards[numBoards].numPorts = numports[i];			moxa_boards[numBoards].busType = MOXA_BUS_TYPE_ISA;			moxa_boards[numBoards].baseAddr = baseaddr[i];			numBoards++;		}	}#endif	/* Find PCI boards here */#ifdef CONFIG_PCI	{		struct pci_dev *p = NULL;		int n = (sizeof(moxa_pcibrds) / sizeof(moxa_pcibrds[0])) - 1;		i = 0;		while (i < n) {			while ((p = pci_get_device(moxa_pcibrds[i].vendor, moxa_pcibrds[i].device, p))!=NULL)			{				if (pci_enable_device(p))					continue;				if (numBoards >= MAX_BOARDS) {					if (verbose)						printk("More than %d MOXA Intellio family boards found. Board is ignored.", MAX_BOARDS);				} else {					moxa_get_PCI_conf(p, moxa_pcibrds[i].driver_data,						&moxa_boards[numBoards]);					numBoards++;				}			}			i++;		}	}#endif	for (i = 0; i < numBoards; i++) {		moxaBaseAddr[i] = ioremap((unsigned long) moxa_boards[i].baseAddr, 0x4000);	}	return (0);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/9b4e3b13b147e9b737de63188a9ae740eaa8c36d/moxa.c/clean/drivers/char/moxa.c