From: Ethan Nelson-Moore enelsonmoore@gmail.com
[ Upstream commit bf4172bd870c3a34d3065cbb39192c22cbd7b18d ]
Some SR9700 devices have an SPI flash chip containing a virtual driver CD, in which case they appear as a device with two interfaces and product ID 0x9702. Interface 0 is the driver CD and interface 1 is the Ethernet device.
Link: https://github.com/name-kurniawan/usb-lan Link: https://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=2185 Signed-off-by: Ethan Nelson-Moore enelsonmoore@gmail.com Link: https://patch.msgid.link/20251211062451.139036-1-enelsonmoore@gmail.com [pabeni@redhat.com: fixes link tags] Signed-off-by: Paolo Abeni pabeni@redhat.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
## Analysis of Commit: net: usb: sr9700: support devices with virtual driver CD
### 1. COMMIT MESSAGE ANALYSIS
The commit adds support for SR9700 USB Ethernet devices that include a virtual driver CD-ROM. These devices use product ID 0x9702 (vs the standard 0x9700) and present two interfaces: interface 0 is the CD-ROM, interface 1 is the actual Ethernet device.
External links reference real-world user issues with these devices (usb_modeswitch discussions, GitHub repo), confirming this addresses actual hardware in the field.
### 2. CODE CHANGE ANALYSIS
The change is minimal and straightforward: ```c { /* SR9700 with virtual driver CD-ROM - interface 0 is the CD-ROM device */ USB_DEVICE_INTERFACE_NUMBER(0x0fe6, 0x9702, 1), .driver_info = (unsigned long)&sr9700_driver_info, }, ```
This adds a single entry to the USB device ID table: - Same vendor ID (0x0fe6) as existing SR9700 - New product ID (0x9702) for devices with virtual CD-ROM - Matches only interface 1 (the Ethernet interface, avoiding the CD-ROM on interface 0) - Uses the exact same `sr9700_driver_info` - no driver code changes
### 3. CLASSIFICATION
**This is a NEW DEVICE ID addition** - one of the explicitly allowed exceptions for stable backports.
- NOT a new feature in the traditional sense - NOT adding a new driver - NOT changing any APIs or driver logic - Simply adding a USB ID to enable hardware on an existing, mature driver
### 4. SCOPE AND RISK ASSESSMENT
| Metric | Assessment | |--------|------------| | Lines changed | +5 lines | | Files touched | 1 | | Code complexity | Trivial - USB ID table entry only | | Risk level | **Very Low** |
The sr9700 driver is mature and unchanged. The only "new" aspect is using `USB_DEVICE_INTERFACE_NUMBER()` instead of `USB_DEVICE()` to specifically bind to interface 1, which is correct behavior for this dual-interface device.
### 5. USER IMPACT
- **Affected users**: Anyone with SR9700 USB Ethernet adapters that have the virtual CD-ROM feature (product ID 0x9702) - **Current state**: Device is completely non-functional without this patch - the driver doesn't recognize it - **Severity**: Hardware unusable - users cannot access their network adapter - **Evidence**: External links show real users encountering this issue
### 6. STABILITY INDICATORS
- Signed-off-by Paolo Abeni (Red Hat networking maintainer) - Clean, follows established patterns for USB device ID additions - Uses standard kernel macros (`USB_DEVICE_INTERFACE_NUMBER`)
### 7. DEPENDENCY CHECK
- No dependencies on other commits - The sr9700 driver exists in all maintained stable kernels (driver added in 2013) - Patch applies cleanly with no modifications needed
---
## Verdict
This commit is a **textbook example** of what should be backported to stable:
**Meets stable criteria:** - ✅ Obviously correct - simple USB ID table entry - ✅ Fixes real bug - hardware completely unusable without it - ✅ Small and contained - 5 lines, single file, no logic changes - ✅ No new features - enables existing driver for device variant - ✅ Falls into Device ID exception - explicitly allowed for stable
**Risk assessment:** - Minimal risk - cannot affect existing 0x9700 device users - Worst case if wrong: only affects users with 0x9702 devices who already can't use them
**Benefit:** - Clear user benefit - enables hardware that otherwise doesn't work at all
**NO** concerns: - No backport adjustments needed - No dependencies - Driver code is identical across stable versions
**YES**
drivers/net/usb/sr9700.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c index 091bc2aca7e8..d8ffb59eaf34 100644 --- a/drivers/net/usb/sr9700.c +++ b/drivers/net/usb/sr9700.c @@ -539,6 +539,11 @@ static const struct usb_device_id products[] = { USB_DEVICE(0x0fe6, 0x9700), /* SR9700 device */ .driver_info = (unsigned long)&sr9700_driver_info, }, + { + /* SR9700 with virtual driver CD-ROM - interface 0 is the CD-ROM device */ + USB_DEVICE_INTERFACE_NUMBER(0x0fe6, 0x9702, 1), + .driver_info = (unsigned long)&sr9700_driver_info, + }, {}, /* END */ };