Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hwsim support #211

Merged
merged 4 commits into from
Jul 11, 2024
Merged

Hwsim support #211

merged 4 commits into from
Jul 11, 2024

Conversation

jow-
Copy link
Owner

@jow- jow- commented Jul 11, 2024

  • Commit 5a67f76 adds support for the MAC80211_HWSIM netlink protocol family, allowing management of simulated physical devices (phys) and userspace data frame transmission.
  • Commit 0d268c8 removes unused structure members
  • Commit a452da5 extends the ucode <-> nla conversion routines to support arrays of structures, as needed for attributes like HWSIM_ATTR_TX_INFO.
  • Commit 15db28e adds error handling for cases where certain netlink commands (like HWSIM_CMD_NEW_RADIO) might return invalid positive error codes, preventing potential infinite loops in the uc_nl_request() function.

@jow- jow- force-pushed the hwsim-support branch 2 times, most recently from 87a5deb to d2970f1 Compare July 11, 2024 12:05
jow- added 3 commits July 11, 2024 14:08
Some generic netlink commands, e.g. `HWSIM_CMD_NEW_RADIO` might reply with
a bogus netlink error message containing a positive error code, leading
to an infinite loop in `uc_nl_request()`.

Gracefully deal with such occurrences by remapping the error code to
`NLE_RANGE` with a custom message.

Signed-off-by: Jo-Philipp Wich <[email protected]>
Some netlink attributes, e.g. `HWSIM_ATTR_TX_INFO` contain arrays of
structures. In order to cover this use-case, extend the ucode <-> nla
conversion routines to support `DT_NESTED` declaration in conjunction
with `DF_ARRAY`.

Signed-off-by: Jo-Philipp Wich <[email protected]>
The `nlctrl` and `nl80211` family pointers were never used, so drop them
from the connection context structure.

Signed-off-by: Jo-Philipp Wich <[email protected]>
@jow- jow- force-pushed the hwsim-support branch 2 times, most recently from 72d75a0 to 9fb7ae2 Compare July 11, 2024 12:32
The mac80211_hwsim module exposes a custom generic netlink family for
managing simulated phys and userspace data frame transmission.

Since hwsim functionality is closely related to nl80211 and useful to
e.g. manage simulated wireless testbeds, I decided to include support
directly into the nl80211 module.

Example calls for creating and destroying hwsim wiphys:

    nl80211.request(nl80211.const.HWSIM_CMD_NEW_RADIO, 0, {
        perm_addr: "02:11:22:33:44:55",
        support_p2p_device: true
    });

    nl80211.request(nl80211.const.HWSIM_CMD_DEL_RADIO, 0, {
        radio_name: "phy2"
    });

Signed-off-by: Jo-Philipp Wich <[email protected]>
@jow- jow- merged commit b391fd7 into master Jul 11, 2024
7 checks passed
@jow- jow- deleted the hwsim-support branch July 11, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant