diff options
Diffstat (limited to 'drivers/char/synclinkmp.c')
-rw-r--r-- | drivers/char/synclinkmp.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index ec949e4c070f..6fb165cf8a61 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: synclinkmp.c,v 4.34 2005/03/04 15:07:10 paulkf Exp $ | 2 | * $Id: synclinkmp.c,v 4.38 2005/07/15 13:29:44 paulkf Exp $ |
3 | * | 3 | * |
4 | * Device driver for Microgate SyncLink Multiport | 4 | * Device driver for Microgate SyncLink Multiport |
5 | * high speed multiprotocol serial adapter. | 5 | * high speed multiprotocol serial adapter. |
@@ -55,7 +55,6 @@ | |||
55 | #include <linux/netdevice.h> | 55 | #include <linux/netdevice.h> |
56 | #include <linux/vmalloc.h> | 56 | #include <linux/vmalloc.h> |
57 | #include <linux/init.h> | 57 | #include <linux/init.h> |
58 | #include <asm/serial.h> | ||
59 | #include <linux/delay.h> | 58 | #include <linux/delay.h> |
60 | #include <linux/ioctl.h> | 59 | #include <linux/ioctl.h> |
61 | 60 | ||
@@ -487,7 +486,7 @@ module_param_array(maxframe, int, NULL, 0); | |||
487 | module_param_array(dosyncppp, int, NULL, 0); | 486 | module_param_array(dosyncppp, int, NULL, 0); |
488 | 487 | ||
489 | static char *driver_name = "SyncLink MultiPort driver"; | 488 | static char *driver_name = "SyncLink MultiPort driver"; |
490 | static char *driver_version = "$Revision: 4.34 $"; | 489 | static char *driver_version = "$Revision: 4.38 $"; |
491 | 490 | ||
492 | static int synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent); | 491 | static int synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent); |
493 | static void synclinkmp_remove_one(struct pci_dev *dev); | 492 | static void synclinkmp_remove_one(struct pci_dev *dev); |
@@ -556,7 +555,6 @@ static int set_txidle(SLMP_INFO *info, int idle_mode); | |||
556 | static int tx_enable(SLMP_INFO *info, int enable); | 555 | static int tx_enable(SLMP_INFO *info, int enable); |
557 | static int tx_abort(SLMP_INFO *info); | 556 | static int tx_abort(SLMP_INFO *info); |
558 | static int rx_enable(SLMP_INFO *info, int enable); | 557 | static int rx_enable(SLMP_INFO *info, int enable); |
559 | static int map_status(int signals); | ||
560 | static int modem_input_wait(SLMP_INFO *info,int arg); | 558 | static int modem_input_wait(SLMP_INFO *info,int arg); |
561 | static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr); | 559 | static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr); |
562 | static int tiocmget(struct tty_struct *tty, struct file *file); | 560 | static int tiocmget(struct tty_struct *tty, struct file *file); |
@@ -645,7 +643,7 @@ static unsigned char tx_active_fifo_level = 16; // tx request FIFO activation le | |||
645 | static unsigned char tx_negate_fifo_level = 32; // tx request FIFO negation level in bytes | 643 | static unsigned char tx_negate_fifo_level = 32; // tx request FIFO negation level in bytes |
646 | 644 | ||
647 | static u32 misc_ctrl_value = 0x007e4040; | 645 | static u32 misc_ctrl_value = 0x007e4040; |
648 | static u32 lcr1_brdr_value = 0x00800029; | 646 | static u32 lcr1_brdr_value = 0x00800028; |
649 | 647 | ||
650 | static u32 read_ahead_count = 8; | 648 | static u32 read_ahead_count = 8; |
651 | 649 | ||
@@ -2750,6 +2748,8 @@ static int startup(SLMP_INFO * info) | |||
2750 | 2748 | ||
2751 | info->pending_bh = 0; | 2749 | info->pending_bh = 0; |
2752 | 2750 | ||
2751 | memset(&info->icount, 0, sizeof(info->icount)); | ||
2752 | |||
2753 | /* program hardware for current parameters */ | 2753 | /* program hardware for current parameters */ |
2754 | reset_port(info); | 2754 | reset_port(info); |
2755 | 2755 | ||
@@ -2953,12 +2953,12 @@ static int get_stats(SLMP_INFO * info, struct mgsl_icount __user *user_icount) | |||
2953 | printk("%s(%d):%s get_params()\n", | 2953 | printk("%s(%d):%s get_params()\n", |
2954 | __FILE__,__LINE__, info->device_name); | 2954 | __FILE__,__LINE__, info->device_name); |
2955 | 2955 | ||
2956 | COPY_TO_USER(err,user_icount, &info->icount, sizeof(struct mgsl_icount)); | 2956 | if (!user_icount) { |
2957 | if (err) { | 2957 | memset(&info->icount, 0, sizeof(info->icount)); |
2958 | if ( debug_level >= DEBUG_LEVEL_INFO ) | 2958 | } else { |
2959 | printk( "%s(%d):%s get_stats() user buffer copy failed\n", | 2959 | COPY_TO_USER(err, user_icount, &info->icount, sizeof(struct mgsl_icount)); |
2960 | __FILE__,__LINE__,info->device_name); | 2960 | if (err) |
2961 | return -EFAULT; | 2961 | return -EFAULT; |
2962 | } | 2962 | } |
2963 | 2963 | ||
2964 | return 0; | 2964 | return 0; |
@@ -3109,16 +3109,6 @@ static int rx_enable(SLMP_INFO * info, int enable) | |||
3109 | return 0; | 3109 | return 0; |
3110 | } | 3110 | } |
3111 | 3111 | ||
3112 | static int map_status(int signals) | ||
3113 | { | ||
3114 | /* Map status bits to API event bits */ | ||
3115 | |||
3116 | return ((signals & SerialSignal_DSR) ? MgslEvent_DsrActive : MgslEvent_DsrInactive) + | ||
3117 | ((signals & SerialSignal_CTS) ? MgslEvent_CtsActive : MgslEvent_CtsInactive) + | ||
3118 | ((signals & SerialSignal_DCD) ? MgslEvent_DcdActive : MgslEvent_DcdInactive) + | ||
3119 | ((signals & SerialSignal_RI) ? MgslEvent_RiActive : MgslEvent_RiInactive); | ||
3120 | } | ||
3121 | |||
3122 | /* wait for specified event to occur | 3112 | /* wait for specified event to occur |
3123 | */ | 3113 | */ |
3124 | static int wait_mgsl_event(SLMP_INFO * info, int __user *mask_ptr) | 3114 | static int wait_mgsl_event(SLMP_INFO * info, int __user *mask_ptr) |
@@ -3145,7 +3135,7 @@ static int wait_mgsl_event(SLMP_INFO * info, int __user *mask_ptr) | |||
3145 | 3135 | ||
3146 | /* return immediately if state matches requested events */ | 3136 | /* return immediately if state matches requested events */ |
3147 | get_signals(info); | 3137 | get_signals(info); |
3148 | s = map_status(info->serial_signals); | 3138 | s = info->serial_signals; |
3149 | 3139 | ||
3150 | events = mask & | 3140 | events = mask & |
3151 | ( ((s & SerialSignal_DSR) ? MgslEvent_DsrActive:MgslEvent_DsrInactive) + | 3141 | ( ((s & SerialSignal_DSR) ? MgslEvent_DsrActive:MgslEvent_DsrInactive) + |
@@ -4489,11 +4479,13 @@ void async_mode(SLMP_INFO *info) | |||
4489 | /* MD2, Mode Register 2 | 4479 | /* MD2, Mode Register 2 |
4490 | * | 4480 | * |
4491 | * 07..02 Reserved, must be 0 | 4481 | * 07..02 Reserved, must be 0 |
4492 | * 01..00 CNCT<1..0> Channel connection, 0=normal | 4482 | * 01..00 CNCT<1..0> Channel connection, 00=normal 11=local loopback |
4493 | * | 4483 | * |
4494 | * 0000 0000 | 4484 | * 0000 0000 |
4495 | */ | 4485 | */ |
4496 | RegValue = 0x00; | 4486 | RegValue = 0x00; |
4487 | if (info->params.loopback) | ||
4488 | RegValue |= (BIT1 + BIT0); | ||
4497 | write_reg(info, MD2, RegValue); | 4489 | write_reg(info, MD2, RegValue); |
4498 | 4490 | ||
4499 | /* RXS, Receive clock source | 4491 | /* RXS, Receive clock source |
@@ -4574,9 +4566,6 @@ void async_mode(SLMP_INFO *info) | |||
4574 | write_reg(info, IE2, info->ie2_value); | 4566 | write_reg(info, IE2, info->ie2_value); |
4575 | 4567 | ||
4576 | set_rate( info, info->params.data_rate * 16 ); | 4568 | set_rate( info, info->params.data_rate * 16 ); |
4577 | |||
4578 | if (info->params.loopback) | ||
4579 | enable_loopback(info,1); | ||
4580 | } | 4569 | } |
4581 | 4570 | ||
4582 | /* Program the SCA for HDLC communications. | 4571 | /* Program the SCA for HDLC communications. |