[PATCH] Char: cyclades, cleanup
- remove cvs rcsid and alter code that uses it. - allow a semicolon after use of macro to not confuse parsers (e.g. indent) by do {} while (0) - JIFFIES_DIFF is simple subtraction, subtract directly - returns cleanup -- do not put values in parenthesis and do not return nothing at the end of void functions - comments are /* */ in C (not //) Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
02f1175c87
commit
096dcfce39
|
@ -1,7 +1,6 @@
|
||||||
#undef BLOCKMOVE
|
#undef BLOCKMOVE
|
||||||
#define Z_WAKE
|
#define Z_WAKE
|
||||||
#undef Z_EXT_CHARS_IN_BUFFER
|
#undef Z_EXT_CHARS_IN_BUFFER
|
||||||
static char rcsid[] = "$Revision: 2.3.2.20 $$Date: 2004/02/25 18:14:16 $";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* linux/drivers/char/cyclades.c
|
* linux/drivers/char/cyclades.c
|
||||||
|
@ -592,6 +591,8 @@ static char rcsid[] = "$Revision: 2.3.2.20 $$Date: 2004/02/25 18:14:16 $";
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define CY_VERSION "2.4"
|
||||||
|
|
||||||
/* If you need to install more boards than NR_CARDS, change the constant
|
/* If you need to install more boards than NR_CARDS, change the constant
|
||||||
in the definition below. No other change is necessary to support up to
|
in the definition below. No other change is necessary to support up to
|
||||||
eight boards. Beyond that you'll have to extend cy_isa_addresses. */
|
eight boards. Beyond that you'll have to extend cy_isa_addresses. */
|
||||||
|
@ -624,9 +625,9 @@ static char rcsid[] = "$Revision: 2.3.2.20 $$Date: 2004/02/25 18:14:16 $";
|
||||||
#undef CY_PCI_DEBUG
|
#undef CY_PCI_DEBUG
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define PAUSE __asm__("nop");
|
#define PAUSE __asm__("nop")
|
||||||
#else
|
#else
|
||||||
#define PAUSE ;
|
#define PAUSE do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -697,8 +698,6 @@ static void cy_send_xchar(struct tty_struct *tty, char ch);
|
||||||
|
|
||||||
#define STD_COM_FLAGS (0)
|
#define STD_COM_FLAGS (0)
|
||||||
|
|
||||||
#define JIFFIES_DIFF(n, j) ((j) - (n))
|
|
||||||
|
|
||||||
static struct tty_driver *cy_serial_driver;
|
static struct tty_driver *cy_serial_driver;
|
||||||
|
|
||||||
#ifdef CONFIG_ISA
|
#ifdef CONFIG_ISA
|
||||||
|
@ -870,26 +869,22 @@ static inline int serial_paranoia_check(struct cyclades_port *info,
|
||||||
char *name, const char *routine)
|
char *name, const char *routine)
|
||||||
{
|
{
|
||||||
#ifdef SERIAL_PARANOIA_CHECK
|
#ifdef SERIAL_PARANOIA_CHECK
|
||||||
static const char *badmagic =
|
|
||||||
"cyc Warning: bad magic number for serial struct (%s) in %s\n";
|
|
||||||
static const char *badinfo =
|
|
||||||
"cyc Warning: null cyclades_port for (%s) in %s\n";
|
|
||||||
static const char *badrange =
|
|
||||||
"cyc Warning: cyclades_port out of range for (%s) in %s\n";
|
|
||||||
|
|
||||||
if (!info) {
|
if (!info) {
|
||||||
printk(badinfo, name, routine);
|
printk("cyc Warning: null cyclades_port for (%s) in %s\n",
|
||||||
|
name, routine);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((long)info < (long)(&cy_port[0]) ||
|
if ((long)info < (long)(&cy_port[0]) ||
|
||||||
(long)(&cy_port[NR_PORTS]) < (long)info) {
|
(long)(&cy_port[NR_PORTS]) < (long)info) {
|
||||||
printk(badrange, name, routine);
|
printk("cyc Warning: cyclades_port out of range for (%s) in "
|
||||||
|
"%s\n", name, routine);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->magic != CYCLADES_MAGIC) {
|
if (info->magic != CYCLADES_MAGIC) {
|
||||||
printk(badmagic, name, routine);
|
printk("cyc Warning: bad magic number for serial struct (%s) "
|
||||||
|
"in %s\n", name, routine);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -991,12 +986,12 @@ static int cyy_issue_cmd(void __iomem * base_addr, u_char cmd, int index)
|
||||||
/* if the CCR never cleared, the previous command
|
/* if the CCR never cleared, the previous command
|
||||||
didn't finish within the "reasonable time" */
|
didn't finish within the "reasonable time" */
|
||||||
if (i == 100)
|
if (i == 100)
|
||||||
return (-1);
|
return -1;
|
||||||
|
|
||||||
/* Issue the new command */
|
/* Issue the new command */
|
||||||
cy_writeb(base_addr + (CyCCR << index), cmd);
|
cy_writeb(base_addr + (CyCCR << index), cmd);
|
||||||
|
|
||||||
return (0);
|
return 0;
|
||||||
} /* cyy_issue_cmd */
|
} /* cyy_issue_cmd */
|
||||||
|
|
||||||
#ifdef CONFIG_ISA
|
#ifdef CONFIG_ISA
|
||||||
|
@ -1511,7 +1506,7 @@ cyz_fetch_msg(struct cyclades_card *cinfo,
|
||||||
|
|
||||||
firm_id = cinfo->base_addr + ID_ADDRESS;
|
firm_id = cinfo->base_addr + ID_ADDRESS;
|
||||||
if (!ISZLOADED(*cinfo)) {
|
if (!ISZLOADED(*cinfo)) {
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) &
|
zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) &
|
||||||
0xfffff);
|
0xfffff);
|
||||||
|
@ -1542,7 +1537,7 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
|
||||||
|
|
||||||
firm_id = cinfo->base_addr + ID_ADDRESS;
|
firm_id = cinfo->base_addr + ID_ADDRESS;
|
||||||
if (!ISZLOADED(*cinfo)) {
|
if (!ISZLOADED(*cinfo)) {
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) &
|
zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) &
|
||||||
0xfffff);
|
0xfffff);
|
||||||
|
@ -1553,7 +1548,7 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
|
||||||
&((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->pci_doorbell;
|
&((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->pci_doorbell;
|
||||||
while ((cy_readl(pci_doorbell) & 0xff) != 0) {
|
while ((cy_readl(pci_doorbell) & 0xff) != 0) {
|
||||||
if (index++ == 1000) {
|
if (index++ == 1000) {
|
||||||
return ((int)(cy_readl(pci_doorbell) & 0xff));
|
return (int)(cy_readl(pci_doorbell) & 0xff);
|
||||||
}
|
}
|
||||||
udelay(50L);
|
udelay(50L);
|
||||||
}
|
}
|
||||||
|
@ -1561,7 +1556,7 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
|
||||||
cy_writel(&board_ctrl->hcmd_param, param);
|
cy_writel(&board_ctrl->hcmd_param, param);
|
||||||
cy_writel(pci_doorbell, (long)cmd);
|
cy_writel(pci_doorbell, (long)cmd);
|
||||||
|
|
||||||
return (0);
|
return 0;
|
||||||
} /* cyz_issue_cmd */
|
} /* cyz_issue_cmd */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1959,8 +1954,6 @@ static void cyz_poll(unsigned long arg)
|
||||||
cyz_timerlist.expires = jiffies + cyz_polling_cycle;
|
cyz_timerlist.expires = jiffies + cyz_polling_cycle;
|
||||||
}
|
}
|
||||||
add_timer(&cyz_timerlist);
|
add_timer(&cyz_timerlist);
|
||||||
|
|
||||||
return;
|
|
||||||
} /* cyz_poll */
|
} /* cyz_poll */
|
||||||
|
|
||||||
#endif /* CONFIG_CYZ_INTR */
|
#endif /* CONFIG_CYZ_INTR */
|
||||||
|
@ -2318,7 +2311,6 @@ static void shutdown(struct cyclades_port *info)
|
||||||
#ifdef CY_DEBUG_OPEN
|
#ifdef CY_DEBUG_OPEN
|
||||||
printk(" cyc shutdown done\n");
|
printk(" cyc shutdown done\n");
|
||||||
#endif
|
#endif
|
||||||
return;
|
|
||||||
} /* shutdown */
|
} /* shutdown */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2349,8 +2341,7 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
|
||||||
if (info->flags & ASYNC_CLOSING) {
|
if (info->flags & ASYNC_CLOSING) {
|
||||||
interruptible_sleep_on(&info->close_wait);
|
interruptible_sleep_on(&info->close_wait);
|
||||||
}
|
}
|
||||||
return ((info->
|
return (info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN: -ERESTARTSYS;
|
||||||
flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2629,8 +2620,7 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
|
||||||
if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) {
|
if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) {
|
||||||
if (info->flags & ASYNC_CLOSING)
|
if (info->flags & ASYNC_CLOSING)
|
||||||
interruptible_sleep_on(&info->close_wait);
|
interruptible_sleep_on(&info->close_wait);
|
||||||
return ((info->
|
return (info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN: -ERESTARTSYS;
|
||||||
flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2727,7 +2717,7 @@ static void cy_wait_until_sent(struct tty_struct *tty, int timeout)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Nothing to do!
|
/* Nothing to do! */
|
||||||
}
|
}
|
||||||
/* Run one more char cycle */
|
/* Run one more char cycle */
|
||||||
msleep_interruptible(jiffies_to_msecs(char_time * 5));
|
msleep_interruptible(jiffies_to_msecs(char_time * 5));
|
||||||
|
@ -2869,7 +2859,6 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CY_UNLOCK(info, flags);
|
CY_UNLOCK(info, flags);
|
||||||
return;
|
|
||||||
} /* cy_close */
|
} /* cy_close */
|
||||||
|
|
||||||
/* This routine gets called when tty_write has put something into
|
/* This routine gets called when tty_write has put something into
|
||||||
|
@ -3053,7 +3042,7 @@ static int cy_chars_in_buffer(struct tty_struct *tty)
|
||||||
#ifdef CY_DEBUG_IO
|
#ifdef CY_DEBUG_IO
|
||||||
printk("cyc:cy_chars_in_buffer ttyC%d %d\n", info->line, info->xmit_cnt + char_count); /* */
|
printk("cyc:cy_chars_in_buffer ttyC%d %d\n", info->line, info->xmit_cnt + char_count); /* */
|
||||||
#endif
|
#endif
|
||||||
return (info->xmit_cnt + char_count);
|
return info->xmit_cnt + char_count;
|
||||||
}
|
}
|
||||||
#endif /* Z_EXT_CHARS_IN_BUFFER */
|
#endif /* Z_EXT_CHARS_IN_BUFFER */
|
||||||
} /* cy_chars_in_buffer */
|
} /* cy_chars_in_buffer */
|
||||||
|
@ -3918,7 +3907,7 @@ static int set_threshold(struct cyclades_port *info, unsigned long value)
|
||||||
cyy_issue_cmd(base_addr, CyCOR_CHANGE | CyCOR3ch, index);
|
cyy_issue_cmd(base_addr, CyCOR_CHANGE | CyCOR3ch, index);
|
||||||
CY_UNLOCK(info, flags);
|
CY_UNLOCK(info, flags);
|
||||||
} else {
|
} else {
|
||||||
// Nothing to do!
|
/* Nothing to do! */
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} /* set_threshold */
|
} /* set_threshold */
|
||||||
|
@ -3942,7 +3931,7 @@ get_threshold(struct cyclades_port *info, unsigned long __user * value)
|
||||||
tmp = cy_readb(base_addr + (CyCOR3 << index)) & CyREC_FIFO;
|
tmp = cy_readb(base_addr + (CyCOR3 << index)) & CyREC_FIFO;
|
||||||
return put_user(tmp, value);
|
return put_user(tmp, value);
|
||||||
} else {
|
} else {
|
||||||
// Nothing to do!
|
/* Nothing to do! */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} /* get_threshold */
|
} /* get_threshold */
|
||||||
|
@ -3979,7 +3968,7 @@ static int set_timeout(struct cyclades_port *info, unsigned long value)
|
||||||
cy_writeb(base_addr + (CyRTPR << index), value & 0xff);
|
cy_writeb(base_addr + (CyRTPR << index), value & 0xff);
|
||||||
CY_UNLOCK(info, flags);
|
CY_UNLOCK(info, flags);
|
||||||
} else {
|
} else {
|
||||||
// Nothing to do!
|
/* Nothing to do! */
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} /* set_timeout */
|
} /* set_timeout */
|
||||||
|
@ -4002,7 +3991,7 @@ static int get_timeout(struct cyclades_port *info, unsigned long __user * value)
|
||||||
tmp = cy_readb(base_addr + (CyRTPR << index));
|
tmp = cy_readb(base_addr + (CyRTPR << index));
|
||||||
return put_user(tmp, value);
|
return put_user(tmp, value);
|
||||||
} else {
|
} else {
|
||||||
// Nothing to do!
|
/* Nothing to do! */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} /* get_timeout */
|
} /* get_timeout */
|
||||||
|
@ -4249,8 +4238,6 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
|
||||||
(tty->termios->c_cflag & CLOCAL))
|
(tty->termios->c_cflag & CLOCAL))
|
||||||
wake_up_interruptible(&info->open_wait);
|
wake_up_interruptible(&info->open_wait);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return;
|
|
||||||
} /* cy_set_termios */
|
} /* cy_set_termios */
|
||||||
|
|
||||||
/* This function is used to send a high-priority XON/XOFF character to
|
/* This function is used to send a high-priority XON/XOFF character to
|
||||||
|
@ -4337,8 +4324,6 @@ static void cy_throttle(struct tty_struct *tty)
|
||||||
info->throttle = 1;
|
info->throttle = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
} /* cy_throttle */
|
} /* cy_throttle */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4396,8 +4381,6 @@ static void cy_unthrottle(struct tty_struct *tty)
|
||||||
info->throttle = 0;
|
info->throttle = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
} /* cy_unthrottle */
|
} /* cy_unthrottle */
|
||||||
|
|
||||||
/* cy_start and cy_stop provide software output flow control as a
|
/* cy_start and cy_stop provide software output flow control as a
|
||||||
|
@ -4434,10 +4417,8 @@ static void cy_stop(struct tty_struct *tty)
|
||||||
cy_readb(base_addr + (CySRER << index)) & ~CyTxRdy);
|
cy_readb(base_addr + (CySRER << index)) & ~CyTxRdy);
|
||||||
CY_UNLOCK(info, flags);
|
CY_UNLOCK(info, flags);
|
||||||
} else {
|
} else {
|
||||||
// Nothing to do!
|
/* Nothing to do! */
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
} /* cy_stop */
|
} /* cy_stop */
|
||||||
|
|
||||||
static void cy_start(struct tty_struct *tty)
|
static void cy_start(struct tty_struct *tty)
|
||||||
|
@ -4470,10 +4451,8 @@ static void cy_start(struct tty_struct *tty)
|
||||||
cy_readb(base_addr + (CySRER << index)) | CyTxRdy);
|
cy_readb(base_addr + (CySRER << index)) | CyTxRdy);
|
||||||
CY_UNLOCK(info, flags);
|
CY_UNLOCK(info, flags);
|
||||||
} else {
|
} else {
|
||||||
// Nothing to do!
|
/* Nothing to do! */
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
} /* cy_start */
|
} /* cy_start */
|
||||||
|
|
||||||
static void cy_flush_buffer(struct tty_struct *tty)
|
static void cy_flush_buffer(struct tty_struct *tty)
|
||||||
|
@ -4661,7 +4640,7 @@ static int __init cy_detect_isa(void)
|
||||||
for (i = 0; i < NR_ISA_ADDRS; i++) {
|
for (i = 0; i < NR_ISA_ADDRS; i++) {
|
||||||
unsigned int isa_address = cy_isa_addresses[i];
|
unsigned int isa_address = cy_isa_addresses[i];
|
||||||
if (isa_address == 0x0000) {
|
if (isa_address == 0x0000) {
|
||||||
return (nboard);
|
return nboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* probe for CD1400... */
|
/* probe for CD1400... */
|
||||||
|
@ -4691,7 +4670,7 @@ static int __init cy_detect_isa(void)
|
||||||
printk("but no more channels are available.\n");
|
printk("but no more channels are available.\n");
|
||||||
printk("Change NR_PORTS in cyclades.c and recompile "
|
printk("Change NR_PORTS in cyclades.c and recompile "
|
||||||
"kernel.\n");
|
"kernel.\n");
|
||||||
return (nboard);
|
return nboard;
|
||||||
}
|
}
|
||||||
/* fill the next cy_card structure available */
|
/* fill the next cy_card structure available */
|
||||||
for (j = 0; j < NR_CARDS; j++) {
|
for (j = 0; j < NR_CARDS; j++) {
|
||||||
|
@ -4704,7 +4683,7 @@ static int __init cy_detect_isa(void)
|
||||||
printk("but no more cards can be used .\n");
|
printk("but no more cards can be used .\n");
|
||||||
printk("Change NR_CARDS in cyclades.c and recompile "
|
printk("Change NR_CARDS in cyclades.c and recompile "
|
||||||
"kernel.\n");
|
"kernel.\n");
|
||||||
return (nboard);
|
return nboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate IRQ */
|
/* allocate IRQ */
|
||||||
|
@ -4713,7 +4692,7 @@ static int __init cy_detect_isa(void)
|
||||||
printk("Cyclom-Y/ISA found at 0x%lx ",
|
printk("Cyclom-Y/ISA found at 0x%lx ",
|
||||||
(unsigned long)cy_isa_address);
|
(unsigned long)cy_isa_address);
|
||||||
printk("but could not allocate IRQ#%d.\n", cy_isa_irq);
|
printk("but could not allocate IRQ#%d.\n", cy_isa_irq);
|
||||||
return (nboard);
|
return nboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set cy_card */
|
/* set cy_card */
|
||||||
|
@ -4734,9 +4713,9 @@ static int __init cy_detect_isa(void)
|
||||||
cy_isa_nchan, cy_next_channel);
|
cy_isa_nchan, cy_next_channel);
|
||||||
cy_next_channel += cy_isa_nchan;
|
cy_next_channel += cy_isa_nchan;
|
||||||
}
|
}
|
||||||
return (nboard);
|
return nboard;
|
||||||
#else
|
#else
|
||||||
return (0);
|
return 0;
|
||||||
#endif /* CONFIG_ISA */
|
#endif /* CONFIG_ISA */
|
||||||
} /* cy_detect_isa */
|
} /* cy_detect_isa */
|
||||||
|
|
||||||
|
@ -4867,7 +4846,7 @@ static int __init cy_detect_pci(void)
|
||||||
printk("but no channels are available.\n");
|
printk("but no channels are available.\n");
|
||||||
printk("Change NR_PORTS in cyclades.c and "
|
printk("Change NR_PORTS in cyclades.c and "
|
||||||
"recompile kernel.\n");
|
"recompile kernel.\n");
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
/* fill the next cy_card structure available */
|
/* fill the next cy_card structure available */
|
||||||
for (j = 0; j < NR_CARDS; j++) {
|
for (j = 0; j < NR_CARDS; j++) {
|
||||||
|
@ -4880,7 +4859,7 @@ static int __init cy_detect_pci(void)
|
||||||
printk("but no more cards can be used.\n");
|
printk("but no more cards can be used.\n");
|
||||||
printk("Change NR_CARDS in cyclades.c and "
|
printk("Change NR_CARDS in cyclades.c and "
|
||||||
"recompile kernel.\n");
|
"recompile kernel.\n");
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate IRQ */
|
/* allocate IRQ */
|
||||||
|
@ -4890,7 +4869,7 @@ static int __init cy_detect_pci(void)
|
||||||
(ulong) cy_pci_phys2);
|
(ulong) cy_pci_phys2);
|
||||||
printk("but could not allocate IRQ%d.\n",
|
printk("but could not allocate IRQ%d.\n",
|
||||||
cy_pci_irq);
|
cy_pci_irq);
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set cy_card */
|
/* set cy_card */
|
||||||
|
@ -5029,7 +5008,7 @@ static int __init cy_detect_pci(void)
|
||||||
cy_writel(&((struct RUNTIME_9060 *)
|
cy_writel(&((struct RUNTIME_9060 *)
|
||||||
(cy_pci_addr0))->loc_addr_base,
|
(cy_pci_addr0))->loc_addr_base,
|
||||||
WIN_CREG);
|
WIN_CREG);
|
||||||
PAUSE
|
PAUSE;
|
||||||
printk("Cyclades-8Zo/PCI: FPGA id %lx, ver "
|
printk("Cyclades-8Zo/PCI: FPGA id %lx, ver "
|
||||||
"%lx\n", (ulong) (0xff &
|
"%lx\n", (ulong) (0xff &
|
||||||
cy_readl(&((struct CUSTOM_REG *)
|
cy_readl(&((struct CUSTOM_REG *)
|
||||||
|
@ -5050,7 +5029,7 @@ static int __init cy_detect_pci(void)
|
||||||
ensures that the driver will not attempt to talk to
|
ensures that the driver will not attempt to talk to
|
||||||
the board until it has been properly initialized.
|
the board until it has been properly initialized.
|
||||||
*/
|
*/
|
||||||
PAUSE
|
PAUSE;
|
||||||
if ((mailbox == ZO_V1) || (mailbox == ZO_V2))
|
if ((mailbox == ZO_V1) || (mailbox == ZO_V2))
|
||||||
cy_writel(cy_pci_addr2 + ID_ADDRESS, 0L);
|
cy_writel(cy_pci_addr2 + ID_ADDRESS, 0L);
|
||||||
|
|
||||||
|
@ -5064,7 +5043,7 @@ static int __init cy_detect_pci(void)
|
||||||
"no channels are available.\nChange "
|
"no channels are available.\nChange "
|
||||||
"NR_PORTS in cyclades.c and recompile "
|
"NR_PORTS in cyclades.c and recompile "
|
||||||
"kernel.\n", (ulong)cy_pci_phys2);
|
"kernel.\n", (ulong)cy_pci_phys2);
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill the next cy_card structure available */
|
/* fill the next cy_card structure available */
|
||||||
|
@ -5077,7 +5056,7 @@ static int __init cy_detect_pci(void)
|
||||||
"no more cards can be used.\nChange "
|
"no more cards can be used.\nChange "
|
||||||
"NR_CARDS in cyclades.c and recompile "
|
"NR_CARDS in cyclades.c and recompile "
|
||||||
"kernel.\n", (ulong)cy_pci_phys2);
|
"kernel.\n", (ulong)cy_pci_phys2);
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_CYZ_INTR
|
#ifdef CONFIG_CYZ_INTR
|
||||||
/* allocate IRQ only if board has an IRQ */
|
/* allocate IRQ only if board has an IRQ */
|
||||||
|
@ -5089,7 +5068,7 @@ static int __init cy_detect_pci(void)
|
||||||
"but could not allocate "
|
"but could not allocate "
|
||||||
"IRQ%d.\n", (ulong)cy_pci_phys2,
|
"IRQ%d.\n", (ulong)cy_pci_phys2,
|
||||||
cy_pci_irq);
|
cy_pci_irq);
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CYZ_INTR */
|
#endif /* CONFIG_CYZ_INTR */
|
||||||
|
@ -5149,7 +5128,7 @@ static int __init cy_detect_pci(void)
|
||||||
printk("Cyclades-Z/PCI: New Cyclades-Z board. FPGA not "
|
printk("Cyclades-Z/PCI: New Cyclades-Z board. FPGA not "
|
||||||
"loaded\n");
|
"loaded\n");
|
||||||
#endif
|
#endif
|
||||||
PAUSE
|
PAUSE;
|
||||||
/* This must be the new Cyclades-Ze/PCI. */
|
/* This must be the new Cyclades-Ze/PCI. */
|
||||||
cy_pci_nchan = ZE_V1_NPORTS;
|
cy_pci_nchan = ZE_V1_NPORTS;
|
||||||
|
|
||||||
|
@ -5158,7 +5137,7 @@ static int __init cy_detect_pci(void)
|
||||||
"are available.\nChange NR_PORTS in cyclades.c "
|
"are available.\nChange NR_PORTS in cyclades.c "
|
||||||
"and recompile kernel.\n",
|
"and recompile kernel.\n",
|
||||||
(ulong) cy_pci_phys2);
|
(ulong) cy_pci_phys2);
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill the next cy_card structure available */
|
/* fill the next cy_card structure available */
|
||||||
|
@ -5171,7 +5150,7 @@ static int __init cy_detect_pci(void)
|
||||||
"cards can be used.\nChange NR_CARDS in "
|
"cards can be used.\nChange NR_CARDS in "
|
||||||
"cyclades.c and recompile kernel.\n",
|
"cyclades.c and recompile kernel.\n",
|
||||||
(ulong) cy_pci_phys2);
|
(ulong) cy_pci_phys2);
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_CYZ_INTR
|
#ifdef CONFIG_CYZ_INTR
|
||||||
/* allocate IRQ only if board has an IRQ */
|
/* allocate IRQ only if board has an IRQ */
|
||||||
|
@ -5183,7 +5162,7 @@ static int __init cy_detect_pci(void)
|
||||||
(ulong) cy_pci_phys2);
|
(ulong) cy_pci_phys2);
|
||||||
printk("but could not allocate IRQ%d.\n",
|
printk("but could not allocate IRQ%d.\n",
|
||||||
cy_pci_irq);
|
cy_pci_irq);
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CYZ_INTR */
|
#endif /* CONFIG_CYZ_INTR */
|
||||||
|
@ -5222,9 +5201,9 @@ static int __init cy_detect_pci(void)
|
||||||
"used.\nChange NR_CARDS in cyclades.c and recompile "
|
"used.\nChange NR_CARDS in cyclades.c and recompile "
|
||||||
"kernel.\n", (unsigned int)Ze_phys2[0]);
|
"kernel.\n", (unsigned int)Ze_phys2[0]);
|
||||||
}
|
}
|
||||||
return (i);
|
return i;
|
||||||
#else
|
#else
|
||||||
return (0);
|
return 0;
|
||||||
#endif /* ifdef CONFIG_PCI */
|
#endif /* ifdef CONFIG_PCI */
|
||||||
} /* cy_detect_pci */
|
} /* cy_detect_pci */
|
||||||
|
|
||||||
|
@ -5234,16 +5213,7 @@ static int __init cy_detect_pci(void)
|
||||||
*/
|
*/
|
||||||
static inline void show_version(void)
|
static inline void show_version(void)
|
||||||
{
|
{
|
||||||
char *rcsvers, *rcsdate, *tmp;
|
printk("Cyclades driver " CY_VERSION "\n");
|
||||||
rcsvers = strchr(rcsid, ' ');
|
|
||||||
rcsvers++;
|
|
||||||
tmp = strchr(rcsvers, ' ');
|
|
||||||
*tmp++ = '\0';
|
|
||||||
rcsdate = strchr(tmp, ' ');
|
|
||||||
rcsdate++;
|
|
||||||
tmp = strrchr(rcsdate, ' ');
|
|
||||||
*tmp = '\0';
|
|
||||||
printk("Cyclades driver %s %s\n", rcsvers, rcsdate);
|
|
||||||
printk(" built %s %s\n", __DATE__, __TIME__);
|
printk(" built %s %s\n", __DATE__, __TIME__);
|
||||||
} /* show_version */
|
} /* show_version */
|
||||||
|
|
||||||
|
@ -5272,14 +5242,11 @@ cyclades_get_proc_info(char *buf, char **start, off_t offset, int length,
|
||||||
if (info->count)
|
if (info->count)
|
||||||
size = sprintf(buf + len, "%3d %8lu %10lu %8lu %10lu "
|
size = sprintf(buf + len, "%3d %8lu %10lu %8lu %10lu "
|
||||||
"%8lu %9lu %6ld\n", info->line,
|
"%8lu %9lu %6ld\n", info->line,
|
||||||
JIFFIES_DIFF(info->idle_stats.in_use,
|
(cur_jifs - info->idle_stats.in_use) / HZ,
|
||||||
cur_jifs) / HZ,
|
|
||||||
info->idle_stats.xmit_bytes,
|
info->idle_stats.xmit_bytes,
|
||||||
JIFFIES_DIFF(info->idle_stats.xmit_idle,
|
(cur_jifs - info->idle_stats.xmit_idle) / HZ,
|
||||||
cur_jifs) / HZ,
|
|
||||||
info->idle_stats.recv_bytes,
|
info->idle_stats.recv_bytes,
|
||||||
JIFFIES_DIFF(info->idle_stats.recv_idle,
|
(cur_jifs - info->idle_stats.recv_idle) / HZ,
|
||||||
cur_jifs) / HZ,
|
|
||||||
info->idle_stats.overruns,
|
info->idle_stats.overruns,
|
||||||
(long)info->tty->ldisc.num);
|
(long)info->tty->ldisc.num);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue