/*****************************************************************************
 * Copyright (C) Gemalto M2M GmbH
 *****************************************************************************
 * Project: IMC-RIL-Driver
 *****************************************************************************
 * Author : Wireless Modules RD SW A2
 *****************************************************************************
 * $Workfile: Y:/z_ms-d/src/working/Quinn/RilDrv/modulespecifics.h $
 * $Revision: /main/ms-d/257 $
 *     $Date: 2014-06-11 15:46:06 $
 *   $Author: pmackent $
 *****************************************************************************
 * Target:
 *  Microsoft Windows Mobile 5.0
 *****************************************************************************
 * Description:
 *  Gemalto IMC RIL
 *****************************************************************************
 *
 * $Log: Y:/z_ms-d/src/working/Quinn/RilDrv/modulespecifics.h$ 
 * 
 * /main/ms-d/257   2014-06-11 15:46:06   pmackent 
 * Workaround for wrong AT+CPIN? response on netlock(IPIS100098325)
 *
 * /main/ms-d/256   2014-05-08 10:31:50   pmackent
 * Move AT^SAIC to RIL initialization (IPIS100096235)
 *
 * /main/ms-d/255   2014-04-15 10:58:59   pmackent
 * Reactivate wrong SIM failure error on PHS8 Rel3
 *
 * /main/ms-d/254   2014-01-31 12:03:44   pmackent
 * Handle SIM-PIN error for Wrong-CPWD-WA. Disable this WA for PHS8 Rel3
 *
 * /main/ms-d/253   2014-01-22 13:52:25   pmackent
 * Introduce COPS before PIN for AHS3
 *
 * /main/ms-d/252   2013-10-24 13:51:17   pmackent
 * Workaround for missing PPP in ATD*99 at AHS3
 *
 * /main/ms-d/251   2013-09-30 15:19:49   pmackent
 * Special handling for AT+CHUP for EHS5
 *
 * /main/ms-d/250   2013-09-13 09:27:04   pmackent
 * Cell Broadcast for CDMA (IPIS100091379)
 *
 * /main/ms-d/249   2013-07-08 14:54:22   pmackent
 * Workaround for missing quotation mark in AT+CLCC response (IPIS100089511)
 *
 * /main/ms-d/248   2013-06-27 17:50:26   pmackent
 * Workaround for wrong "null" response in EHS5
 *
 * /main/ms-d/247   2013-06-25 13:52:08   pmackent
 * Handle new syntax of AT^SMGL command for CDMA (IPIS100089198)
 *
 * /main/ms-d/246   2013-06-18 08:36:55   pmackent
 * Workaround for wrong status of incoming CDMA voice call
 *
 * /main/ms-d/245   2013-06-17 10:50:51   pmackent
 * Workaround for wrong CDMA data call direction
 *
 * /main/ms-d/244   2013-06-12 14:22:59   pmackent
 * Workaround for wrong "#777" in incoming voice call (IPIS100088854)
 *
 * /main/ms-d/243   2013-05-24 13:58:00   pmackent
 * Module changes to multimode after AT+COPS=1
 *
 * /main/ms-d/242   2013-05-22 16:51:44   pmackent
 * Make BGS5 support inofficial
 *
 * /main/ms-d/241   2013-05-21 15:51:36   pmackent
 * Add BGS5 as known module for testing purposes
 *
 * /main/ms-d/240   2013-05-15 15:25:25   pmackent
 * Temporary workaround for wrong AT+CLCC in EVDO
 *
 * /main/ms-d/239   2013-05-10 14:35:31   pmackent
 * Display "1xRTT" icon during voice call in EVDO (IPIS100087443)
 *
 * /main/ms-d/238   2013-05-08 14:18:10   pmackent
 * Workaround for wrong +CCWA URC in CDMA
 *
 * /main/ms-d/237   2013-05-07 14:16:57   pmackent
 * New GPIO setting in EHS5
 *
 * /main/ms-d/236   2013-04-30 14:30:41   pmackent
 * New delete blacklist command for EHS5
 *
 * /main/ms-d/235   2013-04-26 16:21:20   pmackent
 * AT+COPS/<AcT> bug fixed in PXS8
 *
 * /main/ms-d/234   2013-04-24 11:44:39   pmackent
 * New CDMA/CNMI setting and CDMA/CLCC workaround
 *
 * /main/ms-d/233   2013-04-23 11:34:00   pmackent
 * Workarounds for AT^SFLASH / AT^SIND=rssi and AT+CLCC
 *
 * /main/ms-d/232   2013-04-22 16:12:20   pmackent
 * Work on workarounds for AT+COPS/<AcT> and AT^SJDL/ATE
 *
 * /main/ms-d/231   2013-04-16 10:53:33   pmackent
 * CGREG/Multimode issue solved
 *
 * /main/ms-d/230   2013-04-12 16:44:25   pmackent
 * Workaround for wrong CGREG status in PXS8 multimode
 *
 * /main/ms-d/229   2013-04-12 09:21:44   pmackent
 * Adaptions for PXS8 2.910
 *
 * /main/ms-d/228   2013-04-05 09:53:38   pmackent
 * Finish EHS5 Java midlet update
 * Add RHA-API for bootloader pin on EHS5
 *
 * /main/ms-d/227   2013-03-21 16:15:33   pmackent
 * Send ATH on data port only (PHS8, PXS8)
 *
 * /main/ms-d/226   2013-03-15 14:09:08   pmackent
 * Start introducing Java update for EHS5
 *
 * /main/ms-d/225   2013-03-14 09:55:11   pmackent
 * Add configuration for tethered NAI
 *
 * /main/ms-d/224   2013-03-13 15:01:31   pmackent
 * +STKCNF bug in EHS5 solved
 *
 * /main/ms-d/223   2013-03-12 09:11:03   pmackent
 * AT^SMSO for EHS5 Rel1
 *
 * /main/ms-d/222   2013-03-06 10:14:20   pmackent
 * corrected typo in constant name
 *
 * /main/ms-d/221   2013-03-05 13:47:44   pmackent
 * Adaptions for EHS5 1.301
 *
 * /main/ms-d/220   2013-03-05 11:33:39   pmackent
 * Handle ^SYSSTART URC for EHS5 Rel2
 *
 * /main/ms-d/219   2013-03-04 13:19:41   pmackent
 * Adaptions for EHS5 1.300
 *
 * /main/ms-d/218   2013-03-01 09:10:23   pmackent
 * No semicolon for *# on EHS5 (IPIS100085708)
 *
 * /main/ms-d/217   2013-02-27 15:18:17   pmackent
 * Introduce provider spezific PRL update
 *
 * /main/ms-d/216   2013-02-26 15:07:39   pmackent
 * Adaptions for EHS5 1.290
 *
 * /main/ms-d/215   2013-02-22 15:36:38   pmackent
 * Changed behaviour of AT^SIND=eons in EHS5
 *
 * /main/ms-d/214   2013-02-19 11:21:17   pmackent
 * Fix for problem with URC switching in CDMA mode (IPIS100085249)
 *
 * /main/ms-d/213   2013-02-08 09:03:30   pmackent
 * Intel style SAT is now official
 *
 * /main/ms-d/212   2013-02-04 13:30:28   pmackent
 * Repeat AT+CPBS when writing to FD phonebook (IPIS100084674)
 *
 * /main/ms-d/211   2013-01-30 16:01:37   pmackent
 * AT$MDN has been changed to AT$MDN?
 *
 * /main/ms-d/210   2013-01-30 11:12:16   pmackent
 * Changed handling of SM phonebook while FD lock
 *
 * /main/ms-d/209   2013-01-23 14:54:47   pmackent
 * Workaround for wring "SIM not inserted" error at AT+CSCA?
 *
 * /main/ms-d/208   2013-01-18 10:17:57   pmackent
 * Get CDMA numeric network name from AT^SMONI
 *
 * /main/ms-d/207   2013-01-08 11:16:11   pmackent
 * No AT+CMGW for EHS5 1.220
 *
 * /main/ms-d/206   2013-01-07 10:14:50   pmackent
 * Workaround for exit in AT+CPMS in EHS5
 *
 * /main/ms-d/205   2012-12-14 11:55:05   pmackent
 * Still needing SIND/CSQ workaround
 *
 * /main/ms-d/204   2012-12-13 16:05:38   pmackent
 * Workarounds for PXS8 2.822
 *
 * /main/ms-d/203   2012-12-13 09:26:11   pmackent
 * Handling of Sprint variant of AT+CSQ
 *
 * /main/ms-d/202   2012-12-12 15:24:07   pmackent
 * Workarounds for bugs in PXS8 2.821
 *
 * /main/ms-d/201   2012-11-30 17:06:00   pmackent
 * Handle "ABORTED" message from the EHS5
 *
 * /main/ms-d/200   2012-11-23 16:54:51   pmackent
 * Additional adaptions for EHS5
 *
 * /main/ms-d/199   2012-11-22 11:57:01   pmackent
 * Workaround for blocking AT^SIND=eons on EHS5
 *
 * /main/ms-d/198   2012-11-21 13:30:18   pmackent
 * Basic support of EHS5 Rel2
 *
 * /main/ms-d/197   2012-11-15 11:46:15   pmackent
 * Avoid sending AT+CSQ in D3 power state (IPIS100083487)
 *
 * /main/ms-d/196   2012-11-14 10:37:37   pmackent
 * CSQ workaround for all new PXS8 versions
 *
 * /main/ms-d/195   2012-11-06 11:19:33   pmackent
 * PIN2 status workaround for all Px-modules except PXS8 1.000
 * Workaround for SIM_Unlock radiometrics test case
 *
 * /main/ms-d/194   2012-11-05 11:04:56   pmackent
 * Workaround for PIN2-state-query working only once
 *
 * /main/ms-d/193   2012-11-01 15:54:45   pmackent
 * Workaround for AT+CSQ problems with PXS8
 *
 * /main/ms-d/192   2012-10-22 11:21:11   pmackent
 * Workaround for from NITZ indication in CDMA
 *
 * /main/ms-d/191   2012-10-17 15:24:24   pmackent
 * Fix for "COPS changes SCFG" bug in PXS8 firmware avalable
 *
 * /main/ms-d/190   2012-10-12 13:14:53   pmackent
 * New syntax for AT^SBNW=PRI and PRL
 *
 * /main/ms-d/189   2012-10-01 09:58:25   pmackent
 * Handle class 2 SMS for PTCRB 8.2.1 (IPIS100082634)
 *
 * /main/ms-d/188   2012-09-25 10:26:37   pmackent
 * Workaround for double CDMA activation URC
 *
 * /main/ms-d/187   2012-09-18 09:25:30   pmackent
 * Glonass for PH8 Rel3
 *
 * /main/ms-d/186   2012-09-14 16:32:20   pmackent
 * Workaround for missing +CIEV: simstatus,5 URC (IPIS100082280)
 *
 * /main/ms-d/185   2012-09-04 15:09:03   pmackent
 * No audio only for first PXS8 customer sample
 *
 * /main/ms-d/184   2012-08-31 15:04:47   pmackent
 * VTS error also on PXS8 2.501
 *
 * /main/ms-d/183   2012-08-29 15:10:07   pmackent
 * COPS/SCFG workaround needed for more versions
 *
 * /main/ms-d/182   2012-08-29 14:35:54   pmackent
 * Workaround for COPS changes SCFG bug
 *
 * /main/ms-d/181   2012-08-28 09:45:03   pmackent
 * DTMF workaround for PXS8 3.000
 *
 * /main/ms-d/180   2012-08-27 08:49:16   pmackent
 * Workaround for wrong AT+VTS error message.
 *
 * /main/ms-d/179   2012-08-13 16:02:30   pmackent
 * New AHS3 GPS features (Glonass, dead reckoning)
 *
 * /main/ms-d/178   2012-07-18 11:36:41   pmackent
 * Workaround for the wrong "SIM not inserted" error
 *
 * /main/ms-d/177   2012-07-10 11:55:44   pmackent
 * Workaround for lost +CMT: URC.
 *
 * /main/ms-d/176   2012-07-10 11:53:06   pmackent
 * Introduce AHS3
 *
 * /main/ms-d/175   2012-07-02 14:57:28   pmackent
 * Filter out "T" modifier in CDMA (IPIS100080194)
 *
 * /main/ms-d/174   2012-06-13 10:42:21   pmackent
 * Added version PXS8 1.000 to 0.104 workarounds
 *
 * /main/ms-d/173   2012-06-08 11:43:29   pmackent
 * Workaround for missing ^SLCC: URC at end of call in PXS8
 *
 * /main/ms-d/172   2012-06-07 13:58:50   pmackent
 * Adaptions for multimode
 * Workaround for CREG=0 bug in PXS8
 *
 * /main/ms-d/171   2012-06-07 13:48:38   pmackent
 * Avoid *#-squences in CDMA mode
 *
 * /main/ms-d/170   2012-05-16 10:40:29   pmackent
 * New names of the options of for AT^SCFG=MeOpMode/AccT
 *
 * /main/ms-d/169   2012-04-27 09:53:23   pmackent
 * Some typos in comments
 *
 * /main/ms-d/168   2012-04-26 16:26:15   pmackent
 * Use phonebook delete workaround for all modules
 *
 * /main/ms-d/167   2012-04-26 13:02:27   pmackent
 * Further CDMA specific code
 *
 * /main/ms-d/166   2012-04-18 13:47:00   ctna0256
 * Introducing PVS8
 * Implementing CDMA-SMS
 * Various CDMA enhancements
 *
 * /main/ms-d/165   2012-03-23 10:48:57   ctna0256
 * Modified EHS5 call state query delay
 *
 * /main/ms-d/164   2012-02-29 13:31:59   ctna0256
 * EU3 is not supported anymore
 *
 * /main/ms-d/163   2012-02-29 10:05:39   ctna0256
 * Proper handling of the CFUN=7 cases
 *
 * /main/ms-d/162   2012-02-28 14:42:54   ctna0256
 * Solving problem with format of network names
 *
 * /main/ms-d/161   2012-02-27 15:29:30   ctna0256
 * Workaround for phonebook entry delete problem
 *
 * /main/ms-d/160   2012-02-27 10:56:02   ctna0256
 * Handle EHS5 specilities with DTMF, RLP, call control
 *
 * /main/ms-d/159   2012-02-23 16:10:12   ctna0256
 * Special handling of NO CARRIER in Intel-AT-Set
 *
 * /main/ms-d/158   2012-02-22 13:26:46   ctna0256
 * Encapsulate use of Intel AT command set
 *
 * /main/ms-d/157   2012-02-17 11:47:53   ctna0256
 * Define for "no audio" modules
 *
 * /main/ms-d/156   2012-02-17 11:13:02   ctna0256
 * Remove CFUN=7 mode (its not a bug, its a feature)
 *
 * /main/ms-d/155   2012-02-16 12:56:25   ctna0256
 * Separate define for CR-LF problem
 *
 * /main/ms-d/154   2012-02-14 15:13:04   ctna0256
 * Handle URCs within responses.
 *
 * /main/ms-d/153   2012-02-10 10:00:18   ctna0256
 * Reset module if CFUN7 mode is detected (IPIS100077391)
 *
 * /main/ms-d/152   2012-02-09 16:44:23   ctna0256
 * Check for missed SMS with AT+CRSM on EHS5, small bug fixes
 *
 * /main/ms-d/151   2012-02-08 15:16:02   ctna0256
 * Add Intel-style SAT
 *
 * /main/ms-d/149   2012-02-02 17:04:16   ctna0256
 * FD phonebook workaround and NITZ URCs for Intel platform
 *
 * /main/ms-d/148   2012-01-31 16:38:35   ctna0256
 * Added support for EHS5
 *
 * /main/ms-d/147   2012-01-24 10:44:41   ctna0256
 * Workaround for missing "+CREG: 1" URC in HC25 (IPIS100076952)
 *
 * /main/ms-d/146   2012-01-06 13:44:03   ctna0256
 * Added some PXS8 specific settings
 *
 * /main/ms-d/145   2012-01-05 10:26:44   ctna0256
 * Save PIN2 because of problem with AT+CLCK="FD" in PH8 Rel2 (IPIS100076746)
 *
 * /main/ms-d/144   2012-01-04 15:36:50   ctna0256
 * Outsource XML configuration to external application.
 * Improve CDMA configuration mode.
 *
 * /main/ms-d/143   2012-01-03 15:46:39   ctna0256
 * Introduce PXS8
 *
 * /main/ms-d/142   2011-11-14 10:46:15   ctna0256
 * Additional configurations
 *
 * /main/ms-d/141   2011-11-09 09:21:28   ctna0256
 * Different meaning of ^SHUTDOWN-URC
 *
 * /main/ms-d/140   2011-10-25 14:19:31   ctna0256
 * Don't uses SLCC-Workaround for PH8 Rel2
 *
 * /main/ms-d/139   2011-10-24 11:55:39   ctna0256
 * Workaround for missing AT+CLCC output
 *
 * /main/ms-d/138   2011-10-20 09:18:34   ctna0256
 * Workaround for wrong CLIR URC
 *
 * /main/ms-d/137   2011-10-17 11:34:29   ctna0256
 * Workaround for restart on exit and AT+CPIN? timing issues of PH8 Rel2
 *
 * /main/ms-d/136   2011-10-07 16:11:41   ctna0256
 * Small corrections
 *
 * /main/ms-d/135   2011-09-20 15:59:58   ctna0256
 * Workaround for wrong "SIM failure"
 *
 * /main/ms-d/134   2011-09-19 10:26:19   ctna0256
 * Workaround for wrong CME-Error at AT+CPOL on PH8
 *
 * /main/ms-d/133   2011-09-12 14:50:34   ctna0256
 * New GPS test mode for PH8 R2
 *
 * /main/ms-d/132   2011-09-12 10:55:42   ctna0256
 * New NMEA buffer mode
 *
 * /main/ms-d/131   2011-09-02 11:03:39   ctna0256
 * Added PUK for customer SIM lock (IPIS100074643)
 *
 * /main/ms-d/130   2011-09-01 16:27:10   ctna0256
 * New devspecific phonelock API (IPIS100074639)
 *
 * /main/ms-d/129   2011-08-31 14:03:10   ctna0256
 * Use CFUN on PH8 Rel2
 *
 * /main/ms-d/128   2011-08-10 15:12:14   ctna0256
 * Additional CFUN=1 for PH8 246A
 *
 * /main/ms-d/127   2011-07-21 09:38:52   ctna0256
 * Changes for new numbers of audio modes in PH8 Rel2 and timing issue during audio block update (IPIS100073840)
 *
 * /main/ms-d/126   2011-07-20 13:01:35   ctna0256
 * Introduce RIL_NOTIFY_DEVSPECIFIC_NETWORK_REJECT_CAUSE and prevent multiple notifications (IPIS100073123)
 *
 * /main/ms-d/125   2011-06-06 13:54:39   ctna0256
 * New registry key for URC indication methods (IPIS100073124)
 *
 * /main/ms-d/124   2011-05-30 10:11:41   ctna0256
 * Avoid SLCC on PH8 Rel1
 *
 * /main/ms-d/123   2011-05-30 09:36:02   ctna0256
 * Ignore wrong CREG:0 after CREG:3 (IPIS100073002)
 *
 * /main/ms-d/122   2011-04-01 11:29:54   ctna0256
 * Adaptions for new GPS configuration parameters
 *
 * /main/ms-d/121   2011-03-28 11:50:08   ctna0256
 * COPS=1 issue solved in PH8 firmware
 *
 * /main/ms-d/120   2011-03-17 10:07:41   ctna0256
 * Abort dial attempt for emergency calls after timeout (IPIS100070746)
 *
 * /main/ms-d/119   2011-03-07 09:52:24   ctna0256
 * COPS1 workaround necessary for all PH8 versions
 *
 * /main/ms-d/118   2011-01-19 11:20:47   ctna0256
 * Wrong SIM not inserted error may appear on PH8 as well
 *
 * /main/ms-d/117   2011-01-18 15:06:24   ctna0256
 * New syntax for loading A-GPS files
 *
 * /main/ms-d/116   2011-01-03 10:59:53   ctna0256
 * Problem with COPS1 still not solved
 *
 * /main/ms-d/115   2010-12-10 14:41:30   ctna0256
 * Workaround for COPS1 problem
 *
 * /main/ms-d/114   2010-12-03 14:10:34   ctna0256
 * CPOL problem solved in firmware
 *
 * /main/ms-d/113   2010-12-03 11:12:19   ctna0256
 * Workaround for AT+CPOL=? response on wrong interface
 *
 * /main/ms-d/112   2010-12-03 09:37:08   ctna0256
 * "Wrong busy tone"-workaround for PH8
 *
 * /main/ms-d/111   2010-12-02 14:51:57   ctna0256
 * Limit USB voltage for PH8 Rel1
 *
 * /main/ms-d/110   2010-11-29 16:21:07   ctna0256
 * Remove internal MONI command
 *
 * /main/ms-d/109   2010-11-29 14:33:51   ctna0256
 * Added fixed version for COLP problem
 *
 * /main/ms-d/108   2010-11-29 09:26:53   ctna0256
 * Configuration of USB voltage
 *
 * /main/ms-d/107   2010-11-26 14:16:20   ctna0256
 * Workaround for needless parameter in COLP URC
 *
 * /main/ms-d/106   2010-11-26 11:46:18   ctna0256
 * Add power saver for GPS
 *
 * /main/ms-d/105   2010-11-26 10:01:54   ctna0256
 * Workaround for missing parameter in COLP URC
 *
 * /main/ms-d/104   2010-11-17 15:57:22   ctna0256
 * Replace ATH with SHUP
 *
 * /main/ms-d/103   2010-11-17 13:44:24   ctna0256
 * Handle new <AcT> values for COPS
 *
 * /main/ms-d/102   2010-11-16 13:38:56   ctna0256
 * ECC is supported by PH8
 *
 * /main/ms-d/101   2010-11-08 16:00:53   ctna0256
 * Configure antenna diversity
 *
 * /main/ms-d/100   2010-10-28 16:18:25   ctna0256
 * Workaround for missing SMONI command in PH8
 *
 * /main/ms-d/99   2010-10-25 11:33:39   ctna0256
 * Workaround for wrong +CREG URC after COPS=2
 *
 * /main/ms-d/98   2010-10-18 09:05:15   ctna0256
 * No Fax for PH8
 *
 * /main/ms-d/97   2010-10-15 11:56:54   ctna0256
 * COLR now supported in PH8
 *
 * /main/ms-d/96   2010-10-13 13:14:04   ctna0256
 * VExt option now working
 *
 * /main/ms-d/95   2010-10-13 09:44:57   ctna0256
 * SNFO workaround not needed for PH8
 *
 * /main/ms-d/94   2010-10-12 11:12:08   ctna0256
 * Advanced configuradion for PH8
 *
 * /main/ms-d/93   2010-10-11 15:43:40   ctna0256
 * Update version numbers for new customer sample
 *
 * /main/ms-d/92   2010-09-29 15:25:23   ctna0256
 * Adapt for new PH8 customer samples
 *
 * /main/ms-d/91   2010-09-23 13:52:15   ctna0256
 * Workaround for DSR problem in PH8 customer sample
 *
 * /main/ms-d/90   2010-09-22 11:38:40   ctna0256
 * Disable SNFO reset on PH8 customer sample per default
 *
 * /main/ms-d/89   2010-09-21 13:21:51   ctna0256
 * Prevent early use of get operator list
 *
 * /main/ms-d/88   2010-09-21 13:12:46   ctna0256
 * No phonebook access after enabling PIN on PH8 customer sample
 *
 * /main/ms-d/87   2010-09-21 09:27:31   ctna0256
 * Workaround for wrong alpha when reading SMS
 *
 * /main/ms-d/86   2010-09-01 15:53:00   ctna0256
 * Some adjustments for PH8 versions
 *
 * /main/ms-d/85   2010-08-24 16:13:27   ctna0256
 * Fast registration mode for EU3
 *
 * /main/ms-d/84   2010-08-24 11:20:43   ctna0256
 * Wrong blank in COPS resonpse now removed from firmware
 *
 * /main/ms-d/83   2010-08-19 14:30:04   ctna0256
 * Implementation A-GPS for PH8
 *
 * /main/ms-d/82   2010-08-18 10:23:20   ctna0450
 * Added Telstra Home-Net workaround
 *
 * /main/ms-d/81   2010-08-16 09:18:32   ctna0256
 * New flight mode command in Uranus
 *
 * /main/ms-d/80   2010-08-10 09:23:26   ctna0256
 * Phonebook and SMS workarounds for PH8 0.210
 *
 * /main/ms-d/79   2010-07-14 10:40:42   ctna0256
 * Preparation: CCUG and ACM may not be supported in PH8
 *
 * /main/ms-d/78   2010-07-09 10:31:17   ctna0256
 * No fast registration mode in PH8
 *
 * /main/ms-d/77   2010-07-02 15:58:38   ctna0256
 * Introduce SAIC-settings and modified SNFO for PH8
 *
 * /main/ms-d/76   2010-07-02 11:05:19   ctna0256
 * New handling of Customer SIM lock for HC25 R2 (IPIS100065826)
 *
 * /main/ms-d/75   2010-06-22 15:55:15   ctna0256
 * Remove useless blank in PH8 numeric operator name
 *
 * /main/ms-d/74   2010-06-22 15:16:03   ctna0256
 * New format for numeric network name in PH8
 *
 * /main/ms-d/73   2010-05-28 17:02:51   ctna0256
 * Blacklist available on PH8
 *
 * /main/ms-d/72   2010-05-28 14:49:34   ctna0256
 * Typo in comment
 *
 * /main/ms-d/71   2010-05-28 14:47:19   ctna0256
 * Extra delay for PIN query after entering PIN on PH8
 *
 * /main/ms-d/70   2010-05-28 14:23:48   ctna0256
 * Introducing PH8
 *
 * /main/ms-d/69   2010-05-05 13:13:47   ctna0256
 * Support EU3 (for Pre-PH8 testing)
 *
 * /main/ms-d/68   2010-05-03 15:11:01   ctna0256
 * Abort AT+COPS on ring (IPIS100064182)
 *
 * /main/ms-d/67   2010-04-23 10:20:46   ctna0256
 * Workaround for increasing call IDs after GPRS
 *
 * /main/ms-d/66   2010-02-24 13:26:00   ctna0256
 * Made CE6 driver comply with radiometrics test
 *
 * /main/ms-d/65   2010-01-22 13:20:28   ctna0256
 * UDI and SyncPPP not supported in future module types
 *
 * /main/ms-d/64   2010-01-20 12:03:31   ctna0256
 * Send double audio mode change after every use of SNFI outside of voice calls (IPIS100061295)
 *
 * /main/ms-d/63   2010-01-06 14:16:56   ctna0256
 * Additional audio mode changes during initialisation (IPIS100061295)
 *
 * /main/ms-d/62   2009-12-18 10:57:29   ctna0256
 * Translate **002 and **004 code (IPIS100061138)
 *
 * /main/ms-d/61   2009-10-07 09:22:18   ctna0256
 * Introduce no-operation command queue
 * Support 2nd alpha identifier in SAT setup call (IPIS100055375)
 *
 * /main/ms-d/60   2009-09-04 11:14:36   ctna0256
 * Unregister from network before registering manually (IPIS100057521)
 *
 * /main/ms-d/59   2009-09-04 09:21:43   ctna0256
 * Workaround for wrong 2G/3G-SIM detection in module (IPIS100057390)
 *
 * /main/ms-d/58   2009-07-06 09:56:20   ctna0256
 * Workaround for wrong busy tone (IPIS100056689)
 *
 * /main/ms-d/57   2009-05-28 11:36:40   ctna0256
 * Remove "Siemens" from RIL
 *
 * /main/ms-d/56   2009-05-27 10:05:04   ctna0256
 * Deregister module in PUK blocked state caused by wrong PIN change
 *
 * /main/ms-d/55   2009-04-06 14:20:27   ctna0256
 * Read IMSI before using AT+CRSM
 *
 * /main/ms-d/54   2008-12-15 15:32:31   ctna0256
 * Workaround for missing quotationmark in CLIP-URC
 *
 * /main/ms-d/53   2008-12-02 16:14:42   ctna0256
 * Special configuration for UDI
 *
 * /main/ms-d/52   2008-12-02 15:34:12   ctna0256
 * Set call waiting before making CSD
 *
 * /main/ms-d/51   2008-12-02 14:12:04   ctna0256
 * Special reject cause for voice calls
 *
 * /main/ms-d/50   2008-12-02 11:12:55   ctna0256
 * Special default value for fast registration mode
 *
 * /main/ms-d/49   2008-12-01 12:02:24   ctna0256
 * Reject incoming video calls automatically
 *
 * /main/ms-d/48   2008-11-25 15:25:52   ctna0256
 * Wrong CME error on "SIM not inserted" for HC25 Rel1
 *
 * /main/ms-d/47   2008-11-25 10:21:35   ctna0256
 * SIM path not for HC25 R1
 *
 * /main/ms-d/46   2008-11-17 13:22:10   ctna0256
 * Use AT^SHUP when call is dialing or alerting
 *
 * /main/ms-d/45   2008-11-12 13:27:12   ctna0256
 * Added delay for PIN status change
 *
 * /main/ms-d/44   2008-10-06 11:11:31   ctna0256
 * Disable KSC5601 per default
 *
 * /main/ms-d/43   2008-10-06 09:25:03   ctna0256
 * Remove support of extended phonebook
 *
 * /main/ms-d/42   2008-10-01 16:30:45   ctna0256
 * Bug in SCKS in HC28 Rel2
 *
 * /main/ms-d/41   2008-10-01 15:12:07   ctna0256
 * Bug in simstatus URC is back
 *
 * /main/ms-d/40   2008-09-29 08:44:01   ctna0256
 * Extended phonebook not available in official HC28R2
 *
 * /main/ms-d/39   2008-09-23 10:50:09   ctna0256
 * Support of SMS coded with KSC5601
 *
 * /main/ms-d/38   2008-09-17 11:06:05   ctna0256
 * Handle syntax of extended phonebook commands
 *
 * /main/ms-d/37   2008-09-15 17:01:28   ctna0256
 * Set CSCB setting for HC28R2
 *
 * /main/ms-d/36   2008-08-29 13:18:18   ctna0256
 * Set special setting for HC28 Rel2
 *
 * /main/ms-d/35   2008-08-29 10:20:49   ctna0256
 * "+CIEV: simstatus" URC fixed in HC28 R2
 *
 * /main/ms-d/34   2008-08-22 10:24:24   ctna0256
 * Set Cinterion copyright text
 *
 * /main/ms-d/33   2008-08-21 09:34:43   ctna0256
 * Prepared for new disclaimer handling
 *
 * /main/ms-d/32   2008-07-22 10:45:04   mp49210
 * Changed handling of emergency calls for Korea
 *
 * /main/ms-d/31   2008-06-12 15:00:23   mp49210
 * Block writing to phonebook during calls, if there had been an incoming call without number
 *
 * /main/ms-d/30   2008-06-12 11:38:36   mp49210
 * Workaround for wrong characters in EONS name
 *
 * /main/ms-d/29   2008-05-15 15:02:07   mp49210
 * Use ECC configuration from radio
 *
 * /main/ms-d/28   2008-05-14 14:52:01   mp49210
 * Workaround for problems when deleting cell broadcast channels
 *
 * /main/ms-d/27   2008-05-13 11:35:14   mp49210
 * Workaround for wrong OK on changing PIN
 *
 * /main/ms-d/26   2008-04-29 13:38:14   mp49210
 * Workaround for missing simstatus URC.
 * New handling of SIM reset.
 *
 * /main/ms-d/25   2008-03-31 13:34:56   mp49210
 * IPIS100017065: delay for automatic SAT responses
 * Support of new SSTR parameters
 * Support of 'no icon' option
 *
 * /main/ms-d/24   2008-03-18 09:23:49   mp49210
 * Workaround for SAT setup call "hold calls" command
 *
 * /main/ms-d/23   2008-03-17 10:28:29   mp49210
 * Make SAT setup call workaround module specific
 *
 * /main/ms-d/22   2008-02-26 09:22:20   mp49210
 * No use of Radio/Band configuration for HC25 2.010
 *
 * /main/ms-d/21   2008-01-17 15:25:56   mp49210
 * Fix for slow UICC SIMs (wrong SIM not inserted error)
 *
 * /main/ms-d/20   2007-12-12 16:17:47   mp49210
 * Merge SAT Setup Call handling from Classic RIL
 *
 * /main/ms-d/19   2007-12-11 11:01:53   kr36712
 * GPS Powermanagement
 *
 * /main/ms-d/18   2007-12-05 11:44:13   mp49210
 * radio band group no longer neede at HC25 V1.780
 *
 * /main/ms-d/17   2007-11-27 11:45:50   mp49210
 * Introduction: blacklist GSM 02.07
 *
 * /main/ms-d/16   2007-11-26 17:28:28   kr36712
 * GPS support module specific HC25 Rel2 Ver >= 1760
 *
 * /main/ms-d/15   2007-11-26 17:05:47   kr36712
 * integration of GPS support
 * use of the mux protocol
 *
 * /main/ms-d/14   2007-11-23 13:20:26   mp49210
 * Radio/Band/Group for HC25 R2 customer samples
 *
 * /main/ms-d/13   2007-11-09 16:29:13   mp49210
 * Workaround for irritating error on AT+COPS=1
 *
 * /main/ms-d/12   2007-10-11 16:23:10   mp49210
 * Introduction of AT^SLCC
 *
 * /main/ms-d/11   2007-10-10 10:52:19   mp49210
 * Set audio muting after change of audio device
 *
 * /main/ms-d/10   2007-10-09 16:18:14   mp49210
 * Workaround for reset of AcT after radio band group selection
 *
 * /main/ms-d/9   2007-09-27 16:17:03   mp49210
 * Misplaced comma in AT+CLCC in HC28
 *
 * /main/ms-d/8   2007-09-20 12:10:44   mp49210
 * No useful SIM phonebooks on HC25/HC28 customer samples
 *
 * /main/ms-d/7   2007-09-20 10:00:22   mp49210
 * No AT+CMGC in HC28
 *
 * /main/ms-d/6   2007-08-09 09:56:38   mp49210
 * Check ME storage for accidently wrong routed SMS
 *
 * /main/ms-d/5   2007-07-10 13:43:54   mp49210
 * Workaround for blocking AT interface after early AT+COPS=?
 *
 * /main/ms-d/4   2007-07-04 07:32:08   mp49210
 * Introduction of radio band group search
 *
 * /main/ms-d/3   2007-06-11 11:41:10   mp49210
 * Correct use of AT^SNWS/+COPS workarounds
 *
 * /main/ms-d/2   2007-06-01 16:20:57   mp49210
 * IPIS100036445: workaround for sending and receiving SMS per registry key
 *
 * /main/ms-d/1   2006-10-25 16:53:52   wm36264
 * First transformation from classic RIL
 *
*/

