Skip to content

Conversation

@muratcyberfu
Copy link

"If we couldn't ask the chip if OKC is supported, assume it is NOT supported and do not try to use it."

This ensures that if any code later in the connection process checks if (profile->is_okc) ..., it will evaluate to false and skip OKC logic, preventing a potential second error where the driver tries to enable a feature the chip doesn't support.

"If we couldn't ask the chip if OKC is supported, assume it is NOT supported and do not try to use it."

This ensures that if any code later in the connection process checks if (profile->is_okc) ..., it will evaluate to false and skip OKC logic, preventing a potential second error where the driver tries to enable a feature the chip doesn't support.

Signed-off-by: Murat Cyberfu <murat@cyberfu.co.uk>
@svenpeter42
Copy link
Member

This code is upstream and doesn't affect any of our downstream patches or Apple Silicon-specific drivers or functions. Please directly submit it upstream.

@jannau
Copy link
Member

jannau commented Jan 16, 2026

is_okc is added in 778e562 in our downstream bits/080-wifi

@jannau jannau reopened this Jan 16, 2026
@svenpeter42
Copy link
Member

Sorry about that, got confused with my branches and though that was upstream already!

if (err) {
bphy_err(drvr, "could not get wpa_auth (%d)\n", err);
return err;
profile->is_okc = false; // If we couldn't ask the chip if OKC is supported, assume it is NOT supported and do not try to use it
Copy link
Member

Choose a reason for hiding this comment

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

I don't see how profile->is_okc could be true at this point. It is explictly set to false just 8 llines above.

Copy link
Member

Choose a reason for hiding this comment

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

The return must not be removed otherwise val might be used without initialization

&okc_enable);
if (err) {
bphy_err(drvr, "get okc_enable failed (%d)\n", err);
profile->is_okc = false; // Again, set state so it does not try OKC if not allowed
Copy link
Member

Choose a reason for hiding this comment

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

again, I do not see how this could make a difference. profile->is_okc is set to false at the beginning of this function and the places there it might be set to true are the two profile->is_okc = okc_enable; after querying "okc_enable" in lin 1944 and 1956

Copy link
Member

@jannau jannau left a comment

Choose a reason for hiding this comment

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

I don't see how this change could make any difference except for using an uninitialized value. The original code looks ok to me.

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.

3 participants