Weekly Progress Report: upstream wpanusb bcfserial

Hello everyone!
I’m Manas, I’ll be working on the project upstream wpanusb bcfserial as part of Google Summer of Code 2025, under the guidance of my mentors @vaishnav @ayush1325 and @Vedant_Paranjape

The goal of this project is to upstream the wpanusb and bcfserial drivers, which are essential for enabling Linux-based systems (like BeagleConnect Freedom) to act as Sub-GHz IEEE802.15.4 gateways. These drivers currently live outside the mainline kernel and have several known functional gaps. My work this summer will involve:

  • Adding missing driver ops (e.g., Listen Before Talk, frame retries, etc.)
  • Implementing the corresponding firmware-side logic in Zephyr
  • Enabling Linux to query key radio parameters (band, power, supported channels)
  • Supporting dynamic reading of the extended address
  • Laying the groundwork for Zigbee and multi-band (2.4GHz/SubGHz) support

This thread will serve as my weekly devlog, where I’ll document:

  • What I accomplished each week
  • Current roadblocks and how I’m addressing them
  • Any unresolved blockers or tricky issues
  • Plans and goals for the upcoming week

I’ll also be using this space to share relevant patches, RFCs, and discussions with the upstream kernel and linux-wpan communities.

Please feel free to chime in with feedback, suggestions, or just drop by to follow the progress. I’m really excited to contribute and collaborate with the broader community this summer!

Looking forward to a challenging and rewarding journey ahead!

Warm regards,
Manas Gupta

1 Like

Week 0

:white_check_mark: Accomplishments

  • Engaged with mentors for feedback and discussion regarding approach, and timeline finalization
  • Acquired the BeagleConnect Freedom hardware, the primary development platform
  • Initiated a systematic audit of wpanusb.c and bcfserial.c to identify hard-coded parameters, mapping the communication flow between Linux drivers and Zephyr firmware and document unimplemented driver operations LINK : https://www.notion.so/GSoC-25-upstream-wpanusb-bcfserial-blog-20560fe7db43801b8cb0f44fc375a927?source=copy_link
    I’ll work on converting this into a blog website
  • Studied IEEE 802.15.4 specifications and analyzed Zephyr’s radio_api implementation to understand extension points
  • Started configuring the ARM cross-compilation environment for BeagleConnect Freedom targets
  • Installed and configured the b4 tool to streamline interactions with Linux kml
  • Delivered a detailed design document outlining the dynamic configuration strategy
  • Recorded and published an introductory YouTube video summarizing project goals and design. link: hi all, I’ve made a introductory video. link here: https://www.youtube.com/watch?v=MP_S028ihf4

:hammer_and_wrench: Resolution to Blockers

  • Hardware Acquisition: The BeagleConnect Freedom hardware, has been acquired. This unblocks tasks dependent on the physical hardware.

:warning: Ongoing Blockers

  • Hardware Setup Completion & Familiarization: The complete setup of the BeagleConnect Freedom development environment and thorough familiarization is still in progress. This is necessary before intensive hardware-specific development and testing can fully commence.

:date: Plans for Next Week

  • Implement prototype enhancements in the Linux drivers:
    • Implement the basic structure for Listen Before Talk (LBT) in both wpanusb and bcfserial drivers, including parameter validation in wpanusb_set_lbt() and preparing the parameter passing mechanism.
    • Add the framework for the frame retry mechanism, updating wpanusb_set_frame_retries() and implementing equivalent functionality in bcfserial.
    • Replace hard-coded power arrays with placeholder query functions.
    • Develop unit tests to validate these new functionalities.
  • Set up CI/CD pipelines for automated testing of code changes.
  • Run existing drivers with diagnostic logging to establish a baseline for current functionality.
  • Document all current limitations with specific code references.
  • Define data structures for device capability information.
  • Create a detailed mapping of required new firmware API functions (e.g., get_ext_address(), get_band(), get_supported_channels()) to the corresponding Linux driver routines.
  • Outline where and how these API calls will be incorporated into driver initialization and configuration.
  • Share the updated design specification with mentors for feedback.

Feel free to share any suggestions or feedback. Looking forward to an exciting and productive journey with you all!

1 Like

Week 2

:white_check_mark: Accomplishments

  • Continued deep-diving into the wpanusb.c and wpanusb.h driver code to understand internal flow and hook points for new functionality
  • Finalized the design plan for implementing wpanusb_set_lbt() and wpanusb_set_frame_retries() along with required USB control message formatting
  • Began planning the firmware-side API additions (get_extended_addr(), get_supported_channels(), get_tx_power_levels()) required for Milestone 3.
  • Outlined how to replace hardcoded power arrays with placeholder query functions as a first step toward dynamic configuration.

:hammer_and_wrench: Resolution to Blockers

  • Verified readiness of the development setup to begin coding and testing changes this week.

:warning: Ongoing Blockers

  • Out-of-station period (June 5–8) and academic commitments slowed down live testing and code push

:date: Plans for Next Week

  • Implement prototype enhancements in the Linux drivers:
    • Implement the basic structure for Listen Before Talk (LBT) in both wpanusb and bcfserial drivers, including parameter validation in wpanusb_set_lbt() and preparing the parameter passing mechanism.
    • Add the framework for the frame retry mechanism, updating wpanusb_set_frame_retries() and implementing equivalent functionality in bcfserial.
    • Replace hard-coded power arrays with placeholder query functions.
    • Develop unit tests to validate these new functionalities.
  • Set up CI/CD pipelines for automated testing of code changes.
  • Create a detailed mapping of required new firmware API functions (e.g., get_ext_address(), get_band(), get_supported_channels()) to the corresponding Linux driver routines.
  • Outline where and how these API calls will be incorporated into driver initialization and configuration.

Looking forward to wrapping up both Milestone 2 and Milestone 3 by next week. Feedback and suggestions are welcome!

Week 3

:white_check_mark: Accomplishments

:hammer_and_wrench: Resolution to Blockers

  • Coding the handlers for commands mentioned in Zephyr firmware and the missing extended address and capability queries

:warning: Ongoing Blockers

  • hardware testing, integration testing and protocol testing is pending
  • implementation of usbvendor request handlers

:date: Plans for Next Week.

  • Set up CI/CD pipelines for automated testing of code changes for all 3 repos: wpanusb, wpanusb_bc and the bcfserial repo
  • Hardware Validation pending: the codes are complete with comprehensive mock validation, but requires physical BeagleConnect Freedom board for final validation of CC1352 register access and USB protocol communication for all 3 codebases
  • end to end usb testing between the linux host and the firmware
1 Like

Week 4 & 5

:white_check_mark: Accomplishments

Implemented 6 critical driver functions that were previously non-functional:-

  • wpanusb_set_frame_retries() - Removed FIXME comment, added proper IEEE 802.15.4 validation (0-7 retries)

  • wpanusb_set_txpower() - Replaced -ENOTSUPP with full implementation including power level validation against device capabilities

  • wpanusb_set_cca_mode() - Completed empty switch cases, added real USB communication for all CCA modes (Energy/Carrier/Both)

  • wpanusb_set_cca_ed_level() - Replaced stub implementation with real energy detection level

  • settingwpanusb_set_csma_params() - Added IEEE 802.15.4 parameter validation and real USB

  • communicationwpanusb_set_promiscuous_mode() - Implemented real boolean enable/disable functionality

Outlined comprehensive test plan for end-to-end validation covering:

  • LBT (Listen Before Talk) testing scenarios
  • Frame retry mechanism validation

:hammer_and_wrench: Resolution to Blockers

  • Coding the handlers for commands mentioned in Zephyr firmware and the missing extended address and capability queries

:warning: Ongoing Blockers

  • hardware testing, integration testing and protocol testing is pending
  • implementation of usbvendor request handlers

:date: Plans for Next Week.

  • Set up CI/CD pipelines for automated testing of code changes for all 3 repos: wpanusb, wpanusb_bc and the bcfserial repo
  • end to end usb testing between the linux host and the firmware

Week 6

:white_check_mark: Accomplishments

  • created CI/CD pipelines for the wpansub driver
  • created CI/CD pipelines for the bcfserial driver and worked on its code base
  • createdd CI/CD pipelines for the Zephyr firmware
  • been working on the hardcoded assignments

:hammer_and_wrench: Resolution to Blockers

  • Coding the handlers for commands mentioned in Zephyr firmware and the missing extended address and capability queries

:warning: Ongoing Blockers

  • identified some usb control pipe bugs and issues in the usb table
  • hardware testing, integration testing and protocol testing

:date: Plans for Next Week.

  • Plan how to go about the hardcoded parameters and dynamic querying
  • reach out to alex aring for feedback

Week 7-8

:white_check_mark: Accomplishments

  • No major technical progress over the last two weeks due to ongoing academic commitments and placement drives.

  • Spent time reviewing existing code and understanding remaining tasks, especially around:

    Hardcoded assignments
    Zephyr firmware command handlers
    USB control pipe behavior

:hammer_and_wrench: Resolution to Blockers

  • Coding the handlers for commands mentioned in Zephyr firmware and the missing extended address and capability queries

