r/linuxdev • • Dec 20 '23

Device Driver Responsibility

Are there any best practices or guidelines for where the roles and responsibilities of a Device Driver End?

For example, suppose a network device determines the quality of a link is degraded, and the requirement is to either set the link down or attempt to lower the speed before setting the link down based on a policy set by the user. Are there any guidelines to suggest the implementation of such a policy is to be handled within the device driver itself or rather in user space (possibly in a service)?

The engineer in me knows the answer. That it depends on the requirements. However I wanted to see if anyone knew of guidelines that may be in place. I don’t have any specific problem to solve. Just wanted to see if the roles and responsibilities were clear cut.

1 Upvotes

2 comments sorted by

View all comments

Show parent comment

2

u/MadBlueOx Dec 21 '23

Sounds sensible to me. Choose a default behavior that will maintain service and allow users to set a different policy through sysfs if desired. Thanks for your response.