diff options
author | Paul Fulghum <paulkf@microgate.com> | 2006-12-06 23:40:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:45 -0500 |
commit | af69c7f924b272927f9aea378f34f4548d3888d9 (patch) | |
tree | 93333028e018567d85ed94b9192e501ab2f3c58c /drivers | |
parent | 3ee6f61ca0720c71086a9eaf3f5bd0f7c51fe139 (diff) |
[PATCH] generic HDLC synclink config mismatch fix
Fix compile errors on mismatch between generic HDLC and synclink drivers.
Notes:
generic HDLC support for synclink drivers is *optional* so you can't just
use depend on in Kconfig
This solution is deemed the best after 7 months of review and criticism by
many developers including AKPM. Read the threads on LKML before posting
about this solution.
Signed-off-by: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 26 | ||||
-rw-r--r-- | drivers/char/synclink.c | 26 | ||||
-rw-r--r-- | drivers/char/synclink_gt.c | 26 | ||||
-rw-r--r-- | drivers/char/synclinkmp.c | 26 |
4 files changed, 56 insertions, 48 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 1bd12296dca5..74d21c1c104f 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -75,8 +75,10 @@ | |||
75 | #include <pcmcia/cisreg.h> | 75 | #include <pcmcia/cisreg.h> |
76 | #include <pcmcia/ds.h> | 76 | #include <pcmcia/ds.h> |
77 | 77 | ||
78 | #ifdef CONFIG_HDLC_MODULE | 78 | #if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINK_CS_MODULE)) |
79 | #define CONFIG_HDLC 1 | 79 | #define SYNCLINK_GENERIC_HDLC 1 |
80 | #else | ||
81 | #define SYNCLINK_GENERIC_HDLC 0 | ||
80 | #endif | 82 | #endif |
81 | 83 | ||
82 | #define GET_USER(error,value,addr) error = get_user(value,addr) | 84 | #define GET_USER(error,value,addr) error = get_user(value,addr) |
@@ -235,7 +237,7 @@ typedef struct _mgslpc_info { | |||
235 | int dosyncppp; | 237 | int dosyncppp; |
236 | spinlock_t netlock; | 238 | spinlock_t netlock; |
237 | 239 | ||
238 | #ifdef CONFIG_HDLC | 240 | #if SYNCLINK_GENERIC_HDLC |
239 | struct net_device *netdev; | 241 | struct net_device *netdev; |
240 | #endif | 242 | #endif |
241 | 243 | ||
@@ -392,7 +394,7 @@ static void tx_timeout(unsigned long context); | |||
392 | 394 | ||
393 | static int ioctl_common(MGSLPC_INFO *info, unsigned int cmd, unsigned long arg); | 395 | static int ioctl_common(MGSLPC_INFO *info, unsigned int cmd, unsigned long arg); |
394 | 396 | ||
395 | #ifdef CONFIG_HDLC | 397 | #if SYNCLINK_GENERIC_HDLC |
396 | #define dev_to_port(D) (dev_to_hdlc(D)->priv) | 398 | #define dev_to_port(D) (dev_to_hdlc(D)->priv) |
397 | static void hdlcdev_tx_done(MGSLPC_INFO *info); | 399 | static void hdlcdev_tx_done(MGSLPC_INFO *info); |
398 | static void hdlcdev_rx(MGSLPC_INFO *info, char *buf, int size); | 400 | static void hdlcdev_rx(MGSLPC_INFO *info, char *buf, int size); |
@@ -1053,7 +1055,7 @@ static void tx_done(MGSLPC_INFO *info) | |||
1053 | info->drop_rts_on_tx_done = 0; | 1055 | info->drop_rts_on_tx_done = 0; |
1054 | } | 1056 | } |
1055 | 1057 | ||
1056 | #ifdef CONFIG_HDLC | 1058 | #if SYNCLINK_GENERIC_HDLC |
1057 | if (info->netcount) | 1059 | if (info->netcount) |
1058 | hdlcdev_tx_done(info); | 1060 | hdlcdev_tx_done(info); |
1059 | else | 1061 | else |
@@ -1164,7 +1166,7 @@ static void dcd_change(MGSLPC_INFO *info) | |||
1164 | } | 1166 | } |
1165 | else | 1167 | else |
1166 | info->input_signal_events.dcd_down++; | 1168 | info->input_signal_events.dcd_down++; |
1167 | #ifdef CONFIG_HDLC | 1169 | #if SYNCLINK_GENERIC_HDLC |
1168 | if (info->netcount) { | 1170 | if (info->netcount) { |
1169 | if (info->serial_signals & SerialSignal_DCD) | 1171 | if (info->serial_signals & SerialSignal_DCD) |
1170 | netif_carrier_on(info->netdev); | 1172 | netif_carrier_on(info->netdev); |
@@ -2953,7 +2955,7 @@ static void mgslpc_add_device(MGSLPC_INFO *info) | |||
2953 | printk( "SyncLink PC Card %s:IO=%04X IRQ=%d\n", | 2955 | printk( "SyncLink PC Card %s:IO=%04X IRQ=%d\n", |
2954 | info->device_name, info->io_base, info->irq_level); | 2956 | info->device_name, info->io_base, info->irq_level); |
2955 | 2957 | ||
2956 | #ifdef CONFIG_HDLC | 2958 | #if SYNCLINK_GENERIC_HDLC |
2957 | hdlcdev_init(info); | 2959 | hdlcdev_init(info); |
2958 | #endif | 2960 | #endif |
2959 | } | 2961 | } |
@@ -2969,7 +2971,7 @@ static void mgslpc_remove_device(MGSLPC_INFO *remove_info) | |||
2969 | last->next_device = info->next_device; | 2971 | last->next_device = info->next_device; |
2970 | else | 2972 | else |
2971 | mgslpc_device_list = info->next_device; | 2973 | mgslpc_device_list = info->next_device; |
2972 | #ifdef CONFIG_HDLC | 2974 | #if SYNCLINK_GENERIC_HDLC |
2973 | hdlcdev_exit(info); | 2975 | hdlcdev_exit(info); |
2974 | #endif | 2976 | #endif |
2975 | release_resources(info); | 2977 | release_resources(info); |
@@ -3901,7 +3903,7 @@ static int rx_get_frame(MGSLPC_INFO *info) | |||
3901 | return_frame = 1; | 3903 | return_frame = 1; |
3902 | } | 3904 | } |
3903 | framesize = 0; | 3905 | framesize = 0; |
3904 | #ifdef CONFIG_HDLC | 3906 | #if SYNCLINK_GENERIC_HDLC |
3905 | { | 3907 | { |
3906 | struct net_device_stats *stats = hdlc_stats(info->netdev); | 3908 | struct net_device_stats *stats = hdlc_stats(info->netdev); |
3907 | stats->rx_errors++; | 3909 | stats->rx_errors++; |
@@ -3935,7 +3937,7 @@ static int rx_get_frame(MGSLPC_INFO *info) | |||
3935 | ++framesize; | 3937 | ++framesize; |
3936 | } | 3938 | } |
3937 | 3939 | ||
3938 | #ifdef CONFIG_HDLC | 3940 | #if SYNCLINK_GENERIC_HDLC |
3939 | if (info->netcount) | 3941 | if (info->netcount) |
3940 | hdlcdev_rx(info, buf->data, framesize); | 3942 | hdlcdev_rx(info, buf->data, framesize); |
3941 | else | 3943 | else |
@@ -4091,7 +4093,7 @@ static void tx_timeout(unsigned long context) | |||
4091 | 4093 | ||
4092 | spin_unlock_irqrestore(&info->lock,flags); | 4094 | spin_unlock_irqrestore(&info->lock,flags); |
4093 | 4095 | ||
4094 | #ifdef CONFIG_HDLC | 4096 | #if SYNCLINK_GENERIC_HDLC |
4095 | if (info->netcount) | 4097 | if (info->netcount) |
4096 | hdlcdev_tx_done(info); | 4098 | hdlcdev_tx_done(info); |
4097 | else | 4099 | else |
@@ -4099,7 +4101,7 @@ static void tx_timeout(unsigned long context) | |||
4099 | bh_transmit(info); | 4101 | bh_transmit(info); |
4100 | } | 4102 | } |
4101 | 4103 | ||
4102 | #ifdef CONFIG_HDLC | 4104 | #if SYNCLINK_GENERIC_HDLC |
4103 | 4105 | ||
4104 | /** | 4106 | /** |
4105 | * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.) | 4107 | * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.) |
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 147c30da81ea..645187b9141e 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -101,8 +101,10 @@ | |||
101 | #include <linux/hdlc.h> | 101 | #include <linux/hdlc.h> |
102 | #include <linux/dma-mapping.h> | 102 | #include <linux/dma-mapping.h> |
103 | 103 | ||
104 | #ifdef CONFIG_HDLC_MODULE | 104 | #if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINK_MODULE)) |
105 | #define CONFIG_HDLC 1 | 105 | #define SYNCLINK_GENERIC_HDLC 1 |
106 | #else | ||
107 | #define SYNCLINK_GENERIC_HDLC 0 | ||
106 | #endif | 108 | #endif |
107 | 109 | ||
108 | #define GET_USER(error,value,addr) error = get_user(value,addr) | 110 | #define GET_USER(error,value,addr) error = get_user(value,addr) |
@@ -320,7 +322,7 @@ struct mgsl_struct { | |||
320 | int dosyncppp; | 322 | int dosyncppp; |
321 | spinlock_t netlock; | 323 | spinlock_t netlock; |
322 | 324 | ||
323 | #ifdef CONFIG_HDLC | 325 | #if SYNCLINK_GENERIC_HDLC |
324 | struct net_device *netdev; | 326 | struct net_device *netdev; |
325 | #endif | 327 | #endif |
326 | }; | 328 | }; |
@@ -728,7 +730,7 @@ static void usc_loopmode_send_done( struct mgsl_struct * info ); | |||
728 | 730 | ||
729 | static int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg); | 731 | static int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg); |
730 | 732 | ||
731 | #ifdef CONFIG_HDLC | 733 | #if SYNCLINK_GENERIC_HDLC |
732 | #define dev_to_port(D) (dev_to_hdlc(D)->priv) | 734 | #define dev_to_port(D) (dev_to_hdlc(D)->priv) |
733 | static void hdlcdev_tx_done(struct mgsl_struct *info); | 735 | static void hdlcdev_tx_done(struct mgsl_struct *info); |
734 | static void hdlcdev_rx(struct mgsl_struct *info, char *buf, int size); | 736 | static void hdlcdev_rx(struct mgsl_struct *info, char *buf, int size); |
@@ -1277,7 +1279,7 @@ static void mgsl_isr_transmit_status( struct mgsl_struct *info ) | |||
1277 | info->drop_rts_on_tx_done = 0; | 1279 | info->drop_rts_on_tx_done = 0; |
1278 | } | 1280 | } |
1279 | 1281 | ||
1280 | #ifdef CONFIG_HDLC | 1282 | #if SYNCLINK_GENERIC_HDLC |
1281 | if (info->netcount) | 1283 | if (info->netcount) |
1282 | hdlcdev_tx_done(info); | 1284 | hdlcdev_tx_done(info); |
1283 | else | 1285 | else |
@@ -1342,7 +1344,7 @@ static void mgsl_isr_io_pin( struct mgsl_struct *info ) | |||
1342 | info->input_signal_events.dcd_up++; | 1344 | info->input_signal_events.dcd_up++; |
1343 | } else | 1345 | } else |
1344 | info->input_signal_events.dcd_down++; | 1346 | info->input_signal_events.dcd_down++; |
1345 | #ifdef CONFIG_HDLC | 1347 | #if SYNCLINK_GENERIC_HDLC |
1346 | if (info->netcount) { | 1348 | if (info->netcount) { |
1347 | if (status & MISCSTATUS_DCD) | 1349 | if (status & MISCSTATUS_DCD) |
1348 | netif_carrier_on(info->netdev); | 1350 | netif_carrier_on(info->netdev); |
@@ -4313,7 +4315,7 @@ static void mgsl_add_device( struct mgsl_struct *info ) | |||
4313 | info->max_frame_size ); | 4315 | info->max_frame_size ); |
4314 | } | 4316 | } |
4315 | 4317 | ||
4316 | #ifdef CONFIG_HDLC | 4318 | #if SYNCLINK_GENERIC_HDLC |
4317 | hdlcdev_init(info); | 4319 | hdlcdev_init(info); |
4318 | #endif | 4320 | #endif |
4319 | 4321 | ||
@@ -4471,7 +4473,7 @@ static void synclink_cleanup(void) | |||
4471 | 4473 | ||
4472 | info = mgsl_device_list; | 4474 | info = mgsl_device_list; |
4473 | while(info) { | 4475 | while(info) { |
4474 | #ifdef CONFIG_HDLC | 4476 | #if SYNCLINK_GENERIC_HDLC |
4475 | hdlcdev_exit(info); | 4477 | hdlcdev_exit(info); |
4476 | #endif | 4478 | #endif |
4477 | mgsl_release_resources(info); | 4479 | mgsl_release_resources(info); |
@@ -6645,7 +6647,7 @@ static int mgsl_get_rx_frame(struct mgsl_struct *info) | |||
6645 | return_frame = 1; | 6647 | return_frame = 1; |
6646 | } | 6648 | } |
6647 | framesize = 0; | 6649 | framesize = 0; |
6648 | #ifdef CONFIG_HDLC | 6650 | #if SYNCLINK_GENERIC_HDLC |
6649 | { | 6651 | { |
6650 | struct net_device_stats *stats = hdlc_stats(info->netdev); | 6652 | struct net_device_stats *stats = hdlc_stats(info->netdev); |
6651 | stats->rx_errors++; | 6653 | stats->rx_errors++; |
@@ -6721,7 +6723,7 @@ static int mgsl_get_rx_frame(struct mgsl_struct *info) | |||
6721 | *ptmp); | 6723 | *ptmp); |
6722 | } | 6724 | } |
6723 | 6725 | ||
6724 | #ifdef CONFIG_HDLC | 6726 | #if SYNCLINK_GENERIC_HDLC |
6725 | if (info->netcount) | 6727 | if (info->netcount) |
6726 | hdlcdev_rx(info,info->intermediate_rxbuffer,framesize); | 6728 | hdlcdev_rx(info,info->intermediate_rxbuffer,framesize); |
6727 | else | 6729 | else |
@@ -7625,7 +7627,7 @@ static void mgsl_tx_timeout(unsigned long context) | |||
7625 | 7627 | ||
7626 | spin_unlock_irqrestore(&info->irq_spinlock,flags); | 7628 | spin_unlock_irqrestore(&info->irq_spinlock,flags); |
7627 | 7629 | ||
7628 | #ifdef CONFIG_HDLC | 7630 | #if SYNCLINK_GENERIC_HDLC |
7629 | if (info->netcount) | 7631 | if (info->netcount) |
7630 | hdlcdev_tx_done(info); | 7632 | hdlcdev_tx_done(info); |
7631 | else | 7633 | else |
@@ -7701,7 +7703,7 @@ static int usc_loopmode_active( struct mgsl_struct * info) | |||
7701 | return usc_InReg( info, CCSR ) & BIT7 ? 1 : 0 ; | 7703 | return usc_InReg( info, CCSR ) & BIT7 ? 1 : 0 ; |
7702 | } | 7704 | } |
7703 | 7705 | ||
7704 | #ifdef CONFIG_HDLC | 7706 | #if SYNCLINK_GENERIC_HDLC |
7705 | 7707 | ||
7706 | /** | 7708 | /** |
7707 | * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.) | 7709 | * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.) |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 83b5d37d6c59..e4730a7312b5 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -83,8 +83,10 @@ | |||
83 | 83 | ||
84 | #include "linux/synclink.h" | 84 | #include "linux/synclink.h" |
85 | 85 | ||
86 | #ifdef CONFIG_HDLC_MODULE | 86 | #if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINK_GT_MODULE)) |
87 | #define CONFIG_HDLC 1 | 87 | #define SYNCLINK_GENERIC_HDLC 1 |
88 | #else | ||
89 | #define SYNCLINK_GENERIC_HDLC 0 | ||
88 | #endif | 90 | #endif |
89 | 91 | ||
90 | /* | 92 | /* |
@@ -171,7 +173,7 @@ static void set_break(struct tty_struct *tty, int break_state); | |||
171 | /* | 173 | /* |
172 | * generic HDLC support and callbacks | 174 | * generic HDLC support and callbacks |
173 | */ | 175 | */ |
174 | #ifdef CONFIG_HDLC | 176 | #if SYNCLINK_GENERIC_HDLC |
175 | #define dev_to_port(D) (dev_to_hdlc(D)->priv) | 177 | #define dev_to_port(D) (dev_to_hdlc(D)->priv) |
176 | static void hdlcdev_tx_done(struct slgt_info *info); | 178 | static void hdlcdev_tx_done(struct slgt_info *info); |
177 | static void hdlcdev_rx(struct slgt_info *info, char *buf, int size); | 179 | static void hdlcdev_rx(struct slgt_info *info, char *buf, int size); |
@@ -359,7 +361,7 @@ struct slgt_info { | |||
359 | int netcount; | 361 | int netcount; |
360 | int dosyncppp; | 362 | int dosyncppp; |
361 | spinlock_t netlock; | 363 | spinlock_t netlock; |
362 | #ifdef CONFIG_HDLC | 364 | #if SYNCLINK_GENERIC_HDLC |
363 | struct net_device *netdev; | 365 | struct net_device *netdev; |
364 | #endif | 366 | #endif |
365 | 367 | ||
@@ -1354,7 +1356,7 @@ static void set_break(struct tty_struct *tty, int break_state) | |||
1354 | spin_unlock_irqrestore(&info->lock,flags); | 1356 | spin_unlock_irqrestore(&info->lock,flags); |
1355 | } | 1357 | } |
1356 | 1358 | ||
1357 | #ifdef CONFIG_HDLC | 1359 | #if SYNCLINK_GENERIC_HDLC |
1358 | 1360 | ||
1359 | /** | 1361 | /** |
1360 | * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.) | 1362 | * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.) |
@@ -2002,7 +2004,7 @@ static void dcd_change(struct slgt_info *info) | |||
2002 | } else { | 2004 | } else { |
2003 | info->input_signal_events.dcd_down++; | 2005 | info->input_signal_events.dcd_down++; |
2004 | } | 2006 | } |
2005 | #ifdef CONFIG_HDLC | 2007 | #if SYNCLINK_GENERIC_HDLC |
2006 | if (info->netcount) { | 2008 | if (info->netcount) { |
2007 | if (info->signals & SerialSignal_DCD) | 2009 | if (info->signals & SerialSignal_DCD) |
2008 | netif_carrier_on(info->netdev); | 2010 | netif_carrier_on(info->netdev); |
@@ -2180,7 +2182,7 @@ static void isr_txeom(struct slgt_info *info, unsigned short status) | |||
2180 | set_signals(info); | 2182 | set_signals(info); |
2181 | } | 2183 | } |
2182 | 2184 | ||
2183 | #ifdef CONFIG_HDLC | 2185 | #if SYNCLINK_GENERIC_HDLC |
2184 | if (info->netcount) | 2186 | if (info->netcount) |
2185 | hdlcdev_tx_done(info); | 2187 | hdlcdev_tx_done(info); |
2186 | else | 2188 | else |
@@ -3306,7 +3308,7 @@ static void add_device(struct slgt_info *info) | |||
3306 | devstr, info->device_name, info->phys_reg_addr, | 3308 | devstr, info->device_name, info->phys_reg_addr, |
3307 | info->irq_level, info->max_frame_size); | 3309 | info->irq_level, info->max_frame_size); |
3308 | 3310 | ||
3309 | #ifdef CONFIG_HDLC | 3311 | #if SYNCLINK_GENERIC_HDLC |
3310 | hdlcdev_init(info); | 3312 | hdlcdev_init(info); |
3311 | #endif | 3313 | #endif |
3312 | } | 3314 | } |
@@ -3488,7 +3490,7 @@ static void slgt_cleanup(void) | |||
3488 | /* release devices */ | 3490 | /* release devices */ |
3489 | info = slgt_device_list; | 3491 | info = slgt_device_list; |
3490 | while(info) { | 3492 | while(info) { |
3491 | #ifdef CONFIG_HDLC | 3493 | #if SYNCLINK_GENERIC_HDLC |
3492 | hdlcdev_exit(info); | 3494 | hdlcdev_exit(info); |
3493 | #endif | 3495 | #endif |
3494 | free_dma_bufs(info); | 3496 | free_dma_bufs(info); |
@@ -4434,7 +4436,7 @@ check_again: | |||
4434 | framesize = 0; | 4436 | framesize = 0; |
4435 | } | 4437 | } |
4436 | 4438 | ||
4437 | #ifdef CONFIG_HDLC | 4439 | #if SYNCLINK_GENERIC_HDLC |
4438 | if (framesize == 0) { | 4440 | if (framesize == 0) { |
4439 | struct net_device_stats *stats = hdlc_stats(info->netdev); | 4441 | struct net_device_stats *stats = hdlc_stats(info->netdev); |
4440 | stats->rx_errors++; | 4442 | stats->rx_errors++; |
@@ -4477,7 +4479,7 @@ check_again: | |||
4477 | framesize++; | 4479 | framesize++; |
4478 | } | 4480 | } |
4479 | 4481 | ||
4480 | #ifdef CONFIG_HDLC | 4482 | #if SYNCLINK_GENERIC_HDLC |
4481 | if (info->netcount) | 4483 | if (info->netcount) |
4482 | hdlcdev_rx(info,info->tmp_rbuf, framesize); | 4484 | hdlcdev_rx(info,info->tmp_rbuf, framesize); |
4483 | else | 4485 | else |
@@ -4780,7 +4782,7 @@ static void tx_timeout(unsigned long context) | |||
4780 | info->tx_count = 0; | 4782 | info->tx_count = 0; |
4781 | spin_unlock_irqrestore(&info->lock,flags); | 4783 | spin_unlock_irqrestore(&info->lock,flags); |
4782 | 4784 | ||
4783 | #ifdef CONFIG_HDLC | 4785 | #if SYNCLINK_GENERIC_HDLC |
4784 | if (info->netcount) | 4786 | if (info->netcount) |
4785 | hdlcdev_tx_done(info); | 4787 | hdlcdev_tx_done(info); |
4786 | else | 4788 | else |
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 13a57245cf2e..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); | |||
536 | static void unthrottle(struct tty_struct * tty); | 538 | static void unthrottle(struct tty_struct * tty); |
537 | static void set_break(struct tty_struct *tty, int break_state); | 539 | static 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) |
541 | static void hdlcdev_tx_done(SLMP_INFO *info); | 543 | static void hdlcdev_tx_done(SLMP_INFO *info); |
542 | static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size); | 544 | static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size); |
@@ -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.) |
@@ -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 | } |
@@ -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 |