Skip to content

Commit 1bdc0af

Browse files
committed
driver: modem: gsm_ppp: Use preprocessor instead of runtime
1 parent 88308ba commit 1bdc0af

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

drivers/modem/gsm_ppp.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -896,37 +896,37 @@ static int mux_enable(struct gsm_modem *gsm)
896896
int ret;
897897

898898
/* Turn on muxing */
899-
if (IS_ENABLED(CONFIG_MODEM_GSM_SIMCOM)) {
900-
ret = modem_cmd_send_nolock(
901-
&gsm->context.iface,
902-
&gsm->context.cmd_handler,
903-
&response_cmds[0],
904-
ARRAY_SIZE(response_cmds),
899+
#if CONFIG_MODEM_GSM_SIMCOM
900+
ret = modem_cmd_send_nolock(
901+
&gsm->context.iface,
902+
&gsm->context.cmd_handler,
903+
&response_cmds[0],
904+
ARRAY_SIZE(response_cmds),
905905
#if defined(SIMCOM_LTE)
906-
/* FIXME */
907-
/* Some SIMCOM modems can set the channels */
908-
/* Control channel always at DLCI 0 */
909-
"AT+CMUXSRVPORT=0,0;"
910-
/* PPP should be at DLCI 1 */
911-
"+CMUXSRVPORT=" STRINGIFY(DLCI_PPP) ",1;"
912-
/* AT should be at DLCI 2 */
913-
"+CMUXSRVPORT=" STRINGIFY(DLCI_AT) ",1;"
906+
/* FIXME */
907+
/* Some SIMCOM modems can set the channels */
908+
/* Control channel always at DLCI 0 */
909+
"AT+CMUXSRVPORT=0,0;"
910+
/* PPP should be at DLCI 1 */
911+
"+CMUXSRVPORT=" STRINGIFY(DLCI_PPP) ",1;"
912+
/* AT should be at DLCI 2 */
913+
"+CMUXSRVPORT=" STRINGIFY(DLCI_AT) ",1;"
914914
#else
915-
"AT"
915+
"AT"
916+
#endif
917+
"+CMUX=0,0,5,"
918+
STRINGIFY(CONFIG_GSM_MUX_MRU_DEFAULT_LEN),
919+
&gsm->sem_response,
920+
GSM_CMD_AT_TIMEOUT);
921+
#else
922+
/* Generic GSM modem */
923+
ret = modem_cmd_send_nolock(&gsm->context.iface,
924+
&gsm->context.cmd_handler,
925+
&response_cmds[0],
926+
ARRAY_SIZE(response_cmds),
927+
"AT+CMUX=0", &gsm->sem_response,
928+
GSM_CMD_AT_TIMEOUT);
916929
#endif
917-
"+CMUX=0,0,5,"
918-
STRINGIFY(CONFIG_GSM_MUX_MRU_DEFAULT_LEN),
919-
&gsm->sem_response,
920-
GSM_CMD_AT_TIMEOUT);
921-
} else {
922-
/* Generic GSM modem */
923-
ret = modem_cmd_send_nolock(&gsm->context.iface,
924-
&gsm->context.cmd_handler,
925-
&response_cmds[0],
926-
ARRAY_SIZE(response_cmds),
927-
"AT+CMUX=0", &gsm->sem_response,
928-
GSM_CMD_AT_TIMEOUT);
929-
}
930930

931931
if (ret < 0) {
932932
LOG_ERR("AT+CMUX ret:%d", ret);

0 commit comments

Comments
 (0)