aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files-4.14/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* ramips: allow packets with ttl=0Felix Fietkau2019-03-241-2/+2
| | | | | | | Some broken ISPs (e.g. Comcast) send DHCPv6 packets with hop limit=0. This trips up the TTL=0 check in the PPE if enabled. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: mt7621: fix mtu setting with kernel 4.14Mathias Kresin2018-12-181-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> (backported from 5da2c68d001ee44b15a58639ed03a0ebb6f68020)
* Revert "mt7620: gsw: make IntPHY and ExtPHY share mdio addr 4 possible"Jo-Philipp Wich2018-08-061-6/+0
| | | | | | | | | | | | | | | | This reverts commit b40316c21a960d332bc9b04ee1791b8aafcf8786. That change causes ramips/mt7620 to fail with: drivers/net/ethernet/mtk/gsw_mt7620.c: In function 'mt7620_hw_init': drivers/net/ethernet/mtk/gsw_mt7620.c:171:14: error: 'mdio_mode' undeclared (first use in this function); did you mean 'd_move'? } else if (!mdio_mode) { ^~~~~~~~~ d_move Back it out for now to restore compilation. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* 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> (cherry picked from commit f6d81e2fa1f110d8025eaa434d67d0014aca1d42)
* 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> (cherry picked from commit 379fe506729a20c5fdb072840cb662b032e90c36)
* ramips: ethernet: use own page_frag_cacheFelix Fietkau2018-07-132-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-131-3/+3
| | | | 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>