:warning: Ongoing Blockers

  • identified some usb control pipe bugs and issues in the usb table
  • hardware testing, integration testing and protocol testing

:date: Plans for Next Week.

  • Discussions in the wpan kernel mailing list

Week 9

:white_check_mark: Accomplishments

  • Critical USB Protocol Fixes

    • Fixed USB control protocol bug in wpanusb_control_recv() - separated send/receive operations and used correct control pipes instead of bulk pipes
    • Fixed USB device table syntax error for BeagleConnect Freedom device identification
  • Dynamic Capability Discovery System

    • Implemented comprehensive dynamic capability discovery replacing hardcoded parameters:
    • Added wpanusb_get_device_info(), wpanusb_get_hardware_caps(), wpanusb_get_phy_caps()
    • Added wpanusb_get_power_levels() and wpanusb_get_channel_pages() functions
    • Added capability validation with wpanusb_validate_capabilities()
  • Enhanced Driver Validation

    • Enhanced wpanusb_set_txpower() with validation against dynamically discovered power levels
    • Added channel validation in wpanusb_channel() with proper page and channel range checking
  • Memory Management

    • Implemented proper cleanup with wpanusb_cleanup_dynamic_caps() for dynamic allocations
    • Added fallback mechanism - graceful degradation to hardcoded values when dynamic queries fail
  • Protocol Structures (wpanusb.h)

    • Added complete capability discovery protocol with 63 new lines:
    • Device info, hardware caps, PHY caps structures
    • Variable-length power levels and channel pages structures
    • New USB commands: GET_DEVICE_INFO, GET_HARDWARE_CAPS, GET_PHY_CAPS, GET_POWER_LEVELS, GET_CHANNEL_PAGES

:hammer_and_wrench: Resolution to Blockers

  • USB control protocol bugs - RESOLVED: Fixed incorrect pipe usage in wpanusb_control_recv() and control message handling
  • USB table syntax error - RESOLVED: Fixed device table formatting for BeagleConnect Freedom identification
  • Hardcoded parameters - RESOLVED: Implemented comprehensive dynamic capability discovery system replacing all static arrays and values

:warning: Ongoing Blockers

  • I have started a thread on the wpan kernel mailing list but I am yet to receive constructive feedback, that said i have reached out to some of the maintainers personally and have asked for feedback
  • Some function need hardware validation
  • The zephyr firmware west build have some errors

:date: Plans for Next Week.

  • Work on the feedback received by the wpan maintainers
  • debug the errors in the zephyr firmware builds

Week 10

:white_check_mark: Accomplishments

Maintainer Feedback Integration & Architecture Analysis

  • Received valuable responses from WPAN kernel maintainers and analyzed their requirements
  • Confirmed SoftMAC Architecture: Validated that timing-critical MAC operations (AACK/ARET) are properly split between firmware (PHY) and Linux driver (MAC layer) as required
  • Comprehensive Driver Implementation: Completed 1,337 lines of production-quality kernel code with 9 MAC operations fully implemented
  • Advanced Capability System: Dynamic capability discovery system (more sophisticated than existing 802.15.4 drivers) working with device validation and fallback mechanisms

I’ve been working simultaneously on all maintainer-requested components:

  • Generic Framework Design: Architected atusb-style generic layer to enable multiple SoftMAC transceiver support
  • HCI-like Protocol Enhancement: Enhanced existing structured protocol with standardized headers, async events, and version negotiation
  • Virtual Testing Infrastructure: Designed virtual USB-serial backend connecting to mac802154_hwsim for hardware-independent CI/CD testing

:hammer_and_wrench: Resolution to Blockers

  • USB Protocol Issues: RESOLVED - Fixed control pipe bugs and USB table syntax errors
  • Dynamic Capability Discovery: RESOLVED - Replaced all hardcoded parameters with comprehensive device querying system

:warning: Ongoing Blockers

  • Framework Implementation Gap: Generic abstraction layer, virtual testing backend, and formal documentation require implementation (identified as critical for kernel acceptance)
  • Zephyr Firmware Build: some West build errors still present
  • Hardware Testing: Physical BeagleConnect Freedom validation pending for complete protocol verification

:date: Plans for Next Week

  • Extract common USB 802.15.4 functionality into wpan_usb_core.c

  • Make device-specific components pluggable for multiple transceiver support

  • try Implement virtual USB device using dummy_hcd

  • Create protocol bridge to mac802154_hwsim for CI/CD integration

  • start preparing the patches for submission and tesitng

Goal: Address maintainer requirements for generic architecture and testing infrastructure.

1 Like