linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / char / synclinkmp.c
index 66f3754..960adb2 100644 (file)
@@ -34,6 +34,7 @@
 
 #define MAX_DEVICES 12
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -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);
@@ -1649,7 +1650,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
        }
 
        info->params.encoding = new_encoding;
-       info->params.crc_type = new_crctype;
+       info->params.crc_type = new_crctype;;
 
        /* if network interface up, reprogram hardware */
        if (info->netcount)
@@ -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;