//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2008 Gemalto M2M GmbH
// Copyright (C) 2006-2008 Siemens AG
//
// Version: 1.0
// Date:    dummy
//
//////////////////////////////////////////////////////////////////////////////

//
// This file contains defines for all module specific features or known issues
//

extern MODEMTYPE g_dwModemType;
extern DWORD g_dwModemVersion;
extern DWORD g_dwProductInternalVersion;

// -----------------------------------------------
// SPECIAL FEATURES
// -----------------------------------------------

// The PXS8 is a global mode module, which supports CDMA and GSM/UMTS.
#define GLOBAL_MODE_RADIO  (g_dwModemType == MODEMTYPE_PXS8)

// The PXS8 is a global mode module, which supports CDMA and GSM/UMTS.
#define CDMA_ONLY_RADIO  (g_dwModemType == MODEMTYPE_PVS8)

#ifdef SUPPORTS_EHSX_R1
//For EHSx and PDSx products.
#define IS_EHSX_FAMILY   ((g_dwModemType == MODEMTYPE_EHS5) || (g_dwModemType == MODEMTYPE_EHS8) || (g_dwModemType == MODEMTYPE_PDS5) || (g_dwModemType == MODEMTYPE_PDS8))

// The EHS5 Rel1 doesn't support the whole CWM AT command set, so the RIL has to
// substitute them with commands from the Intel AT command set.
#define INTEL_AT_CMDS    (IS_EHSX_FAMILY && g_dwModemVersion < 1290)

