sim: Fix the quirk handling of CPIN for Wavecom
authorHolger Hans Peter Freyther <hfreyther@sysmocom.de>
Thu, 1 Nov 2012 09:05:03 +0000 (10:05 +0100)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 1 Nov 2012 09:56:51 +0000 (04:56 -0500)
commit2b9b1ae6d3a0d75a3c59bfb6cb295f3d9edaa84d
tree18d8caf98719e4e8b33f184c835a52af487fc414
parent320096a7da23c3262499b78e2be8bd59e73839be
sim: Fix the quirk handling of CPIN for Wavecom

The Wavecom Q2XXX support broke in commit 72ce19bf3e87b5e73c053f7ea1.
This is because at_cpin_cb called decode_at_error with final and not
with OK. This lead to an error being set in the error variable and the
new code returns early when an error is set.

The addition of the terminator in at_sim_probe for Wavecom broke in
git commit ac524be99f8c72a2593e4ffcecad8beea7679e55 because
terminators can not be added on cloned chats.

Move the addition of the terminator from the atmodem to the wavecom
plugin. Use the same terminator for Q2XXX and the normal Wavecom
class. The WAVECOM terminator has been tested on a Q2XXX modem.

Apply the CPIN quirk for both WAVECOM and WAVECOM_Q2XXX inside the
sim.c file. Introduce needs_wavecom_sim_quirk to handle it for
WAVECOM and WAVECOM_Q2XXX.
drivers/atmodem/sim.c