summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/realtek/rtase/rtase_main.c
AgeCommit message (Collapse)AuthorFilesLines
11 daysrtase: Modify the name of the goto labelJustin Lai1-5/+5
Modify the name of the goto label in rtase_init_one(). Signed-off-by: Justin Lai <justinlai0215@realtek.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20241114112549.376101-2-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-14rtase: Fix error code in rtase_init_board()Dan Carpenter1-1/+2
Return an error if dma_set_mask_and_coherent() fails. Don't return success. Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this module") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/f53ed942-5ac2-424b-a1ed-9473c599905e@stanley.mountain Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-11rtase: Fix spelling mistake: "tx_underun" -> "tx_underrun"Colin Ian King1-3/+3
There is a spelling mistake in the struct field tx_underun, rename it to tx_underrun. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20240909134612.63912-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement ethtool functionJustin Lai1-0/+74
Implement the ethtool function to support users to obtain network card information, including obtaining various device settings, Report whether physical link is up, Report pause parameters, Set pause parameters, Return extended statistics about the device. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-11-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement pci_driver suspend and resume functionJustin Lai1-0/+51
Implement the pci_driver suspend function to enable the device to sleep, and implement the resume function to enable the device to resume operation. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-10-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement net_device_opsJustin Lai1-0/+235
1. Implement .ndo_set_rx_mode so that the device can change address list filtering. 2. Implement .ndo_set_mac_address so that mac address can be changed. 3. Implement .ndo_change_mtu so that mtu can be changed. 4. Implement .ndo_tx_timeout to perform related processing when the transmitter does not make any progress. 5. Implement .ndo_get_stats64 to provide statistics that are called when the user wants to get network device usage. 6. Implement .ndo_vlan_rx_add_vid to register VLAN ID when the device supports VLAN filtering. 7. Implement .ndo_vlan_rx_kill_vid to unregister VLAN ID when the device supports VLAN filtering. 8. Implement the .ndo_setup_tc to enable setting any "tc" scheduler, classifier or action on dev. 9. Implement .ndo_fix_features enables adjusting requested feature flags based on device-specific constraints. 10. Implement .ndo_set_features enables updating device configuration to new features. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-9-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement a function to receive packetsJustin Lai1-0/+144
Implement rx_handler to read the information of the rx descriptor, thereby checking the packet accordingly and storing the packet in the socket buffer to complete the reception of the packet. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-8-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement .ndo_start_xmit functionJustin Lai1-0/+283
Implement .ndo_start_xmit function to fill the information of the packet to be transmitted into the tx descriptor, and then the hardware will transmit the packet using the information in the tx descriptor. In addition, we also implemented the tx_handler function to enable the tx descriptor to be reused. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-7-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement hardware configuration functionJustin Lai1-0/+238
Implement rtase_hw_config to set default hardware settings, including setting interrupt mitigation, tx/rx DMA burst, interframe gap time, rx packet filter, near fifo threshold and fill descriptor ring and tally counter address, and enable flow control. When filling the rx descriptor ring, the first group of queues needs to be processed separately because the positions of the first group of queues are not regular with other subsequent groups. The other queues are all newly added features, but we want to retain the original design. So they were not put together. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-6-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement the interrupt routine and rtase_pollJustin Lai1-0/+69
1. Implement rtase_interrupt to handle txQ0/rxQ0, txQ4~txQ7 interrupts, and implement rtase_q_interrupt to handle txQ1/rxQ1, txQ2/rxQ2 and txQ3/rxQ3 interrupts. 2. Implement rtase_poll to call ring_handler to process the tx or rx packet of each ring. If the returned value is budget,it means that there is still work of a certain ring that has not yet been completed. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-5-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement the rtase_down functionJustin Lai1-0/+150
Implement the rtase_down function to disable hardware setting and interrupt and clear descriptor ring. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-4-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Implement the .ndo_open functionJustin Lai1-0/+405
Implement the .ndo_open function to set default hardware settings and initialize the descriptor ring and interrupts. Among them, when requesting interrupt, because the first group of interrupts needs to process more events, the overall structure and interrupt handler will be different from other groups of interrupts, so it needs to be handled separately. The first set of interrupt handlers need to handle the interrupt status of RXQ0 and TXQ0, TXQ4~7, while other groups of interrupt handlers will handle the interrupt status of RXQ1&TXQ1 or RXQ2&TXQ2 or RXQ3&TXQ3 according to the interrupt vector. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-3-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-06rtase: Add support for a pci table in this moduleJustin Lai1-0/+638
Add support for a pci table in this module, and implement pci_driver function to initialize this driver, remove this driver, or shutdown this driver. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Link: https://patch.msgid.link/20240904032114.247117-2-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>