Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (36 commits)
  jsm: fixing error if the driver fails to load
  jsm: removing the uart structure and filename on error
  tty: Add a new VT mode which is like VT_PROCESS but doesn't require a VT_RELDISP ioctl call
  tty: Keep the default buffering to sub-page units
  tty: Fix up char drivers request_room usage
  tty: Fix the ldisc hangup race
  serial: timberdale: Remove dependancies
  nozomi: Tidy up the PCI table
  nozomi: Fix mutex handling
  nozomi: Add tty_port usage
  sdio_uart: Use kfifo instead of the messy circ stuff
  serial: bcm63xx_uart: allow more than one uart to be registered.
  serial: bcm63xx_uart: don't use kfree() on non kmalloced area.
  serial: bfin_5xx: pull in linux/io.h for ioremap prototypes
  serial: bfin_5xx: kgdboc should accept gdb break only when it is active
  serial: bfin_5xx: need to disable DMA TX interrupt too
  serial: bfin_5xx: remove useless gpio handling with hard flow control
  Char: synclink, remove unnecessary checks
  tty: declare MODULE_FIRMWARE in various drivers
  ip2: Add module parameter.
  ...
  • Loading branch information
Linus Torvalds committed Mar 3, 2010
2 parents fb7b096 + 137ee2f commit 9446808
Show file tree
Hide file tree
Showing 36 changed files with 978 additions and 652 deletions.
16 changes: 2 additions & 14 deletions drivers/char/cyclades.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,11 @@ static unsigned int cy_isa_addresses[] = {

#define NR_ISA_ADDRS ARRAY_SIZE(cy_isa_addresses)

#ifdef MODULE
static long maddr[NR_CARDS];
static int irq[NR_CARDS];

module_param_array(maddr, long, NULL, 0);
module_param_array(irq, int, NULL, 0);
#endif

#endif /* CONFIG_ISA */

Expand Down Expand Up @@ -598,12 +596,6 @@ static void cyy_chip_tx(struct cyclades_card *cinfo, unsigned int chip,
save_car = readb(base_addr + (CyCAR << index));
cy_writeb(base_addr + (CyCAR << index), save_xir);

/* validate the port# (as configured and open) */
if (channel + chip * 4 >= cinfo->nports) {
cy_writeb(base_addr + (CySRER << index),
readb(base_addr + (CySRER << index)) & ~CyTxRdy);
goto end;
}
info = &cinfo->ports[channel + chip * 4];
tty = tty_port_tty_get(&info->port);
if (tty == NULL) {
Expand Down Expand Up @@ -3316,13 +3308,10 @@ static int __init cy_detect_isa(void)
unsigned short cy_isa_irq, nboard;
void __iomem *cy_isa_address;
unsigned short i, j, cy_isa_nchan;
#ifdef MODULE
int isparam = 0;
#endif

nboard = 0;

#ifdef MODULE
/* Check for module parameters */
for (i = 0; i < NR_CARDS; i++) {
if (maddr[i] || i) {
Expand All @@ -3332,7 +3321,6 @@ static int __init cy_detect_isa(void)
if (!maddr[i])
break;
}
#endif

/* scan the address table probing for Cyclom-Y/ISA boards */
for (i = 0; i < NR_ISA_ADDRS; i++) {
Expand All @@ -3353,11 +3341,10 @@ static int __init cy_detect_isa(void)
iounmap(cy_isa_address);
continue;
}
#ifdef MODULE

if (isparam && i < NR_CARDS && irq[i])
cy_isa_irq = irq[i];
else
#endif
/* find out the board's irq by probing */
cy_isa_irq = detect_isa_irq(cy_isa_address);
if (cy_isa_irq == 0) {
Expand Down Expand Up @@ -4208,3 +4195,4 @@ module_exit(cy_cleanup_module);
MODULE_LICENSE("GPL");
MODULE_VERSION(CY_VERSION);
MODULE_ALIAS_CHARDEV_MAJOR(CYCLADES_MAJOR);
MODULE_FIRMWARE("cyzfirm.bin");
2 changes: 1 addition & 1 deletion drivers/char/hvc_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void hvc_console_print(struct console *co, const char *b,
return;

/* This console adapter was removed so it is not usable. */
if (vtermnos[index] < 0)
if (vtermnos[index] == -1)
return;

while (count > 0 || i > 0) {
Expand Down
26 changes: 20 additions & 6 deletions drivers/char/ip2/ip2main.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ static int DumpFifoBuffer( char __user *, int);

static void ip2_init_board(int, const struct firmware *);
static unsigned short find_eisa_board(int);
static int ip2_setup(char *str);

/***************/
/* Static Data */
Expand Down Expand Up @@ -263,7 +264,7 @@ static int tracewrap;
/* Macros */
/**********/

#if defined(MODULE) && defined(IP2DEBUG_OPEN)
#ifdef IP2DEBUG_OPEN
#define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] ttyc=%d, modc=%x -> %s\n", \
tty->name,(pCh->flags), \
tty->count,/*GET_USE_COUNT(module)*/0,s)
Expand All @@ -285,7 +286,10 @@ MODULE_AUTHOR("Doug McNash");
MODULE_DESCRIPTION("Computone IntelliPort Plus Driver");
MODULE_LICENSE("GPL");

#define MAX_CMD_STR 50

static int poll_only;
static char cmd[MAX_CMD_STR];

static int Eisa_irq;
static int Eisa_slot;
Expand All @@ -309,6 +313,8 @@ module_param_array(io, int, NULL, 0);
MODULE_PARM_DESC(io, "I/O ports for IntelliPort Cards");
module_param(poll_only, bool, 0);
MODULE_PARM_DESC(poll_only, "Do not use card interrupts");
module_param_string(ip2, cmd, MAX_CMD_STR, 0);
MODULE_PARM_DESC(ip2, "Contains module parameter passed with 'ip2='");

/* for sysfs class support */
static struct class *ip2_class;
Expand Down Expand Up @@ -487,7 +493,6 @@ static const struct firmware *ip2_request_firmware(void)
return fw;
}

#ifndef MODULE
/******************************************************************************
* ip2_setup:
* str: kernel command line string
Expand Down Expand Up @@ -531,22 +536,27 @@ static int __init ip2_setup(char *str)
return 1;
}
__setup("ip2=", ip2_setup);
#endif /* !MODULE */

static int __init ip2_loadmain(void)
{
int i, j, box;
int err = 0;
i2eBordStrPtr pB = NULL;
int rc = -1;
struct pci_dev *pdev = NULL;
const struct firmware *fw = NULL;
char *str;

str = cmd;

if (poll_only) {
/* Hard lock the interrupts to zero */
irq[0] = irq[1] = irq[2] = irq[3] = poll_only = 0;
}

/* Check module parameter with 'ip2=' has been passed or not */
if (!poll_only && (!strncmp(str, "ip2=", 4)))
ip2_setup(str);

ip2trace(ITRC_NO_PORT, ITRC_INIT, ITRC_ENTER, 0);

/* process command line arguments to modprobe or
Expand Down Expand Up @@ -612,6 +622,7 @@ static int __init ip2_loadmain(void)
case PCI:
#ifdef CONFIG_PCI
{
struct pci_dev *pdev = NULL;
u32 addr;
int status;

Expand All @@ -626,7 +637,7 @@ static int __init ip2_loadmain(void)

if (pci_enable_device(pdev)) {
dev_err(&pdev->dev, "can't enable device\n");
break;
goto out;
}
ip2config.type[i] = PCI;
ip2config.pci_dev[i] = pci_dev_get(pdev);
Expand All @@ -638,6 +649,8 @@ static int __init ip2_loadmain(void)
dev_err(&pdev->dev, "I/O address error\n");

ip2config.irq[i] = pdev->irq;
out:
pci_dev_put(pdev);
}
#else
printk(KERN_ERR "IP2: PCI card specified but PCI "
Expand All @@ -656,7 +669,6 @@ static int __init ip2_loadmain(void)
break;
} /* switch */
} /* for */
pci_dev_put(pdev);

for (i = 0; i < IP2_MAX_BOARDS; ++i) {
if (ip2config.addr[i]) {
Expand Down Expand Up @@ -3197,3 +3209,5 @@ static struct pci_device_id ip2main_pci_tbl[] __devinitdata = {
};

MODULE_DEVICE_TABLE(pci, ip2main_pci_tbl);

MODULE_FIRMWARE("intelliport2.bin");
54 changes: 31 additions & 23 deletions drivers/char/isicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
* 64-bit verification
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/firmware.h>
#include <linux/kernel.h>
Expand Down Expand Up @@ -140,7 +142,6 @@
#define InterruptTheCard(base) outw(0, (base) + 0xc)
#define ClearInterrupt(base) inw((base) + 0x0a)

#define pr_dbg(str...) pr_debug("ISICOM: " str)
#ifdef DEBUG
#define isicom_paranoia_check(a, b, c) __isicom_paranoia_check((a), (b), (c))
#else
Expand Down Expand Up @@ -249,8 +250,7 @@ static int lock_card(struct isi_board *card)
spin_unlock_irqrestore(&card->card_lock, card->flags);
msleep(10);
}
printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n",
card->base);
pr_warning("Failed to lock Card (0x%lx)\n", card->base);

return 0; /* Failed to acquire the card! */
}
Expand Down Expand Up @@ -379,13 +379,13 @@ static inline int __isicom_paranoia_check(struct isi_port const *port,
char *name, const char *routine)
{
if (!port) {
printk(KERN_WARNING "ISICOM: Warning: bad isicom magic for "
"dev %s in %s.\n", name, routine);
pr_warning("Warning: bad isicom magic for dev %s in %s.\n",
name, routine);
return 1;
}
if (port->magic != ISICOM_MAGIC) {
printk(KERN_WARNING "ISICOM: Warning: NULL isicom port for "
"dev %s in %s.\n", name, routine);
pr_warning("Warning: NULL isicom port for dev %s in %s.\n",
name, routine);
return 1;
}

Expand Down Expand Up @@ -450,8 +450,8 @@ static void isicom_tx(unsigned long _data)
if (!(inw(base + 0x02) & (1 << port->channel)))
continue;

pr_dbg("txing %d bytes, port%d.\n", txcount,
port->channel + 1);
pr_debug("txing %d bytes, port%d.\n",
txcount, port->channel + 1);
outw((port->channel << isi_card[card].shift_count) | txcount,
base);
residue = NO;
Expand Down Expand Up @@ -547,8 +547,8 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
byte_count = header & 0xff;

if (channel + 1 > card->port_count) {
printk(KERN_WARNING "ISICOM: isicom_interrupt(0x%lx): "
"%d(channel) > port_count.\n", base, channel+1);
pr_warning("%s(0x%lx): %d(channel) > port_count.\n",
__func__, base, channel+1);
outw(0x0000, base+0x04); /* enable interrupts */
spin_unlock(&card->card_lock);
return IRQ_HANDLED;
Expand Down Expand Up @@ -582,14 +582,15 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
if (port->status & ISI_DCD) {
if (!(header & ISI_DCD)) {
/* Carrier has been lost */
pr_dbg("interrupt: DCD->low.\n"
);
pr_debug("%s: DCD->low.\n",
__func__);
port->status &= ~ISI_DCD;
tty_hangup(tty);
}
} else if (header & ISI_DCD) {
/* Carrier has been detected */
pr_dbg("interrupt: DCD->high.\n");
pr_debug("%s: DCD->high.\n",
__func__);
port->status |= ISI_DCD;
wake_up_interruptible(&port->port.open_wait);
}
Expand Down Expand Up @@ -641,17 +642,19 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
break;

case 2: /* Statistics */
pr_dbg("isicom_interrupt: stats!!!.\n");
pr_debug("%s: stats!!!\n", __func__);
break;

default:
pr_dbg("Intr: Unknown code in status packet.\n");
pr_debug("%s: Unknown code in status packet.\n",
__func__);
break;
}
} else { /* Data Packet */

count = tty_prepare_flip_string(tty, &rp, byte_count & ~1);
pr_dbg("Intr: Can rx %d of %d bytes.\n", count, byte_count);
pr_debug("%s: Can rx %d of %d bytes.\n",
__func__, count, byte_count);
word_count = count >> 1;
insw(base, rp, word_count);
byte_count -= (word_count << 1);
Expand All @@ -661,8 +664,8 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
byte_count -= 2;
}
if (byte_count > 0) {
pr_dbg("Intr(0x%lx:%d): Flip buffer overflow! dropping "
"bytes...\n", base, channel + 1);
pr_debug("%s(0x%lx:%d): Flip buffer overflow! dropping bytes...\n",
__func__, base, channel + 1);
/* drain out unread xtra data */
while (byte_count > 0) {
inw(base);
Expand Down Expand Up @@ -888,8 +891,8 @@ static void isicom_shutdown_port(struct isi_port *port)
struct isi_board *card = port->card;

if (--card->count < 0) {
pr_dbg("isicom_shutdown_port: bad board(0x%lx) count %d.\n",
card->base, card->count);
pr_debug("%s: bad board(0x%lx) count %d.\n",
__func__, card->base, card->count);
card->count = 0;
}
/* last port was closed, shutdown that board too */
Expand Down Expand Up @@ -1681,13 +1684,13 @@ static int __init isicom_init(void)

retval = tty_register_driver(isicom_normal);
if (retval) {
pr_dbg("Couldn't register the dialin driver\n");
pr_debug("Couldn't register the dialin driver\n");
goto err_puttty;
}

retval = pci_register_driver(&isicom_driver);
if (retval < 0) {
printk(KERN_ERR "ISICOM: Unable to register pci driver.\n");
pr_err("Unable to register pci driver.\n");
goto err_unrtty;
}

Expand Down Expand Up @@ -1717,3 +1720,8 @@ module_exit(isicom_exit);
MODULE_AUTHOR("MultiTech");
MODULE_DESCRIPTION("Driver for the ISI series of cards by MultiTech");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE("isi608.bin");
MODULE_FIRMWARE("isi608em.bin");
MODULE_FIRMWARE("isi616em.bin");
MODULE_FIRMWARE("isi4608.bin");
MODULE_FIRMWARE("isi4616.bin");
Loading

0 comments on commit 9446808

Please sign in to comment.