Skip to content

Implement CYW4373E USB device driver#596

Open
julianuziemblo wants to merge 2 commits intomasterfrom
julianuziemblo/RTOS-1122
Open

Implement CYW4373E USB device driver#596
julianuziemblo wants to merge 2 commits intomasterfrom
julianuziemblo/RTOS-1122

Conversation

@julianuziemblo
Copy link
Contributor

@julianuziemblo julianuziemblo commented Oct 16, 2025

Driver for vendor-specific usbwlan devices, only available for Sterling LWB5+ USB Dongle (CYW4373E) for now.

JIRA: RTOS-1122

Description

Motivation and Context

Depends-On: libphoenix:julianuziemblo/remove_dev
Depends-On: phoenix-rtos-kernel:julianuziemblo/port-unregister

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: armv7m7-imxrt117x-evk

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

@gemini-code-assist
Copy link

Summary of Changes

Hello @julianuziemblo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements a new USB WLAN device driver for the Phoenix-RTOS, enabling support for specific wireless dongles like the Sterling LWB5+ USB Dongle. The driver integrates seamlessly with the existing USB host infrastructure, providing the necessary mechanisms for device detection, configuration, and data transfer. It establishes a robust framework for managing USB WLAN devices, facilitating wireless network capabilities within the system.

Highlights

  • New USB WLAN Driver: This pull request introduces a new USB WLAN device driver, usbwlan, designed to provide wireless connectivity.
  • Targeted Device Support: The driver specifically supports vendor-specific USB WLAN devices, initially focusing on the Sterling LWB5+ USB Dongle (CYW4373E) with vendor IDs 0x04b4:0x0bdc and 0x04b4:0xbd29.
  • Driver Architecture: The driver utilizes a message-based architecture with multiple message threads (USBWLAN_N_MSGTHREADS) to handle device interactions, including control, interrupt, and bulk transfers, and manages device insertion and deletion events.
  • Build System Integration: New Makefile entries are added to build the libusbdrv-usbwlan static library and the usbwlan binary, and these components are integrated into the DEFAULT_COMPONENTS for imxrt117x targets.
  • Device Control Interface: A new header (usbwlan.h) defines a structured message format (usbwlan_i_t) for inter-process communication, allowing clients to perform various device control operations such as download commands, control transfers, and register read/write operations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch from d59005d to 931b94f Compare October 16, 2025 10:59
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new USB device driver for the CYW4373E WLAN dongle. The implementation includes the core driver logic, a server process, and Makefile changes for building and integrating the driver. The code structure is generally good, following patterns seen elsewhere in the repository for USB drivers. However, my review has identified several critical issues related to resource management and locking that could lead to deadlocks or resource leaks. There are also some high-severity concerns regarding the use of sleep for synchronization and performing blocking I/O while holding locks. Additionally, I've pointed out several medium-severity issues related to code safety, consistency, and debug logging. Addressing these points will significantly improve the robustness and maintainability of the new driver.

@github-actions
Copy link

github-actions bot commented Oct 16, 2025

Unit Test Results

9 553 tests   8 961 ✅  52m 57s ⏱️
  591 suites    592 💤
    1 files        0 ❌

Results for commit 26fc0fd.

♻️ This comment has been updated with latest results.

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch 2 times, most recently from 9a81bc6 to 6117576 Compare October 17, 2025 08:45
Copy link
Member

@adamgreloch adamgreloch left a comment

Choose a reason for hiding this comment

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

Minor nitpicks, otherwise LGTM

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch 3 times, most recently from 02cdfbf to 96982b0 Compare October 24, 2025 08:12
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch 2 times, most recently from 09a1e82 to 3dcfffc Compare October 24, 2025 08:14
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch 2 times, most recently from 26dddc8 to a1f5678 Compare October 24, 2025 11:10
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch 5 times, most recently from 8882efb to 5cbfc2a Compare November 28, 2025 15:57
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch from 5cbfc2a to 3924327 Compare December 9, 2025 10:31
ziemleszcz
ziemleszcz previously approved these changes Jan 20, 2026
ziemleszcz
ziemleszcz previously approved these changes Jan 20, 2026
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch 3 times, most recently from 2f10450 to c2fcfc7 Compare February 12, 2026 13:23
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch 2 times, most recently from 6ddeaf3 to 8e5d707 Compare February 18, 2026 09:33
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch from 8e5d707 to 1440060 Compare February 18, 2026 09:48
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch from 1440060 to e7dab00 Compare March 13, 2026 16:34
@julianuziemblo julianuziemblo requested a review from Darchiv March 13, 2026 16:34
@ziemleszcz
Copy link
Contributor

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces the CYW4373E USB device driver, including its Makefile, server component, and core driver logic. The changes correctly integrate the new driver into the build system and establish the necessary USB communication channels. Error handling and resource management appear to be implemented appropriately for device insertion and deletion. The driver also includes specific handling for vendor-specific USB requests related to the CYW4373E chip.

Darchiv
Darchiv previously approved these changes Mar 16, 2026
Copy link
Member

@Darchiv Darchiv left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for addressing the issues.

Driver for vendor-specific usbwlan devices
Only available for Sterling LWB5+ USB Dongle for now.

JIRA: RTOS-1122
The user may want to close the device when a thread is in the middle of
an ongoing read. This can be achieved through added usbwlan_abort devctl.

JIRA: RTOS-1122
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1122 branch from 8168972 to 26fc0fd Compare March 18, 2026 11:04
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.

5 participants