Commit graph

647 commits

Author SHA1 Message Date
simbit18
aadb929526 drivers/net/CMakeLists.txt: Aligned Cmake with Make
Add KSZ9477 driver #10503

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-27 11:05:32 +08:00
Jani Paalijarvi
e2b1d186d7 drivers/net/ksz9477.c: Errata 16, reset SGMII always on init 2025-08-26 09:10:43 -03:00
Jari Nippula
56870fb0ea ksz9477: MMD indirect access check fix
Instead of verifying MMD indirect access by checking
EEE ADVERTISEMENT register has value 0x6 (which may be changed),
the verification is done by write and check LED MODE register.
1. Backup current LED_MODE register value
2. Write value Single-LED mode (0x10) to LED_MODE
3. Read LED_MODE register and verify it returns value 0x10
4. Write original (backup) value to LED_MODE
2025-08-26 09:10:43 -03:00
Jani Paalijarvi
fcab00d3a8 drivers/net/ksz9477: Implement errata fixes
From the ksz9477 errata, setup the configuration which is tested to work.

- Improve PHY receive performance
- Disable EEE for ports 1-5
- Fix supply current values

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-08-26 09:10:43 -03:00
michal matias
4a4235b5a2 drivers/net: Remove the NCV7410 10BASE-T1S MAC-PHY driver
This commit removes existing support for the NCV7410 10BASE-T1S MAC-PHY.
The driver will be replaced by its generalized version with different organization.
The new driver has naming clashes with the old, therefore the old has to be removed first.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-08-25 20:32:35 +08:00
p-szafonimateusz
880c8e5d26 drivers/net: add IGB network card support
Add support for Intel IGB type of network cards.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-08 10:02:15 +02:00
p-szafonimateusz
bba1741421 drivers/net/{e1000|igc}: align descriptors to 8
A descriptor ring length must be aligned to 128, one descriptor is 16B length,
so we can provide this condition with the appropriate number of descriptors

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
5a9530855c drivers/net/{e1000|igc}: drop TX packets if TX ring is full
drop TX packets if TX ring is full, so we don't overwrite
not handled TX descriptors

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
0f537dcb97 drivers/net/{e1000|igc}: fix reinit for RX/TX rings
Descriptor head is managed by HW and should not be modified by SW unless:
1. device is after a reset
2. device is before enabling TX or RX

Also set correct tail for RX which should point at the end of ring
(descriptor ring is zero-indexed).

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
bdde180d7a drivers/net/{e1000|igc}: disable TX by modify only TX enable bit
disable TX by modify only TX enable bit, otherwise we lose TX configuration

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
0a8ef045ab drivers/net/{e1000|igc}: update link status when card is enabled
Update link status in case link status interrupt is missing.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
7a8ac49836 drivers/net/{e1000|igc}: do not touch RX/TX rings when link status change
Do not reset RX/TX rings when link status change.
This can break internal card state which is impossible to recovery.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
bccee707d6 drivers/net/{e1000|igc}: reset RX/TX rings after RX/TX disabled
reset RX/TX rings **after** RX/TX are disabled to make sure the rings are
not used by hardware when software modify rings state.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
f4e8def270 drivers/net/Kconfig: Move NET_IGC_TXDESC and NET_IGC_RXDESC to NET_IGC menu 2025-07-03 00:16:24 +08:00
michal matias
c5a3089e87 drivers/net: Add support for the NCV7410 10BASE-T1S MAC-PHY
This commit adds driver for the Onsemi NCV7410 10BASE-T1S
Ethernet MAC-PHY.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-06-28 08:49:46 -03:00
dongjiuzhu1
a12d21e830 fs/file: unify prefix about file_xxx api, like file_open, file_ioctl
old:
fs_getfilep, fs_putfilep, fs_reffilep
new:
file_get, file_put, file_ref

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-12 18:12:42 +08:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
Filipe Cavalcanti
5e52e75631 drivers/net: update format specifier on lan9250 driver
Fix print statement for uint8 and uint16 types.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-05 19:54:58 +01:00
Filipe Cavalcanti
b542be4a14 drivers/net: change format specifiers macros on lan9250 driver
This fixes build warnings when different archs are used.
Simply changes "lx" to "PRIx32" when using uint32_t.
2025-02-21 11:29:48 -03:00
lipengfei28
82cf59bff5 arch/arm64: use UP_DSB, UP_DMB, UP_ISB as barrier standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
2d1af01d44 mem barrier: use UP_DMP UP_DSP as barriers standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
Huang Qi
cfd0cc0d1a Remove duplicate includes across multiple files
This commit cleans up redundant header file includes throughout the codebase.
 The changes include:

 - Removing duplicate #include directives that were present in the same file
 - Consolidating includes that were split across multiple lines unnecessarily
 - Removing unused includes that were no longer needed
 - Fixing some formatting issues with includes

 The changes improve code organization and maintainability by:
 - Reducing unnecessary dependencies
 - Making include dependencies more explicit
 - Following consistent include patterns
 - Removing dead code

 No functional changes are made - this is purely a code cleanup commit.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-09 23:30:23 +08:00
