Page MenuHomeFreeBSD

LinuxKPI: Improve sysfs support.
ClosedPublic

Authored by johalun on Fri, Sep 6, 3:13 AM.

Details

Summary
  • Add functions for creating and merging sysfs groups.
  • Add sysfs_streq function to compare strings ignoring newline from the sysctl userland call.
  • Add a call to sysfs_create_groups in device_add.
  • Remove duplicate header include.
  • Bump __FreeBSD_version
Test Plan

Tested OK with WIP drm driver update on i915.
mlx* drivers built and loaded OK (but without hardware).

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

johalun created this revision.Fri, Sep 6, 3:13 AM
hselasky added inline comments.Fri, Sep 6, 6:27 AM
sys/compat/linuxkpi/common/include/linux/device.h
43 ↗(On Diff #61713)

Why is this header file removed? Does device.h still build standalone?

sys/compat/linuxkpi/common/include/linux/sysfs.h
276 ↗(On Diff #61713)

You should test for l1 != 0 and l2 != 0

johalun updated this revision to Diff 61737.Fri, Sep 6, 3:02 PM

Check if strlen=0.

johalun updated this revision to Diff 61739.Fri, Sep 6, 3:04 PM

Improve strlen safety checks.

Apply reviewer suggestions

sys/compat/linuxkpi/common/include/linux/device.h
43 ↗(On Diff #61713)

This is a duplicate.

sys/compat/linuxkpi/common/include/linux/sysfs.h
276 ↗(On Diff #61713)

Good catch. Fixed.

johalun edited the summary of this revision. (Show Details)Fri, Sep 6, 3:06 PM
hselasky accepted this revision.Fri, Sep 6, 3:07 PM

Make sure:
make buildkernel WITH_OFED=YES

pass.

This revision is now accepted and ready to land.Fri, Sep 6, 3:07 PM
This revision was automatically updated to reflect the committed changes.