FireBrick Modeswitch Commands

Back up to the FireBrick Category
From AAISP Support Site
Revision as of 15:47, 21 June 2021 by AA-Andrew (talk | contribs) (Created page with "<indicator name="FireBrick">link=:Category:FireBrick|30px|Back up to the FireBrick Category</indicator> Category:FireBrick The following is a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


The following is a rather quick description about the USB modeswitch mechanism.

Most USB dongles present themselves as mass storage devices when first connected - ie they look like a CD rom or a memory stick. This is so that, on platforms (such as Windows) which need manufacturer-specific drivers to communicate, the drivers can be installed from the dongle itself. Once installed the driver will "morph" the dongle into a device capable of the 3G/4G communication. This process is called modeswitching.

Unfortunately there is no standard way to perform this modeswitch. The major dongle manufacturers seem to have each picked their own way to do it. This isn't a problem for platforms such as Windows, where the installed driver will know how to do the switch, and is also normally not a problem for Linux which has a large database containing details of most of the various known ways to switch a dongle.

For the FB this isn't so easy. We don't want to have to keep a large database, which would probably need frequent updating. So we attempt to guess how to do the modeswitch, depending on the manufacturer and in some cases the usb device code. This works well for the majority of devices, but to cater for others we have a config option allowing the customer to set the required mechanism.

The config "dongle" item has a "modeswitch" attribute, which is normally left null, which gives the default behaviour. It can be set to a space-separated list of actions to be performed, from the list below. Normally only one of the following rather than a sequence would be used.

default        - uses the default action (same as if unset) - see below
reset          - perform a USB device reset
wakeup         - perform a "remote wakeup" request (some older Huawei devices need this)
mass-reset     - issue a mass-storage reset command
read           - perform a mass-storage read command (any data read is logged and discarded)
eject          - issue a scsi eject command
huawei         - send the huawei-specific sequence needed by most Huawei devices
allow          - send a bulk storage "allow remove" request.
raw:<hexbytes> - send exactly the bytes specified
noswitch       - do nothing

The default behaviour is to issue "wakeup" for older Huawei devices, "huawei" for newer Huawei devices, and "eject" for others.