Commit Graph

261 Commits (2c7530a62229dac8a6f4049fbfb5d327e9361c2c)

Author SHA1 Message Date
Gabor Juhos d187e3c32e generic: add port mirroring/monitoring capability to rtl8366rb switch
This patch adds swlib attributes to the RTL8366RB switch/PHY found in the
TL-WR1043ND router that allow to mirror ethernet packets to a monitor port.

Signed-off-by: Colin Leitner <colin.leitner@googlemail.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36847
11 years ago
Gabor Juhos a1f91282b4 generic: ar8216: allow to specify SGMII config via platform data
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36798
11 years ago
Gabor Juhos c170d3c3e4 generic: ar8216: add get_port_link callback
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36797
11 years ago
Gabor Juhos 8e56b1e742 generic: ar8216: show chip revision in the kernel log
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36791
11 years ago
Luka Perkov 0998065a53 generic: ar8216: add port mirroring
Tested on Buffalo WZR-600DHP with ar8316 switch. Commands used to mirror both
RX and TX traffic from LAN port 1 to LAN port 4:

$ swconfig dev switch0 set enable_mirror_rx 1
$ swconfig dev switch0 set enable_mirror_tx 1
$ swconfig dev switch0 set mirror_monitor_port 4
$ swconfig dev switch0 set mirror_source_port 1

Signed-off-by: Colin Leitner <colin.leitner@googlemail.com>
Tested-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 36713
11 years ago
Felix Fietkau 2c5a5d8736 kernel: add missing PHY ID for an AR8327 switch variant
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 36630
11 years ago
Hauke Mehrtens 0b161c6f9e kernel: b53: use correct oops for bcm5365 switch
SVN-Revision: 36589
11 years ago
Jonas Gorski a33dd13c98 kernel: add missing bcma defines and header file for bcrmfmac
Fixes build failure when having kmod-mmc and brcmfmac selected.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 36468
11 years ago
John Crispin 4664e21293 generic: fix rtl8366_smi compile warning
drivers/net/phy/rtl8366_smi.c: In function 'rtl8366_sw_set_vlan_ports':
drivers/net/phy/rtl8366_smi.c:1125:6: warning: 'pvid' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36442
11 years ago
John Crispin 10f432ba9d fix rtl8366s OF binding
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36323
11 years ago
John Crispin fb47fd0d6b unbreak portmapping - typo fix
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36293
11 years ago
John Crispin fff58a5801 allow loading port maps from OF
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36283
11 years ago
Gabor Juhos 747b795b56 generic: rtl8367: add compatible string with vendor prefix
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36230
11 years ago
Gabor Juhos f5d8d80ca9 generic: rtl8367b: fix rtl8367b_extif_init_of
* disable external interface if its property is not present
* show an error message if the extif property is not valid
* use proper error values intead of -1
* fix memory leak
* wrap long lines

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36229
11 years ago
Gabor Juhos 38bd9b4337 generic: rtl8367: allow to load extif config from OF
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36220
11 years ago
Gabor Juhos 585d19d168 generic: rtl8367: fix a typo in MODULE_DEVICE_TABLE macro
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36219
11 years ago
Gabor Juhos 68c931c637 generic: rtl8367: add vendor prefix to the compatible string
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36218
11 years ago
John Crispin 1105bd2897 add OF support to rtl8367b driver
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36159
11 years ago
Gabor Juhos 72253b9073 generic: ar8216: start AR8327 switch from the probe routine
The AR8327 switch gets its configuration from platform
data or from the device-tree. This allows to start it
from the probe routine. Doing so makes it usable with
ethernet drivers which only connects to the PHY device
when the ethernet interface is opened.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36050
11 years ago
Gabor Juhos 5503686f69 generic: ar8216: add ar8xxx_start helper
Move switch starting code into a separate function.
This makes it usable from other places.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36049
11 years ago
Gabor Juhos 7ba6a8d8e8 generic: ar8216: add OF configuration support for AR8327
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36047
11 years ago
Gabor Juhos ee12b1b7d5 generic: ar8216: separate platform_data based AR8327 code
Move platform_data specific configuration code
into a separate routine. Do it in preparation
for the upcoming OF support.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36046
11 years ago
Gabor Juhos d88f66ae21 generic: ar8216: don't use platform_data in ar8327_init_port
Fetch the PORT_STATUS values in ar8327_hw_init and
store those in a private data stucture for later use.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36045
11 years ago
Gabor Juhos 9d3f70d503 generic: ar8216: move the ar8327_get_port_init_status function
It will be used in ar8327_probe routine.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36044
11 years ago
Gabor Juhos 17d735fc46 generic: ar8216: simplify and rename ar8327_config_port
Return with the PORT_STATUS register value instead of
writing that directly into the corresponding register.
Also rename the function to ar8327_get_port_init_status.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36043
11 years ago
Gabor Juhos 3fee1bddbe generic: ar8216: remove superfluous pdata checks
The presence of the platform data is already verified in
ar8327_hw_init, and the driver does not start without that
anyway.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 36042
11 years ago
Jonas Gorski 3010a0b616 generic: b53: clear SM_SW_FWD_MODE unconditionally when enabling VLAN
Setting this bit stops BCM53125 (bgmac actually) from receiving any
packets. This bit is cleared conditionally in b53_switch_reset and it
seems the same is done in bcmrobo.c which never sets that bit again.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 35723
12 years ago
Jonas Gorski 23e71c56ba generic: b53: remove empty spaces
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 35722
12 years ago
Gabor Juhos 451dd745bd generic: ar8216: cleanup function/variable names
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35642
12 years ago
Gabor Juhos 51996304c4 generic: ar8216: rename struct ar8216_priv to ar8xxx_priv
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35641
12 years ago
Gabor Juhos f35c369710 generic: ar8216: move PHY4 RGMII workaround code out of the loop
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35603
12 years ago
Gabor Juhos d64888ffc0 generic: ar8216: register the switch from the probe routine
Currently the switch gets registered when an ethernet
driver connects to a PHY of the switch. This method does
not work with the ethernet drivers which are connecting
to the PHY from their ndo_open callback. With those
ethernet drivers, the driver tries to register the switch
each time when the etherned device is opened and this causes
a deadlock.

