aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wan/pc300_drv.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index 56e69403d178..8d9b959bf15b 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -2016,7 +2016,6 @@ static void sca_intr(pc300_t * card)
2016 pc300ch_t *chan = &card->chan[ch]; 2016 pc300ch_t *chan = &card->chan[ch];
2017 pc300dev_t *d = &chan->d; 2017 pc300dev_t *d = &chan->d;
2018 struct net_device *dev = d->dev; 2018 struct net_device *dev = d->dev;
2019 hdlc_device *hdlc = dev_to_hdlc(dev);
2020 2019
2021 spin_lock(&card->card_lock); 2020 spin_lock(&card->card_lock);
2022 2021
@@ -2049,8 +2048,8 @@ static void sca_intr(pc300_t * card)
2049 } 2048 }
2050 cpc_net_rx(dev); 2049 cpc_net_rx(dev);
2051 /* Discard invalid frames */ 2050 /* Discard invalid frames */
2052 hdlc->stats.rx_errors++; 2051 hdlc_stats(dev)->rx_errors++;
2053 hdlc->stats.rx_over_errors++; 2052 hdlc_stats(dev)->rx_over_errors++;
2054 chan->rx_first_bd = 0; 2053 chan->rx_first_bd = 0;
2055 chan->rx_last_bd = N_DMA_RX_BUF - 1; 2054 chan->rx_last_bd = N_DMA_RX_BUF - 1;
2056 rx_dma_start(card, ch); 2055 rx_dma_start(card, ch);
@@ -2116,8 +2115,8 @@ static void sca_intr(pc300_t * card)
2116 card->hw.cpld_reg2) & 2115 card->hw.cpld_reg2) &
2117 ~ (CPLD_REG2_FALC_LED1 << (2 * ch))); 2116 ~ (CPLD_REG2_FALC_LED1 << (2 * ch)));
2118 } 2117 }
2119 hdlc->stats.tx_errors++; 2118 hdlc_stats(dev)->tx_errors++;
2120 hdlc->stats.tx_fifo_errors++; 2119 hdlc_stats(dev)->tx_fifo_errors++;
2121 sca_tx_intr(d); 2120 sca_tx_intr(d);
2122 } 2121 }
2123 } 2122 }
@@ -2534,7 +2533,6 @@ static int cpc_change_mtu(struct net_device *dev, int new_mtu)
2534 2533
2535static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 2534static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2536{ 2535{
2537 hdlc_device *hdlc = dev_to_hdlc(dev);
2538 pc300dev_t *d = (pc300dev_t *) dev->priv; 2536 pc300dev_t *d = (pc300dev_t *) dev->priv;
2539 pc300ch_t *chan = (pc300ch_t *) d->chan; 2537 pc300ch_t *chan = (pc300ch_t *) d->chan;
2540 pc300_t *card = (pc300_t *) chan->card; 2538 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 case SIOCGPC300CONF: 2550 case SIOCGPC300CONF:
2553#ifdef CONFIG_PC300_MLPPP 2551#ifdef CONFIG_PC300_MLPPP
2554 if (conf->proto != PC300_PROTO_MLPPP) { 2552 if (conf->proto != PC300_PROTO_MLPPP) {
2555 conf->proto = hdlc->proto.id; 2553 conf->proto = /* FIXME hdlc->proto.id */ 0;
2556 } 2554 }
2557#else 2555#else
2558 conf->proto = hdlc->proto.id; 2556 conf->proto = /* FIXME hdlc->proto.id */ 0;
2559#endif 2557#endif
2560 memcpy(&conf_aux.conf, conf, sizeof(pc300chconf_t)); 2558 memcpy(&conf_aux.conf, conf, sizeof(pc300chconf_t));
2561 memcpy(&conf_aux.hw, &card->hw, sizeof(pc300hw_t)); 2559 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 } 2586 }
2589 } else { 2587 } else {
2590 memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t)); 2588 memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t));
2591 hdlc->proto.id = conf->proto; 2589 /* FIXME hdlc->proto.id = conf->proto; */
2592 } 2590 }
2593 } 2591 }
2594#else 2592#else
2595 memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t)); 2593 memcpy(conf, &conf_aux.conf, sizeof(pc300chconf_t));
2596 hdlc->proto.id = conf->proto; 2594 /* FIXME hdlc->proto.id = conf->proto; */
2597#endif 2595#endif
2598 return 0; 2596 return 0;
2599 case SIOCGPC300STATUS: 2597 case SIOCGPC300STATUS:
@@ -2606,7 +2604,7 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2606 case SIOCGPC300UTILSTATS: 2604 case SIOCGPC300UTILSTATS:
2607 { 2605 {
2608 if (!arg) { /* clear statistics */ 2606 if (!arg) { /* clear statistics */
2609 memset(&hdlc->stats, 0, sizeof(struct net_device_stats)); 2607 memset(hdlc_stats(dev), 0, sizeof(struct net_device_stats));
2610 if (card->hw.type == PC300_TE) { 2608 if (card->hw.type == PC300_TE) {
2611 memset(&chan->falc, 0, sizeof(falc_t)); 2609 memset(&chan->falc, 0, sizeof(falc_t));
2612 } 2610 }
@@ -2617,7 +2615,7 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2617 pc300stats.hw_type = card->hw.type; 2615 pc300stats.hw_type = card->hw.type;
2618 pc300stats.line_on = card->chan[ch].d.line_on; 2616 pc300stats.line_on = card->chan[ch].d.line_on;
2619 pc300stats.line_off = card->chan[ch].d.line_off; 2617 pc300stats.line_off = card->chan[ch].d.line_off;
2620 memcpy(&pc300stats.gen_stats, &hdlc->stats, 2618 memcpy(&pc300stats.gen_stats, hdlc_stats(dev),
2621 sizeof(struct net_device_stats)); 2619 sizeof(struct net_device_stats));
2622 if (card->hw.type == PC300_TE) 2620 if (card->hw.type == PC300_TE)
2623 memcpy(&pc300stats.te_stats,&chan->falc,sizeof(falc_t)); 2621 memcpy(&pc300stats.te_stats,&chan->falc,sizeof(falc_t));
@@ -3147,7 +3145,6 @@ static void cpc_closech(pc300dev_t * d)
3147 3145
3148int cpc_open(struct net_device *dev) 3146int cpc_open(struct net_device *dev)
3149{ 3147{
3150 hdlc_device *hdlc = dev_to_hdlc(dev);
3151 pc300dev_t *d = (pc300dev_t *) dev->priv; 3148 pc300dev_t *d = (pc300dev_t *) dev->priv;
3152 struct ifreq ifr; 3149 struct ifreq ifr;
3153 int result; 3150 int result;
@@ -3156,12 +3153,14 @@ int cpc_open(struct net_device *dev)
3156 printk("pc300: cpc_open"); 3153 printk("pc300: cpc_open");
3157#endif 3154#endif
3158 3155
3156#ifdef FIXME
3159 if (hdlc->proto.id == IF_PROTO_PPP) { 3157 if (hdlc->proto.id == IF_PROTO_PPP) {
3160 d->if_ptr = &hdlc->state.ppp.pppdev; 3158 d->if_ptr = &hdlc->state.ppp.pppdev;
3161 } 3159 }
3160#endif
3162 3161
3163 result = hdlc_open(dev); 3162 result = hdlc_open(dev);
3164 if (hdlc->proto.id == IF_PROTO_PPP) { 3163 if (/* FIXME hdlc->proto.id == IF_PROTO_PPP*/ 0) {
3165 dev->priv = d; 3164 dev->priv = d;
3166 } 3165 }
3167 if (result) { 3166 if (result) {
@@ -3176,7 +3175,6 @@ int cpc_open(struct net_device *dev)
3176 3175
3177static int cpc_close(struct net_device *dev) 3176static int cpc_close(struct net_device *dev)
3178{ 3177{
3179 hdlc_device *hdlc = dev_to_hdlc(dev);
3180 pc300dev_t *d = (pc300dev_t *) dev->priv; 3178 pc300dev_t *d = (pc300dev_t *) dev->priv;
3181 pc300ch_t *chan = (pc300ch_t *) d->chan; 3179 pc300ch_t *chan = (pc300ch_t *) d->chan;
3182 pc300_t *card = (pc300_t *) chan->card; 3180 pc300_t *card = (pc300_t *) chan->card;
@@ -3193,7 +3191,7 @@ static int cpc_close(struct net_device *dev)
3193 CPC_UNLOCK(card, flags); 3191 CPC_UNLOCK(card, flags);
3194 3192
3195 hdlc_close(dev); 3193 hdlc_close(dev);
3196 if (hdlc->proto.id == IF_PROTO_PPP) { 3194 if (/* FIXME hdlc->proto.id == IF_PROTO_PPP*/ 0) {
3197 d->if_ptr = NULL; 3195 d->if_ptr = NULL;
3198 } 3196 }
3199#ifdef CONFIG_PC300_MLPPP 3197#ifdef CONFIG_PC300_MLPPP