Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42946
b: refs/heads/master
c: af69c7f
h: refs/heads/master
v: v3
  • Loading branch information
Paul Fulghum authored and Linus Torvalds committed Dec 7, 2006
1 parent 7da3bf9 commit 8a3a167
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 49 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ee6f61ca0720c71086a9eaf3f5bd0f7c51fe139
refs/heads/master: af69c7f924b272927f9aea378f34f4548d3888d9
26 changes: 14 additions & 12 deletions trunk/drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>

#ifdef CONFIG_HDLC_MODULE
#define CONFIG_HDLC 1
#if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINK_CS_MODULE))
#define SYNCLINK_GENERIC_HDLC 1
#else
#define SYNCLINK_GENERIC_HDLC 0
#endif

#define GET_USER(error,value,addr) error = get_user(value,addr)
Expand Down Expand Up @@ -235,7 +237,7 @@ typedef struct _mgslpc_info {
int dosyncppp;
spinlock_t netlock;

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
struct net_device *netdev;
#endif

Expand Down Expand Up @@ -392,7 +394,7 @@ static void tx_timeout(unsigned long context);

static int ioctl_common(MGSLPC_INFO *info, unsigned int cmd, unsigned long arg);

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
#define dev_to_port(D) (dev_to_hdlc(D)->priv)
static void hdlcdev_tx_done(MGSLPC_INFO *info);
static void hdlcdev_rx(MGSLPC_INFO *info, char *buf, int size);
Expand Down Expand Up @@ -1053,7 +1055,7 @@ static void tx_done(MGSLPC_INFO *info)
info->drop_rts_on_tx_done = 0;
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_tx_done(info);
else
Expand Down Expand Up @@ -1164,7 +1166,7 @@ static void dcd_change(MGSLPC_INFO *info)
}
else
info->input_signal_events.dcd_down++;
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount) {
if (info->serial_signals & SerialSignal_DCD)
netif_carrier_on(info->netdev);
Expand Down Expand Up @@ -2953,7 +2955,7 @@ static void mgslpc_add_device(MGSLPC_INFO *info)
printk( "SyncLink PC Card %s:IO=%04X IRQ=%d\n",
info->device_name, info->io_base, info->irq_level);

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
hdlcdev_init(info);
#endif
}
Expand All @@ -2969,7 +2971,7 @@ static void mgslpc_remove_device(MGSLPC_INFO *remove_info)
last->next_device = info->next_device;
else
mgslpc_device_list = info->next_device;
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
hdlcdev_exit(info);
#endif
release_resources(info);
Expand Down Expand Up @@ -3901,7 +3903,7 @@ static int rx_get_frame(MGSLPC_INFO *info)
return_frame = 1;
}
framesize = 0;
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
{
struct net_device_stats *stats = hdlc_stats(info->netdev);
stats->rx_errors++;
Expand Down Expand Up @@ -3935,7 +3937,7 @@ static int rx_get_frame(MGSLPC_INFO *info)
++framesize;
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_rx(info, buf->data, framesize);
else
Expand Down Expand Up @@ -4091,15 +4093,15 @@ static void tx_timeout(unsigned long context)

spin_unlock_irqrestore(&info->lock,flags);

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_tx_done(info);
else
#endif
bh_transmit(info);
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC

/**
* called by generic HDLC layer when protocol selected (PPP, frame relay, etc.)
Expand Down
26 changes: 14 additions & 12 deletions trunk/drivers/char/synclink.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@
#include <linux/hdlc.h>
#include <linux/dma-mapping.h>

#ifdef CONFIG_HDLC_MODULE
#define CONFIG_HDLC 1
#if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINK_MODULE))
#define SYNCLINK_GENERIC_HDLC 1
#else
#define SYNCLINK_GENERIC_HDLC 0
#endif

#define GET_USER(error,value,addr) error = get_user(value,addr)
Expand Down Expand Up @@ -320,7 +322,7 @@ struct mgsl_struct {
int dosyncppp;
spinlock_t netlock;

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
struct net_device *netdev;
#endif
};
Expand Down Expand Up @@ -728,7 +730,7 @@ static void usc_loopmode_send_done( struct mgsl_struct * info );

static int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg);

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
#define dev_to_port(D) (dev_to_hdlc(D)->priv)
static void hdlcdev_tx_done(struct mgsl_struct *info);
static void hdlcdev_rx(struct mgsl_struct *info, char *buf, int size);
Expand Down Expand Up @@ -1277,7 +1279,7 @@ static void mgsl_isr_transmit_status( struct mgsl_struct *info )
info->drop_rts_on_tx_done = 0;
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_tx_done(info);
else
Expand Down Expand Up @@ -1342,7 +1344,7 @@ static void mgsl_isr_io_pin( struct mgsl_struct *info )
info->input_signal_events.dcd_up++;
} else
info->input_signal_events.dcd_down++;
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount) {
if (status & MISCSTATUS_DCD)
netif_carrier_on(info->netdev);
Expand Down Expand Up @@ -4313,7 +4315,7 @@ static void mgsl_add_device( struct mgsl_struct *info )
info->max_frame_size );
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
hdlcdev_init(info);
#endif

Expand Down Expand Up @@ -4471,7 +4473,7 @@ static void synclink_cleanup(void)

info = mgsl_device_list;
while(info) {
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
hdlcdev_exit(info);
#endif
mgsl_release_resources(info);
Expand Down Expand Up @@ -6645,7 +6647,7 @@ static int mgsl_get_rx_frame(struct mgsl_struct *info)
return_frame = 1;
}
framesize = 0;
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
{
struct net_device_stats *stats = hdlc_stats(info->netdev);
stats->rx_errors++;
Expand Down Expand Up @@ -6721,7 +6723,7 @@ static int mgsl_get_rx_frame(struct mgsl_struct *info)
*ptmp);
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_rx(info,info->intermediate_rxbuffer,framesize);
else
Expand Down Expand Up @@ -7625,7 +7627,7 @@ static void mgsl_tx_timeout(unsigned long context)

spin_unlock_irqrestore(&info->irq_spinlock,flags);

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_tx_done(info);
else
Expand Down Expand Up @@ -7701,7 +7703,7 @@ static int usc_loopmode_active( struct mgsl_struct * info)
return usc_InReg( info, CCSR ) & BIT7 ? 1 : 0 ;
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC

/**
* called by generic HDLC layer when protocol selected (PPP, frame relay, etc.)
Expand Down
26 changes: 14 additions & 12 deletions trunk/drivers/char/synclink_gt.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@

#include "linux/synclink.h"

#ifdef CONFIG_HDLC_MODULE
#define CONFIG_HDLC 1
#if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINK_GT_MODULE))
#define SYNCLINK_GENERIC_HDLC 1
#else
#define SYNCLINK_GENERIC_HDLC 0
#endif

/*
Expand Down Expand Up @@ -171,7 +173,7 @@ static void set_break(struct tty_struct *tty, int break_state);
/*
* generic HDLC support and callbacks
*/
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
#define dev_to_port(D) (dev_to_hdlc(D)->priv)
static void hdlcdev_tx_done(struct slgt_info *info);
static void hdlcdev_rx(struct slgt_info *info, char *buf, int size);
Expand Down Expand Up @@ -359,7 +361,7 @@ struct slgt_info {
int netcount;
int dosyncppp;
spinlock_t netlock;
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
struct net_device *netdev;
#endif

Expand Down Expand Up @@ -1354,7 +1356,7 @@ static void set_break(struct tty_struct *tty, int break_state)
spin_unlock_irqrestore(&info->lock,flags);
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC

/**
* called by generic HDLC layer when protocol selected (PPP, frame relay, etc.)
Expand Down Expand Up @@ -2002,7 +2004,7 @@ static void dcd_change(struct slgt_info *info)
} else {
info->input_signal_events.dcd_down++;
}
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount) {
if (info->signals & SerialSignal_DCD)
netif_carrier_on(info->netdev);
Expand Down Expand Up @@ -2180,7 +2182,7 @@ static void isr_txeom(struct slgt_info *info, unsigned short status)
set_signals(info);
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_tx_done(info);
else
Expand Down Expand Up @@ -3306,7 +3308,7 @@ static void add_device(struct slgt_info *info)
devstr, info->device_name, info->phys_reg_addr,
info->irq_level, info->max_frame_size);

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
hdlcdev_init(info);
#endif
}
Expand Down Expand Up @@ -3488,7 +3490,7 @@ static void slgt_cleanup(void)
/* release devices */
info = slgt_device_list;
while(info) {
#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
hdlcdev_exit(info);
#endif
free_dma_bufs(info);
Expand Down Expand Up @@ -4434,7 +4436,7 @@ static int rx_get_frame(struct slgt_info *info)
framesize = 0;
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (framesize == 0) {
struct net_device_stats *stats = hdlc_stats(info->netdev);
stats->rx_errors++;
Expand Down Expand Up @@ -4477,7 +4479,7 @@ static int rx_get_frame(struct slgt_info *info)
framesize++;
}

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_rx(info,info->tmp_rbuf, framesize);
else
Expand Down Expand Up @@ -4780,7 +4782,7 @@ static void tx_timeout(unsigned long context)
info->tx_count = 0;
spin_unlock_irqrestore(&info->lock,flags);

#ifdef CONFIG_HDLC
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_tx_done(info);
else
Expand Down
Loading

0 comments on commit 8a3a167

Please sign in to comment.