mwavedd.c (a8b3e6f10f08f66ae1072efd087b30966a3654f6) | mwavedd.c (5981d644209c38029df7f91eb8c61bc5952f182b) |
---|---|
1/* 2* 3* mwavedd.c -- mwave device driver 4* 5* 6* Written By: Mike Sullivan IBM Corporation 7* 8* Copyright (C) 1999 IBM Corporation --- 43 unchanged lines hidden (view full) --- 52#include <linux/init.h> 53#include <linux/major.h> 54#include <linux/miscdevice.h> 55#include <linux/device.h> 56#include <linux/serial.h> 57#include <linux/sched.h> 58#include <linux/spinlock.h> 59#include <linux/delay.h> | 1/* 2* 3* mwavedd.c -- mwave device driver 4* 5* 6* Written By: Mike Sullivan IBM Corporation 7* 8* Copyright (C) 1999 IBM Corporation --- 43 unchanged lines hidden (view full) --- 52#include <linux/init.h> 53#include <linux/major.h> 54#include <linux/miscdevice.h> 55#include <linux/device.h> 56#include <linux/serial.h> 57#include <linux/sched.h> 58#include <linux/spinlock.h> 59#include <linux/delay.h> |
60#include <linux/serial_8250.h> |
|
60#include "smapi.h" 61#include "mwavedd.h" 62#include "3780i.h" 63#include "tp3780i.h" 64 65MODULE_DESCRIPTION("3780i Advanced Communications Processor (Mwave) driver"); 66MODULE_AUTHOR("Mike Sullivan and Paul Schroeder"); 67MODULE_LICENSE("GPL"); --- 337 unchanged lines hidden (view full) --- 405 file, buf, count, ppos); 406 407 return -EINVAL; 408} 409 410 411static int register_serial_portandirq(unsigned int port, int irq) 412{ | 61#include "smapi.h" 62#include "mwavedd.h" 63#include "3780i.h" 64#include "tp3780i.h" 65 66MODULE_DESCRIPTION("3780i Advanced Communications Processor (Mwave) driver"); 67MODULE_AUTHOR("Mike Sullivan and Paul Schroeder"); 68MODULE_LICENSE("GPL"); --- 337 unchanged lines hidden (view full) --- 406 file, buf, count, ppos); 407 408 return -EINVAL; 409} 410 411 412static int register_serial_portandirq(unsigned int port, int irq) 413{ |
413 struct serial_struct serial; 414 | 414 struct uart_port uart; 415 |
415 switch ( port ) { 416 case 0x3f8: 417 case 0x2f8: 418 case 0x3e8: 419 case 0x2e8: 420 /* OK */ 421 break; 422 default: --- 14 unchanged lines hidden (view full) --- 437 default: 438 PRINTK_ERROR(KERN_ERR_MWAVE 439 "mwavedd::register_serial_portandirq:" 440 " Error: Illegal irq %x\n", irq ); 441 return -1; 442 } /* switch */ 443 /* irq is okay */ 444 | 416 switch ( port ) { 417 case 0x3f8: 418 case 0x2f8: 419 case 0x3e8: 420 case 0x2e8: 421 /* OK */ 422 break; 423 default: --- 14 unchanged lines hidden (view full) --- 438 default: 439 PRINTK_ERROR(KERN_ERR_MWAVE 440 "mwavedd::register_serial_portandirq:" 441 " Error: Illegal irq %x\n", irq ); 442 return -1; 443 } /* switch */ 444 /* irq is okay */ 445 |
445 memset(&serial, 0, sizeof(serial)); 446 serial.port = port; 447 serial.irq = irq; 448 serial.flags = ASYNC_SHARE_IRQ; 449 450 return register_serial(&serial); | 446 memset(&uart, 0, sizeof(struct uart_port)); 447 448 uart.uartclk = 1843200; 449 uart.iobase = port; 450 uart.irq = irq; 451 uart.iotype = UPIO_PORT; 452 uart.flags = UPF_SHARE_IRQ; 453 return serial8250_register_port(&uart); |
451} 452 453 454static struct file_operations mwave_fops = { 455 .owner = THIS_MODULE, 456 .read = mwave_read, 457 .write = mwave_write, 458 .ioctl = mwave_ioctl, --- 59 unchanged lines hidden (view full) --- 518 519 if (pDrvData->device_registered) { 520 device_unregister(&mwave_device); 521 pDrvData->device_registered = FALSE; 522 } 523#endif 524 525 if ( pDrvData->sLine >= 0 ) { | 454} 455 456 457static struct file_operations mwave_fops = { 458 .owner = THIS_MODULE, 459 .read = mwave_read, 460 .write = mwave_write, 461 .ioctl = mwave_ioctl, --- 59 unchanged lines hidden (view full) --- 521 522 if (pDrvData->device_registered) { 523 device_unregister(&mwave_device); 524 pDrvData->device_registered = FALSE; 525 } 526#endif 527 528 if ( pDrvData->sLine >= 0 ) { |
526 unregister_serial(pDrvData->sLine); | 529 serial8250_unregister_port(pDrvData->sLine); |
527 } 528 if (pDrvData->bMwaveDevRegistered) { 529 misc_deregister(&mwave_misc_dev); 530 } 531 if (pDrvData->bDSPEnabled) { 532 tp3780I_DisableDSP(&pDrvData->rBDData); 533 } 534 if (pDrvData->bResourcesClaimed) { --- 140 unchanged lines hidden --- | 530 } 531 if (pDrvData->bMwaveDevRegistered) { 532 misc_deregister(&mwave_misc_dev); 533 } 534 if (pDrvData->bDSPEnabled) { 535 tp3780I_DisableDSP(&pDrvData->rBDData); 536 } 537 if (pDrvData->bResourcesClaimed) { --- 140 unchanged lines hidden --- |