arswitch_8226.c revision 253572
167754Smsmith/*-
267754Smsmith * Copyright (c) 2011-2012 Stefan Bethke.
367754Smsmith * Copyright (c) 2012 Adrian Chadd.
477424Smsmith * All rights reserved.
5107325Siwasaki *
667754Smsmith * Redistribution and use in source and binary forms, with or without
767754Smsmith * modification, are permitted provided that the following conditions
867754Smsmith * are met:
967754Smsmith * 1. Redistributions of source code must retain the above copyright
1067754Smsmith *    notice, this list of conditions and the following disclaimer.
1167754Smsmith * 2. Redistributions in binary form must reproduce the above copyright
1267754Smsmith *    notice, this list of conditions and the following disclaimer in the
1391116Smsmith *    documentation and/or other materials provided with the distribution.
1470243Smsmith *
1567754Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1667754Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1767754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1867754Smsmith * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1967754Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2067754Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2167754Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2267754Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2367754Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2467754Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2567754Smsmith * SUCH DAMAGE.
2667754Smsmith *
2767754Smsmith * $FreeBSD: head/sys/dev/etherswitch/arswitch/arswitch_8226.c 253572 2013-07-23 14:24:22Z loos $
2867754Smsmith */
2967754Smsmith
3067754Smsmith#include <sys/param.h>
3167754Smsmith#include <sys/bus.h>
3267754Smsmith#include <sys/errno.h>
3367754Smsmith#include <sys/kernel.h>
3467754Smsmith#include <sys/module.h>
3567754Smsmith#include <sys/socket.h>
3667754Smsmith#include <sys/sockio.h>
3767754Smsmith#include <sys/sysctl.h>
3867754Smsmith#include <sys/systm.h>
3967754Smsmith
4067754Smsmith#include <net/if.h>
4167754Smsmith#include <net/if_arp.h>
4267754Smsmith#include <net/ethernet.h>
4367754Smsmith#include <net/if_dl.h>
4467754Smsmith#include <net/if_media.h>
4567754Smsmith#include <net/if_types.h>
4667754Smsmith
4767754Smsmith#include <machine/bus.h>
4867754Smsmith#include <dev/iicbus/iic.h>
4967754Smsmith#include <dev/iicbus/iiconf.h>
5067754Smsmith#include <dev/iicbus/iicbus.h>
5167754Smsmith#include <dev/mii/mii.h>
5267754Smsmith#include <dev/mii/miivar.h>
5367754Smsmith#include <dev/etherswitch/mdio.h>
5467754Smsmith
5567754Smsmith#include <dev/etherswitch/etherswitch.h>
5667754Smsmith
5767754Smsmith#include <dev/etherswitch/arswitch/arswitchreg.h>
5867754Smsmith#include <dev/etherswitch/arswitch/arswitchvar.h>
5967754Smsmith#include <dev/etherswitch/arswitch/arswitch_phy.h>
6067754Smsmith#include <dev/etherswitch/arswitch/arswitch_8226.h>
6167754Smsmith
6267754Smsmith#include "mdio_if.h"
6367754Smsmith#include "miibus_if.h"
6467754Smsmith#include "etherswitch_if.h"
6567754Smsmith
6667754Smsmith/*
6767754Smsmith * AR8226 specific functions
6867754Smsmith */
6967754Smsmithstatic int
7067754Smsmithar8226_hw_setup(struct arswitch_softc *sc)
7167754Smsmith{
7267754Smsmith
7367754Smsmith	return (0);
7467754Smsmith}
7567754Smsmith
7667754Smsmith/*
7767754Smsmith * Initialise other global values, for the AR8226.
7867754Smsmith */
7967754Smsmithstatic int
8067754Smsmithar8226_hw_global_setup(struct arswitch_softc *sc)
8167754Smsmith{
8267754Smsmith
8367754Smsmith	return (0);
8467754Smsmith}
8567754Smsmith
8667754Smsmithvoid
8767754Smsmithar8226_attach(struct arswitch_softc *sc)
8867754Smsmith{
8967754Smsmith
9067754Smsmith	sc->hal.arswitch_hw_setup = ar8226_hw_setup;
9167754Smsmith	sc->hal.arswitch_hw_global_setup = ar8226_hw_global_setup;
9267754Smsmith
9367754Smsmith	sc->info.es_nvlangroups = 0;
9467754Smsmith}
9567754Smsmith