Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
tomthecat
Posts: 2
Joined: 14 Dec 2020, 14:00

switch codes for Realtek USB ethernet adapter

Post by tomthecat » 14 Dec 2020, 14:30

for 0bda:8151 and 0bda:8152

see
https://forum.manjaro.org/t/solved-ethe ... er/41773/9

sudo usb_modeswitch -v 0bda -p 8151 -V 0bda -P 8152 -M 555342430860d9a9c0000000800006e0000000000000000000000000000000
sudo usb_modeswitch -v 0bda -p 8152 -V 0bda -P 8153 -M 555342430860d9a9c0000000800006e0000000000000000000000000000000

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: switch codes for Realtek USB ethernet adapter

Post by LOM » 14 Dec 2020, 15:45

So the rtl8152 adapter has an initial id of 0bda:8151 which changes to 0bda:8152 after switching, then we hit the second udev rule switching it from 0bda:8152 to 0bda:8153?
Sorry but that doesn't seem logical to me, I would guess that the rtl8153 adapter also has an initial id of 0bda:8151.

tomthecat
Posts: 2
Joined: 14 Dec 2020, 14:00

Re: switch codes for Realtek USB ethernet adapter

Post by tomthecat » 14 Dec 2020, 22:41

Sorry, my post was maybe a little bit ambigous.

My adapter (part of a multiport adapter) had the initial id of 0bda:8151

Code: Select all

 Port 1: Dev 3, If 0, Class=Mass Storage, Driver=, 12M
            ID 0bda:8151 Realtek Semiconductor Corp. RTL8151 Adapteon Business Mobile Networks BV
After issuing the modeswitch command

Code: Select all

 sudo usb_modeswitch -v 0bda -p 8151 -V 0bda -P 8152 -M 555342430860d9a9c0000000800006e0000000000000000000000000000000
the device changes to

Code: Select all

           Device-2: Realtek RTL8152 Fast Ethernet Adapter type: USB driver: r8152 
with the id 0bda:8152

The USB sequence was found in the code of MIST, the Modem Interface Switching Tool from ChromeOS.

Code: Select all

###############################################################################
# The following devices are Ethernet adapters, not cellular modems.
###############################################################################

# Samsung USB Ethernet Adapter AA-AE2N12B
usb_modem_info {
  initial_usb_id { vendor_id: 0x04e8 product_id: 0xa100 }
  final_usb_id { vendor_id: 0x04e8 product_id: 0xa101 }
  initial_reset: true
}

# Realtek RTL8152-based Ethernet Adapters
usb_modem_info {
  initial_usb_id { vendor_id: 0x0bda product_id: 0x8151 }
  final_usb_id { vendor_id: 0x0bda product_id: 0x8152 }
  usb_message: "555342430860d9a9c0000000800006e0000000000000000000000000000000"
}

# Realtek RTL8153-based Ethernet Adapters
usb_modem_info {
  initial_usb_id { vendor_id: 0x0bda product_id: 0x8152 }
  final_usb_id { vendor_id: 0x0bda product_id: 0x8153 }
  usb_message: "555342430860d9a9c0000000800006e0000000000000000000000000000000"
}
The second command was only given for completeness. If I have had a 0bda:8152 device in the first instance, I had to issue the other command.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: switch codes for Realtek USB ethernet adapter

Post by LOM » 23 Dec 2020, 04:12

tomthecat wrote: 14 Dec 2020, 22:41 Sorry, my post was maybe a little bit ambigous.

My adapter (part of a multiport adapter) had the initial id of 0bda:8151

Code: Select all

 Port 1: Dev 3, If 0, Class=Mass Storage, Driver=, 12M
            ID 0bda:8151 Realtek Semiconductor Corp. RTL8151 Adapteon Business Mobile Networks BV
After issuing the modeswitch command

