History log of /freebsd-10.2-release/sys/dev/etherswitch/arswitch/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
285830 23-Jul-2015 gjb

- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
builds.
- Update newvers.sh to reflect RC1.
- Update __FreeBSD_version to reflect 10.2.
- Update default pkg(8) configuration to use the quarterly branch.[1]

Discussed with: re, portmgr [1]
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

261455 04-Feb-2014 eadler

MFC r258779,r258780,r258787,r258822:

Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit. Instead use (1U << 31) which gets the
expected result.

Similar to the (1 << 31) case it is not defined to do (2 << 30).

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


253572 23-Jul-2013 loos

Add the support for 802.1q and port based vlans for arswitch.

Tested on: RB450G (standalone ar8316), RSPRO (standalone ar8316) and
TPLink MR-3220 (ar724x integrated switch).

Approved by: adrian (mentor)
Obtained from: zrouter


253570 23-Jul-2013 loos

Fix the arswitch instability problem. It turns out that the
arswitch_writereg() routine was writing the registers in the wrong order.

Revert -r241918 as the root problem is now fixed. Remove another workaround
from arswitch_ar7240.c.

Simplify and fix the code on arswitch_writephy() by using
arswitch_writereg().

While here remove a redundant declaration from arswitchvar.h.

Approved by: adrian (mentor)


250383 08-May-2013 adrian

Correctly mark the CPU port.

Submitted by: Luiz Otavio O Souza <loos.br@gmail.com>
Reviewed by: ray


249775 22-Apr-2013 adrian

Update arswitch to the new API.


242716 07-Nov-2012 ray

Disable automatic attachment of arswitch. It can't be auto-detected (like PHYs
do) and cause a problems trying to attach another instance to child mdio.

Submitted by: Luiz Otavio O Souza
Approved by: adrian (menthor)


241918 22-Oct-2012 adrian

Don't try to cache the page setting - always set the page before
doing a switch register read/write.

PR: kern/172968


241579 15-Oct-2012 ray

Mask data to only 16 bits to be sure on write into switch reg.

Submitted by: Luiz Otavio O Souza
Approved by: adrian (mentor)


241578 15-Oct-2012 ray

Locking for etherswitch framework:
* add lock/unlock methods;
* add lock/unlock default implementation;
* surround switch IOCTLs with locking;
* add lock/unlock implementation for arswitch;

Submitted by: Luiz Otavio O Souza
Approved by: adrian (mentor)


241577 15-Oct-2012 ray

Defaulting to id "0" if ar7240_probe(dev) success, fix warning when building
with DEBUG.

Submitted by: Luiz Otavio O Souza
Approved by: adrian (mentor)


241463 11-Oct-2012 ray

Fix tiypo.

Submitted by: Luiz Otavio O Souza
Approved by: adrian (mentor)


235377 12-May-2012 adrian

Setup the CPU port and broadcast map on the AR7240, rather than
depending upon the bootloader initialising it.

The aim is to eventually support a full switch set and reinitialisation
rather than relying on a consistent bootloader setup.

Remove the port flood config from arswitch.c, it's not yet used and
it's totally incorrect.

Whilst I'm here, also add in a comment describing why the full switch
reset is disabled.

Obtained from: Linux (OpenWRT) - Values


235370 12-May-2012 adrian

.. oops, include setting the MTU.


235369 12-May-2012 adrian

Document what the flood register setting does.


235367 12-May-2012 adrian

* Add in the AR7240 global control field for setting the maximum frame
size for the AR7240.

* Include SM/MS macros, thanks to ath_hal(4).

* This field is for normal packets, VLAN and other headers are added to
this by the switch device.

* Set the MTU to 1536, to match what is done in Linux. Use the SM
macro to write this field.

Obtained from: Atheros (AR7240 datasheet), Linux OpenWRT (MTU default)


235325 12-May-2012 adrian

* Remove the AR7240 register defines and reuse the AR8x16 defines.
* Include a new register define to represent "disable port mirroring
to CPU port".

Obtained from: Patrick Kelsey <kelsey@ieee.org>


235323 12-May-2012 adrian

Further arswitch work:

* Add in the AR724x support. It probes the same as an AR8216/AR8316, so
just add in a hint to force the probe success rather than auto-detecting
it.

* Add in the missing entries from conf/files, lacking in the previous
commit.

The register values and CPU port / mirror port initialisation value was
obtained from Linux OpenWRT ag71xx_ar7240.c.

The DELAY(1000) to let things settle is my local workaround. For some
reason, PHY4 doesn't seem to probe very reliably without it. It's quite
possible that we're missing some MDIO bus initialisation code in if_arge
for the AR724x case. As I dislike DELAY() workarounds in general, it's
definitely worth trying to figure out why this is the case.

Tested on: AP93 (AR7240) reference design

Obtained from: Linux OpenWRT


235288 11-May-2012 adrian

Commit the first pass of the etherswitch support.

This is designed to support the very basic ethernet switch chip behaviour,
specifically:

* accessing switch register space;
* accessing per-PHY registers (for switches that actually expose PHYs);
* basic vlan group support, which applies for the rtl8366 driver but not
for the atheros switches.

This also includes initial support for:

* rtl8366rb support - which is a 10/100/1000 switch which supports
vlan groups;
* Initial Atheros AR8316 switch support - which is a 10/100/1000 switch
which supports an alternate vlan configuration (so the vlan group
methods are stubbed.)

The general idea here is that the switch driver may speak to a variety of
backend busses (mdio, i2c, spi, whatever) and expose:

* If applicable, one or more MDIO busses which ethernet interfaces can
then attach PHYs to via miiproxy/mdioproxy;

* exposes miibusses, one for each port at the moment, so ..

* .. a PHY can be exposed on each miibus, for each switch port, with all
of the existing MII/ifnet framework.

However:

* The ifnet is manually created for now, and it isn't linked into the
interface list, nor can you (currently) send/receive frames on this ifnet.
At some point in the future there may be _some_ support for this, for
switches with a multi-port, isolated mode.

* I'm still in the process of sorting out correct(er) locking.

TODO:

* ray's switch code in zrouter (zrouter.org) includes a much more developed
newbus API that covers the various switch methods, as well as a
capability API so drivers, the switch layer and the userland utility
can properly control the subset of supported features.

The plan is to sort that out later, once the rest of ray's switch drivers
are brought over and extended to export MII busses and PHYs.

Submitted by: Stefan Bethke <stb@lassitu.de>
Reviewed by: ray