diff options
Diffstat (limited to 'drivers/char/synclink.c')
| -rw-r--r-- | drivers/char/synclink.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 37c8bea8e2b0..ea2d54be4843 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/drivers/char/synclink.c | 2 | * linux/drivers/char/synclink.c |
| 3 | * | 3 | * |
| 4 | * $Id: synclink.c,v 4.28 2004/08/11 19:30:01 paulkf Exp $ | 4 | * $Id: synclink.c,v 4.37 2005/09/07 13:13:19 paulkf Exp $ |
| 5 | * | 5 | * |
| 6 | * Device driver for Microgate SyncLink ISA and PCI | 6 | * Device driver for Microgate SyncLink ISA and PCI |
| 7 | * high speed multiprotocol serial adapters. | 7 | * high speed multiprotocol serial adapters. |
| @@ -141,9 +141,9 @@ static MGSL_PARAMS default_params = { | |||
| 141 | typedef struct _DMABUFFERENTRY | 141 | typedef struct _DMABUFFERENTRY |
| 142 | { | 142 | { |
| 143 | u32 phys_addr; /* 32-bit flat physical address of data buffer */ | 143 | u32 phys_addr; /* 32-bit flat physical address of data buffer */ |
| 144 | u16 count; /* buffer size/data count */ | 144 | volatile u16 count; /* buffer size/data count */ |
| 145 | u16 status; /* Control/status field */ | 145 | volatile u16 status; /* Control/status field */ |
| 146 | u16 rcc; /* character count field */ | 146 | volatile u16 rcc; /* character count field */ |
| 147 | u16 reserved; /* padding required by 16C32 */ | 147 | u16 reserved; /* padding required by 16C32 */ |
| 148 | u32 link; /* 32-bit flat link to next buffer entry */ | 148 | u32 link; /* 32-bit flat link to next buffer entry */ |
| 149 | char *virt_addr; /* virtual address of data buffer */ | 149 | char *virt_addr; /* virtual address of data buffer */ |
| @@ -896,7 +896,7 @@ module_param_array(txdmabufs, int, NULL, 0); | |||
| 896 | module_param_array(txholdbufs, int, NULL, 0); | 896 | module_param_array(txholdbufs, int, NULL, 0); |
| 897 | 897 | ||
| 898 | static char *driver_name = "SyncLink serial driver"; | 898 | static char *driver_name = "SyncLink serial driver"; |
| 899 | static char *driver_version = "$Revision: 4.28 $"; | 899 | static char *driver_version = "$Revision: 4.37 $"; |
| 900 | 900 | ||
| 901 | static int synclink_init_one (struct pci_dev *dev, | 901 | static int synclink_init_one (struct pci_dev *dev, |
| 902 | const struct pci_device_id *ent); | 902 | const struct pci_device_id *ent); |
| @@ -1814,6 +1814,8 @@ static int startup(struct mgsl_struct * info) | |||
| 1814 | 1814 | ||
| 1815 | info->pending_bh = 0; | 1815 | info->pending_bh = 0; |
| 1816 | 1816 | ||
| 1817 | memset(&info->icount, 0, sizeof(info->icount)); | ||
| 1818 | |||
| 1817 | init_timer(&info->tx_timer); | 1819 | init_timer(&info->tx_timer); |
| 1818 | info->tx_timer.data = (unsigned long)info; | 1820 | info->tx_timer.data = (unsigned long)info; |
| 1819 | info->tx_timer.function = mgsl_tx_timeout; | 1821 | info->tx_timer.function = mgsl_tx_timeout; |
| @@ -2470,12 +2472,12 @@ static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount __user * | |||
| 2470 | printk("%s(%d):mgsl_get_params(%s)\n", | 2472 | printk("%s(%d):mgsl_get_params(%s)\n", |
| 2471 | __FILE__,__LINE__, info->device_name); | 2473 | __FILE__,__LINE__, info->device_name); |
| 2472 | 2474 | ||
| 2473 | COPY_TO_USER(err,user_icount, &info->icount, sizeof(struct mgsl_icount)); | 2475 | if (!user_icount) { |
| 2474 | if (err) { | 2476 | memset(&info->icount, 0, sizeof(info->icount)); |
| 2475 | if ( debug_level >= DEBUG_LEVEL_INFO ) | 2477 | } else { |
| 2476 | printk( "%s(%d):mgsl_get_stats(%s) user buffer copy failed\n", | 2478 | COPY_TO_USER(err, user_icount, &info->icount, sizeof(struct mgsl_icount)); |
| 2477 | __FILE__,__LINE__,info->device_name); | 2479 | if (err) |
| 2478 | return -EFAULT; | 2480 | return -EFAULT; |
| 2479 | } | 2481 | } |
| 2480 | 2482 | ||
| 2481 | return 0; | 2483 | return 0; |
| @@ -6149,6 +6151,11 @@ static void usc_set_async_mode( struct mgsl_struct *info ) | |||
| 6149 | usc_OutReg(info, PCR, (u16)((usc_InReg(info, PCR) | BIT13) & ~BIT12)); | 6151 | usc_OutReg(info, PCR, (u16)((usc_InReg(info, PCR) | BIT13) & ~BIT12)); |
| 6150 | } | 6152 | } |
| 6151 | 6153 | ||
| 6154 | if (info->params.loopback) { | ||
| 6155 | info->loopback_bits = 0x300; | ||
| 6156 | outw(0x0300, info->io_base + CCAR); | ||
| 6157 | } | ||
| 6158 | |||
| 6152 | } /* end of usc_set_async_mode() */ | 6159 | } /* end of usc_set_async_mode() */ |
| 6153 | 6160 | ||
| 6154 | /* usc_loopback_frame() | 6161 | /* usc_loopback_frame() |