Code: Select all

 sudo usb_modeswitch -v 0bda -p 8151 -V 0bda -P 8152 -M 555342430860d9a9c0000000800006e0000000000000000000000000000000
the device changes to

Code: Select all

           Device-2: Realtek RTL8152 Fast Ethernet Adapter type: USB driver: r8152 
with the id 0bda:8152
Yes, I have no problem with that part and thanks for the report!

tomthecat wrote: 14 Dec 2020, 22:41 The USB sequence was found in the code of MIST, the Modem Interface Switching Tool from ChromeOS.

Code: Select all

###############################################################################
# The following devices are Ethernet adapters, not cellular modems.
###############################################################################

# Samsung USB Ethernet Adapter AA-AE2N12B
usb_modem_info {
  initial_usb_id { vendor_id: 0x04e8 product_id: 0xa100 }
  final_usb_id { vendor_id: 0x04e8 product_id: 0xa101 }
  initial_reset: true
}

# Realtek RTL8152-based Ethernet Adapters
usb_modem_info {
  initial_usb_id { vendor_id: 0x0bda product_id: 0x8151 }
  final_usb_id { vendor_id: 0x0bda product_id: 0x8152 }
  usb_message: "555342430860d9a9c0000000800006e0000000000000000000000000000000"
}

# Realtek RTL8153-based Ethernet Adapters
usb_modem_info {
  initial_usb_id { vendor_id: 0x0bda product_id: 0x8152 }
  final_usb_id { vendor_id: 0x0bda product_id: 0x8153 }
  usb_message: "555342430860d9a9c0000000800006e0000000000000000000000000000000"
}
The second command was only given for completeness. If I have had a 0bda:8152 device in the first instance, I had to issue the other command.
This second part is where MIST has it wrong, the 0bda:8152 is not an initial id for the rtl8153, it is only an id after an rtl8152 has been switched.

I started to look for Realtek ethernet devices in my own computers and found that I have one matching in a USB C portexpander (billboard device) which has a 3-port USB 2.x hub, a 2-port USB C hub, an SD/TF card reader, a hdmi video device, and a Realtek GBit Ethernet device. I used it on a Win10 laptop and never needed the Ethernet port but remember it behaving strange, the Ethernet device disappeared and reappeared frequently.

Testing this one again I find that it appears as USB Storage Device (virtual cd-rom) with Realtek drivers on it and it has the USB Id 0bda:8151.
usbview under Win10 displays it as:

Code: Select all

Device Descriptor:
bcdUSB:             0x0300
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x09 (9)
idVendor:           0x0BDA
idProduct:          0x8151
bcdDevice:          0x3000
iManufacturer:        0x01
iProduct:             0x02
iSerialNumber:        0x06
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     Full
Device Address:       0x3B
Open Pipes:              2

Endpoint Descriptor:
bEndpointAddress:     0x84
Transfer Type:        Bulk
wMaxPacketSize:     0x0400 (1024)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:     0x05
Transfer Type:        Bulk
wMaxPacketSize:     0x0400 (1024)
bInterval:            0x00
The drivers are flaky, won't self extract but I somehow managed to eject the "cd-rom" and then the Ethernet device appeared as 0bda:8153.

Code: Select all

Device Descriptor:
bcdUSB:             0x0300
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x09 (9)
idVendor:           0x0BDA
idProduct:          0x8153
bcdDevice:          0x3000
iManufacturer:        0x01
iProduct:             0x02
iSerialNumber:        0x06
bNumConfigurations:   0x02

ConnectionStatus: DeviceConnected
Current Config Value: 0x00
Device Bus Speed:     Full
Device Address:       0x17
Open Pipes:              0
So I am quite confident that the initial USB Id of the Realtek GBit Ethernet adapter is 0bda:8151 as it is for the Realtek Fast Ethernet adapter. Future versions of usb_modeswitch will get support for switching 0bda:8151 with the switch message you gave us and it will work for both the Fast and Gbit adapters.

Post Reply