aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files-4.14/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* ramips: mt7620: enable all ports unconditionallyPawel Dembicki2018-08-151-1/+10
| | | | | | | This patch make all mt7620 ephy ports turned on. It is necessary for some JBOOT devices. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
* mt7620: gsw: make IntPHY and ExtPHY share mdio addr 4 possibleChen Minqiang2018-08-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | To share mdio addr for IntPHY and ExtPHY, as described in the documentation (MT7620_ProgrammingGuide.pdf). (refer: http://download.villagetelco.org/hardware/MT7620/MT7620_ProgrammingGuide.pdf) when port4 setup to work as gmac mode, dts like: &gsw { mediatek,port4 = "gmac"; }; we should set SYSCFG1.GE2_MODE==0x0 (RGMII). but SYSCFG1.GE2_MODE may have been set to 3(RJ-45) by uboot/default so we need to re-set it to 0x0 before this changes: gsw: 4FE + 2GE may not work correctly and MDIO addr 4 cannot be used by ExtPHY after this changes: gsw: 4FE + 2GE works and MDIO addr 4 can be used by ExtPHY Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
* ramips: fix gigabit switch PHY access on MDIODaniel Gimpelevich2018-08-061-1/+2
| | | | | | | | | | When PHY's are defined on the MDIO bus in the DTS, gigabit support was being masked out for no apparent reason, pegging all such ports to 10/100. If gigabit support must be disabled for some reason, there should be a "max-speed" property in the DTS. Reported-by: James McKenzie <openwrt@madingley.org> Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
* ramips: remove superfluous & confusing DT bindingDaniel Gimpelevich2018-08-061-3/+24
| | | | | | | | | | | Mediatek has a reference platform that pairs an MT7620A with an MT7530W, where the latter responds on MDIO address 0x1f while both chips respond on 0x0 to 0x4. The driver special-cases this arrangement to make sure it's talking to the right chip, but two different ways in two different places. This patch consolidates the detection without the current requirement of both tests to be separately satisfied in the DTS. Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
* ramips: ethernet: disable fraglist supportFelix Fietkau2018-07-141-1/+1
| | | | | | | The code has some remaining issues that cause ethernet hangs, so disable it for now until we can get it fixed Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: ethernet: use own page_frag_cacheFelix Fietkau2018-07-122-3/+15
| | | | | | | | | | | | | | | | Using the NAPI or netdev frag cache along with other drivers can lead to 32 KiB pages being held for a long time, despite only being used for very few page fragment. This can happen if the ethernet driver grabs one or two fragments for rx ring refill, while other drivers use (and free up) the remaining fragments. The 32 KiB higher-order page can only be freed once all users have freed their fragments, which only happens after the rings of all drivers holding the fragments have wrapped around. Depending on the traffic patterns, this can waste a lot of memory and look a lot like a memory leak Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: ethernet: use skb_free_frag to free fragmentsFelix Fietkau2018-07-121-3/+3
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: improve ethernet driver performance with GRO/TSOFelix Fietkau2018-06-193-76/+105
| | | | | | | | | | | GRO stores packets as fraglist. If they are routed back to the ethernet device, they need to be re-segmented if the driver does not support sending fraglists. Add the missing support for that, along with a missing feature flag that allows full routed GRO->TSO offload. Considerably reduces CPU utilization for routing Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: mt7621: fix mtu setting with kernel 4.14Mathias Kresin2018-06-161-11/+7
| | | | | | | | | | Since kernel 4.10 commit 61e84623ace3 ("net: centralize net_device min/max MTU checking"), the range of mtu is [min_mtu, max_mtu], which is [68, 1500] by default. It's necessary to set a max_mtu if a mtu > 1500 is supported. Signed-off-by: Mathias Kresin <dev@kresin.me>
* ramips: rename ethernet driver folder to the same one that upstream usesFelix Fietkau2018-06-1326-0/+0
| | | | | | | Preparation for sharing offload code with the mediatek target through generic files/ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* staging: mt7621-eth: fix return value check in mt7621_gsw_probe()Wei Yongjun2018-05-153-6/+6
| | | | | | | | | | In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: f079b6406348 ("staging: mt7621-eth: add gigabit switch driver (GSW)") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: mt7621-eth: fix return value check in mtk_connect_phy_node()Wei Yongjun2018-05-151-2/+2
| | | | | | | | | | In case of error, the function of_phy_connect() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: e3cbf478f846 ("staging: mt7621-eth: add the drivers core files") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: mt7621-eth: fix return value check in mtk_probe()Wei Yongjun2018-05-151-1/+1
| | | | | | | | | | In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: e3cbf478f846 ("staging: mt7621-eth: add the drivers core files") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ramips: fix locking issues in the ethernet driverFelix Fietkau2018-04-171-2/+3
| | | | | | | The stats update needs to protect against being interrupted by a tasklet The u64 stats seqlock needs to be initialized Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: add missing unlock in fe_phy_link_adjustFelix Fietkau2018-04-141-0/+1
| | | | | | Based on patch by Neil Brown Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: fix build error caused by missing ifdef guard in hwnat codeJohn Crispin2018-04-061-1/+4
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* ramips: implement hardware NAT offload for MT7621John Crispin2018-04-067-3/+975
| | | | | | | | | | Supports IPv4 flow offloading on MT7621 for Routing, SNAT and DNAT Supported are regular ethernet->ethernet connections, including one 802.1q VLAN and/or PPPoE encapsulation Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: remove dead (and potentially crashy) code in mt7621 gsw initFelix Fietkau2018-03-231-11/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: rename ethernet priv->device field to dev to match upstreamFelix Fietkau2018-03-237-26/+26
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: mt7620: power up ephy port 4Pawel Dembicki2018-03-061-0/+1
| | | | | | | | | | | In some boards port 4 of mt7620 switch is powered down in bootloader configuration as lan/wan package leak mitigation. Reset ephy port 4 to default settings to power up the port. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> [clarify issue in commit message] Signed-off-by: Mathias Kresin <dev@kresin.me>
* ramips: fix MT7621 switch driver IRQ storm on init with linux 4.14Felix Fietkau2018-02-211-4/+7
| | | | | | | | The hardware emits some interrupts while initializing and handling them can mess up the state or cause infinite loops. Fix this by disabling IRQs during init and re-enabling them afterwards Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: preliminary support for 4.14Roman Yeryomin2018-02-1523-0/+7314
- removed upstreamed patches - 0901-spansion_nand_id_fix.patch is disabled, not clear if it's needed Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: John Crispin <john@phrozen.org>