~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to drivers/net/tokenring/ibmtr.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
static void     ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev);
201
201
static void     tok_rerun(unsigned long dev_addr);
202
202
static void     ibmtr_readlog(struct net_device *dev);
203
 
static struct   net_device_stats *tok_get_stats(struct net_device *dev);
204
203
static int      ibmtr_change_mtu(struct net_device *dev, int mtu);
205
204
static void     find_turbo_adapters(int *iolist);
206
205
 
816
815
 
817
816
/*****************************************************************************/
818
817
 
 
818
static const struct net_device_ops trdev_netdev_ops = {
 
819
        .ndo_open               = tok_open,
 
820
        .ndo_stop               = tok_close,
 
821
        .ndo_start_xmit         = tok_send_packet,
 
822
        .ndo_set_multicast_list = tok_set_multicast_list,
 
823
        .ndo_change_mtu         = ibmtr_change_mtu,
 
824
};
 
825
 
819
826
static int __devinit trdev_init(struct net_device *dev)
820
827
{
821
828
        struct tok_info *ti = netdev_priv(dev);
822
829
 
823
830
        SET_PAGE(ti->srb_page);
824
831
        ti->open_failure = NO    ;
825
 
        dev->open = tok_open;
826
 
        dev->stop = tok_close;
827
 
        dev->hard_start_xmit = tok_send_packet;
828
 
        dev->get_stats = tok_get_stats;
829
 
        dev->set_multicast_list = tok_set_multicast_list;
830
 
        dev->change_mtu = ibmtr_change_mtu;
 
832
        dev->netdev_ops = &trdev_netdev_ops;
831
833
 
832
834
        return 0;
833
835
}
1460
1462
                                        "%02X\n",
1461
1463
                                        (int)retcode, (int)readb(ti->ssb + 6));
1462
1464
                        else
1463
 
                                ti->tr_stats.tx_packets++;
 
1465
                                dev->stats.tx_packets++;
1464
1466
                        break;
1465
1467
                case XMIT_XID_CMD:
1466
1468
                        DPRINTK("xmit xid ret_code: %02X\n",
1646
1648
                break;
1647
1649
        }
1648
1650
        writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
1649
 
        ti->tr_stats.tx_bytes += ti->current_skb->len;
 
1651
        dev->stats.tx_bytes += ti->current_skb->len;
1650
1652
        dev_kfree_skb_irq(ti->current_skb);
1651
1653
        ti->current_skb = NULL;
1652
1654
        netif_wake_queue(dev);
1722
1724
        if (readb(llc + offsetof(struct trllc, llc)) != UI_CMD) {
1723
1725
                SET_PAGE(ti->asb_page);
1724
1726
                writeb(DATA_LOST, ti->asb + RETCODE_OFST);
1725
 
                ti->tr_stats.rx_dropped++;
 
1727
                dev->stats.rx_dropped++;
1726
1728
                writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
1727
1729
                return;
1728
1730
        }
1757
1759
 
1758
1760
        if (!(skb = dev_alloc_skb(skb_size))) {
1759
1761
                DPRINTK("out of memory. frame dropped.\n");
1760
 
                ti->tr_stats.rx_dropped++;
 
1762
                dev->stats.rx_dropped++;
1761
1763
                SET_PAGE(ti->asb_page);
1762
1764
                writeb(DATA_LOST, ti->asb + offsetof(struct asb_rec, ret_code));
1763
1765
                writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
1813
1815
 
1814
1816
        writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
1815
1817
 
1816
 
        ti->tr_stats.rx_bytes += skb->len;
1817
 
        ti->tr_stats.rx_packets++;
 
1818
        dev->stats.rx_bytes += skb->len;
 
1819
        dev->stats.rx_packets++;
1818
1820
 
1819
1821
        skb->protocol = tr_type_trans(skb, dev);
1820
1822
        if (IPv4_p) {
1876
1878
 
1877
1879
/*****************************************************************************/
1878
1880
 
1879
 
/* tok_get_stats():  Basically a scaffold routine which will return
1880
 
   the address of the tr_statistics structure associated with
1881
 
   this device -- the tr.... structure is an ethnet look-alike
1882
 
   so at least for this iteration may suffice.   */
1883
 
 
1884
 
static struct net_device_stats *tok_get_stats(struct net_device *dev)
1885
 
{
1886
 
 
1887
 
        struct tok_info *toki;
1888
 
        toki = netdev_priv(dev);
1889
 
        return (struct net_device_stats *) &toki->tr_stats;
1890
 
}
1891
 
 
1892
 
/*****************************************************************************/
1893
 
 
1894
1881
static int ibmtr_change_mtu(struct net_device *dev, int mtu)
1895
1882
{
1896
1883
        struct tok_info *ti = netdev_priv(dev);