Jani Paalijarvi
e1fb0b30c4 drivers/net/ksz9477.c: Check return values in init
Check that writes to configuration registers success.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-01-07 21:42:00 +08:00
wangmingrong1
500d193096 drivers/e1000: malloc size error
priv->mta is uint32_t

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-26 23:26:18 +08:00
Zhe Weng
286de7df01 netdev/upper: Fix wrong CPU when RSS is disabled
When `CONFIG_NETDEV_RSS` is disabled, `NETDEV_THREAD_COUNT` will be 1,
and we should not access `upper->sem[cpu]` with `cpu > 0`.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-12-25 15:58:42 +08:00
zhangyuan29
060fda032b drivers/net: change netdev_lower_quota_load to macro.
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-05 13:26:22 +08:00
zhangyuan29
dcea1b90e7 arch_atomic: only support atomic_xx and atomic64_xx function
Modify the kernel to use only atomic_xx and atomic64_xx interfaces,
avoiding the use of sizeof or typeof to determine the type of
atomic operations, thereby simplifying the kernel's atomic
interface operations.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-04 14:03:14 +01:00
zhanghongyu
ba419cc894 drivers/net/{e1000|igc}: limit no packet is transmit after carrier off
if the drvier tx queue is full up during the network cable unplugging,
there will be no txdone interrupt after inserting the network cable,
transmit cannot be recovered.

Modified to no longer fill the driver with packet when link down.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
0932fccfb2 drivers/net/{e1000|igc}: reset TX ring when disconnected
drivers/net/{e1000|igc}: reset TX ring when disconnected

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
ada47439bd drivers/net/{e1000|igc}: fix link status crash
netdev_lower_carrier_xxx API can't be used in interrupt context

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
5e48f2a3d8 drivers/net/igc: make Interrupt Throttle configurable
make Interrupt Throttle configurable for igc

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
bf4eadf735 drivers/net/{e1000|igc}: configure RX/TX descriptors from Kconfig
configure E1000/IGC RX/TX descriptors from Kconfig

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
Xiang Xiao
d7209fabf4 pci: Remove igc produt config
to simplify the configuration since the driver could detect the device correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-17 08:40:26 +01:00
yezhonghui
775ff286a4 pci e1000 net delete produce config
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-11-17 08:40:26 +01:00
Alin Jerpelea
286d37026c drivers: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-11-06 18:02:25 +08:00
ouyangxiangzhen
5450b50951 net/igc: Support Intel I226V.
This commit supported Intel I226V.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-11-05 14:03:02 +08:00
Xiang Xiao
c5381c3eb2 Replace __attribute__((packed)) with [begin|end]_packed_struct
since the different compiler express the packed structure in the different way
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-03 10:20:38 +08:00
ouyangxiangzhen
17c51c0667 userspace: Exclude nuttx/arch.h
This patch fixed userspace headers conflict. Architecture-related definition and API should not be exposed to users.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-11-01 16:59:37 +08:00
zhanghongyu
948d51cd67 e1000: add polling mode support for tx/rx
In scenarios that require high time accuracy, we do not want an
interrupt from the NIC to interrupt the current task, so add support
for polling mode.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-08 13:15:31 +02:00
Bowen Wang
064eb5fd35 rpmsg services: should release the tx buffer when rpmsg_send_nocopy failed
Otherwise, the tx buffer will be discarded and can no longer be obtained

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-08 18:26:39 +08:00
Xiang Xiao
4e5a963443 drivers/net: Register "/dev/net/tun" as tun node too
to compatible with Linux convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-08 11:16:01 +08:00
Xiang Xiao
7c839d7a09 rptun: Remove include/nuttx/rptun/openamp.h
and use include/nuttx/rpmsg/rpmsg.h instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-07 00:44:28 +08:00
nuttxs
c0403ed768 1.xtensa/esp32s3: configure the number of universal management
(IEEE) MAC addresses when there are multipleinterfaces.
2.Optimize Lan9250 to adapt to ESP32S3 universalMAC address.
2024-09-28 11:47:24 +08:00
Shoukui Zhang
43223124ec vfs/file: add reference counting to prevent accidental close during reading writing...
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-17 12:01:53 +08:00
p-szafonimateusz
1e212981b9 drivers/net: add support for Intel I225 network card
add support for Intel I225 network card

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-17 01:42:38 +08:00
p-szafonimateusz
bc0c7b0db3 drivers/net: add Intel e1000 network card support
add Intel e1000 network card support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-17 01:42:38 +08:00
meijian
a7224cf35a net/netstatistics: add tx/rx bytes statistics for dev
We can see them in ifconfig:

ap> ifconfig
wlan0   Link encap:Ethernet HWaddr 42:64:7f:b3:12:03 at UP mtu 1500
        inet addr:10.0.1.2 DRaddr:10.0.1.1 Mask:255.255.255.0
        inet6 DRaddr: ::

        RX: Received Fragment Errors   Bytes
            00000b9b 00000000 00000000 21daf5
            IPv4     IPv6     ARP      Dropped
            00000a33 00000137 00000031 00000000
        TX: Queued   Sent     Errors   Timeouts Bytes
            00000ac4 00000ac4 00000000 00000000 1a2103
        Total Errors: 00000000

Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-10 11:36:03 +08:00
fangxinyong
7b05a550dc sched: replace up_cpu_index with this_cpu
Make this_cpu is arch independent and up_cpu_index do that.
In AMP mode, up_cpu_index() may return the index of the physical core.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-09-05 12:09:24 +08:00
daichuan
e48d5d8271 add for support cmake with netdev_notify_recvcpu.c
Signed-off-by: daichuan <daichuan@xiaomi.com>
2024-08-30 01:45:06 +08:00
daichuan
b5753d06f2 support rss/arfs with device
Signed-off-by: daichuan <daichuan@xiaomi.com>
2024-08-30 01:45:06 +08:00