This is the port to git master of the following commit:
commit e0242b4db7fb1556e79f6829d22edf411f9f6ba4
Author: Dan Williams <dcbw@redhat.com>
Date: Thu Aug 23 21:14:38 2012 -0500
sierra: fix detection of APP1 port
The APP1 port (which has a limited AT parser) doesn't prefix
its replies with <CR><LF> like nice modems do, and that means
it runs afoul of the echo removal bits of the AT serial port
code. We need to parse the whole string even though it's not
prefixed properly to find the APP1 string in the response.
This is the port to git master of the following patch:
commit 21e66dfa1774ac2ee037ac8b6e8bb4d71a6f7931
Author: Dan Williams <dcbw@redhat.com>
Date: Thu Aug 23 21:13:35 2012 -0500
core: add function to open probe ports without removing echo
Some devices (Sierra GSM ones) return stuff we need but don't
bother to prefix it with <CR><LF>, so we need to optionally turn
off the echo removal at probe time.
Don't abort the connection if the modem reports unregistered in either
3GPP or CDMA, as mixed CDMA+3GPP modems may connect even if not registered
in both technologies.
Some sierra modems (e.g. MC7710) have a secondary port that likes to reply OK
to any AT command passed. Detect that as soon as possible, and don't consider
the Icera port probing result from that secondary port.
QMI and wwan ports come in pairs. Each wwan port has an associated control QMI
port, which is the only port allowed to send the Start|Stop Network QMI requests
to start|stop the connection in the given wwan interface.
Paired QMI and wwan interfaces (should) share the same parent udev device,
quoting Bjørn:
"If we ignore the unfortunate 3.4 and 3.5 kernels, then a matching wwanX
and cdc-wdmY set will always share the same parent USB interface on QMI
devices.
Having the same parent USB device is *not* sufficient. You cannot control
wwan0 using cdc-wdm1 in the above example."
When bands or allowed modes are changed, the modem will very likely reset its
current registration and start from scratch. We will now give it some seconds
to settle down before going on with the connection request, so that the modem
has enough time to report being unregistered. Without this sleep time, the
unsolicited message reporting being unregistered may arrive *after* having
checked registration status in the Simple connect sequence, and therefore we
end up failing the connection request.
Whenever we query current unlock required status and we get that we're unlocked,
we'll launch the after-sim-unlock step so that we try to ensure that the SIM is
ready.
We'll try to cope with getting devices being reported in either 'usb' or
'usbmisc', trying to avoid the need of checking kernel version during runtime.
All grabbed 'net' ports are added to the new list of data ports. It is a task
for the specific plugin to decide how each of the data ports should be
connected. In the case of not having 'net' ports, the list of data ports will
only contain a single AT port.
All grabbed 'qmi' ports are added to the new list of QMI ports. The first port
in the list is to be considered the 'primary' one, and will be the one used
for all services. The remaining QMI ports, if any, will only be used to for WDS,
to manage the associated 'net' ports.
The 'detailed service status' TLV is either pretty new and not always available,
or given only under some specific circumstances. So, try to gather CDMA1x and
EV-DO registration status with the default info we usually do get.
The logic is the following:
* If registered and the access technologies contain CDMA1x, then CDMA1x is
registered, otherwise it's not.
* If registered and the access technologies contain any of the EV-DO revisions,
then EV-DO is registered, otherwise it's not.
An example output in a CDMA network:
[/dev/cdc-wdm0] Successfully got serving system:
Registration state: 'registered'
CS: 'attached'
PS: 'attached'
Selected network: '3gpp2'
Radio interfaces: '2'
[0]: 'cdma-1xevdo'
[1]: 'cdma-1x'
Roaming status: 'off'
Data service capabilities: '2'
[0]: 'cdma'
[1]: 'evdo-rev-a'
Current PLMN:
MCC: '311'
MNC: '480'
Description: 'Verizon Wireless'
CDMA System ID:
SID: '26'
ESN: '1'
CDMA Base station info:
Base station ID: '3633'
Latitude: '44.913333'º
Longitude: '-93.279722'º
Roaming indicators: '2'
[0]: '(null)' (cdma-1x)
[1]: '(null)' (none)
Default roaming status: '(null)'
3GPP2 time zone:
Leap seconds: '16' seconds
Local time offset: '-300' minutes
Daylight saving time: 'no'
CDMA P_Rev: '6'
Seems that sometimes we get 'selected network' as UNKNOWN, but we still have
proper registration information. Try to handle those cases.
[/dev/cdc-wdm0] Successfully got serving system:
Registration state: 'registered'
CS: 'detached'
PS: 'attached'
Selected network: 'unknown'
Radio interfaces: '1'
[0]: 'lte'
Roaming status: 'off'
Data service capabilities: '1'
[0]: 'lte'
Current PLMN:
MCC: '311'
MNC: '480'
Description: 'Verizon Wireless'
Roaming indicators: '1'
[0]: 'off' (lte)