Skip to content

Add brcm-reset property for WiFi SDIO interface recovery#2

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-network-manager-reset
Draft

Add brcm-reset property for WiFi SDIO interface recovery#2
Copilot wants to merge 4 commits intomainfrom
copilot/add-network-manager-reset

Conversation

Copy link

Copilot AI commented Nov 16, 2025

Adds a connection property brcm-reset that triggers SDIO interface reset after 5 consecutive WiFi connection failures by unbinding/rebinding the sunxi-mmc driver.

Changes

Connection Property

  • Added connection.brcm-reset boolean property to NMSettingConnection (default: false)
  • Accessible via D-Bus, nmcli, and configuration files

Failure Tracking

  • Added connection_failure_count to NMDeviceWifiPrivate
  • Increments on NM_DEVICE_STATE_FAILED, resets only on NM_DEVICE_STATE_ACTIVATED
  • Preserves count across retry attempts until successful connection

Reset Handler

  • Implemented brcm_reset_sdio() executing the sequence:
    echo 1c10000.mmc > /sys/bus/platform/drivers/sunxi-mmc/unbind
    sleep 1
    echo 1c10000.mmc > /sys/bus/platform/drivers/sunxi-mmc/bind
    
  • Triggered in device_state_changed() when count reaches 5 and property is enabled
  • Resets failure counter after execution

Usage

nmcli connection modify <connection-name> connection.brcm-reset true

Or in connection config:

[connection]
brcm-reset=true

Fixes #1

Original prompt

This section details on the original issue you should resolve

<issue_title>Network Manager reset sdio bcrm</issue_title>
<issue_description>If a WiFi network with the property connection.bcrm-reset = true fails to connect 5 times in a row then call a special error handler function.

This function should execute:

echo 1c10000.mmc > /sys/bus/platform/drivers/sunxi-mmc/unbind
sleep 1
echo 1c10000.mmc > /sys/bus/platform/drivers/sunxi-mmc/bind

Before resuming the process

Steps

  • Add custom property (accessible via configuration & dbus)
  • Add failure tracking
  • Add failure handling
  • Add special error handler
  • The sucessful connect counter should not reset untila successful connection occurs</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 16, 2025
Copilot AI and others added 2 commits November 16, 2025 22:44
Co-authored-by: splitice <468579+splitice@users.noreply.github.com>
Co-authored-by: splitice <468579+splitice@users.noreply.github.com>
@splitice
Copy link
Owner

@copilot change bcrm to brcm

Copilot AI changed the title [WIP] Add network manager reset for failed WiFi connections Add bcrm-reset property for WiFi SDIO interface recovery Nov 16, 2025
Copilot AI requested a review from splitice November 16, 2025 22:51
Co-authored-by: splitice <468579+splitice@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 16, 2025

@copilot change bcrm to brcm

Changed bcrm to brcm throughout the codebase in commit 1b4d6b5.

Copilot AI changed the title Add bcrm-reset property for WiFi SDIO interface recovery Add brcm-reset property for WiFi SDIO interface recovery Nov 16, 2025
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.

Network Manager reset sdio bcrm

2 participants