// Only known modules are supported.
// INTERNAL: The EU3 was never officially supported (see comment below).
// INTERNAL: The BGS5 is not officially supported (see comment below).
#define UNSUPPORTED_MODULE   (g_dwModemType == MODEMTYPE_UNKNOWN || g_dwModemType == MODEMTYPE_EU3)
#else
// Only known modules are supported, EHS5 requires Release 2.
// INTERNAL: The EU3 was never officially supported. It was only included
// INTERNAL: to make it possible to run a RadioMetrics test on the new
// INTERNAL: Qualcomm chipset.
// INTERNAL: The BGS5 is not officially supported. If was only included
// INTERNAL: to make tests on the Windows CE platform.
#define UNSUPPORTED_MODULE   (g_dwModemType == MODEMTYPE_UNKNOWN || g_dwModemType == MODEMTYPE_EU3 || (IS_EHSX_FAMILY && g_dwModemVersion < 1290) || g_dwModemType == MODEMTYPE_BGS5)
#endif

//For ELSx products
#define IS_ELSX_FAMILY   (g_dwModemType == MODEMTYPE_ELS61_E || g_dwModemType == MODEMTYPE_ELS61_US || g_dwModemType == MODEMTYPE_ELS61_USA || g_dwModemType == MODEMTYPE_ELS61_AUS ||g_dwModemType == MODEMTYPE_PLS62 ||g_dwModemType == MODEMTYPE_ELS81_E ||g_dwModemType == MODEMTYPE_ELS81_US)

