aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/synclinkmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/synclinkmp.c')
-rw-r--r--drivers/char/synclinkmp.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index 3e932b681371..20a96ef250be 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -67,8 +67,10 @@
67#include <linux/workqueue.h> 67#include <linux/workqueue.h>
68#include <linux/hdlc.h> 68#include <linux/hdlc.h>
69 69
70#ifdef CONFIG_HDLC_MODULE 70#if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINKMP_MODULE))
71#define CONFIG_HDLC 1 71#define SYNCLINK_GENERIC_HDLC 1
72#else
73#define SYNCLINK_GENERIC_HDLC 0
72#endif 74#endif
73 75
74#define GET_USER(error,value,addr) error = get_user(value,addr) 76#define GET_USER(error,value,addr) error = get_user(value,addr)
@@ -280,7 +282,7 @@ typedef struct _synclinkmp_info {
280 int dosyncppp; 282 int dosyncppp;
281 spinlock_t netlock; 283 spinlock_t netlock;
282 284
283#ifdef CONFIG_HDLC 285#if SYNCLINK_GENERIC_HDLC
284 struct net_device *netdev; 286 struct net_device *netdev;
285#endif 287#endif
286 288
@@ -536,7 +538,7 @@ static void throttle(struct tty_struct * tty);
536static void unthrottle(struct tty_struct * tty); 538static void unthrottle(struct tty_struct * tty);
537static void set_break(struct tty_struct *tty, int break_state); 539static void set_break(struct tty_struct *tty, int break_state);
538 540
539#ifdef CONFIG_HDLC 541#if SYNCLINK_GENERIC_HDLC
540#define dev_to_port(D) (dev_to_hdlc(D)->priv) 542#define dev_to_port(D) (dev_to_hdlc(D)->priv)
541static void hdlcdev_tx_done(SLMP_INFO *info); 543static void hdlcdev_tx_done(SLMP_INFO *info);
542static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size); 544static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size);
@@ -602,7 +604,7 @@ static void enable_loopback(SLMP_INFO *info, int enable);
602static void set_rate(SLMP_INFO *info, u32 data_rate); 604static void set_rate(SLMP_INFO *info, u32 data_rate);
603 605
604static int bh_action(SLMP_INFO *info); 606static int bh_action(SLMP_INFO *info);
605static void bh_handler(void* Context); 607static void bh_handler(struct work_struct *work);
606static void bh_receive(SLMP_INFO *info); 608static void bh_receive(SLMP_INFO *info);
607static void bh_transmit(SLMP_INFO *info); 609static void bh_transmit(SLMP_INFO *info);
608static void bh_status(SLMP_INFO *info); 610static void bh_status(SLMP_INFO *info);
@@ -1607,7 +1609,7 @@ static void set_break(struct tty_struct *tty, int break_state)
1607 spin_unlock_irqrestore(&info->lock,flags); 1609 spin_unlock_irqrestore(&info->lock,flags);
1608} 1610}
1609 1611
1610#ifdef CONFIG_HDLC 1612#if SYNCLINK_GENERIC_HDLC
1611 1613
1612/** 1614/**
1613 * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.) 1615 * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.)
@@ -2063,9 +2065,9 @@ int bh_action(SLMP_INFO *info)
2063 2065
2064/* Perform bottom half processing of work items queued by ISR. 2066/* Perform bottom half processing of work items queued by ISR.
2065 */ 2067 */
2066void bh_handler(void* Context) 2068void bh_handler(struct work_struct *work)
2067{ 2069{
2068 SLMP_INFO *info = (SLMP_INFO*)Context; 2070 SLMP_INFO *info = container_of(work, SLMP_INFO, task);
2069 int action; 2071 int action;
2070 2072
2071 if (!info) 2073 if (!info)
@@ -2339,7 +2341,7 @@ static void isr_txeom(SLMP_INFO * info, unsigned char status)
2339 set_signals(info); 2341 set_signals(info);
2340 } 2342 }
2341 2343
2342#ifdef CONFIG_HDLC 2344#if SYNCLINK_GENERIC_HDLC
2343 if (info->netcount) 2345 if (info->netcount)
2344 hdlcdev_tx_done(info); 2346 hdlcdev_tx_done(info);
2345 else 2347 else
@@ -2523,7 +2525,7 @@ void isr_io_pin( SLMP_INFO *info, u16 status )
2523 info->input_signal_events.dcd_up++; 2525 info->input_signal_events.dcd_up++;
2524 } else 2526 } else
2525 info->input_signal_events.dcd_down++; 2527 info->input_signal_events.dcd_down++;
2526#ifdef CONFIG_HDLC 2528#if SYNCLINK_GENERIC_HDLC
2527 if (info->netcount) { 2529 if (info->netcount) {
2528 if (status & SerialSignal_DCD) 2530 if (status & SerialSignal_DCD)
2529 netif_carrier_on(info->netdev); 2531 netif_carrier_on(info->netdev);
@@ -3783,7 +3785,7 @@ void add_device(SLMP_INFO *info)
3783 info->irq_level, 3785 info->irq_level,
3784 info->max_frame_size ); 3786 info->max_frame_size );
3785 3787
3786#ifdef CONFIG_HDLC 3788#if SYNCLINK_GENERIC_HDLC
3787 hdlcdev_init(info); 3789 hdlcdev_init(info);
3788#endif 3790#endif
3789} 3791}
@@ -3805,7 +3807,7 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev)
3805 } else { 3807 } else {
3806 memset(info, 0, sizeof(SLMP_INFO)); 3808 memset(info, 0, sizeof(SLMP_INFO));
3807 info->magic = MGSL_MAGIC; 3809 info->magic = MGSL_MAGIC;
3808 INIT_WORK(&info->task, bh_handler, info); 3810 INIT_WORK(&info->task, bh_handler);
3809 info->max_frame_size = 4096; 3811 info->max_frame_size = 4096;
3810 info->close_delay = 5*HZ/10; 3812 info->close_delay = 5*HZ/10;
3811 info->closing_wait = 30*HZ; 3813 info->closing_wait = 30*HZ;
@@ -3977,7 +3979,7 @@ static void synclinkmp_cleanup(void)
3977 /* release devices */ 3979 /* release devices */
3978 info = synclinkmp_device_list; 3980 info = synclinkmp_device_list;
3979 while(info) { 3981 while(info) {
3980#ifdef CONFIG_HDLC 3982#if SYNCLINK_GENERIC_HDLC
3981 hdlcdev_exit(info); 3983 hdlcdev_exit(info);
3982#endif 3984#endif
3983 free_dma_bufs(info); 3985 free_dma_bufs(info);
@@ -4979,7 +4981,7 @@ CheckAgain:
4979 info->icount.rxcrc++; 4981 info->icount.rxcrc++;
4980 4982
4981 framesize = 0; 4983 framesize = 0;
4982#ifdef CONFIG_HDLC 4984#if SYNCLINK_GENERIC_HDLC
4983 { 4985 {
4984 struct net_device_stats *stats = hdlc_stats(info->netdev); 4986 struct net_device_stats *stats = hdlc_stats(info->netdev);
4985 stats->rx_errors++; 4987 stats->rx_errors++;
@@ -5020,7 +5022,7 @@ CheckAgain:
5020 index = 0; 5022 index = 0;
5021 } 5023 }
5022 5024
5023#ifdef CONFIG_HDLC 5025#if SYNCLINK_GENERIC_HDLC
5024 if (info->netcount) 5026 if (info->netcount)
5025 hdlcdev_rx(info,info->tmp_rx_buf,framesize); 5027 hdlcdev_rx(info,info->tmp_rx_buf,framesize);
5026 else 5028 else
@@ -5531,7 +5533,7 @@ void tx_timeout(unsigned long context)
5531 5533
5532 spin_unlock_irqrestore(&info->lock,flags); 5534 spin_unlock_irqrestore(&info->lock,flags);
5533 5535
5534#ifdef CONFIG_HDLC 5536#if SYNCLINK_GENERIC_HDLC
5535 if (info->netcount) 5537 if (info->netcount)
5536 hdlcdev_tx_done(info); 5538 hdlcdev_tx_done(info);
5537 else 5539 else