Lines Matching refs:ax
321 struct ax_device *ax = to_ax_dev(dev); in ax_handle_link_change() local
325 if (phy_dev->link && ((ax->speed != phy_dev->speed) || in ax_handle_link_change()
326 (ax->duplex != phy_dev->duplex))) { in ax_handle_link_change()
328 ax->speed = phy_dev->speed; in ax_handle_link_change()
329 ax->duplex = phy_dev->duplex; in ax_handle_link_change()
333 if (phy_dev->link != ax->link) { in ax_handle_link_change()
335 ax->speed = 0; in ax_handle_link_change()
336 ax->duplex = -1; in ax_handle_link_change()
338 ax->link = phy_dev->link; in ax_handle_link_change()
349 struct ax_device *ax = to_ax_dev(dev); in ax_mii_probe() local
354 phy_dev = phy_find_first(ax->mii_bus); in ax_mii_probe()
380 struct ax_device *ax = to_ax_dev(dev); in ax_phy_switch() local
382 u8 reg_gpoc = ax->plat->gpoc_val; in ax_phy_switch()
394 struct ax_device *ax = to_ax_dev(dev); in ax_open() local
399 ret = request_irq(dev->irq, ax_ei_interrupt, ax->irqflags, in ax_open()
416 ax->running = 1; in ax_open()
431 struct ax_device *ax = to_ax_dev(dev); in ax_close() local
435 ax->running = 0; in ax_close()
547 struct ax_device *ax = container_of(ctrl, struct ax_device, bb_ctrl); in ax_bb_mdc() local
550 ax->reg_memr |= AX_MEMR_MDC; in ax_bb_mdc()
552 ax->reg_memr &= ~AX_MEMR_MDC; in ax_bb_mdc()
554 ei_outb(ax->reg_memr, ax->addr_memr); in ax_bb_mdc()
559 struct ax_device *ax = container_of(ctrl, struct ax_device, bb_ctrl); in ax_bb_dir() local
562 ax->reg_memr &= ~AX_MEMR_MDIR; in ax_bb_dir()
564 ax->reg_memr |= AX_MEMR_MDIR; in ax_bb_dir()
566 ei_outb(ax->reg_memr, ax->addr_memr); in ax_bb_dir()
571 struct ax_device *ax = container_of(ctrl, struct ax_device, bb_ctrl); in ax_bb_set_data() local
574 ax->reg_memr |= AX_MEMR_MDO; in ax_bb_set_data()
576 ax->reg_memr &= ~AX_MEMR_MDO; in ax_bb_set_data()
578 ei_outb(ax->reg_memr, ax->addr_memr); in ax_bb_set_data()
583 struct ax_device *ax = container_of(ctrl, struct ax_device, bb_ctrl); in ax_bb_get_data() local
584 int reg_memr = ei_inb(ax->addr_memr); in ax_bb_get_data()
603 struct ax_device *ax = to_ax_dev(dev); in ax_mii_init() local
606 ax->bb_ctrl.ops = &bb_ops; in ax_mii_init()
607 ax->addr_memr = ei_local->mem + AX_MEMR; in ax_mii_init()
608 ax->mii_bus = alloc_mdio_bitbang(&ax->bb_ctrl); in ax_mii_init()
609 if (!ax->mii_bus) { in ax_mii_init()
614 ax->mii_bus->name = "ax88796_mii_bus"; in ax_mii_init()
615 ax->mii_bus->parent = dev->dev.parent; in ax_mii_init()
616 snprintf(ax->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", in ax_mii_init()
619 err = mdiobus_register(ax->mii_bus); in ax_mii_init()
626 free_mdio_bitbang(ax->mii_bus); in ax_mii_init()
634 struct ax_device *ax = to_ax_dev(dev); in ax_initial_setup() local
640 ei_outb(ax->plat->dcr_val & ~1, ioaddr + EN0_DCFG); in ax_initial_setup()
641 ei_outb(ax->plat->gpoc_val, ioaddr + EI_SHIFT(0x17)); in ax_initial_setup()
655 struct ax_device *ax = to_ax_dev(dev); in ax_init_dev() local
672 if (ax->plat->flags & AXFLG_HAS_EEPROM) { in ax_init_dev()
680 if (ax->plat->wordlength == 2) in ax_init_dev()
688 if (ax->plat->flags & AXFLG_HAS_93CX6) { in ax_init_dev()
704 if (ax->plat->wordlength == 2) { in ax_init_dev()
706 ei_outb(ax->plat->dcr_val, ei_local->mem + EN0_DCFG); in ax_init_dev()
715 if (ax->plat->flags & AXFLG_MAC_FROMDEV) { in ax_init_dev()
723 if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) && in ax_init_dev()
724 ax->plat->mac_addr) in ax_init_dev()
725 memcpy(dev->dev_addr, ax->plat->mac_addr, ETH_ALEN); in ax_init_dev()
732 ei_local->word16 = (ax->plat->wordlength == 2); in ax_init_dev()
777 struct ax_device *ax = to_ax_dev(dev); in ax_remove() local
787 if (ax->map2) { in ax_remove()
788 iounmap(ax->map2); in ax_remove()
809 struct ax_device *ax; in ax_probe() local
821 ax = to_ax_dev(dev); in ax_probe()
823 ax->plat = dev_get_platdata(&pdev->dev); in ax_probe()
826 ei_local->rxcr_base = ax->plat->rcr_val; in ax_probe()
837 ax->irqflags = irq->flags & IRQF_TRIGGER_MASK; in ax_probe()
852 if (ax->plat->reg_offsets) in ax_probe()
853 ei_local->reg_offset = ax->plat->reg_offsets; in ax_probe()
855 ei_local->reg_offset = ax->reg_offsets; in ax_probe()
857 ax->reg_offsets[ret] = (mem_size / 0x18) * ret; in ax_probe()
879 if (!ax->plat->reg_offsets) { in ax_probe()
881 ax->reg_offsets[ret] = (mem_size / 0x20) * ret; in ax_probe()
892 ax->map2 = ioremap(mem2->start, mem2_size); in ax_probe()
893 if (!ax->map2) { in ax_probe()
899 ei_local->reg_offset[0x1f] = ax->map2 - ei_local->mem; in ax_probe()
907 if (!ax->map2) in ax_probe()
910 iounmap(ax->map2); in ax_probe()
934 struct ax_device *ax = to_ax_dev(ndev); in ax_suspend() local
936 ax->resume_open = ax->running; in ax_suspend()
947 struct ax_device *ax = to_ax_dev(ndev); in ax_resume() local
950 ax_NS8390_init(ndev, ax->resume_open); in ax_resume()
953 if (ax->resume_open) in ax_resume()