projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'mv-merge'
[powerpc.git]
/
drivers
/
char
/
istallion.c
diff --git
a/drivers/char/istallion.c
b/drivers/char/istallion.c
index
ce3bc0d
..
e5247f8
100644
(file)
--- a/
drivers/char/istallion.c
+++ b/
drivers/char/istallion.c
@@
-135,7
+135,7
@@
static stlconf_t stli_brdconf[] = {
/*{ BRD_ECP, 0x2a0, 0, 0xcc000, 0, 0 },*/
};
/*{ BRD_ECP, 0x2a0, 0, 0xcc000, 0, 0 },*/
};
-static int stli_nrbrds =
sizeof(stli_brdconf) / sizeof(stlconf_t
);
+static int stli_nrbrds =
ARRAY_SIZE(stli_brdconf
);
/*
* There is some experimental EISA board detection code in this driver.
/*
* There is some experimental EISA board detection code in this driver.
@@
-181,7
+181,6
@@
static struct tty_driver *stli_serial;
* is already swapping a shared buffer won't make things any worse.
*/
static char *stli_tmpwritebuf;
* is already swapping a shared buffer won't make things any worse.
*/
static char *stli_tmpwritebuf;
-static DECLARE_MUTEX(stli_tmpwritesem);
#define STLI_TXBUFSIZE 4096
#define STLI_TXBUFSIZE 4096
@@
-379,13
+378,13
@@
MODULE_DESCRIPTION("Stallion Intelligent Multiport Serial Driver");
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
-
MODULE_PARM(board0, "1-3s"
);
+
module_param_array(board0, charp, NULL, 0
);
MODULE_PARM_DESC(board0, "Board 0 config -> name[,ioaddr[,memaddr]");
MODULE_PARM_DESC(board0, "Board 0 config -> name[,ioaddr[,memaddr]");
-
MODULE_PARM(board1, "1-3s"
);
+
module_param_array(board1, charp, NULL, 0
);
MODULE_PARM_DESC(board1, "Board 1 config -> name[,ioaddr[,memaddr]");
MODULE_PARM_DESC(board1, "Board 1 config -> name[,ioaddr[,memaddr]");
-
MODULE_PARM(board2, "1-3s"
);
+
module_param_array(board2, charp, NULL, 0
);
MODULE_PARM_DESC(board2, "Board 2 config -> name[,ioaddr[,memaddr]");
MODULE_PARM_DESC(board2, "Board 2 config -> name[,ioaddr[,memaddr]");
-
MODULE_PARM(board3, "1-3s"
);
+
module_param_array(board3, charp, NULL, 0
);
MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,memaddr]");
#endif
MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,memaddr]");
#endif
@@
-406,7
+405,7
@@
static unsigned long stli_eisamemprobeaddrs[] = {
0xff000000, 0xff010000, 0xff020000, 0xff030000,
};
0xff000000, 0xff010000, 0xff020000, 0xff030000,
};
-static int stli_eisamempsize =
sizeof(stli_eisamemprobeaddrs) / sizeof(unsigned long
);
+static int stli_eisamempsize =
ARRAY_SIZE(stli_eisamemprobeaddrs
);
/*
* Define the Stallion PCI vendor and device IDs.
/*
* Define the Stallion PCI vendor and device IDs.
@@
-899,15
+898,13
@@
static void stli_argbrds(void)
{
stlconf_t conf;
stlibrd_t *brdp;
{
stlconf_t conf;
stlibrd_t *brdp;
- int
nrargs,
i;
+ int i;
#ifdef DEBUG
printk("stli_argbrds()\n");
#endif
#ifdef DEBUG
printk("stli_argbrds()\n");
#endif
- nrargs = sizeof(stli_brdsp) / sizeof(char **);
-
- for (i = stli_nrbrds; (i < nrargs); i++) {
+ for (i = stli_nrbrds; i < ARRAY_SIZE(stli_brdsp); i++) {
memset(&conf, 0, sizeof(conf));
if (stli_parsebrd(&conf, stli_brdsp[i]) == 0)
continue;
memset(&conf, 0, sizeof(conf));
if (stli_parsebrd(&conf, stli_brdsp[i]) == 0)
continue;
@@
-967,7
+964,7
@@
static unsigned long stli_atol(char *str)
static int stli_parsebrd(stlconf_t *confp, char **argp)
{
char *sp;
static int stli_parsebrd(stlconf_t *confp, char **argp)
{
char *sp;
- int
nrbrdnames,
i;
+ int i;
#ifdef DEBUG
printk("stli_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp);
#ifdef DEBUG
printk("stli_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp);
@@
-979,14
+976,13
@@
static int stli_parsebrd(stlconf_t *confp, char **argp)
for (sp = argp[0], i = 0; ((*sp != 0) && (i < 25)); sp++, i++)
*sp = TOLOWER(*sp);
for (sp = argp[0], i = 0; ((*sp != 0) && (i < 25)); sp++, i++)
*sp = TOLOWER(*sp);
- nrbrdnames = sizeof(stli_brdstr) / sizeof(stlibrdtype_t);
- for (i = 0; (i < nrbrdnames); i++) {
+ for (i = 0; i < ARRAY_SIZE(stli_brdstr); i++) {
if (strcmp(stli_brdstr[i].name, argp[0]) == 0)
break;
}
if (strcmp(stli_brdstr[i].name, argp[0]) == 0)
break;
}
- if (i
>= nrbrdnames
) {
+ if (i
== ARRAY_SIZE(stli_brdstr)
) {
printk("STALLION: unknown board name, %s?\n", argp[0]);
printk("STALLION: unknown board name, %s?\n", argp[0]);
- return
(0)
;
+ return
0
;
}
confp->brdtype = stli_brdstr[i].type;
}
confp->brdtype = stli_brdstr[i].type;
@@
-2714,17
+2710,13
@@
static void stli_read(stlibrd_t *brdp, stliport_t *portp)
stlen = size - tail;
}
stlen = size - tail;
}
- len = MIN(len, (TTY_FLIPBUF_SIZE - tty->flip.count));
+ len = tty_buffer_request_room(tty, len);
+ /* FIXME : iomap ? */
shbuf = (volatile char *) EBRDGETMEMPTR(brdp, portp->rxoffset);
while (len > 0) {
stlen = MIN(len, stlen);
shbuf = (volatile char *) EBRDGETMEMPTR(brdp, portp->rxoffset);
while (len > 0) {
stlen = MIN(len, stlen);
- memcpy(tty->flip.char_buf_ptr, (char *) (shbuf + tail), stlen);
- memset(tty->flip.flag_buf_ptr, 0, stlen);
- tty->flip.char_buf_ptr += stlen;
- tty->flip.flag_buf_ptr += stlen;
- tty->flip.count += stlen;
-
+ tty_insert_flip_string(tty, (char *)(shbuf + tail), stlen);
len -= stlen;
tail += stlen;
if (tail >= size) {
len -= stlen;
tail += stlen;
if (tail >= size) {
@@
-2909,16
+2901,12
@@
static int stli_hostcmd(stlibrd_t *brdp, stliport_t *portp)
if ((nt.data & DT_RXBREAK) && (portp->rxmarkmsk & BRKINT)) {
if (tty != (struct tty_struct *) NULL) {
if ((nt.data & DT_RXBREAK) && (portp->rxmarkmsk & BRKINT)) {
if (tty != (struct tty_struct *) NULL) {
- if (tty->flip.count < TTY_FLIPBUF_SIZE) {
- tty->flip.count++;
- *tty->flip.flag_buf_ptr++ = TTY_BREAK;
- *tty->flip.char_buf_ptr++ = 0;
- if (portp->flags & ASYNC_SAK) {
- do_SAK(tty);
- EBRDENABLE(brdp);
- }
- tty_schedule_flip(tty);
+ tty_insert_flip_char(tty, 0, TTY_BREAK);
+ if (portp->flags & ASYNC_SAK) {
+ do_SAK(tty);
+ EBRDENABLE(brdp);
}
}
+ tty_schedule_flip(tty);
}
}
}
}
@@
-4943,7
+4931,7
@@
static int stli_portcmdstats(stliport_t *portp)
if (portp->tty != (struct tty_struct *) NULL) {
if (portp->tty->driver_data == portp) {
stli_comstats.ttystate = portp->tty->flags;
if (portp->tty != (struct tty_struct *) NULL) {
if (portp->tty->driver_data == portp) {
stli_comstats.ttystate = portp->tty->flags;
- stli_comstats.rxbuffered =
portp->tty->flip.count
;
+ stli_comstats.rxbuffered =
-1 /*portp->tty->flip.count*/
;
if (portp->tty->termios != (struct termios *) NULL) {
stli_comstats.cflags = portp->tty->termios->c_cflag;
stli_comstats.iflags = portp->tty->termios->c_iflag;
if (portp->tty->termios != (struct termios *) NULL) {
stli_comstats.cflags = portp->tty->termios->c_cflag;
stli_comstats.iflags = portp->tty->termios->c_iflag;