summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/wangxun
AgeCommit message (Collapse)AuthorFilesLines
2023-02-16net: wangxun: Add the basic ethtool interfacesMengyuan Lou12-3/+98
Add the basic ethtool ops get_drvinfo and get_link for ngbe and txgbe. Ngbe implements get_link_ksettings, nway_reset and set_link_ksettings for free using phylib code. The code related to the physical interface is not yet fully implemented in txgbe using phylink code. So do not implement get_link_ksettings, nway_reset and set_link_ksettings in txgbe. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230214091527.69943-1-mengyuanlou@net-swift.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-02-11net: libwx: fix an error code in wx_alloc_page_pool()Dan Carpenter1-1/+1
This function always returns success. We need to preserve the error code before setting rx_ring->page_pool = NULL. Fixes: 850b971110b2 ("net: libwx: Allocate Rx and Tx resources") Signed-off-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/r/Y+T4aoefc1XWvGYb@kili Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-02-09net: libwx: Remove unneeded semicolonYang Li1-1/+1
./drivers/net/ethernet/wangxun/libwx/wx_lib.c:683:2-3: Unneeded semicolon Reported-by: Abaci Robot <abaci@linux.alibaba.com> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3976 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20230208004959.47553-1-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-02-09net: libwx: clean up one inconsistent indentingYang Li1-1/+1
drivers/net/ethernet/wangxun/libwx/wx_lib.c:1835 wx_setup_all_rx_resources() warn: inconsistent indenting Reported-by: Abaci Robot <abaci@linux.alibaba.com> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3981 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20230208013227.111605-1-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-02-06net: ngbe: Support Rx and Tx process pathMengyuan Lou2-13/+61
Add enable and disable operation process for ngbe open/close. Clean Rx and Tx ring interrupts, process packets in the data path. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: txgbe: Support Rx and Tx process pathJiawen Wu1-9/+28
Clean Rx and Tx ring interrupts, process packets in the data path. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: libwx: Add tx path to process packetsMengyuan Lou4-0/+465
Support to transmit packets without hardware features. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: libwx: Support to receive packets in NAPIJiawen Wu4-1/+706
Clean all queues associated with a q_vector, to simple receive packets without hardware features. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: txgbe: Setup Rx and Tx ringJiawen Wu3-3/+44
Improve the configuration of Rx and Tx ring, set Rx flags and implement ndo_set_rx_mode ops. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: libwx: Allocate Rx and Tx resourcesJiawen Wu5-0/+388
Setup Rx and Tx descriptors for specefic rings. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: libwx: Configure Rx and Tx unit on hardwareJiawen Wu3-0/+684
Configure hardware for preparing to process packets. Including configure receive and transmit unit of the MAC layer, and setup the specific rings. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: txgbe: Add interrupt supportJiawen Wu2-0/+219
Determine proper interrupt scheme to enable and handle interrupt. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: ngbe: Add irqs request flowMengyuan Lou2-1/+202
Add request_irq for tx/rx rings and misc other events. If the application is successful, config vertors for interrupts. Enable some base interrupts mask in ngbe_irq_enable. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-02-06net: libwx: Add irq flow functionsMengyuan Lou6-2/+788
Add irq flow functions for ngbe and txgbe. Alloc pcie msix irqs for drivers, otherwise fall back to msi/legacy. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-01-21net: ngbe: Drop mdiobus_c45_regad()Michael Walle1-2/+2
With the new C45 MDIO access API, there is no encoding of the register number anymore and thus the masking isn't necessary anymore. Remove it. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-18net: wangxun: clean up the codeMengyuan Lou4-33/+24
Convert various mult-bit fields to be defined using GENMASK/FIELD_PREP. Simplify the code with the ternary operator. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20230116103839.84087-1-mengyuanlou@net-swift.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-13net: ngbe: Add ngbe mdio bus driver.Mengyuan Lou9-14/+397
Add mdio bus register for ngbe. The internal phy and external phy need to be handled separately. Add phy changed event detection. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230111111718.40745-1-mengyuanlou@net-swift.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-07net: ngbe: Remove structure ngbe_adapterMengyuan Lou5-205/+120
Move the total private structure to libwx. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-07net: txgbe: Remove structure txgbe_adapterJiawen Wu6-90/+64
Move the total private structure to libwx. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-07net: wangxun: Rename private structure in libwxJiawen Wu10-432/+432
In order to move the total members in struct adapter to struct wx_hw to keep the code clean, it's a bad name of 'wx_hw' only for hardware. Rename 'wx_hw' to 'wx', and rename the pointers at use. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-07net: wangxun: Move MAC address handling to libwxJiawen Wu7-212/+151
For setting MAC address, both txgbe and ngbe drivers have the same handling flow with different parameters. Move the same codes to libwx. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-07net: ngbe: Move defines into unified fileJiawen Wu4-35/+27
Remove ngbe.h, move defines into ngbe_type.h file. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-07net: txgbe: Move defines into unified fileJiawen Wu4-25/+16
Remove txgbe.h, move defines into txgbe_type.h file. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-07net: ngbe: Remove structure ngbe_hwJiawen Wu5-95/+84
Remove useless structure ngbe_hw to make the codes clear. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-07net: txgbe: Remove structure txgbe_hwJiawen Wu5-66/+49
Remove useless structure txgbe_hw to make the codes clear. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-11-18net: libwx: Fix dead code for duplicate checkJiawen Wu1-2/+0
Fix duplicate check on polling timeout. Fixes: 1efa9bfe58c5 ("net: libwx: Implement interaction with firmware") Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-11-08net: txgbe: Fix unsigned comparison to zero in txgbe_calc_eeprom_checksum()YueHaibing1-2/+3
The error checks on checksum for a negative error return always fails because it is unsigned and can never be negative. Fixes: 049fe5365324 ("net: txgbe: Add operations to interact with firmware") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-11-08net: txgbe: Fix memleak in txgbe_calc_eeprom_checksum()YueHaibing1-3/+4
eeprom_ptrs should be freed before returned. Fixes: 049fe5365324 ("net: txgbe: Add operations to interact with firmware") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-11-02net: ngbe: Initialize sw info and register netdevMengyuan Lou10-8/+665
Initialize ngbe mac/phy type. Check whether the firmware is initialized. Initialize ngbe hw and register netdev. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-11-02net: txgbe: Add operations to interact with firmwareJiawen Wu5-5/+316
Add firmware interaction to get EEPROM information. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-11-02net: libwx: Implement interaction with firmwareJiawen Wu3-0/+543
Add mailbox commands to interact with firmware. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-10-28net: txgbe: Set MAC address and register netdevJiawen Wu7-7/+566
Add MAC address related operations, and register netdev. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-10-28net: txgbe: Reset hardwareJiawen Wu9-9/+434
Reset and initialize the hardware by configuring the MAC layer. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-10-28net: txgbe: Store PCI infoJiawen Wu9-10/+280
Get PCI config space info, set LAN id and check flash status. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-08-30net: ngbe: Add build support for ngbeMengyuan Lou6-0/+267
Add build options and guidance doc. Initialize pci device access for Wangxun Gigabit Ethernet devices. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Link: https://lore.kernel.org/r/20220826034609.51854-1-mengyuanlou@net-swift.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2022-08-06eth: fix the help in Wangxun's KconfigJakub Kicinski1-3/+3
The text was copy&pasted from Intel, adjust it to say Wangxun. Reported-by: Ingo Saitz <ingo@hannover.ccc.de> Fixes: 3ce7547e5b71 ("net: txgbe: Add build support for txgbe") Link: https://lore.kernel.org/r/20220804182641.1442000-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-08-01net: txgbe: Fix an error handling path in txgbe_probe()Christophe JAILLET1-0/+1
A pci_enable_pcie_error_reporting() should be balanced by a corresponding pci_disable_pcie_error_reporting() call in the error handling path, as already done in the remove function. Fixes: 3ce7547e5b71 ("net: txgbe: Add build support for txgbe") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Jiawen Wu <jiawenwu@trustnetic.com> Link: https://lore.kernel.org/r/082003d00be1f05578c9c6434272ceb314609b8e.1659285240.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-06-30net: txgbe: Add build support for txgbeJiawen Wu6-0/+293
Add doc build infrastructure for txgbe driver. Initialize PCI memory space for WangXun 10 Gigabit Ethernet devices. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Link: https://lore.kernel.org/r/20220628095530.889344-1-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>