Skip to content

Commit 0e5554e

Browse files
author
Ian Seyler
committed
Add comments for reset procedure
1 parent d88cbd3 commit 0e5554e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/drivers/net/ena.asm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,24 @@ net_ena_reset:
9999
; Stop queues if they are running
100100

101101
; Reset interface
102-
mov eax, 1
102+
mov eax, 1 ; Set the bit for ENA_CTRL_RESET
103103
mov [rsi+ENA_DEV_CTL], eax
104104

105105
; Wait for reset
106106
net_ena_reset_wait:
107-
mov eax, [rsi+ENA_DEV_STS]
108-
bt eax, 3
109-
jc net_ena_reset_wait
107+
mov eax, [rsi+ENA_DEV_STS] ; Read the current controller status
108+
bt eax, 3 ; Put bit 3 into carry flag
109+
jc net_ena_reset_wait ; Keep polling until carry is clear (reset completed)
110110

111111
; Clear reset
112-
xor eax, eax
112+
xor eax, eax ; Clear the ENA_CTRL_RESET bit we set earlier
113113
mov [rsi+ENA_DEV_CTL], eax
114114

115115
; Wait for reset clear
116116
net_ena_reset_wait_clear:
117-
mov eax, [rsi+ENA_DEV_STS]
118-
bt eax, 3
119-
jnc net_ena_reset_wait_clear
117+
mov eax, [rsi+ENA_DEV_STS] ; Read the current controller status
118+
bt eax, 3 ; Put bit 3 into carry flag
119+
jnc net_ena_reset_wait_clear ; Keep polling until carry is set
120120

121121
; Check ENA_DEV_STS.READY
122122
mov eax, [rsi+ENA_DEV_STS]
@@ -145,7 +145,7 @@ net_ena_reset_wait_clear:
145145
shr rax, 32
146146
mov [rsi+ENA_AENQ_BASE_HI], eax
147147

148-
; Create Admin Queue
148+
; Create Admin Queues
149149
; Admin Submission Queue (AQ)
150150
; Admin Completion Queue (ACQ)
151151

0 commit comments

Comments
 (0)