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

« back to all changes in this revision

Viewing changes to drivers/net/ax88796.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:
93
93
 
94
94
        unsigned char            running;
95
95
        unsigned char            resume_open;
 
96
        unsigned int             irqflags;
96
97
 
97
98
        u32                      reg_offsets[0x20];
98
99
};
474
475
 
475
476
        dev_dbg(&ax->dev->dev, "%s: open\n", dev->name);
476
477
 
477
 
        ret = request_irq(dev->irq, ax_ei_interrupt, 0, dev->name, dev);
 
478
        ret = request_irq(dev->irq, ax_ei_interrupt, ax->irqflags,
 
479
                          dev->name, dev);
478
480
        if (ret)
479
481
                return ret;
480
482
 
731
733
        /* load the mac-address from the device if this is the
732
734
         * first time we've initialised */
733
735
 
734
 
        if (first_init && ax->plat->flags & AXFLG_MAC_FROMDEV) {
735
 
                ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP,
736
 
                        ei_local->mem + E8390_CMD); /* 0x61 */
 
736
        if (first_init) {
 
737
                if (ax->plat->flags & AXFLG_MAC_FROMDEV) {
 
738
                        ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP,
 
739
                                ei_local->mem + E8390_CMD); /* 0x61 */
 
740
                        for (i = 0; i < ETHER_ADDR_LEN; i++)
 
741
                                dev->dev_addr[i] =
 
742
                                        ei_inb(ioaddr + EN1_PHYS_SHIFT(i));
 
743
                }
737
744
 
738
 
                for (i = 0 ; i < ETHER_ADDR_LEN ; i++)
739
 
                        dev->dev_addr[i] = ei_inb(ioaddr + EN1_PHYS_SHIFT(i));
 
745
                if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) &&
 
746
                     ax->plat->mac_addr)
 
747
                        memcpy(dev->dev_addr, ax->plat->mac_addr,
 
748
                                ETHER_ADDR_LEN);
740
749
        }
741
750
 
742
751
        ax_reset_8390(dev);
829
838
        struct ax_device  *ax;
830
839
        struct resource   *res;
831
840
        size_t size;
832
 
        int ret;
 
841
        int ret = 0;
833
842
 
834
843
        dev = ax__alloc_ei_netdev(sizeof(struct ax_device));
835
844
        if (dev == NULL)
850
859
 
851
860
        /* find the platform resources */
852
861
 
853
 
        ret  = platform_get_irq(pdev, 0);
854
 
        if (ret < 0) {
 
862
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 
863
        if (res == NULL) {
855
864
                dev_err(&pdev->dev, "no IRQ specified\n");
856
865
                goto exit_mem;
857
866
        }
858
 
        dev->irq = ret;
 
867
 
 
868
        dev->irq = res->start;
 
869
        ax->irqflags = res->flags & IRQF_TRIGGER_MASK;
859
870
 
860
871
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
861
872
        if (res == NULL) {