Commit 30a4ddd
committed
stm32/eth: Add link state detection and fix active() method.
This implements automatic detection of Ethernet cable connect/disconnect
events and fixes the active() method to return interface state instead
of link state.
Changes:
- Add PHY interrupt register support and link tracking in eth_t
- Implement periodic PHY link status polling in ETH_IRQHandler
- Update LWIP netif link state based on cable connection
- Add enabled flag to track interface state vs physical link
- Fix active() to return eth_is_enabled() instead of link status
- Trigger DHCP renewal when link comes back up
The implementation polls link status every ~100 RX interrupts,
providing good responsiveness while minimizing overhead. The active()
method now correctly reflects whether the interface has been explicitly
enabled/disabled by the user, independent of cable state.
Signed-off-by: Andrew Leech <[email protected]>1 parent 4ce2dd2 commit 30a4ddd
4 files changed
+50
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| 193 | + | |
| 194 | + | |
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
| |||
396 | 400 | | |
397 | 401 | | |
398 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
399 | 410 | | |
400 | 411 | | |
401 | 412 | | |
| |||
713 | 724 | | |
714 | 725 | | |
715 | 726 | | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
716 | 757 | | |
717 | 758 | | |
718 | 759 | | |
| |||
849 | 890 | | |
850 | 891 | | |
851 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
852 | 897 | | |
853 | 898 | | |
854 | 899 | | |
| |||
860 | 905 | | |
861 | 906 | | |
862 | 907 | | |
| 908 | + | |
863 | 909 | | |
864 | 910 | | |
865 | 911 | | |
866 | 912 | | |
867 | 913 | | |
868 | 914 | | |
| 915 | + | |
869 | 916 | | |
870 | 917 | | |
871 | 918 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
0 commit comments