Even just walking sysfs for driver and parent devices takes
time for ports we know we'll never use, so take a short-cut
and save some startup time. This reduces the startup
overhead to some 15%.
Some devices won't get to the initialization stage where we send
CMEE=1 (for numeric error codes) before they return some errors,
so handle the string representation of CME error codes too.
Clients can check the property to determine lock/unlock status and thus
unlock the modem before trying to connect if required.
Bits of the patch by dcbw (see the bug).
Some cards (Novatel S720 for example) can take a long time to start
a data call if the device isn't activated on the network or the
signal strength is low.
Some modems key the AT+CSS? response off their 1X state, so if the
modem has EVDO service but no 1X service, AT+CSS? will provide incorrect
registration state information and the registration checking will
end too early. Allow modems that can handle more specific registration
checking to skip the AT+CSS? part.
There are more places to handle, but these are the most critical. If
the modem is removed while a command is in-progress, the mm-callback-info
code will set info->modem to NULL. Make sure we check for that in
callbacks and return a reasonable error. Previous code would just
blindly forge ahead and die on a null dereference.
Some devices (ZTE MF628) respond to everything except CPIN? with
ERROR unless the PIN has been sent. Since no known CDMA devices
support AT+CPIN, assume that devices that return a CPIN response
are GSM devices.
Anything with vendor ID 0x1c9e really; like Alcatel X020, X030,
X060s, etc. Longcheer appears to make the actual hardware that all
the devices with vendor ID 0x1c9e use. You'll see it in .INF files
with "CMLONG" as part of the USB interface definition.
If the ports are not correctly detected, we need to get the driver's
.INF files to determine what the ports should be, and add them to
the udev rules file.
MM would appear to hang sometimes when writing to serial devices but
in reality was just retrying the write too many times. Make the
retry limit time-based so MM doesn't hang but times the attempt out
instead.