Commit 8aca2310 authored by Krzysztof Halasa's avatar Krzysztof Halasa Committed by Jeff Garzik

[PATCH] Make PC300 WAN driver compile again

This patch removes accesses to the HDLC-internal data structures
from pc300 driver, thus enabling it to compile but breaking part
of its functionality.
Signed-off-by: default avatarKrzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent eb2a2fd9
...@@ -2016,7 +2016,6 @@ static void sca_intr(pc300_t * card) ...@@ -2016,7 +2016,6 @@ static void sca_intr(pc300_t * card)
pc300ch_t *chan = &card->chan[ch]; pc300ch_t *chan = &card->chan[ch];
pc300dev_t *d = &chan->d; pc300dev_t *d = &chan->d;
struct net_device *dev = d->dev; struct net_device *dev = d->dev;
hdlc_device *hdlc = dev_to_hdlc(dev);
spin_lock(&card->card_lock); spin_lock(&card->card_lock);
...@@ -2049,8 +2048,8 @@ static void sca_intr(pc300_t * card) ...@@ -2049,8 +2048,8 @@ static void sca_intr(pc300_t * card)
} }
cpc_net_rx(dev); cpc_net_rx(dev);
/* Discard invalid frames */ /* Discard invalid frames */
hdlc->stats.rx_errors++; hdlc_stats(dev)->rx_errors++;
hdlc->stats.rx_over_errors++; hdlc_stats(dev)->rx_over_errors++;
chan->rx_first_bd = 0; chan->rx_first_bd = 0;
chan->rx_last_bd = N_DMA_RX_BUF - 1; chan->rx_last_bd = N_DMA_RX_BUF - 1;
rx_dma_start(card, ch); rx_dma_start(card, ch);
...@@ -2116,8 +2115,8 @@ static void sca_intr(pc300_t * card) ...@@ -2116,8 +2115,8 @@ static void sca_intr(pc300_t * card)
card->hw.cpld_reg2) & card->hw.cpld_reg2) &
~ (CPLD_REG2_FALC_LED1 << (2 * ch))); ~ (CPLD_REG2_FALC_LED1 << (2 * ch)));
} }
hdlc->stats.tx_errors++; hdlc_stats(dev)->tx_errors++;
hdlc->stats.tx_fifo_errors++; hdlc_stats(dev)->tx_fifo_errors++;
sca_tx_intr(d); sca_tx_intr(d);
} }
} }
...@@ -2534,7 +2533,6 @@ static int cpc_change_mtu(struct net_device *dev, int new_mtu) ...@@ -2534,7 +2533,6 @@ static int cpc_change_mtu(struct net_device *dev, int new_mtu)
static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ {
hdlc_device *hdlc = dev_to_hdlc(dev);
pc300dev_t *d = (pc300dev_t *) dev->priv; pc300dev_t *d = (pc300dev_t *) dev->priv;
pc300ch_t *chan = (pc300ch_t *) d->chan; pc300ch_t *chan = (pc300ch_t *) d->chan;
pc300_t *card = (pc300_t *) chan->card; pc300_t *card = (pc300_t *) chan->card;
...@@ -2552,10 +2550,10 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -2552,10 +2550,10 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCGPC300CONF: case SIOCGPC300CONF:
#ifdef CONFIG_PC300_MLPPP #ifdef CONFIG_PC300_MLPPP
if (conf->proto != PC300_PROTO_MLPPP) { if (conf->proto != PC300_PROTO_MLPPP) {
conf->proto = hdlc->proto.id; conf->proto = /* FIXME hdlc->proto.id */ 0;
} }
#else #else
conf->proto = hdlc->proto.id; conf->proto = /* FIXME hdlc->proto.id */ 0;
#endif #endif
memcpy(&conf_aux.conf, conf, sizeof(pc300chconf_t)); memcpy(&conf_aux.conf, conf, sizeof(pc300chconf_t));
memcpy(&conf_aux.hw, &card->hw, sizeof(pc300hw_t)); memcpy(&conf_aux.hw, &card->hw, sizeof(pc300hw_t));
...@@ -2588,12 +2586,12 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -2588,12 +2586,12 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
} }
} else { } else {
memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t)); memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t));
hdlc->proto.id = conf->proto; /* FIXME hdlc->proto.id = conf->proto; */
} }
} }
#else #else
memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t)); memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t));
hdlc->proto.id = conf->proto; /* FIXME hdlc->proto.id = conf->proto; */
#endif #endif
return 0; return 0;
case SIOCGPC300STATUS: case SIOCGPC300STATUS:
...@@ -2606,7 +2604,7 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -2606,7 +2604,7 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCGPC300UTILSTATS: case SIOCGPC300UTILSTATS:
{ {
if (!arg) { /* clear statistics */ if (!arg) { /* clear statistics */
memset(&hdlc->stats, 0, sizeof(struct net_device_stats)); memset(hdlc_stats(dev), 0, sizeof(struct net_device_stats));
if (card->hw.type == PC300_TE) { if (card->hw.type == PC300_TE) {
memset(&chan->falc, 0, sizeof(falc_t)); memset(&chan->falc, 0, sizeof(falc_t));
} }
...@@ -2617,7 +2615,7 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -2617,7 +2615,7 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
pc300stats.hw_type = card->hw.type; pc300stats.hw_type = card->hw.type;
pc300stats.line_on = card->chan[ch].d.line_on; pc300stats.line_on = card->chan[ch].d.line_on;
pc300stats.line_off = card->chan[ch].d.line_off; pc300stats.line_off = card->chan[ch].d.line_off;
memcpy(&pc300stats.gen_stats, &hdlc->stats, memcpy(&pc300stats.gen_stats, hdlc_stats(dev),
sizeof(struct net_device_stats)); sizeof(struct net_device_stats));
if (card->hw.type == PC300_TE) if (card->hw.type == PC300_TE)
memcpy(&pc300stats.te_stats,&chan->falc,sizeof(falc_t)); memcpy(&pc300stats.te_stats,&chan->falc,sizeof(falc_t));
...@@ -3147,7 +3145,6 @@ static void cpc_closech(pc300dev_t * d) ...@@ -3147,7 +3145,6 @@ static void cpc_closech(pc300dev_t * d)
int cpc_open(struct net_device *dev) int cpc_open(struct net_device *dev)
{ {
hdlc_device *hdlc = dev_to_hdlc(dev);
pc300dev_t *d = (pc300dev_t *) dev->priv; pc300dev_t *d = (pc300dev_t *) dev->priv;
struct ifreq ifr; struct ifreq ifr;
int result; int result;
...@@ -3156,12 +3153,14 @@ int cpc_open(struct net_device *dev) ...@@ -3156,12 +3153,14 @@ int cpc_open(struct net_device *dev)
printk("pc300: cpc_open"); printk("pc300: cpc_open");
#endif #endif
#ifdef FIXME
if (hdlc->proto.id == IF_PROTO_PPP) { if (hdlc->proto.id == IF_PROTO_PPP) {
d->if_ptr = &hdlc->state.ppp.pppdev; d->if_ptr = &hdlc->state.ppp.pppdev;
} }
#endif
result = hdlc_open(dev); result = hdlc_open(dev);
if (hdlc->proto.id == IF_PROTO_PPP) { if (/* FIXME hdlc->proto.id == IF_PROTO_PPP*/ 0) {
dev->priv = d; dev->priv = d;
} }
if (result) { if (result) {
...@@ -3176,7 +3175,6 @@ int cpc_open(struct net_device *dev) ...@@ -3176,7 +3175,6 @@ int cpc_open(struct net_device *dev)
static int cpc_close(struct net_device *dev) static int cpc_close(struct net_device *dev)
{ {
hdlc_device *hdlc = dev_to_hdlc(dev);
pc300dev_t *d = (pc300dev_t *) dev->priv; pc300dev_t *d = (pc300dev_t *) dev->priv;
pc300ch_t *chan = (pc300ch_t *) d->chan; pc300ch_t *chan = (pc300ch_t *) d->chan;
pc300_t *card = (pc300_t *) chan->card; pc300_t *card = (pc300_t *) chan->card;
...@@ -3193,7 +3191,7 @@ static int cpc_close(struct net_device *dev) ...@@ -3193,7 +3191,7 @@ static int cpc_close(struct net_device *dev)
CPC_UNLOCK(card, flags); CPC_UNLOCK(card, flags);
hdlc_close(dev); hdlc_close(dev);
if (hdlc->proto.id == IF_PROTO_PPP) { if (/* FIXME hdlc->proto.id == IF_PROTO_PPP*/ 0) {
d->if_ptr = NULL; d->if_ptr = NULL;
} }
#ifdef CONFIG_PC300_MLPPP #ifdef CONFIG_PC300_MLPPP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment