X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fsynclinkmp.c;h=8587401311155dd5abcb9e0bde00ed6e8a3493c2;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=66f3754fbbdf443e891b21cdfcf88c799144e6b9;hpb=3944158a6d33f94668dbd6bdc32ff5c67bb53ec2;p=linux-2.6.git diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 66f3754fb..858740131 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c @@ -34,6 +34,7 @@ #define MAX_DEVICES 12 +#include #include #include #include @@ -987,7 +988,7 @@ static int write(struct tty_struct *tty, if (sanity_check(info, tty->name, "write")) goto cleanup; - if (!info->tx_buf) + if (!tty || !info->tx_buf) goto cleanup; if (info->params.mode == MGSL_MODE_HDLC) { @@ -1066,7 +1067,7 @@ static void put_char(struct tty_struct *tty, unsigned char ch) if (sanity_check(info, tty->name, "put_char")) return; - if (!info->tx_buf) + if (!tty || !info->tx_buf) return; spin_lock_irqsave(&info->lock,flags); @@ -1752,10 +1753,8 @@ static int hdlcdev_open(struct net_device *dev) spin_lock_irqsave(&info->lock, flags); get_signals(info); spin_unlock_irqrestore(&info->lock, flags); - if (info->serial_signals & SerialSignal_DCD) - netif_carrier_on(dev); - else - netif_carrier_off(dev); + hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, dev); + return 0; } @@ -2524,12 +2523,8 @@ void isr_io_pin( SLMP_INFO *info, u16 status ) } else info->input_signal_events.dcd_down++; #ifdef CONFIG_HDLC - if (info->netcount) { - if (status & SerialSignal_DCD) - netif_carrier_on(info->netdev); - else - netif_carrier_off(info->netdev); - } + if (info->netcount) + hdlc_set_carrier(status & SerialSignal_DCD, info->netdev); #endif } if (status & MISCSTATUS_CTS_LATCHED) @@ -3841,7 +3836,7 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) info->phys_statctrl_base &= ~(PAGE_SIZE-1); info->bus_type = MGSL_BUS_TYPE_PCI; - info->irq_flags = IRQF_SHARED; + info->irq_flags = SA_SHIRQ; init_timer(&info->tx_timer); info->tx_timer.data = (unsigned long)info;