HomeFreeBSD

LinuxKPI: add kstrtou32_from_user() and mac_pton()

Description

LinuxKPI: add kstrtou32_from_user() and mac_pton()

While here:

  • fix an argument of kstrtouint_from_user() to correct signedness.
  • make kstrtou32() call kstrtouint() to avoid duplication (keep inline function)

Add kstrtou32_from_user() based on other examples in the file
making it a copy of the now fixed kstrtouint_from_user().

Also add a rudimentarily hacked up version of mac_pton() which is
leanient accepting non-well-formed input but so far only with ':'
separators. It does not seem to obviously belong to any networking
header file so add it here.

Both new functions are needed for debugfs support for iwlwifi hence
coming together in one commit.

Sponsored by: The FreeBSD Foundation
Commented on by: emaste
Differential Revision: https://reviews.freebsd.org/D37088

(cherry picked from commit f82cf28b317b6b3ffd1418ab9c5b230145da8f75)

Details

Provenance
bzAuthored on Oct 22 2022, 6:02 PM
Differential Revision
D37088: LinuxKPI: add kstrtou32_from_user() and mac_pton()
Parents
rG4c7aee8a7009: rtw88: use #define for NL80211_BAND_2GHZ instead of hardcoded number
Branches
Unknown
Tags
Unknown