// The SIM Application Toolkit functionality on the EHS5 is based on a different
// set of AT commands than on the QCT based modules.
#define INTEL_STYLE_SAT      (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)
// EHS5 before 1.300: use AT+CFUN=6 to start SAT.
#define START_SAT_WITH_CFUN      ((IS_EHSX_FAMILY && g_dwModemVersion < 1300) || g_dwModemType == MODEMTYPE_BGS5)

// Some network related AT commands are different in the EHS5.
#define INTEL_STYLE_NET_CMDS    ((IS_EHSX_FAMILY && g_dwModemVersion >= 1290) || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// Indicates if the module supports GPS.
#define SUPPORTS_GPS   ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1760) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion >= 2000) || (g_dwModemType == MODEMTYPE_UNKNOWN) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) || (g_dwModemType == MODEMTYPE_AHS3) || (g_dwModemType == MODEMTYPE_EHS8) || (g_dwModemType == MODEMTYPE_PDS8))

// Indicates if the module supports A-GPS.
#define SUPPORTS_AGPS  (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8 || g_dwModemType == MODEMTYPE_AHS3 )

// AGPS on EHS8/PDS8 doesn't require external assistance data file.
#define SUPPORTS_INTERNAL_AGPS ((g_dwModemType == MODEMTYPE_EHS8) || (g_dwModemType == MODEMTYPE_PDS8))

// On EHS8, active GPS antenna should be configured with GPIO.
#define CONFIG_GPS_ANTENNA_GPIO (g_dwModemType == MODEMTYPE_EHS8)

// AHS3: Indicates if the module supports dead reckoning. This feature is not supported
// by all firmware versions.
#define SUPPORTS_DEAD_RECKONING  (g_dwModemType == MODEMTYPE_AHS3)

// Indicates if the module supports GLONASS.
#define SUPPORTS_GLONASS  ((g_dwModemType == MODEMTYPE_AHS3) || ((g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2700))

// The AT^SCFG="Radio/Band/Group" command can be used in HC25 V1.200 and HC25 Rel2 customer samples.
// In HC28 and HC25 Release 2 this command is not needed.
#define SUPPORTS_RADIOBANDGROUP  (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1200 && g_dwModemVersion < 1780)

// The command AT+CMGC is not supported in the HC28.
#define SUPPORTS_CMGC ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The command AT^SLCC is not supported in the HC25 Release 1.
// INTERNAL: The EHS5 Rel1 has got the AT+XCALLSTAT URC as an replacement.
#define SUPPORTS_SLCC ((g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion >= 160) || (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1700) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) || (IS_EHSX_FAMILY) || (IS_ELSX_FAMILY) || (g_dwModemType == MODEMTYPE_AHS3))

// Bug in the PH8 Release 1: the SLCC URC doesn't always indicate the correct
// call status. For this reason the RIL will avoid it and uses AT+CLCC whenever
// possible. A similar problem can be seen in PXS8 2.8.
// The EHS5 Rel2 uses AT^SXCALLSTAT as a replacement.
// INTERNAL: The EHS5 uses the +XCALLSTAT URC which is not as good as the ^SLCC URC.
#define AVOID_SLCC ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion <= 1100) || (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion >= 2800) || (IS_EHSX_FAMILY) || (IS_ELSX_FAMILY))

// Bug in PH8 Rel2: sometimes the AT+CLCC command can temporarily not get the
// current call list. Unfortunately it returns "OK" in this case. The module
// prints out an additional empty line in this case, so the RIL can still detect
// the error situation.
#define EMPTY_LINE_CLCC_INDICATES_ERROR  (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion == 2001)

// Indicate if the module supports a black list according to GSM 02.07 Annex A.
// Bug in PXS8 1.000: in this version the black list is not working correctly.
#define SUPPORTS_BLACKLIST   ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1760) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion != 1000) || (g_dwModemType == MODEMTYPE_AHS3) || (IS_EHSX_FAMILY && g_dwModemVersion >= 1300) || IS_ELSX_FAMILY)

// The command AT^SHUP is not supported in the HC25 Release 1.
#define SUPPORTS_SHUP ((g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 2000) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3) || (g_dwModemType == IS_ELSX_FAMILY))

// Paths for SIM files are not supported in the HC25 Release 1.
#define SUPPORTS_CRSM_PATH  ((g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 2000) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (IS_EHSX_FAMILY) || (IS_ELSX_FAMILY) || (g_dwModemType == MODEMTYPE_AHS3) || (g_dwModemType == MODEMTYPE_BGS5))

// Configuration of UDI only in HC25 and HC28
#define SUPPORTS_UDI_CONFIG  ((g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_HC25))

// Configuration of SyncPPP only in HC25 and HC28
#define SUPPORTS_SYNCPPP_CONFIG  ((g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_HC25))

// The HC25 and the PH8 support customer SIM lock
#define SUPPORTS_CUSTOMER_SIM_LOCK  (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_EU3 || g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// The PH8 supports a PUK for the customer SIM lock
#define SUPPORTS_CUSTOMER_SIM_LOCK_WITH_PUK  ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 1300)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The PH8 Release 2 supports customer phone lock
#define SUPPORTS_CUSTOMER_PHONE_LOCK  ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 1300)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// Configuration of Fast/Normal-Registration mode only in HC25 and HC28
#define SUPPORTS_FASTRM_CONFIG  ((g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_EU3))

// The PH8 allows an advanced audio configuration via AT^SAIC
#define SUPPORTS_SAIC_AUDIO_CONFIG  ((g_dwModemType == MODEMTYPE_PH8)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) || (g_dwModemType == MODEMTYPE_AHS3))

// Closed User Gruops (CCUG) may not be supported by all radios
#define SUPPORTS_CCUG  ((g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (IS_EHSX_FAMILY) || (g_dwModemType == MODEMTYPE_AHS3) || (g_dwModemType == MODEMTYPE_BGS5))

// Advice of Charge may not be supported by all radios
#define SUPPORTS_ADVICE_OF_CHARGE  ((g_dwModemType == IS_ELSX_FAMILY) || (g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (IS_EHSX_FAMILY) || (g_dwModemType == MODEMTYPE_AHS3) || (g_dwModemType == MODEMTYPE_BGS5))

// With the PH8 it is possible to configure the VExt power mode
#define SUPPORTS_VEXT_POWER_MODE   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 300)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) || (g_dwModemType == MODEMTYPE_AHS3))

// With the PH8 Release 1 a special flight mode configured with AT^SCFG is used. For
// PH8 Release 2 and the HC25/28 AT+CFUN configures the flight mode.
#define SPECIAL_FLIGHT_MODE_CMD ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion <= 1300))

// The PH8 allows to configure the GPRS and EDGE multislot classes.
#define SUPPORTS_CONFIG_GPRSEDGE_CLASS   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 290)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The PH8 allows to configure the maximum HSDPA data rate.
#define SUPPORTS_CONFIG_HSDPA_DATA_RATE   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 290) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The PH8 allows to configure the maximum HSUPA data rate.
#define SUPPORTS_CONFIG_HSUPA_DATA_RATE   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 290) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The PH8 Release 2 supports some additional radio configurations.
#define SUPPORTS_ADDITIONAL_RADIO_CFG   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 1800) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The PH8 allows activating and deactivating of COLR (other radios only support query)
#define SUPPORTS_FULL_COLR   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 290) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3)  || (IS_EHSX_FAMILY && g_dwModemVersion >= 1200) || g_dwModemType == MODEMTYPE_BGS5)

// Fax is supported by the HC25, but not by the PH8
#define SUPPORTS_FAX ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_HC28))

// Indicate, if the module supports antenna diversity.
#define SUPPORTS_ANTENNA_DIVERSITY  ((g_dwModemType == MODEMTYPE_PH8)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// Indicate, if the module allow to configure how URC are indicated via USB.
#define SUPPORTS_URC_CONFIGURATION ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 1002) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The number of audio modes (set with AT^SNFS) depends on the used radio release (PH8 Release 2
// has got 8 modes, all other version and radios 6).
#define NUMBER_OF_AUDIO_MODES  ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion > 1300)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) ? 8 : (INTEL_STYLE_NET_CMDS ? 10: 6))

// The PH8 Release 2 supports a NMEA buffer modus.
#define SUPPORTS_NMEA_BUFFER_MODUS   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 1800) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) || (g_dwModemType == MODEMTYPE_AHS3) || (g_dwModemType == MODEMTYPE_EHS8) || (g_dwModemType == MODEMTYPE_PDS8))

// The PH8 Release 2 supports a special GPS test modus.
#define SUPPORTS_GPS_TEST_MODUS   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 1800)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_PVS8) || (g_dwModemType == MODEMTYPE_AHS3))

