projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] tb0219: convert to the new platform device interface
[powerpc.git]
/
drivers
/
char
/
synclink_gt.c
diff --git
a/drivers/char/synclink_gt.c
b/drivers/char/synclink_gt.c
index
2b9cde9
..
b046390
100644
(file)
--- a/
drivers/char/synclink_gt.c
+++ b/
drivers/char/synclink_gt.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: synclink_gt.c,v 4.2
0 2005/11/08 19:51:55
paulkf Exp $
+ * $Id: synclink_gt.c,v 4.2
2 2006/01/09 20:16:06
paulkf Exp $
*
* Device driver for Microgate SyncLink GT serial adapters.
*
*
* Device driver for Microgate SyncLink GT serial adapters.
*
@@
-75,7
+75,6
@@
#include <linux/workqueue.h>
#include <linux/hdlc.h>
#include <linux/workqueue.h>
#include <linux/hdlc.h>
-#include <asm/serial.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/irq.h>
@@
-93,7
+92,7
@@
* module identification
*/
static char *driver_name = "SyncLink GT";
* module identification
*/
static char *driver_name = "SyncLink GT";
-static char *driver_version = "$Revision: 4.2
0
$";
+static char *driver_version = "$Revision: 4.2
2
$";
static char *tty_driver_name = "synclink_gt";
static char *tty_dev_prefix = "ttySLG";
MODULE_LICENSE("GPL");
static char *tty_driver_name = "synclink_gt";
static char *tty_dev_prefix = "ttySLG";
MODULE_LICENSE("GPL");
@@
-289,7
+288,6
@@
struct slgt_info {
unsigned char __iomem * reg_addr; /* memory mapped registers address */
u32 phys_reg_addr;
unsigned char __iomem * reg_addr; /* memory mapped registers address */
u32 phys_reg_addr;
- u32 reg_offset;
int reg_addr_requested;
MGSL_PARAMS params; /* communications parameters */
int reg_addr_requested;
MGSL_PARAMS params; /* communications parameters */
@@
-308,7
+306,7
@@
struct slgt_info {
int tx_active;
unsigned char signals; /* serial signal states */
int tx_active;
unsigned char signals; /* serial signal states */
-
unsigned
int init_error; /* initialization error */
+ int init_error; /* initialization error */
unsigned char *tx_buf;
int tx_count;
unsigned char *tx_buf;
int tx_count;
@@
-1750,6
+1748,9
@@
static void rx_async(struct slgt_info *info)
unsigned char status;
struct slgt_desc *bufs = info->rbufs;
int i, count;
unsigned char status;
struct slgt_desc *bufs = info->rbufs;
int i, count;
+ int chars = 0;
+ int stat;
+ unsigned char ch;
start = end = info->rbuf_current;
start = end = info->rbuf_current;
@@
-1761,16
+1762,15
@@
static void rx_async(struct slgt_info *info)
DBGDATA(info, p, count, "rx");
for(i=0 ; i < count; i+=2, p+=2) {
DBGDATA(info, p, count, "rx");
for(i=0 ; i < count; i+=2, p+=2) {
- if (tty) {
- if (tty->flip.count >= TTY_FLIPBUF_SIZE)
- tty_flip_buffer_push(tty);
- if (tty->flip.count >= TTY_FLIPBUF_SIZE)
- break;
- *tty->flip.char_buf_ptr = *p;
- *tty->flip.flag_buf_ptr = 0;
+ if (tty && chars) {
+ tty_flip_buffer_push(tty);
+ chars = 0;
}
}
+ ch = *p;
icount->rx++;
icount->rx++;
+ stat = 0;
+
if ((status = *(p+1) & (BIT9 + BIT8))) {
if (status & BIT9)
icount->parity++;
if ((status = *(p+1) & (BIT9 + BIT8))) {
if (status & BIT9)
icount->parity++;
@@
-1779,17
+1779,14
@@
static void rx_async(struct slgt_info *info)
/* discard char if tty control flags say so */
if (status & info->ignore_status_mask)
continue;
/* discard char if tty control flags say so */
if (status & info->ignore_status_mask)
continue;
- if (tty) {
- if (status & BIT9)
- *tty->flip.flag_buf_ptr = TTY_PARITY;
- else if (status & BIT8)
- *tty->flip.flag_buf_ptr = TTY_FRAME;
- }
+ if (status & BIT9)
+ stat = TTY_PARITY;
+ else if (status & BIT8)
+ stat = TTY_FRAME;
}
if (tty) {
}
if (tty) {
- tty->flip.flag_buf_ptr++;
- tty->flip.char_buf_ptr++;
- tty->flip.count++;
+ tty_insert_flip_char(tty, ch, stat);
+ chars++;
}
}
}
}
@@
-1812,7
+1809,7
@@
static void rx_async(struct slgt_info *info)
break;
}
break;
}
- if (tty &&
tty->flip.count
)
+ if (tty &&
chars
)
tty_flip_buffer_push(tty);
}
tty_flip_buffer_push(tty);
}
@@
-2030,7
+2027,7
@@
static void isr_serial(struct slgt_info *info)
if (info->tty) {
if (!(status & info->ignore_status_mask)) {
if (info->read_status_mask & MASK_BREAK) {
if (info->tty) {
if (!(status & info->ignore_status_mask)) {
if (info->read_status_mask & MASK_BREAK) {
-
*info->tty->flip.flag_buf_ptr = TTY_BREAK
;
+
tty_insert_flip_char(info->tty, 0, TTY_BREAK)
;
if (info->flags & ASYNC_SAK)
do_SAK(info->tty);
}
if (info->flags & ASYNC_SAK)
do_SAK(info->tty);
}
@@
-2633,7
+2630,7
@@
static int get_interface(struct slgt_info *info, int __user *if_mode)
static int set_interface(struct slgt_info *info, int if_mode)
{
unsigned long flags;
static int set_interface(struct slgt_info *info, int if_mode)
{
unsigned long flags;
- unsigned
char
val;
+ unsigned
short
val;
DBGINFO(("%s set_interface=%x)\n", info->device_name, if_mode));
spin_lock_irqsave(&info->lock,flags);
DBGINFO(("%s set_interface=%x)\n", info->device_name, if_mode));
spin_lock_irqsave(&info->lock,flags);
@@
-2978,14
+2975,13
@@
static int claim_resources(struct slgt_info *info)
else
info->reg_addr_requested = 1;
else
info->reg_addr_requested = 1;
- info->reg_addr = ioremap(info->phys_reg_addr,
PAGE
_SIZE);
+ info->reg_addr = ioremap(info->phys_reg_addr,
SLGT_REG
_SIZE);
if (!info->reg_addr) {
DBGERR(("%s cant map device registers, addr=%08X\n",
info->device_name, info->phys_reg_addr));
info->init_error = DiagStatus_CantAssignPciResources;
goto errout;
}
if (!info->reg_addr) {
DBGERR(("%s cant map device registers, addr=%08X\n",
info->device_name, info->phys_reg_addr));
info->init_error = DiagStatus_CantAssignPciResources;
goto errout;
}
- info->reg_addr += info->reg_offset;
return 0;
errout:
return 0;
errout:
@@
-3006,7
+3002,7
@@
static void release_resources(struct slgt_info *info)
}
if (info->reg_addr) {
}
if (info->reg_addr) {
- iounmap(info->reg_addr
- info->reg_offset
);
+ iounmap(info->reg_addr);
info->reg_addr = NULL;
}
}
info->reg_addr = NULL;
}
}
@@
-3110,12
+3106,6
@@
static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev
info->irq_level = pdev->irq;
info->phys_reg_addr = pci_resource_start(pdev,0);
info->irq_level = pdev->irq;
info->phys_reg_addr = pci_resource_start(pdev,0);
- /* veremap works on page boundaries
- * map full page starting at the page boundary
- */
- info->reg_offset = info->phys_reg_addr & (PAGE_SIZE-1);
- info->phys_reg_addr &= ~(PAGE_SIZE-1);
-
info->bus_type = MGSL_BUS_TYPE_PCI;
info->irq_flags = SA_SHIRQ;
info->bus_type = MGSL_BUS_TYPE_PCI;
info->irq_flags = SA_SHIRQ;