Deleted Added
full compact
if_tsec.c (193096) if_tsec.c (194101)
1/*-
2 * Copyright (C) 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com>
3 * Copyright (C) 2006-2007 Semihalf, Piotr Kruszynski <ppk@semihalf.com>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 14 unchanged lines hidden (view full) ---

23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27/*
28 * Freescale integrated Three-Speed Ethernet Controller (TSEC) driver.
29 */
30#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com>
3 * Copyright (C) 2006-2007 Semihalf, Piotr Kruszynski <ppk@semihalf.com>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 14 unchanged lines hidden (view full) ---

23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27/*
28 * Freescale integrated Three-Speed Ethernet Controller (TSEC) driver.
29 */
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/tsec/if_tsec.c 193096 2009-05-30 15:14:44Z attilio $");
31__FBSDID("$FreeBSD: head/sys/dev/tsec/if_tsec.c 194101 2009-06-13 08:57:04Z raj $");
32
33#ifdef HAVE_KERNEL_OPTION_HEADERS
34#include "opt_device_polling.h"
35#endif
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/bus.h>

--- 268 unchanged lines hidden (view full) ---

308 }
309
310 /* Free DMA resources */
311 tsec_free_dma(sc);
312
313 return (0);
314}
315
32
33#ifdef HAVE_KERNEL_OPTION_HEADERS
34#include "opt_device_polling.h"
35#endif
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/bus.h>

--- 268 unchanged lines hidden (view full) ---

308 }
309
310 /* Free DMA resources */
311 tsec_free_dma(sc);
312
313 return (0);
314}
315
316void
316int
317tsec_shutdown(device_t dev)
318{
319 struct tsec_softc *sc;
320
321 sc = device_get_softc(dev);
322
323 TSEC_GLOBAL_LOCK(sc);
324 tsec_stop(sc);
325 TSEC_GLOBAL_UNLOCK(sc);
317tsec_shutdown(device_t dev)
318{
319 struct tsec_softc *sc;
320
321 sc = device_get_softc(dev);
322
323 TSEC_GLOBAL_LOCK(sc);
324 tsec_stop(sc);
325 TSEC_GLOBAL_UNLOCK(sc);
326 return (0);
326}
327
328int
329tsec_suspend(device_t dev)
330{
331
332 /* TODO not implemented! */
333 return (0);

--- 1243 unchanged lines hidden (view full) ---

1577 DELAY(TSEC_READ_DELAY);
1578
1579 if (timeout == 0)
1580 device_printf(dev, "Timeout while reading from PHY!\n");
1581
1582 return (TSEC_READ(sc, TSEC_REG_MIIMSTAT));
1583}
1584
327}
328
329int
330tsec_suspend(device_t dev)
331{
332
333 /* TODO not implemented! */
334 return (0);

--- 1243 unchanged lines hidden (view full) ---

1578 DELAY(TSEC_READ_DELAY);
1579
1580 if (timeout == 0)
1581 device_printf(dev, "Timeout while reading from PHY!\n");
1582
1583 return (TSEC_READ(sc, TSEC_REG_MIIMSTAT));
1584}
1585
1585void
1586int
1586tsec_miibus_writereg(device_t dev, int phy, int reg, int value)
1587{
1588 struct tsec_softc *sc;
1589 uint32_t timeout;
1590
1591 sc = device_get_softc(dev);
1592
1593 if (device_get_unit(dev) != phy)

--- 7 unchanged lines hidden (view full) ---

1601
1602 timeout = TSEC_READ_RETRY;
1603 while (--timeout && (TSEC_READ(sc, TSEC_REG_MIIMIND) &
1604 TSEC_MIIMIND_BUSY))
1605 DELAY(TSEC_READ_DELAY);
1606
1607 if (timeout == 0)
1608 device_printf(dev, "Timeout while writing to PHY!\n");
1587tsec_miibus_writereg(device_t dev, int phy, int reg, int value)
1588{
1589 struct tsec_softc *sc;
1590 uint32_t timeout;
1591
1592 sc = device_get_softc(dev);
1593
1594 if (device_get_unit(dev) != phy)

--- 7 unchanged lines hidden (view full) ---

1602
1603 timeout = TSEC_READ_RETRY;
1604 while (--timeout && (TSEC_READ(sc, TSEC_REG_MIIMIND) &
1605 TSEC_MIIMIND_BUSY))
1606 DELAY(TSEC_READ_DELAY);
1607
1608 if (timeout == 0)
1609 device_printf(dev, "Timeout while writing to PHY!\n");
1610
1611 return (0);
1609}
1610
1611void
1612tsec_miibus_statchg(device_t dev)
1613{
1614 struct tsec_softc *sc;
1615 struct mii_data *mii;
1616 uint32_t ecntrl, id, tmp;

--- 314 unchanged lines hidden ---
1612}
1613
1614void
1615tsec_miibus_statchg(device_t dev)
1616{
1617 struct tsec_softc *sc;
1618 struct mii_data *mii;
1619 uint32_t ecntrl, id, tmp;

--- 314 unchanged lines hidden ---