Move the switch registration into the probe routine to fix
this problem.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35602
12 years ago
Gabor Juhos 9525a075c1 ar8216: remove superfluous code from ar8216_config_init
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35562
12 years ago
Gabor Juhos 9c86d268eb generic: ar8216: don't use ethernet device name in register_switch
The switches are accessed via an MDIO bus. Set the alias
to the name of the MDIO bus, and show that in the message
along with the name of the switch switch device.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35560
12 years ago
Gabor Juhos 3f3eba88f6 generic: ar8216: reuse the private data from ar8216_probe
The private data of the switch is already
allocated in ar8216_priv, assign that to
each PHY on the same MDIO bus. Also remove
the redundant code from ar8216_config_init.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35559
12 years ago
Gabor Juhos 1afb759b35 generic: ar8216: use phydev instead of pdev everywhere
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35555
12 years ago
Gabor Juhos 0b1fe07e8e generic: ar8216: use pr_* macros for kernel messages
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35554
12 years ago
Gabor Juhos eea297884e generic: ar8216: fix PHY features setup
Sujith says:

This commit breaks the WAN port on my AP96 - DHCP fails.
Reverting it fixes the issue.

  commit b67cc3a0cdd02973610d4d5a63226d1c44841e94
  Author: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
  Date:   Fri Feb 8 09:13:18 2013 +0000

    generic: ar8216: simplify phy features setup

    Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

    git-svn-id: svn://svn.openwrt.org/openwrt/trunk@355183c298f89-4303-0410-b956-a3cf2f4a3e73

This change restores the previous behaviour and moves
the code into the ar8216_probe function.

Reported-by: Sujith Manoharan <sujith@msujith.org>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Tested-by: Sujith Manoharan <sujith@msujith.org>

SVN-Revision: 35549
12 years ago
Gabor Juhos 617076c613 generic: ar8216: add ar8xxx_probe_switch helper
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35547
12 years ago
Gabor Juhos 98b13e39ac generic: ar8216: rename ar8xxx_mib_cleanup to ar8xxx_mib_stop
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35546
12 years ago
Gabor Juhos f97170a720 generic: ar8216: free mib counters from ar8xxx_free
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35545
12 years ago
Gabor Juhos 7924e517af generic: ar8216: add ar8xxx_free helper
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35544
12 years ago
Gabor Juhos 77b3c551c4 generic: ar8216: add ar8xxx_create{,mii} helpers
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35543
12 years ago
Gabor Juhos 5f70b1db2a generic: ar8216: remove redundant phy address check
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35542
12 years ago
Gabor Juhos 14fd37258b generic: ar8216: only set phy_ptr if packet mangling is used
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35541
12 years ago
Gabor Juhos 393163b098 generic: ar8216: add defines for the AR8316 POSTRIP register
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35539
12 years ago
Gabor Juhos 5ed480598d generic: ar8216: don't probe the chip multiple times
It is only needed when the private data is allocated.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35538
12 years ago
Gabor Juhos 774da6c7a4 generic: ar8216: add sanity check to ar8216_probe
Verify that the mdio bus has PHY devices with
a supported PHY ID at address 0-4.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35537
12 years ago
Gabor Juhos 4720c75cf7 generic: ar8216: skip probe on unused PHY addresses
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35536
12 years ago
Jonas Gorski eedc3554fe generic: b53: fix reverted error check in probe
b53_switch_detect returns value returned by b53_read8, which is 0 for
success. So fail (and return error) only if b53_switch_detect returned
something else than 0. This fixes supported and advertising being zeros
for MDIO access.

Cc: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 35534
12 years ago