Lines Matching refs:fep
297 struct fec_enet_private *fep; in fec_enet_start_xmit() local
301 fep = dev->priv; in fec_enet_start_xmit()
305 bdp = fep->cur_tx; in fec_enet_start_xmit()
308 if (!fep->tx_free || (bdp->cbd_sc & BD_ENET_TX_READY)) { in fec_enet_start_xmit()
328 fep->tx_skbuff[fep->skb_cur] = skb; in fec_enet_start_xmit()
330 fep->stats.tx_bytes += skb->len; in fec_enet_start_xmit()
331 fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK; in fec_enet_start_xmit()
339 spin_lock_irq(&fep->lock); in fec_enet_start_xmit()
356 bdp = fep->tx_bd_base; in fec_enet_start_xmit()
361 if (!--fep->tx_free) in fec_enet_start_xmit()
364 fep->cur_tx = (cbd_t *)bdp; in fec_enet_start_xmit()
366 spin_unlock_irq(&fep->lock); in fec_enet_start_xmit()
374 struct fec_enet_private *fep = dev->priv; in fec_timeout() local
377 fep->stats.tx_errors++; in fec_timeout()
384 (unsigned long)fep->cur_tx, fep->tx_free, in fec_timeout()
385 (unsigned long)fep->dirty_tx, in fec_timeout()
386 (unsigned long)fep->cur_rx); in fec_timeout()
388 bdp = fep->tx_bd_base; in fec_timeout()
399 bdp = fep->rx_bd_base; in fec_timeout()
411 if (fep->tx_free) in fec_timeout()
462 struct fec_enet_private *fep; in fec_enet_tx() local
466 fep = dev->priv; in fec_enet_tx()
467 spin_lock(&fep->lock); in fec_enet_tx()
468 bdp = fep->dirty_tx; in fec_enet_tx()
471 if (fep->tx_free == TX_RING_SIZE) break; in fec_enet_tx()
473 skb = fep->tx_skbuff[fep->skb_dirty]; in fec_enet_tx()
478 fep->stats.tx_errors++; in fec_enet_tx()
480 fep->stats.tx_heartbeat_errors++; in fec_enet_tx()
482 fep->stats.tx_window_errors++; in fec_enet_tx()
484 fep->stats.tx_aborted_errors++; in fec_enet_tx()
486 fep->stats.tx_fifo_errors++; in fec_enet_tx()
488 fep->stats.tx_carrier_errors++; in fec_enet_tx()
490 fep->stats.tx_packets++; in fec_enet_tx()
500 fep->stats.collisions++; in fec_enet_tx()
505 printk("TXI: %x %x %x\n", bdp, skb, fep->skb_dirty); in fec_enet_tx()
508 fep->tx_skbuff[fep->skb_dirty] = NULL; in fec_enet_tx()
509 fep->skb_dirty = (fep->skb_dirty + 1) & TX_RING_MOD_MASK; in fec_enet_tx()
514 bdp = fep->tx_bd_base; in fec_enet_tx()
521 if (!fep->tx_free++) { in fec_enet_tx()
526 fep->dirty_tx = (cbd_t *)bdp; in fec_enet_tx()
527 spin_unlock(&fep->lock); in fec_enet_tx()
539 struct fec_enet_private *fep; in fec_enet_rx() local
546 fep = dev->priv; in fec_enet_rx()
552 bdp = fep->cur_rx; in fec_enet_rx()
567 fep->stats.rx_errors++; in fec_enet_rx()
570 fep->stats.rx_length_errors++; in fec_enet_rx()
573 fep->stats.rx_frame_errors++; in fec_enet_rx()
575 fep->stats.rx_crc_errors++; in fec_enet_rx()
577 fep->stats.rx_crc_errors++; in fec_enet_rx()
585 fep->stats.rx_errors++; in fec_enet_rx()
586 fep->stats.rx_frame_errors++; in fec_enet_rx()
592 fep->stats.rx_packets++; in fec_enet_rx()
594 fep->stats.rx_bytes += pkt_len; in fec_enet_rx()
595 data = fep->rx_vaddr[bdp - fep->rx_bd_base]; in fec_enet_rx()
606 fep->stats.rx_dropped++; in fec_enet_rx()
627 bdp = fep->rx_bd_base; in fec_enet_rx()
639 fep->cur_rx = (cbd_t *)bdp; in fec_enet_rx()
658 struct fec_enet_private *fep; in fec_enet_mii() local
663 fep = (struct fec_enet_private *)dev->priv; in fec_enet_mii()
693 struct fec_enet_private *fep; in mii_queue() local
700 fep = dev->priv; in mii_queue()
701 regval |= fep->phy_addr << 23; in mii_queue()
768 struct fec_enet_private *fep = dev->priv; in mii_parse_sr() local
769 volatile uint *s = &(fep->phy_status); in mii_parse_sr()
780 fep->link = (*s & PHY_STAT_LINK) ? 1 : 0; in mii_parse_sr()
785 struct fec_enet_private *fep = dev->priv; in mii_parse_cr() local
786 volatile uint *s = &(fep->phy_status); in mii_parse_cr()
798 struct fec_enet_private *fep = dev->priv; in mii_parse_anar() local
799 volatile uint *s = &(fep->phy_status); in mii_parse_anar()
832 struct fec_enet_private *fep = dev->priv; in mii_parse_lxt970_csr() local
833 volatile uint *s = &(fep->phy_status); in mii_parse_lxt970_csr()
914 struct fec_enet_private *fep = dev->priv; in mii_parse_lxt971_sr2() local
915 volatile uint *s = &(fep->phy_status); in mii_parse_lxt971_sr2()
992 struct fec_enet_private *fep = dev->priv; in mii_parse_qs6612_pcr() local
993 volatile uint *s = &(fep->phy_status); in mii_parse_qs6612_pcr()
1065 struct fec_enet_private *fep = dev->priv; in mii_parse_dp83843_physts() local
1066 volatile uint *s = &(fep->phy_status); in mii_parse_dp83843_physts()
1131 struct fec_enet_private *fep = (struct fec_enet_private *)dev->priv; in mii_parse_dp83846a_physts() local
1132 volatile uint *s = &(fep->phy_status); in mii_parse_dp83846a_physts()
1151 if(fep->old_status != (link_change_mask & *s)) in mii_parse_dp83846a_physts()
1153 fep->old_status = (link_change_mask & *s); in mii_parse_dp83846a_physts()
1217 struct fec_enet_private *fep = dev->priv; in mii_display_status() local
1218 volatile uint *s = &(fep->phy_status); in mii_display_status()
1220 if (!fep->link && !fep->old_link) { in mii_display_status()
1227 if (!fep->link) { in mii_display_status()
1253 struct fec_enet_private *fep = dev->priv; in mii_display_config() local
1254 volatile uint *s = &(fep->phy_status); in mii_display_config()
1279 fep->sequence_done = 1; in mii_display_config()
1284 struct fec_enet_private *fep = dev->priv; in mii_relink() local
1287 fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; in mii_relink()
1289 fep->old_link = fep->link; in mii_relink()
1291 if (fep->link) { in mii_relink()
1293 if (fep->phy_status in mii_relink()
1302 enable_irq(fep->mii_irq); in mii_relink()
1309 struct fec_enet_private *fep = dev->priv; in mii_queue_relink() local
1311 fep->phy_task.routine = (void *)mii_relink; in mii_queue_relink()
1312 fep->phy_task.data = dev; in mii_queue_relink()
1313 schedule_task(&fep->phy_task); in mii_queue_relink()
1318 struct fec_enet_private *fep = dev->priv; in mii_queue_config() local
1320 fep->phy_task.routine = (void *)mii_display_config; in mii_queue_config()
1321 fep->phy_task.data = dev; in mii_queue_config()
1322 schedule_task(&fep->phy_task); in mii_queue_config()
1339 struct fec_enet_private *fep; in mii_discover_phy3() local
1342 fep = dev->priv; in mii_discover_phy3()
1343 fep->phy_id |= (mii_reg & 0xffff); in mii_discover_phy3()
1346 if(phy_info[i]->id == (fep->phy_id >> 4)) in mii_discover_phy3()
1351 dev->name, fep->phy_id); in mii_discover_phy3()
1353 fep->phy = phy_info[i]; in mii_discover_phy3()
1354 fep->phy_id_done = 1; in mii_discover_phy3()
1357 dev->name, fep->phy_addr, fep->phy->name, fep->phy_id); in mii_discover_phy3()
1366 struct fec_enet_private *fep; in mii_discover_phy() local
1369 fep = dev->priv; in mii_discover_phy()
1375 fep->phy_id = phytype << 16; in mii_discover_phy()
1378 fep->phy_addr++; in mii_discover_phy()
1379 if (fep->phy_addr < 32) { in mii_discover_phy()
1396 struct fec_enet_private *fep = dev->priv; in mii_link_interrupt() local
1405 if (fep->phy) { in mii_link_interrupt()
1406 mii_do_cmd(dev, fep->phy->ack_int); in mii_link_interrupt()
1418 struct fec_enet_private *fep = dev->priv; in fec_enet_open() local
1425 fep->sequence_done = 0; in fec_enet_open()
1426 fep->link = 0; in fec_enet_open()
1428 if (fep->phy) { in fec_enet_open()
1429 mii_do_cmd(dev, fep->phy->config); in fec_enet_open()
1431 while(!fep->sequence_done) in fec_enet_open()
1434 mii_do_cmd(dev, fep->phy->startup); in fec_enet_open()
1437 if(fep->phy == &phy_info_dp83846a) in fec_enet_open()
1441 init_timer( &fep->phy_timer_list ); in fec_enet_open()
1446 fep->phy_timer_list.expires = jiffies + (100 * HZ / 1000); in fec_enet_open()
1447 fep->phy_timer_list.data = (unsigned long)dev; in fec_enet_open()
1448 fep->phy_timer_list.function = mdio_timer_callback; in fec_enet_open()
1449 add_timer( &fep->phy_timer_list ); in fec_enet_open()
1455 …while(fep->link == 0 || ((((volatile fec_t*)dev->base_addr)->fec_ecntrl & FEC_ECNTRL_ETHER_EN) == … in fec_enet_open()
1468 fep->link = 1; in fec_enet_open()
1488 struct fec_enet_private *fep = (struct fec_enet_private *)dev->priv; in fec_enet_get_stats() local
1490 return &fep->stats; in fec_enet_get_stats()
1500 struct fec_enet_private *fep = (struct fec_enet_private *)(dev->priv); in mdio_timer_callback() local
1501 mii_do_cmd(dev, fep->phy->ack_int); in mdio_timer_callback()
1503 if(fep->link == 0) in mdio_timer_callback()
1505 fep->phy_timer_list.expires = jiffies + (100 * HZ / 1000); /* Sleep for 100ms */ in mdio_timer_callback()
1509 fep->phy_timer_list.expires = jiffies + (1 * HZ); /* Sleep for 1 sec. */ in mdio_timer_callback()
1511 add_timer( &fep->phy_timer_list ); in mdio_timer_callback()
1638 struct fec_enet_private *fep; in set_multicast_list() local
1641 fep = (struct fec_enet_private *)dev->priv; in set_multicast_list()
1705 struct fec_enet_private *fep; in fec_enet_init() local
1724 fep = (struct fec_enet_private *)kmalloc(sizeof(*fep), GFP_KERNEL); in fec_enet_init()
1725 if (fep == NULL) in fec_enet_init()
1728 __clear_user(fep,sizeof(*fep)); in fec_enet_init()
1783 fep->rx_bd_base = cbd_base; in fec_enet_init()
1784 fep->tx_bd_base = cbd_base + RX_RING_SIZE; in fec_enet_init()
1786 fep->skb_cur = fep->skb_dirty = 0; in fec_enet_init()
1790 bdp = fep->rx_bd_base; in fec_enet_init()
1803 fep->rx_vaddr[k++] = ba; in fec_enet_init()
1844 dev->priv = fep; in fec_enet_init()
1877 fecp->fec_mii_speed = fep->phy_speed = in fec_enet_init()
1906 fep->phy_id_done = 0; in fec_enet_init()
1907 fep->phy_addr = 0; in fec_enet_init()
1910 fep->old_status = 0; in fec_enet_init()
1923 struct fec_enet_private *fep; in fec_restart() local
1933 fep = dev->priv; in fec_restart()
1969 fecp->fec_r_des_start = iopa((uint)(fep->rx_bd_base)); in fec_restart()
1970 fecp->fec_x_des_start = iopa((uint)(fep->tx_bd_base)); in fec_restart()
1972 fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; in fec_restart()
1973 fep->tx_free = TX_RING_SIZE; in fec_restart()
1974 fep->cur_rx = fep->rx_bd_base; in fec_restart()
1978 fep->skb_cur = fep->skb_dirty = 0; in fec_restart()
1980 if (fep->tx_skbuff[i] != NULL) { in fec_restart()
1981 dev_kfree_skb(fep->tx_skbuff[i]); in fec_restart()
1982 fep->tx_skbuff[i] = NULL; in fec_restart()
1988 bdp = fep->rx_bd_base; in fec_restart()
2004 bdp = fep->tx_bd_base; in fec_restart()
2029 fep->full_duplex = duplex; in fec_restart()
2038 fecp->fec_mii_speed = fep->phy_speed; in fec_restart()
2068 struct fec_enet_private *fep; in fec_stop() local
2078 fep = dev->priv; in fec_stop()