// Some modules allow to set AT+COPS before entering the PIN.
#define ALLOW_PRE_PIN_COPS   (g_dwModemType == MODEMTYPE_AHS3)

//   -- Japan requirements (HC28) --

// When an incoming voice call is rejected, it is required to set a special reject cause.
#define SEPCIAL_VOICECALL_REJECT_CAUSE  (g_dwModemType == MODEMTYPE_HC28)

// All incoming video calls must be rejected immediately.
#define AUTOMATIC_VCALL_REJECT  (g_dwModemType == MODEMTYPE_HC28)

// Configure fast registration mode as default.
#define FAST_REGISTRATION_AS_DEFAULT (g_dwModemType == MODEMTYPE_HC28)

// Before an outgoing CSD connection can be esatblished, the call waiting for CSD
// must be disabled.
#define DISABLE_CCWA_ON_CSD   (g_dwModemType == MODEMTYPE_HC28)

/// For UDI a special configuration is needed.
#define SPECIAL_UDI_CONFIGURATION   (g_dwModemType == MODEMTYPE_HC28)

// -----------------------------------------------
// KNWON ISSUES
// -----------------------------------------------

// The numeric network name is coded in UCS2 in the EHS5.
#define COPS_NUM_NAME_IN_UCS2   (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The EHS5 might send an unsolicited CME ERROR 32 in case of an active call
// barring.
#define UNSOL_CME_ERROR_32   (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The early EHS5 version didn't have a full support of AT^SIND=nitz.
#define AVOID_SIND_NITZ   (IS_EHSX_FAMILY && g_dwModemVersion <= 1100)

// The EHS5 doesn't support the AT^SIND=audio URC.
#define NO_SIND_AUDIO   (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The EHS5 needs an extgended SIM initialization timeout because the Java
// midlet is starting at the same time as the SIM.
#define EXTENDED_SIM_INIT_TIMEOUT   (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// EHS5: *#-sequences can be sent with ATD, but only without the ";".
#define STARHASH_WITHOUT_SEMICOLON      (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The format of the AT+CEER command differs in the EHS5 and other Intel based radios.
#define INTEL_STYLE_CEER      (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The HC25 Rel1 cannot send an SMS while in UCS2 alphabet, even when the
// message doesn't contain UCS2 characters.
#define NO_UCS2_WHILE_SENDING_SMS  (g_dwModemType == MODEMTYPE_HC25)

// In HC25Rel1 befor sendong of each SMS the status of AT+CSCA must be tested,
// even if the value is not needed.
#define MUST_QUERY_CSCA_BEFORE_SENDING_SMS  (g_dwModemType == MODEMTYPE_HC25)

// The HC25 Rel1 changes the settings of AT^SNFG="Radio/Band", when the
// AT^SNWS command is used. As a workaround the RIL reads the settings
// before using AT^SNWS and re-writes them afterwards.
#define NEED_RESET_BAND_SETTINGS_AFTER_SNWS  (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion <= 2000)

// In the HC25 Rel1 it is necessary to set AT+COPS=0, before AT^SNWS=1,...
// will work.
#define NEED_COPS0_BEFORE_SNWS  (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion < 2000)

// When setting to manual network registration it is necessary to de-register
// first, otherwise there may be no module activities for 3 minutes (worst case).
#define NEED_COPS2_BEFORE_COPS1  (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_HC28)

// When using the AT+COPS? command the very first time, it will always
// return "0" instead of the correct value.
// Similar problem with EHS5 Rel1: here the value is always "2".
#define WRONG_COPS_VALUE_AT_STARTUP  (g_dwModemType == MODEMTYPE_HC25 || (IS_EHSX_FAMILY && g_dwModemVersion <= 1300))

// After using AT^SNWS, AT+COPS? will always report '0'.
#define WRONG_COPS_VALUE_AFTER_SNWS  (g_dwModemType == MODEMTYPE_HC25)

// When changing from AT^SNWS=1,.... to AT+COPS=0, it is necessary to use the
// AT^SCFG="Radio/Band/Group" command to find the correct band.
#define NEEDS_RADIOBANDGROUP_WORKAROUND  (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1100 && g_dwModemVersion <= 2000)

// If one of the get operator list command (AT+COPS=?, AT^SOPS=?, AT^SNWS=?) is used, while
// the SIM is not completely ready, the radio may become inoperable.
#define USE_GETOPERATORS_ONLY_WHEN_SIM_READY   (g_dwModemType == MODEMTYPE_HC25 || (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion <= 290))

// The HC25 Rel1 doesn't store incoming SMS on the ME memory, even when
// this is configured so explicitely with AT+CPMS.
#define NO_INCOMING_SMS_ON_ME   (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion <= 1100)

// The PH8 0.210, HC25 V1.710, V1.712 and HC28 V0.110 don't support phonebook operations.
#define NO_PHONEBOOK_ACCESS ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1710 && g_dwModemVersion <= 1712) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion == 110) || (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 200 && g_dwModemVersion <= 230))

// HC28 V0.140: misplaced comma in AT+CLCC responses.
#define MISPLACED_COMMA_IN_CLCC  (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion == 140)

// When changing the audio mode with AT^SNFS, AT+CMUT will be reset.
#define SNFS_DISABLES_CMUT  (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_HC28 || g_dwModemType == MODEMTYPE_EU3 || g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// Changing the radio band group may reset the AcT to automatic (HC25 V1.200).
#define RADIOBANDGROUP_OVERWRITES_ACT   (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1200 && g_dwModemVersion < 1700)

// Some modules indicate the success of the AT+COPS command woth the CMEE error 30.
#define IGONERE_CMEE_30_ON_COPS   ((g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion > 1200) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The SAT setup call command can be handle manually by ATD or automatically
// with AT^SSTR. For ADI based modules the second method is necessary.
#define MUST_USE_SAT_CMD_FOR_SETUP_CALL   (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_HC28 || g_dwModemType == MODEMTYPE_EU3 || g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_AHS3 || g_dwModemType == MODEMTYPE_BGS5)

// Strange behaviour the <commandDetail> of the SAT setup call command
// requires the RIL to do some workarounds:
// <<commandDetail> = 0: although the command details state, that a call
// must not be set up, if another call is in progress, the radio doesn't allow
// the AT^SSTR=16,32 response in this case.
// <commandDetail> = 2: the the specification requieres the MMI to put the
// call on hold, but the radio is not able to to handle this correctly. To solve
// this problem  the RIL must report <commandDetail> = 0 instead, so the
// workaround described above applies.
#define WA_FOR_SAT_SETUP_CALL_CMD  ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion <= 2020 && g_dwModemVersion != 1830) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion < 2000))

// To be able to give an addition SAT error cause, the new versions of the HC25
// introduce a 5th parameter to the SSTR AT-command.
#define NEW_SAT_SSTR_PARAMETERS ((g_dwModemType == MODEMTYPE_HC25 && (g_dwModemVersion == 1830 || g_dwModemVersion > 2020)) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion >= 2000) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (IS_EHSX_FAMILY) || IS_ELSX_FAMILY || (g_dwModemType == MODEMTYPE_AHS3))

// Unlike the ATD command, the AT^SSTR=16,x command doesn't return until the
// call is actually established.
#define SSTR16_IS_BLOCKING   (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_HC28 || g_dwModemType == MODEMTYPE_EU3 || g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// The AT+CPIN? may return "SIM not inserted" even if the SIM is inserted.
// The AT^SCKS command gives the correct status, but not on the HC28
// Release 2.
#define POSSIBLE_WRONG_SIMNOTINSTERTED_ERROR  ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1000) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion < 2100) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8))

// The HC25 Rel1 returns "+CME ERROR: 13", when "+CME ERROR: 10" would
// be correct.
#define WRONG_CME_ERROR_FOR_NO_SIM  (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion < 2000)

// Bug in HC25 Rel2: After a SAT SIM reset, the AT^SIND=simstatus command will
// return "SIM initialized" even when the SIM is not initialized.
#define WRONG_SIMSTATUS_AFTER_SAT_SIM_RESET  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28 && (g_dwModemVersion < 2000 || g_dwModemVersion >= 2100)) || (g_dwModemType == MODEMTYPE_EU3))

// On Some SIM cards the HC25 answers with OK on the CPWD command,
// although the command couldn't be executed.
#define FALSE_OK_ON_CPWD ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion > 1200) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion >= 2000) || (g_dwModemType == MODEMTYPE_EU3))

// On new modules a configuration of emergency numbers via AT^SCFG is available.
#define SCFG_ECC_HANDLING_AVAILABE  ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 2000) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion >= 2000) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The AT^SCFG=Call/ECC usually applies only to SIM whithout an ECC SIM field.
// On some firmware versions this setting also applies to SIMs with an empty ECC
// field.
#define ECC_CONFIG_ON_EMPTY_ECC_FIELD  ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion <= 2100) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion < 2000))

// Problem with the AT+CSCB command when trying to delete the last channel.
#define CANNOT_REMOVE_CSCB_SETTINGS_DIRECTLY ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion > 1200) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion > 2000) || (g_dwModemType == MODEMTYPE_EU3))

// The HC25 Rel2 doesn't read the EONS SIM files correctly, so the RIL must do it itself.
#define MUST_CHECK_SIM_FOR_EONS   (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 2000)

// Problem with HC25: Sending the command AT+CPBW may cause the radio
// to become stuck, when the radio had received a voice call with no phone
// number in the display. This is a special problem during voice calls, so the RIL
// should not use this command, when a voice call is active.
#define AVOID_CPBW_WHILE_VOICE_CALL   (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 2000)

// Bug in the PH8: the new PIN status is not displayed immediately. As a
// workaround the RIL must send filler commands to provide the necessary delay.
#define DELAYED_NETLOCK_STATUS (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// If the <alpha> parameter in the +CLIP URC has got more than 19 characters,
// it is cut and the last quotationmark is lost (HC25 R1+R2, HC28 R2).
#define POSSIBLE_WRONG_ALPHA_IN_CLIP  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion < 2000))

// After reading certain SIM files like EF_FDN on some SIM cards, the module will
// answer all subsequent AT+CRSM comands with an error until the IMSI has been
// read again.
#define READ_IMSI_BEFORE_CRSM   ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 1000) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion >= 1000) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// During the 1st test the module may indicate, that a 3G-SIM is inserted, but later
// the module will decide to treat it as a 2G-SIM so the RIL must recheck this status.
#define NEED_RECHECK_2G3G_SIM  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// Bug in HC25: If the PUK-required-state is entered, for example by using
// the wrong old PIN when changing the PIN, the module doesn't deregister
// from the network as required, so the RIL has to do this manually.
#define NO_UNREGISTER_IN_PUK_STATE  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion < 2000))

// Related to unregister-problem above: after sucessfully entering the PUK,
// module doesn't re-register automatically to the network.
#define NO_REGISTER_AFTER_CFUN_IN_PUK_STATE  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion < 2000))

// The AT+CPWD="SC" command return "PUK2 required" instead of "PUK required".
#define CPWD_INDICATES_PUK2_INSTEADOF_PUK  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion < 2000))

// When rejecting an incoming voice call, the HC25/HC28 Rel2 plays the BUSY tone.
// This is wrong, so the RIL must deactivate the audio path to prevent the module
// play this tone.
#define WRONG_BUSY_TONE_AFTER_CHLD  ((g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 2000 && g_dwModemVersion <= 2100) || (g_dwModemType == MODEMTYPE_HC28 && g_dwModemVersion >= 2000 && g_dwModemVersion <= 2100) || (g_dwModemType == MODEMTYPE_EU3) || (g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The codes **002 and **004 cannot be used on the HC25. They must be
// translated into *002 and *004.
#define DONT_USE_CF_REG_CODE  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28) || (g_dwModemType == MODEMTYPE_EU3))

// The power consumption can be higher than usual unless the audio
// mode is changed twice after AT^SNFI is used outside a voice call.
#define NEED_DOUBLE_AUDIO_MODE_CHANGE    (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_HC28)

// If there is a fast switch between GPRS and CSD data connection (or voice
// call), the call ID for the CSD connection increments. This confuses the
// dialup-connection on Windows CE 6.
#define ID_INCREMENTS_AFTER_GPRS  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28))

// In rare conditions it may happen, that the AT+COPS=1 command doesn't return
// when a call comes in. In this case the RIL has to abort the command.
#define COPS1_MAY_HANG_ON_INCOMING_CALL  ((g_dwModemType == MODEMTYPE_HC25) || (g_dwModemType == MODEMTYPE_HC28))

// There are two styles to print out the numeric netword name: HC25: "CC 234 NC 05"
// or PH8: "234 05"
#define SHORT_NUMERIC_NETWORK_NAME  (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_AHS3 || g_dwModemType == MODEMTYPE_BGS5)

// The PH8 customer samples put in a useless space in the numeric network name.
#define SPACE_IN_NUMERIC_NETWORK_NAME  (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion < 230)

// Problem with HC25 Rel2: the PH-NET PIN of the customer SIM lock feature
// is the same on all modules. As a workaround the RIL generates its own
// PIN based on the IMEI of the module.
// If this workaround is not wanted, comment out the following line:
#define NEED_OWN_PHNET_PIN   (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 2000)

// The value range for the AT^SNFO parameter <cdcRxGain> is 0..63 on PH8 and
// 0..65535 on HC25/HC28.
#define NEW_SNFO_RXGAIN_SETTINGS    (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8 || g_dwModemType == MODEMTYPE_AHS3)

// The set of parameters of AT^SNFO/SNFI differs in in the EHS5.
#define INTEL_STYLE_SNFO   (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// On the PH8 customer samples (version 0.230 or earlier) it is recomended, to store incoming
// text messages on SIM.
#define STORE_SMS_ON_SIM_PER_DEFAULT   ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion <= 280) || IS_EHSX_FAMILY || IS_ELSX_FAMILY)

// Some providers require login to their own net if there are more provider controlled networks avalable.
#define FORCE_HOMENET_POSSIBLE   (g_dwModemType == MODEMTYPE_HC25 && g_dwModemVersion >= 2000)

// PH8 customer sample: <alpha> parameter of AT+CMGR cannot be used.
#define INVALID_CMGR_ALPHA   (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion <= 290)

// Bug in PH8 customer sample: the phonebook cannot be accessed after
// the PIN is enabled or disabled.
#define NO_PHONEBOOK_AFTER_CLCK   (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion <= 290)

// Per default the RIL will set the SNFO values to 0, if the audio mode
// is changed. This setting can be overridden by registry.
#define AVOID_RESET_OF_SNFO_FOR_MODE_CHANGE   (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8 || g_dwModemType == MODEMTYPE_AHS3)

// Problem of PH8 customer sample: the status of the DSR line during data
// connections is not always reliable.
#define DSR_LINE_NOT_ALWAYS_CORRECT   (g_dwModemType == MODEMTYPE_PH8 && (g_dwModemVersion >= 260 || g_dwModemVersion <= 290))

// There might be a delay necessary before sending the AT+COPS=2 command.
#define NEED_DELAY_ON_COPS2 (g_dwModemType == MODEMTYPE_PH8 && (g_dwModemVersion >= 320 || g_dwModemVersion <= 330))

// There might be a delay necessary before sending the AT+COPS=1,... command.
#define NEED_DELAY_ON_COPS1 (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion < 1250)

// The EHS5 Rel1 and early PH8 versions don't support the AT^SMONI command.
#define SMONI_UNAVAILABLE    ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion < 400) || (IS_EHSX_FAMILY && g_dwModemVersion <= 1300) || g_dwModemType == (MODEMTYPE_BGS5))

// The AT+COPS may show the <Act> values according to 3GPP 27.007 Release 8. The Microsoft
// MMI wants values according to Release 7, so the RIL has to translate the values.
#define NEW_COPS_ACT_VALUES    ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 360)  || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The ATH is depreciated on the PH8 to be used on the application port.
// It is better to use AT^SHUP.
#define REPLACE_ATH_WITH_SHUP       (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// The 4th parameter of the COLP-URC is missing in some early versions of the PH8
#define MISSING_PARAMETER_IN_COLP       (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion > 370 && g_dwModemVersion <= 390)

// There is a misplaced 6th parameter parameter in the COLP-URC in some early versions of the PH8
#define TOO_MANY_PARAMETERS_IN_COLP       (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 400 && g_dwModemVersion <= 410)

// The power saver for GPS is not available in early PH8 versions.
#define SUPPORT_GPS_POWERSAVER       ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 360) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// The response to the AT+CPOL=? command may appear a second time
// on the wrong interface on some firmware version.
#define CPOL_RESPONSE_ON_WRONG_PORT    (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion <= 410)

// Old syntax of the AGPS send command: include file length in file. New syntax:
// give length as parameter.
#define INCLUDE_AGPS_LENGTH_IN_FILE      (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion < 1000)

// With introduction of the PH8 Rel2 the GPS configuration option have a new concept.
#define NEW_AGPS_CONFIG_OPTIONS      ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 1250) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// Problem when making an emergency call if there is no network available:
// in this case the module may never complete its dial attempt.
#define ENDLESS_DIAL_ON_EMERGENCYCALL   (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_HC28 || g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// On the PH8 a "+CREG: 3" (access denied) URC is followed by a "+CREG: 0" URC, even though
// the network still denies access. The RIL must ignore this URC, otherwise the OS shows the
// wrong registration status.
#define CREG0_FOLLOWS_CREG3      (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// The radio might not indicate the "limited service" status in the AT^SMONI command.
#define MISSING_LIMSERV_ON_SMONI   (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_HC28 || (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion < 1300))

// PH8 Version 1.382 is delivered with a wrong CFUN default setting. In this case it is
// necessary to send AT+CFUN=1 before any other AT commands can be used.
#define FORCE_CFUN1_ON_START      (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion == 1382)

// The PH8 might answer the AT+CPOL command with "SIM failure" even though
// the SIM is fine but only the operator list is read protected.
#define WRONG_SIM_FAILURE_AT_CPOL      (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// When trying to change the PIN while the PIN is disabled, the PH8 Rel2 incorrectly answer
// with "SIM failure", which will be misinterpreted by the MMI.
#define WRONG_SIM_FAILURE_AT_CPWD      ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 1800) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// With the PH8 Rel2 the radio shows the EONS names with the AT+COPS command,
// unless a special mode is selected.
#define SPECIAL_COPS_MODE_FOR_NO_EONS      ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 2001) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// Issue with PH8 Release 2.001: If the first AT+CPIN? command is sent too early after module start
// the module will later no longer accept the PIN2. As a workaround the RIL will delay the first use
// of this AT command.
#define DELAY_FOR_FIRST_CPIN      (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion == 2001)

// Issue with PH8 Release 2.001: After the expected response of AT+CLIR there migth
// follow a second response as an URC.
#define WRONG_CLIR_URC      (g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion == 2001)

// The ^SHUTDOWN URC has different meanings for the modules: for the HC2x it indicates
// an emergency shutdown situation like overtemeprature, for the PH8 it indicates
// a planed restort for reconfiguration.
#define SHUTDOWN_MEANS_PLANED_RESTART  (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// PH8 Rel2: If the module is configured to be to require a Customer IMEI and
// this IMEI isn't written yet, the module puts itself into the CFUN=7 mode. The
// RIL must not change this mode.
#define KEEP_CFUN7_MODE      ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion >= 2000) || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3)

// If the PIN2 is entered with AT+CPIN, it should be no longer necessary to enter
// the PIN2 again on commands with require the PIN2. Unfortunately this isn't true
// for the AT+CLCK command in the PH8 Release 2. To solve this issue the RIL must
// store the PIN2 and use this stored PIN2 on AT+CLCK.
#define STORE_PIN2_FOR_CLCK  ((g_dwModemType == MODEMTYPE_PH8 && g_dwModemVersion > 1100) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3))

// If the module is in PIN2 state the AT+CPIN? command can be used only once.
// The PXS8 1.000, on the other hand, handle this differently.
#define CAN_QUERY_PIN2_ONLY_ONCE  (g_dwModemType != MODEMTYPE_PXS8 ||  g_dwModemVersion != 1000)

// Problem with the HC25: when the module gets back the registration after losing it
// due to bad reception, the expected "+CREG: 1" URC might not come.
#define CREG1_MIGHT_BE_MISSING      (g_dwModemType == MODEMTYPE_HC25 || g_dwModemType == MODEMTYPE_HC28)

// Problem with EHS5 AT command set: the read access to the FD phonebook requires
// the PIN2. Solution: direct SIM access.
#define NO_READ_ON_FD_WO_PIN2   (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// The "NO CARRIER" can also mean "BUSY" in the EHS5, so the RIL needs to
// re-check the reason using AT+CEER.
#define NEED_CHECK_NO_CARRIER_REASON   (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

#ifdef SUPPORTS_EHSX_R1
// Problem with Intel AT command set: URCs might appear within the responses of
// an AT command. either between the lines of a multi-line response or between
// the response line and the OK.
#define URCS_MIGHT_BE_IN_RESPONSE     (IS_EHSX_FAMILY && g_dwModemVersion <= 1002)

// The EHS5 Rel1 doesn't support any AT command that allows to check for unread messages
// without changing their status to "read".To solve this problem the RIL has to read
// the messages directly from the SIM.
#define CHECK_FOR_MISSED_SMS_ON_SIM     (IS_EHSX_FAMILY && g_dwModemVersion < 1290)

// The older versions of the EHS5 don't support the AT^SMSO command.
#define NO_SUPPORT_SMSO  (IS_EHSX_FAMILY && g_dwModemVersion <= 1000)

// The AT^SIND=psinfo/eons/nitz/rssi command is not available on early EHS5 versions.
#define NO_SIND_INDICATIONS   (IS_EHSX_FAMILY && g_dwModemVersion <= 1100)

// Bug in EHS5 Rel 1.2: The AT^SIND=eons,2 command sometimes crashes the module.
#define AVOID_SIND_EONS   (IS_EHSX_FAMILY && g_dwModemVersion > 1100 && g_dwModemVersion <= 1281)
#endif

// Bug in EHS5 Rel1: The +STKCNF: URC might come with missing parameters.
#define CHECK_STKCNF_FOR_MISSING_PARAMS    (IS_EHSX_FAMILY && g_dwModemVersion <= 1300 || g_dwModemType == MODEMTYPE_BGS5)

// Special behaviour of EHS5: after SAT SIM reset the module stays unregistered.
#define RECHECK_COPS_AFTER_SAT_SIM_RESET   (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// The Windows Mobile API may use AT+CRSM to delete a phonebook entry. Unfortunately
// the radios have got some kind of phonebook cache, which doesn't get updated in
// that case. So the RIL must detect this situation. This can happen for all modules
// whicht support the SIM path feature.
#define NEED_DETECT_PBR_DELETE     (SUPPORTS_CRSM_PATH || g_dwModemType == MODEMTYPE_BGS5)

// Unlike all other modules the EHS5 prints out the result "ABORTED" if an AT command
// is aborted. All other modules use the standard "ERROR" response.
#define SPECIAL_RESULT_FOR_ABORT   (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// Problem with EHS5 Rel1 AT command set: sometimes lines end with <LF><CR> instead
// of <CR><LF>.
#define CR_LF_MISSMATCH     (IS_EHSX_FAMILY && g_dwModemVersion < 1300)

// After ending a CSD data connection the EHS5 REl1 turns on the echo, so the RIL
// must turn it off again before using the data channel again.
#define ECHO_SETTING_LOST_AFTER_CSD     (IS_EHSX_FAMILY && g_dwModemVersion < 1300)

// For the EHS5 Rel1 it is not necessary to check the current GPRS availability before
// trying a re-attach.
#define NO_CHECK_BEFORE_GPRS_REATTACH     (IS_EHSX_FAMILY && g_dwModemVersion < 1300)

// The EHS5 Rel1 doesn't support the extended <ds> parameter on AT+CNMI.
#define USE_STANDARD_CNMI_SETTINGS     (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// For the EHS5 the RIL uses the URC port for all AT commands which not explicitly
// require to go on the data port.
#define USE_URC_PORT_AS_DEFAULT     (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// The EHS5 might print out unnecessary blank lines in the AT responses.
#define UNNECESSARY_BLANK_LINES_IN_RESPONSE     (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// The EHS5 Rel1 always does GPRS autoattach, so there is no need to configure it.
#define GPRS_AUTO_ATTACH_CONFIGURATION     (g_dwModemType != MODEMTYPE_EHS5 || g_dwModemVersion > 1100)

// The EHS5 Rel1 doesn't support the "+CIEV: eons" URC, so the RIL must recheck the
// EONS name after each cell change.
#define CHECK_EONS_AFTER_CELL_CHANGE     (IS_EHSX_FAMILY && g_dwModemVersion < 1300)

// In difference to the other modules the EHS5 prints out the (numeric) network names
// in UCS2.
#define UCS2_NETWORK_NAMES     (IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// The EHS5 Rel1 doesn't support ATD*#-sequences, so the RIL must use the AT commands
// as defined by 3GPP 07.07 instead.
#define USE_GSM0707_CMDS_FOR_SS     ((IS_EHSX_FAMILY && g_dwModemVersion < 1300) || g_dwModemType == MODEMTYPE_BGS5)

// The EHS5 doesn't have the "+CIEV: simstatus" URC, so the RIL needs to use
// the +PBREADY URC instead. For EHS5 Rel1 use polling, since the +PBREADY
// URC isn't reliable.
#define USE_PBREADY_URC     ((IS_EHSX_FAMILY && g_dwModemVersion > 1300) || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)
#define USE_POLLING_FOR_SIM_READY     (IS_EHSX_FAMILY && g_dwModemVersion <= 1300 )

// Problem with EHS5 Rel2: when sending an AT command before ^SYSSTART the
// module might become unresponsive.
#define MUST_WAIT_FOR_SYSSTART   ((IS_EHSX_FAMILY && g_dwModemVersion >= 1300) || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// Problem with EHS5 1.300: the strings SAT "+STK" URC might not be coded in UCS2
// even if this is configured with AT^SSTA. At least for the "Setup Menu" URCs it
// is necessary to check if the strings might be in GSM instead of UCS2.
#define UNCLEAR_CODING_ON_SAT  ((IS_EHSX_FAMILY && g_dwModemVersion >= 1300) || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// Problem with EHS5 1.300: the command AT^SMSO is shutting down the module
// without printing out "OK".
#define MISSING_OK_ON_SMSO  (IS_EHSX_FAMILY && g_dwModemVersion >= 1300 && g_dwModemVersion < 1400)

// The PXS8 Rel1 doesn' have a reliable "+CIEV: simstatus" URC, so the RIL has to
// avoid it.
#define CIEV_SIMSTATUS_UNRELIABLE     (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion <= 1010)

// The EHS5 requires the AT+CPOL command to be configured to the correct
// output format.
#define NEED_CONFIG_CPOL     (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The EHS5 requires to use the AT+CRSM=242 command to check for the SIM type.
#define USE_CRSM242_FOR_SIM_CHECK     (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// EHS5: The AT^SIND=signal/audio command is not available.
#define NO_SIND_SIGNAL_AUDIO   (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// EHS5 problem: If AT^SIND=call is used in a concatenated AT command it mixes up
// the results of the other commands.
#define SIND_CALL_MIXES_UP_RESPONSE  (IS_EHSX_FAMILY && g_dwModemVersion <= 1300)

// Problem with EHS5: AT^SIND=eons may need a couple of retries.
#define NEED_SIND_EONS_RETRIES   ((IS_EHSX_FAMILY && g_dwModemVersion > 1281) || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The EHS5 requires to use the AT+CRSM=242 command to check for the SIM type.
#define NO_SUPPORT_GPRS_AUTOATTACH_CFG  (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The EHS5 Rel1 doesn't give the numeric network name in the for "XXX YY" as
// required by AT&T, so the RIL has to check the name.
#define CHECK_FOR_NUMERIC_NETWORK_NAME     (IS_EHSX_FAMILY && g_dwModemVersion < 1300)

// The EHS5 Rel1 always starts with COPS=2, so it is necessary for the RIL to set the
// radio to COPS=0/1 at startup, even if the OS didn't requested it.
#define MUST_SET_COPS_AT_STARTUP     (IS_EHSX_FAMILY && g_dwModemVersion <= 1300)

// The EHS5 may not execute the voice commands immediately. Therfore
// the RIL should wait a little bit before executing the next status query.
#define SHOULD_WAIT_AFTER_LAST_VOICECMD     (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The EHS5 Rel1 doesn't support configuration of the SAT-UTP like the other radios.
#define SUPPORTS_SAT_UTP_CONFIG     (g_dwModemType != MODEMTYPE_EHS5 || g_dwModemVersion > 1100)

// For the EHS5 Rel1 is is better to alway use the class parameter on supplementary
// service commands.
#define MANDATORY_CLASS_PARAMETER     (IS_EHSX_FAMILY && g_dwModemVersion < 1300)

// The EHS5 allows to set the DTMF tone duration via AT+VTD.
#define SUPPORTS_VTD_COMMAND     (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The EHS5 Rel1 doesn't support to configure ther radio link protocol version.
#define SUPPORTS_RLP_VERSIONS     (g_dwModemType != MODEMTYPE_EHS5 || g_dwModemType == MODEMTYPE_BGS5)

// The EHS5 prints the <alpha> parameter always in GSM alphabet.
#define CLCC_ALPHA_ALWAYS_GSM     (IS_EHSX_FAMILY && g_dwModemVersion < 1300)

// Bug in EHS5 1.220: AT+CPMS cannot be used.
#define CANT_USE_CPMS     (IS_EHSX_FAMILY && g_dwModemVersion == 1220)

// Bug in EHS5 1.220: AT+CMGW sometimes freezes the module..
#define CANT_USE_CMGW     (IS_EHSX_FAMILY && g_dwModemVersion == 1220)

// The index for AT+CMGR/+CMGW start with 1 for the EHS5 and for all other
// modules with 0.
#define SMS_INDEX_STARTS_WITH_1   (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// Introduced with EHS5 1.300: in addition to the firmware, there is also
// necessary to update the Java midlet as well.
#define FIRMWARE_UPDATE_WITH_JAVA    ((IS_EHSX_FAMILY && g_dwModemVersion >= 1300) || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)
// A restart after a Java midlet update is usually not necessary.
#define RESTART_AFTER_JAVA_UPDATE    (IS_EHSX_FAMILY && g_dwModemVersion <= 1300)

// Problem with EHS5: The AT^SJDL command modifies the setting of ATE.
#define SJDL_CHANGES_ATE   (IS_EHSX_FAMILY && g_dwModemVersion >= 1300 && g_dwModemVersion < 1360)

// The EHS5 uses the At+CPBS rather than the AT^SBLK command to erase the blacklist.
#define USE_CPBS_FOR_BLACKLIST   ((IS_EHSX_FAMILY && g_dwModemVersion >= 1300) || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// The GPIO mode of the EHS5 need configuration.
#define SUPPORTS_GPIO_CONFIG   ((IS_EHSX_FAMILY && g_dwModemVersion >= 1370) || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// Bug in EHS5: Sometimes the module prints out "null" instead of OK/ERROR/URC.
#define ILLEGAL_NULL_STRING_IN_RESPONSE     (IS_EHSX_FAMILY && g_dwModemVersion >= 1220 || IS_ELSX_FAMILY)

// EHS5: In difference to other modules the AT+CHUP command applies only to
// active calls.
#define CHUP_FOR_ACTIVE_CALLS_ONLY   (IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5 || IS_ELSX_FAMILY)

// These development versions currently don't support audio configurations, so
// the RIL must not send any audio AT commands.
#define MUST_NOT_USE_AUDIO     ((g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion < 102) || (IS_EHSX_FAMILY && g_dwModemVersion < 1300))

// Bug in PXS8 0.102: an incomming SMS is marked as "read". After it got read
// it enters the state "unread" (CDMA only).
#define CDMA_NEW_SMS_ARE_READ     (g_dwModemType == MODEMTYPE_PXS8 && ((g_dwModemVersion >= 102 && g_dwModemVersion <= 104) || g_dwModemVersion == 1000))

// The AT^SCFG=MeOpmode/AccT settings got renamed in PXS8 0.103.
#define OLD_MULTIMODE_SETTINGS   (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion <= 102)

// Bug in PXS8 0.104: Sometimes the modules sends a "+CREG: 0" URC indicating
// that the module is not registered while it actually is registered to an UMTS
// network.
#define CREG0_MIGHT_BE_WRONG     (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion == 104)

// The RIL should avoid sending *#-sequences in CDMA mode.
#define AVOID_STARHASH_IN_CDMA     (g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8)

// The ^SLCC: URC is supposed to show up on all call state changes. Unfortunately
// in PXS8 0.104 it doesn't show up at the end of a call.
#define MISSING_SLCC_AT_CALLEND    (g_dwModemType == MODEMTYPE_PXS8 && (g_dwModemVersion == 104 || g_dwModemVersion == 1000))

// The ATD command accepts the V.250 modifiers even though many of them don't
// have any function. In CDMA the radio might misinterpretes them, so the RIL
// must filter them out.
#define FILTER_V250_MODIFIERS_IN_CDMA     (g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8)

// Problem: when sending an SMS the RIL briefly changes the CNMI setting. If a
// message comes in while the AT+CNMI is running, the SMS is not indicated at
// all. To detect whis situation the RIL has to re-check the CNMI status after
// sending a SMS.
#define NEEDS_RECHECK_OF_CNMI_AFTER_CMGS   (g_dwModemType == MODEMTYPE_AHS3)

// The PXS8 1.020 sometimes answers with "SIM not insterted" error even though
// the SIM is inserted and fully initialized. In this situation a simple retry helps.
#define WRONG_SIM_NOT_INSERTED_ERROR   (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion>= 1020)

// Bug in PXS8 3.000: the AT+VTS command returns with "ERROR", even when the
// tone has been sent successfully.
#define WRONG_ERROR_ON_VTS   (g_dwModemType == MODEMTYPE_PXS8 && (g_dwModemVersion == 1010 || g_dwModemVersion >= 2500 || g_dwModemVersion <= 2501))

// Bug in some versions of the PXS8: the AT+COPS=<x> command changes the setting
#define COPS_CHANGES_SCFG   (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion >= 1010 && g_dwModemVersion <= 2720)
// Related: other firmware versions have the same problem as above, but only
// with AT+COPS=1.
#define COPS1_CHANGES_SCFG   (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion >=3001)

// Problem with PXS8: the CDMA activation URC may appear twice. The second one
// can be ignored.
#define DOUBLE_CDMA_ACTIVATION_URC   ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 1000)

// The module is not supposed to indicate an incoming SMS class 2 with an URC, if
// CNMI is set to <mt>=2. The Px8 family modules since release 2 don't handle
// this correctly.
#define INCORRECT_URC_FOR_SMS_CLASS2  (((g_dwModemType == MODEMTYPE_PH8) || (g_dwModemType == MODEMTYPE_PXS8) || (g_dwModemType == MODEMTYPE_AHS3)) && g_dwModemVersion >= 1800)

// The AT^SBNW option "PRL" needs the file length since PXS8 2.720.
#define FILELEN_FOR_SBNW_PRL   ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2720)

// The AT^SBNW option "PRI" needs the SPC as an additional parameter since PXS8 2.720.
#define INCLUDE_SPC_FOR_SBNW_PRI   ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2720)

// CDMA modules: The NITZ time zone parameter is supposed to be in 15 minutes
// resolution, while registered to a CDMA network it is 60 minutes. It also
// incorrectly includes the daylight saving time offset.
#define CDMA_NITZ_TZ_IN_60_MINUTES  ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion <= 2720)

// Problem with PXS8 2.810: while in CDMA mode, AT+CSQ sometimes doesn't give
// the correct signal strength. To avoid this situation the RIL uses AT^SIND=rssi.
// On the other hand with PXS8 2.910 is is sometimes the other way round.
#define SUBSTITUTE_CSQ_WITH_SIND  ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2810 && g_dwModemVersion < 2910)

// Starting with PXS8 2.810: while in CDMA mode, AT+CSQ is replaced by AT+CSQ?.
#define USE_CSQ_READ  ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2810)

// Problem with older versions of the PXS8: the URCs for signal strength are
// not reliable. The RIL uses polling woth AT+CSQ instead.
#define AVOID_SIND_RSSI_IN_CDMA  ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion < 2810)

// Problem with PXS8 2.821 and newer: AT^SIND=signal doesn't work while the
// module is registered to CDMA.
#define NO_SIND_SIGNAL_IN_CDMA  ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion == 2821)

// Problem with PXS8 2.821 and newer: AT^SIND=nitz doesn't work while the
// module is registered to CDMA.
#define NO_SIND_NITZ_IN_CDMA  ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion == 2821)

// Problem with PXS8 2.821 : AT^SIND=psinfo doesn't work while the module is registered to CDMA.
#define NO_SIND_PSINFO_IN_CDMA  ((g_dwModemType == MODEMTYPE_PXS8  || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion == 2821)

// Problem with PXS8 2.821: misplaces comma at the end of AT+CLCC response in CDMA.
#define MISPLACED_COMMA_IN_CLCC_CDMA  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2821 && g_dwModemVersion < 2860)

// New feature for CDMA: AT^SMONI reports numeric network name.
#define SMONI_REPPORTS_CDMA_MCCMNC  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2820)

// Bug in AT+CSCA: the command might return "SIM not inserted" even though
// the SIM is actually inserted.
#define WRONG_SIM_NOT_INSERTED_ON_CSCA  (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion <= 2850)

// The SIM phonebook is not accessible while fixed dialing is active.
#define NO_SIM_PB_WHILE_FD (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3 || IS_EHSX_FAMILY || IS_ELSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5)

// PXS8/PVS8 2.810: The AT$MDN command got renamed to AT$MDN?. Same in AT$MSID.
#define USE_MDN_READ_CMD  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2810)

// Problem with PHS8 Rel3: if writing to the FD phonebook it is necessary to
// repeat the AT+CPBS command before every use of AT+CPBW.
#define NEED_CPBS_BEFORE_CPBW_ON_FD ((g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3) && g_dwModemVersion >= 3000)

// PXS8/PVS8 2.860: The AT+CGREG command is not needed in CDMA mode, but until
// release 2.860 it existed as a dummy command.
#define NO_CGREG_IN_CDMA  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2860)

// Introducing in PXS8/PVS8 2.860: the module can be configured to different CDMA
// operators (Verizon, Sprint). For each operator there are different PRL lists for
// update.
#define MULTIPLE_CDMA_PRL_LIST  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2860)

// New feature for CDMA: Configuration for "Tethered NAI".
#define SUPPORTS_CDMA_TETHERED_NAI  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2880)

// Px-family radios: The ATH command must be sent on the data port. Relevant for
// CSD data calls and CDMA data connections.
#define MUST_SEND_ATH_ON_DATA_PORT      (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8 || g_dwModemType == MODEMTYPE_AHS3)

// PXS8 2.910: introducing new parameter for EVDO attach status for AT^SREG.
#define NEW_SREG_PARAM  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2910)

// Bug in PXS8 (CDMA mode): the <number> parameter of AT+CLCC is supposed to
// be a string, might might come as a numeric value. Bug applies to AT^SLCC
// as well.
#define CLCC_NUMBER_AS_NUMERIC  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion <= 2919)

// Bug PXS8: when the module is configured to multimode the AT+CGREG command
// doesn't gives the correct status. It can be substituted with AT^SIND=psinfo.
#define WRONG_CGREG_IN_MULTIMODE  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion <= 2912)

// Bug in PXS8: when the <act> parameter of AT+COPS is used, the module might
// freeze up. To avoid this situation the RIL will adjust the radio band
// configuration.
#define AVOID_COPS_ACT  (g_dwModemType == MODEMTYPE_PXS8 && g_dwModemVersion >= 1100 && g_dwModemVersion <= 2914)

// Early versions of the PXS8 supported only the first two parameters for AT+CNMI
// when module was running in CDMA mode.
#define FULL_CDMA_CNMI_SUPPORT  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2800)

// Bug in PXS8: the <idx> parameter in CDMA might be indicated as "10" which
// is out ouf range.
#define WRONG_CLCC_IDX_10_IN_CDMA  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2800)

// Bug in PXS8: the +CRING URC might be followed by an incorrect +CCWA URC during
// an active CDMA data connection. The RIL must filter out this invalid URC.
#define WRONG_CCWA_AFTER_RING_IN_CDMA  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2800)

// When the module is in EVDO/1xRTT hybird mode, the module switches to 1xRTT
// during voice calls. The problem is, that the module is not indicating this
// fact with the "+CIEV: psinfo" URC.
#define MISSING_1XRTT_INDICATION_FOR_CDMA_VC  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 1000)

// Bug in PXS8: if voice calls are made during active EVDO data connections,
// the AT+CLCC response might indicate two data calls instead of one data and
// one voice call. The RIL can check for the last call status from ^SLCC, it
// might be correct.
#define INPLAUSIBLE_CDMA_CLCC_RESPONSE  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2900)

// Bug in PXS8: for incoming voice calls the AT+CLCC command might show the
// data number #777 instead of the actual number of the caller.
#define WRONG_CDMA_CLCC_VOICE_NUMBER  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 3000)

// Bug in PXS8: sometimes an outgoing CDMA data connection is indicated as an
// incoming one by AT+CLCC.
#define WRONG_CDMA_CLCC_DATA_CALL_DIRECTION  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2910)

// Bug in PXS8: sometimes an active incoming CDMA voice call is indicated as a
// ringing one.
#define WRONG_CDMA_CLCC_RINGING_STATE  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2910)

// Bug in PXS8: sometimes the AT+CLCC <number> parameter doesn't end with the
// closing quotation mark. Instead the next line beginns without any end of
// line characters.
#define WRONG_CDMA_CLCC_MISSING_EOL  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2910)

// Bug in PXS8: sometimes an outgoing CDMA data connection is indicated as
// "dialing" instead of "active" by AT+CLCC.
#define WRONG_CDMA_CLCC_DATA_CALL_STATUS  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 2910)

// The syntax of the AT^SMGL command for CDMA changed in version PXS8 3.001.
// Newer versions got the new syntax, the 3.001 might use the old or the new one.
#define NEW_CDMA_SMGL_SYNTAX  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion > 3001)
#define UNCLEAR_CDMA_SMGL_SYNTAX  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion == 3001)

// Bug in PXS8: the PDUs for cell broadcast messages in CDMA have got incorrect
// leading bytes. The RIL will replace them with something useful.
#define INCORRECT_CDMA_CB_PDU  ((g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8) && g_dwModemVersion >= 1001)

// Bug in some versions of the AHS3: the <L2P> parameter for ATD*99# doesn't
// accept "PPP" even though it is specified.
#define INCORRECT_L2P_PARAM  (g_dwModemType == MODEMTYPE_AHS3  && g_dwModemVersion >= 3000)

// Problem with QCT modules: if AT^SAIC is called while a voice call is ongoing
// the module might crash. Solution: at startup the RIL set the SAIC settings for
// all audio modes. During the voice calls only the SNFx settings are changed.
#define NO_SAIC_IN_CALL  (g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_PVS8 || g_dwModemType == MODEMTYPE_AHS3)

// Bug in PHS8 Rel3: if AT+CPIN? is called directly after entering the PIN,
// the module might indicate "READY" even though the module is actually
// in the net lock state.
#define WRONG_PIN_READY_ON_NETLOCK ((g_dwModemType == MODEMTYPE_PH8 || g_dwModemType == MODEMTYPE_PXS8 || g_dwModemType == MODEMTYPE_AHS3) && g_dwModemVersion >= 3000)

// Later versions of the EHS5 require to reconfigure the serial interface
// on the first use of the radio.
#define CONFIG_SERIAL_IF_REQUIRED   ((IS_EHSX_FAMILY || g_dwModemType == MODEMTYPE_BGS5) && g_dwModemVersion >= 1400)

// The band configuration of ELS6 products are different with EHS5 variants. For different ACT,
// Band mode should be configured separately.
#define BANDMODE_SEPERATE_SETTING (IS_ELSX_FAMILY)

// ELS6 are Data mode only module
// ELS6 variant products are not support voice call and related Supplementary Service are not supported.
#define SUPPORTS_ONLY_DATAMODE (IS_ELSX_FAMILY && ((g_dwModemType == MODEMTYPE_ELS81_E) || (g_dwModemType == MODEMTYPE_ELS81_US) || (g_dwModemType == MODEMTYPE_ELS61_AUS) || (g_dwModemType == MODEMTYPE_PLS62) || ((g_dwModemType == MODEMTYPE_ELS61_E) && ((g_dwProductInternalVersion == 100) || (g_dwProductInternalVersion == 400))) || ((g_dwModemType == MODEMTYPE_ELS61_US))))

// ELS6 don't support AUDIO, All aduio related requests are not support.
#define UNSUPPORTS_AUDIO (0)

// ELS6 Rel1 dont's support Phonebook. Might be supported on Rel2. Disable it for now.
#define UNSUPPORTS_PHONEBOOK (0)


// Only for ELS6 US products
// ELS6 US variant support and only support 3G and 4G.
#define SUPPORTS_ONLY_UMTS_LTE ((g_dwModemType == MODEMTYPE_ELS61_US) || (g_dwModemType == MODEMTYPE_ELS61_USA) || (g_dwModemType == MODEMTYPE_ELS61_AUS) || (g_dwModemType == MODEMTYPE_ELS81_US))

// Only for ELS6 EU products
// ELS6 EU variant support and only support 2G and 4G. Boxwood100
#define SUPPORTS_ONLY_GPRS_LTE ((g_dwModemType == MODEMTYPE_ELS61_E) && ((g_dwProductInternalVersion == 100) || (g_dwProductInternalVersion == 400)))

#define SUPPORTS_ONLY_GPRS_UMTS (g_dwModemType == MODEMTYPE_EHS8)

#define SUPPORTS_ALL_NETWORK (((g_dwModemType == MODEMTYPE_ELS61_E) && (g_dwProductInternalVersion == 300)) || (g_dwModemType == MODEMTYPE_PLS62) || (g_dwModemType == MODEMTYPE_ELS81_E))

#define SUPPORTS_INTERNAL_PRODUCT_VERSION  (IS_ELSX_FAMILY && (g_dwModemType != MODEMTYPE_PLS62))

#define SUPPORTS_IMS ((g_dwModemType == MODEMTYPE_ELS61_USA) && (g_dwProductInternalVersion == 300))
