dahdi: Drop some 'zt' prefixes on chan.

'zt' is a carry over from the Zaptel days.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9445 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2010-10-20 12:23:23 +00:00
parent aa5c973611
commit 53d674dc21

View File

@ -93,9 +93,9 @@
#include <asm/i387.h> #include <asm/i387.h>
#endif #endif
#define hdlc_to_ztchan(h) (((struct dahdi_hdlc *)(h))->chan) #define hdlc_to_chan(h) (((struct dahdi_hdlc *)(h))->chan)
#define dev_to_ztchan(h) (((struct dahdi_hdlc *)(dev_to_hdlc(h)->priv))->chan) #define netdev_to_chan(h) (((struct dahdi_hdlc *)(dev_to_hdlc(h)->priv))->chan)
#define ztchan_to_dev(h) ((h)->hdlcnetdev->netdev) #define chan_to_netdev(h) ((h)->hdlcnetdev->netdev)
/* macro-oni for determining a unit (channel) number */ /* macro-oni for determining a unit (channel) number */
#define UNIT(file) MINOR(file->f_dentry->d_inode->i_rdev) #define UNIT(file) MINOR(file->f_dentry->d_inode->i_rdev)
@ -1711,7 +1711,7 @@ static inline struct net_device_stats *hdlc_stats(struct net_device *dev)
static int dahdi_net_open(struct net_device *dev) static int dahdi_net_open(struct net_device *dev)
{ {
int res = hdlc_open(dev); int res = hdlc_open(dev);
struct dahdi_chan *ms = dev_to_ztchan(dev); struct dahdi_chan *ms = netdev_to_chan(dev);
/* if (!dev->hard_start_xmit) return res; is this really necessary? --byg */ /* if (!dev->hard_start_xmit) return res; is this really necessary? --byg */
if (res) /* this is necessary to avoid kernel panic when UNSPEC link encap, proven --byg */ if (res) /* this is necessary to avoid kernel panic when UNSPEC link encap, proven --byg */
@ -1719,7 +1719,7 @@ static int dahdi_net_open(struct net_device *dev)
#else #else
static int dahdi_net_open(hdlc_device *hdlc) static int dahdi_net_open(hdlc_device *hdlc)
{ {
struct dahdi_chan *ms = hdlc_to_ztchan(hdlc); struct dahdi_chan *ms = hdlc_to_chan(hdlc);
int res; int res;
#endif #endif
if (!ms) { if (!ms) {
@ -1745,7 +1745,7 @@ static int dahdi_net_open(hdlc_device *hdlc)
fasthdlc_init(&ms->txhdlc, (ms->flags & DAHDI_FLAG_HDLC56) ? FASTHDLC_MODE_56 : FASTHDLC_MODE_64); fasthdlc_init(&ms->txhdlc, (ms->flags & DAHDI_FLAG_HDLC56) ? FASTHDLC_MODE_56 : FASTHDLC_MODE_64);
ms->infcs = PPP_INITFCS; ms->infcs = PPP_INITFCS;
netif_start_queue(ztchan_to_dev(ms)); netif_start_queue(chan_to_netdev(ms));
#ifdef CONFIG_DAHDI_DEBUG #ifdef CONFIG_DAHDI_DEBUG
module_printk(KERN_NOTICE, "DAHDINET: Opened channel %d name %s\n", ms->channo, ms->name); module_printk(KERN_NOTICE, "DAHDINET: Opened channel %d name %s\n", ms->channo, ms->name);
@ -1781,7 +1781,7 @@ static int dahdi_net_stop(struct net_device *dev)
static void dahdi_net_close(hdlc_device *hdlc) static void dahdi_net_close(hdlc_device *hdlc)
{ {
#endif #endif
struct dahdi_chan *ms = hdlc_to_ztchan(hdlc); struct dahdi_chan *ms = hdlc_to_chan(hdlc);
if (!ms) { if (!ms) {
#ifdef NEW_HDLC_INTERFACE #ifdef NEW_HDLC_INTERFACE
module_printk(KERN_NOTICE, "dahdi_net_stop: nothing??\n"); module_printk(KERN_NOTICE, "dahdi_net_stop: nothing??\n");
@ -1801,7 +1801,7 @@ static void dahdi_net_close(hdlc_device *hdlc)
#endif #endif
} }
/* Not much to do here. Just deallocate the buffers */ /* Not much to do here. Just deallocate the buffers */
netif_stop_queue(ztchan_to_dev(ms)); netif_stop_queue(chan_to_netdev(ms));
dahdi_reallocbufs(ms, 0, 0); dahdi_reallocbufs(ms, 0, 0);
hdlc_close(dev); hdlc_close(dev);
#ifdef NEW_HDLC_INTERFACE #ifdef NEW_HDLC_INTERFACE
@ -1850,14 +1850,14 @@ static struct dahdi_hdlc *dahdi_hdlc_alloc(void)
static int dahdi_xmit(struct sk_buff *skb, struct net_device *dev) static int dahdi_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
/* FIXME: this construction seems to be not very optimal for me but I could find nothing better at the moment (Friday, 10PM :( ) --byg */ /* FIXME: this construction seems to be not very optimal for me but I could find nothing better at the moment (Friday, 10PM :( ) --byg */
/* struct dahdi_chan *ss = hdlc_to_ztchan(list_entry(dev, struct dahdi_hdlc, netdev.netdev));*/ /* struct dahdi_chan *ss = hdlc_to_chan(list_entry(dev, struct dahdi_hdlc, netdev.netdev));*/
struct dahdi_chan *ss = dev_to_ztchan(dev); struct dahdi_chan *ss = netdev_to_chan(dev);
struct net_device_stats *stats = hdlc_stats(dev); struct net_device_stats *stats = hdlc_stats(dev);
#else #else
static int dahdi_xmit(hdlc_device *hdlc, struct sk_buff *skb) static int dahdi_xmit(hdlc_device *hdlc, struct sk_buff *skb)
{ {
struct dahdi_chan *ss = hdlc_to_ztchan(hdlc); struct dahdi_chan *ss = hdlc_to_chan(hdlc);
struct net_device *dev = &ss->hdlcnetdev->netdev.netdev; struct net_device *dev = &ss->hdlcnetdev->netdev.netdev;
struct net_device_stats *stats = &ss->hdlcnetdev->netdev.stats; struct net_device_stats *stats = &ss->hdlcnetdev->netdev.stats;
#endif #endif
@ -1896,7 +1896,7 @@ static int dahdi_xmit(hdlc_device *hdlc, struct sk_buff *skb)
/* Whoops, no more space. */ /* Whoops, no more space. */
ss->inwritebuf = -1; ss->inwritebuf = -1;
netif_stop_queue(ztchan_to_dev(ss)); netif_stop_queue(chan_to_netdev(ss));
} }
if (ss->outwritebuf < 0) { if (ss->outwritebuf < 0) {
/* Let the interrupt handler know there's /* Let the interrupt handler know there's
@ -4235,7 +4235,7 @@ static int dahdi_ioctl_chanconfig(struct file *file, unsigned long data)
spin_lock_irqsave(&chan->lock, flags); spin_lock_irqsave(&chan->lock, flags);
#ifdef CONFIG_DAHDI_NET #ifdef CONFIG_DAHDI_NET
if (dahdi_have_netdev(chan)) { if (dahdi_have_netdev(chan)) {
if (ztchan_to_dev(chan)->flags & IFF_UP) { if (chan_to_netdev(chan)->flags & IFF_UP) {
spin_unlock_irqrestore(&chan->lock, flags); spin_unlock_irqrestore(&chan->lock, flags);
module_printk(KERN_WARNING, "Can't switch HDLC net mode on channel %s, since current interface is up\n", chan->name); module_printk(KERN_WARNING, "Can't switch HDLC net mode on channel %s, since current interface is up\n", chan->name);
return -EBUSY; return -EBUSY;
@ -6782,7 +6782,7 @@ out in the later versions, and is put back now. */
fasthdlc_tx_frame_nocheck(&ms->txhdlc); fasthdlc_tx_frame_nocheck(&ms->txhdlc);
#ifdef CONFIG_DAHDI_NET #ifdef CONFIG_DAHDI_NET
if (dahdi_have_netdev(ms)) if (dahdi_have_netdev(ms))
netif_wake_queue(ztchan_to_dev(ms)); netif_wake_queue(chan_to_netdev(ms));
#endif #endif
#ifdef CONFIG_DAHDI_PPP #ifdef CONFIG_DAHDI_PPP
if (ms->flags & DAHDI_FLAG_PPP) { if (ms->flags & DAHDI_FLAG_PPP) {
@ -7983,9 +7983,10 @@ that the waitqueue is empty. */
#else #else
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
#endif #endif
skb->dev = ztchan_to_dev(ms); skb->dev = chan_to_netdev(ms);
#ifdef DAHDI_HDLC_TYPE_TRANS #ifdef DAHDI_HDLC_TYPE_TRANS
skb->protocol = hdlc_type_trans(skb, ztchan_to_dev(ms)); skb->protocol = hdlc_type_trans(skb,
chan_to_netdev(ms));
#else #else
skb->protocol = htons (ETH_P_HDLC); skb->protocol = htons (ETH_P_HDLC);
#endif #endif