Skip to content

Conversation

@masc2008
Copy link
Contributor

@masc2008 masc2008 commented Jan 23, 2026

Note: Please adhere to Contributing Guidelines.

Summary

The link status of RNDIS net device needs to keep synchronous with the link status of the network on the system which has internet communication function. This link status event can be sent to host since RNDIS has interrupt endpoint to notify host that "I have something to notify you, please read from me". Then host will use control endpoint to do msg query from nuttx side. Everything will go well if one notification, then read one msg.
however, situation will go complicated: if more than two intr ep events (that means more than two msg need to be reported to host) happen in quite short time and host just read once, then the msg in nuttx will become cached more and more.
What RNDIS client side do:

  1. It can implement a sync policy, which generate another "intr ep" till msg has been read.
  2. when host read, return multiple msgs cached.

To this issue, I prefer 2 to fix it. It has high efficiency. Especially considering that the host read msg length is "0x1000" when it query from client.

Impact

give as much as possible for the response msg, this imply the RNDIS spec which mentioned in 2.2.14.

Testing

Tested and can see multi msgs may return in one USB control transfer.

@github-actions github-actions bot added Area: Drivers Drivers issues Area: USB Size: S The size of the change in this PR is small labels Jan 23, 2026
Copy link
Contributor

@jerpelea jerpelea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix commit title
919d0ef

Copy link
Contributor

@jerpelea jerpelea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move to a separate PR since the PR is open on another topci

@jerpelea jerpelea changed the title fix rndis net link status can't update timely issue drivers/usbdev: fix rndis net link status can't update timely issue Jan 23, 2026
@acassis
Copy link
Contributor

acassis commented Jan 23, 2026

Hi @masc2008 thank you contribution! Please read the CONTRIBUTING.md to guide you.
In the git commit log you need to include more information what was the issue you was seeing and how did you fix it. It will help other devs in the future when they look at your commit in the git.

… +0800

drivers/usbdev/rndis: after client send notication, host can't read msg timely

rndis use intr ep to notify host to read RNDIS message from client, it should
read all the messages cached. Need notify host to read again if there is msg left.

Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
@masc2008
Copy link
Contributor Author

@jerpelea @acassis Thanks!
I cleaned this PR and updated the summary to give more background of this issue.
Let me know for any further concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: USB Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants