Skip to content

Troubleshooting mt7612 authentication errors#22

Closed
Copilot wants to merge 1 commit into
masterfrom
copilot/fix-mt7612-client-auth-error
Closed

Troubleshooting mt7612 authentication errors#22
Copilot wants to merge 1 commit into
masterfrom
copilot/fix-mt7612-client-auth-error

Conversation

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Pull request created by AI Agent

Change the BSSID index mask from 7 to 0xf in mt76x02_mac_set_bssid()
to properly support all 16 hardware BSSID slots (0-15).

The hardware is configured for "8 APs + 8 STAs" mode where:
- Indices 0-7 are used for AP mode
- Indices 8-15 are used for client (STA) mode

The previous mask of 7 (0b0111) was truncating client mode indices
8-15 back to 0-7, causing client interfaces to write their BSSID to
the wrong hardware register. This resulted in the hardware not
recognizing the AP's BSSID during authentication, leading to
authentication timeouts.

Fixes authentication timeout issue when mt7612/mt7662 operates in
client mode.
@HiGarfield HiGarfield marked this pull request as ready for review June 21, 2026 08:07
Copilot AI review requested due to automatic review settings June 21, 2026 08:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4173587c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mt76x02_mac.c
void mt76x02_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr)
{
idx &= 7;
idx &= 0xf;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid addressing non-BSSID registers for high slots

When mt76x02_mac_setaddr() clears i = 0..15, this wider mask lets i = 14 and i = 15 reach the APC BSSID address macro instead of wrapping to the eight defined slots. With MT_MAC_APC_BSSID_BASE at 0x1090 and an 8-byte stride, slot 14 writes 0x1100 (MT_XIFS_TIME_CFG) and slot 15 updates 0x110c (MT_CH_TIME_CFG), so any device init or first-interface MAC reset can zero timing/channel-counter registers rather than only BSSID storage.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR attempts to address mt7612 authentication issues by changing how mt76x02_mac_set_bssid() constrains the BSSID index before programming the MT_MAC_APC_BSSID_* register block.

Changes:

  • Expand the BSSID index mask from idx &= 7 to idx &= 0xf in mt76x02_mac_set_bssid().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mt76x02_mac.c
void mt76x02_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr)
{
idx &= 7;
idx &= 0xf;
@HiGarfield HiGarfield closed this Jun 21, 2026
@HiGarfield HiGarfield deleted the copilot/fix-mt7612-client-auth-error branch June 21, 2026 08:46
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