cinterion: fix coding style for enum values

The enum values are given in UPPER_CASE format, not in CamelCase.
This commit is contained in:
Aleksander Morgado
2016-11-23 23:02:29 +01:00
parent ef50c085f9
commit 938a53e7c6
2 changed files with 45 additions and 45 deletions

View File

@@ -38,28 +38,28 @@ G_DEFINE_TYPE (MMBroadbandBearerCinterion, mm_broadband_bearer_cinterion, MM_TYP
#define SECOND_USB_INTERFACE 2 #define SECOND_USB_INTERFACE 2
typedef enum { typedef enum {
BearerCinterionAuthUnknown = -1, BEARER_CINTERION_AUTH_UNKNOWN = -1,
BearerCinterionAuthNone = 0, BEARER_CINTERION_AUTH_NONE = 0,
BearerCinterionAuthPap = 1, BEARER_CINTERION_AUTH_PAP = 1,
BearerCinterionAuthChap = 2, BEARER_CINTERION_AUTH_CHAP = 2,
BearerCinterionAuthMsChapV2 = 3, BEARER_CINTERION_AUTH_MSCHAPV2 = 3,
} BearerCinterionAuthType; } BearerCinterionAuthType;
typedef enum { typedef enum {
Connect3gppContextStepInit = 0, CONNECT_3GPP_CONTEXT_STEP_INIT = 0,
Connect3gppContextStepAuth, CONNECT_3GPP_CONTEXT_STEP_AUTH,
Connect3gppContextStepPdpCtx, CONNECT_3GPP_CONTEXT_STEP_PDP_CTX,
Connect3gppContextStepStartSwwan, CONNECT_3GPP_CONTEXT_STEP_START_SWWAN,
Connect3gppContextStepValidateConnection, CONNECT_3GPP_CONTEXT_STEP_VALIDATE_CONNECTION,
Connect3gppContextStepIpConfig, CONNECT_3GPP_CONTEXT_STEP_IP_CONFIG,
Connect3gppContextStepFinalizeBearer, CONNECT_3GPP_CONTEXT_STEP_FINALIZE_BEARER,
} Connect3gppContextStep; } Connect3gppContextStep;
typedef enum { typedef enum {
Disconnect3gppContextStepStopSwwan = 0, DISCONNECT_3GPP_CONTEXT_STEP_STOP_SWWAN = 0,
Disconnect3gppContextStepConnectionStatus, DISCONNECT_3GPP_CONTEXT_STEP_CONNECTION_STATUS,
Disconnect3gppContextStepFinish DISCONNECT_3GPP_CONTEXT_STEP_FINISH,
} Disconnect3gppContextStep; } Disconnect3gppContextStep;;
typedef struct { typedef struct {
MMBroadbandBearerCinterion *self; MMBroadbandBearerCinterion *self;
@@ -162,15 +162,15 @@ cinterion_parse_auth_type (MMBearerAllowedAuth mm_auth)
{ {
switch (mm_auth) { switch (mm_auth) {
case MM_BEARER_ALLOWED_AUTH_NONE: case MM_BEARER_ALLOWED_AUTH_NONE:
return BearerCinterionAuthNone; return BEARER_CINTERION_AUTH_NONE;
case MM_BEARER_ALLOWED_AUTH_PAP: case MM_BEARER_ALLOWED_AUTH_PAP:
return BearerCinterionAuthPap; return BEARER_CINTERION_AUTH_PAP;
case MM_BEARER_ALLOWED_AUTH_CHAP: case MM_BEARER_ALLOWED_AUTH_CHAP:
return BearerCinterionAuthChap; return BEARER_CINTERION_AUTH_CHAP;
case MM_BEARER_ALLOWED_AUTH_MSCHAPV2: case MM_BEARER_ALLOWED_AUTH_MSCHAPV2:
return BearerCinterionAuthMsChapV2; return BEARER_CINTERION_AUTH_MSCHAPV2;
default: default:
return BearerCinterionAuthUnknown; return BEARER_CINTERION_AUTH_UNKNOWN;
} }
} }
@@ -306,7 +306,7 @@ build_cinterion_auth_string (Connect3gppContext *ctx)
const gchar *user = NULL; const gchar *user = NULL;
const gchar *passwd = NULL; const gchar *passwd = NULL;
MMBearerAllowedAuth auth; MMBearerAllowedAuth auth;
gint encoded_auth = BearerCinterionAuthUnknown; gint encoded_auth = BEARER_CINTERION_AUTH_UNKNOWN;
gchar *command = NULL; gchar *command = NULL;
user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
@@ -320,8 +320,8 @@ build_cinterion_auth_string (Connect3gppContext *ctx)
encoded_auth = cinterion_parse_auth_type (auth); encoded_auth = cinterion_parse_auth_type (auth);
/* Default to no authentication if not specified */ /* Default to no authentication if not specified */
if (encoded_auth == BearerCinterionAuthUnknown) { if (encoded_auth == BEARER_CINTERION_AUTH_UNKNOWN) {
encoded_auth = BearerCinterionAuthNone; encoded_auth = BEARER_CINTERION_AUTH_NONE;
mm_dbg ("Unable to detect authentication type. Defaulting to:%i", encoded_auth); mm_dbg ("Unable to detect authentication type. Defaulting to:%i", encoded_auth);
} }
@@ -489,14 +489,14 @@ connect_3gpp_context_step (Connect3gppContext *ctx)
g_assert (ctx->self->priv->network_disconnect_pending_id == 0); g_assert (ctx->self->priv->network_disconnect_pending_id == 0);
switch (ctx->connect) { switch (ctx->connect) {
case Connect3gppContextStepInit: case CONNECT_3GPP_CONTEXT_STEP_INIT:
/* Insure no connection is currently /* Insure no connection is currently
* active with the bearer we're creating.*/ * active with the bearer we're creating.*/
send_swwan_disconnect_command_ctx_connect (ctx); send_swwan_disconnect_command_ctx_connect (ctx);
return; return;
case Connect3gppContextStepAuth: { case CONNECT_3GPP_CONTEXT_STEP_AUTH: {
gchar *command = NULL; gchar *command = NULL;
@@ -517,7 +517,7 @@ connect_3gpp_context_step (Connect3gppContext *ctx)
/* GOTO next step - Fall down below */ /* GOTO next step - Fall down below */
ctx->connect++; ctx->connect++;
} }
case Connect3gppContextStepPdpCtx: { case CONNECT_3GPP_CONTEXT_STEP_PDP_CTX: {
gchar *command = NULL; gchar *command = NULL;
command = build_cinterion_pdp_context_string (ctx); command = build_cinterion_pdp_context_string (ctx);
@@ -528,23 +528,23 @@ connect_3gpp_context_step (Connect3gppContext *ctx)
g_free (command); g_free (command);
return; return;
} }
case Connect3gppContextStepStartSwwan: case CONNECT_3GPP_CONTEXT_STEP_START_SWWAN:
send_swwan_connect_command_ctx_connect (ctx); send_swwan_connect_command_ctx_connect (ctx);
return; return;
case Connect3gppContextStepValidateConnection: case CONNECT_3GPP_CONTEXT_STEP_VALIDATE_CONNECTION:
send_swwan_read_command_ctx_connect (ctx); send_swwan_read_command_ctx_connect (ctx);
return; return;
case Connect3gppContextStepIpConfig: case CONNECT_3GPP_CONTEXT_STEP_IP_CONFIG:
setup_ip_settings (ctx); setup_ip_settings (ctx);
/* GOTO next step - Fall down below */ /* GOTO next step - Fall down below */
ctx->connect++; ctx->connect++;
case Connect3gppContextStepFinalizeBearer: case CONNECT_3GPP_CONTEXT_STEP_FINALIZE_BEARER:
/* Setup bearer */ /* Setup bearer */
create_cinterion_bearer (ctx); create_cinterion_bearer (ctx);
@@ -580,7 +580,7 @@ connect_3gpp (MMBroadbandBearer *self,
MM_CORE_ERROR_NOT_FOUND, MM_CORE_ERROR_NOT_FOUND,
"No valid data port found to launch connection"); "No valid data port found to launch connection");
return; return;
} }
/* Setup connection context */ /* Setup connection context */
ctx = g_slice_new0 (Connect3gppContext); ctx = g_slice_new0 (Connect3gppContext);
@@ -598,7 +598,7 @@ connect_3gpp (MMBroadbandBearer *self,
pdp_cid_connect (ctx); pdp_cid_connect (ctx);
/* Initialize */ /* Initialize */
ctx->connect = Connect3gppContextStepInit; ctx->connect = CONNECT_3GPP_CONTEXT_STEP_INIT;
/* Run! */ /* Run! */
connect_3gpp_context_step (ctx); connect_3gpp_context_step (ctx);
@@ -746,20 +746,20 @@ disconnect_3gpp_context_step (Disconnect3gppContext *ctx)
mm_dbg ("Disconnect Step:%i", ctx->disconnect); mm_dbg ("Disconnect Step:%i", ctx->disconnect);
switch (ctx->disconnect) { switch (ctx->disconnect) {
case Disconnect3gppContextStepStopSwwan: case DISCONNECT_3GPP_CONTEXT_STEP_STOP_SWWAN:
/* Has call back to next state */ /* Has call back to next state */
send_swwan_disconnect_command_ctx_disconnect (ctx); send_swwan_disconnect_command_ctx_disconnect (ctx);
return; return;
case Disconnect3gppContextStepConnectionStatus: case DISCONNECT_3GPP_CONTEXT_STEP_CONNECTION_STATUS:
/* Has call back to next state */ /* Has call back to next state */
send_swwan_read_command_ctx_disconnect (ctx); send_swwan_read_command_ctx_disconnect (ctx);
return; return;
case Disconnect3gppContextStepFinish: case DISCONNECT_3GPP_CONTEXT_STEP_FINISH:
ctx->self->priv->pdp_cid = 0; ctx->self->priv->pdp_cid = 0;
@@ -801,7 +801,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
pdp_cid_disconnect (ctx); pdp_cid_disconnect (ctx);
/* Initialize */ /* Initialize */
ctx->disconnect = Disconnect3gppContextStepStopSwwan; ctx->disconnect = DISCONNECT_3GPP_CONTEXT_STEP_STOP_SWWAN;
/* Start */ /* Start */
disconnect_3gpp_context_step (ctx); disconnect_3gpp_context_step (ctx);

View File

@@ -54,9 +54,9 @@ G_DEFINE_TYPE_EXTENDED (MMBroadbandModemCinterion, mm_broadband_modem_cinterion,
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init)) G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init))
typedef enum { typedef enum {
FeatureSupportUnknown, FEATURE_SUPPORT_UNKNOWN,
FeatureNotSupported, FEATURE_NOT_SUPPORTED,
FeatureSupported FEATURE_SUPPORTED,
} FeatureSupport; } FeatureSupport;
struct _MMBroadbandModemCinterionPrivate { struct _MMBroadbandModemCinterionPrivate {
@@ -1697,11 +1697,11 @@ swwan_test_ready (MMBaseModem *self,
if (mm_port_get_subsys (port) == MM_PORT_SUBSYS_NET && if (mm_port_get_subsys (port) == MM_PORT_SUBSYS_NET &&
!error) { !error) {
mm_dbg ("SWWAN supported"); mm_dbg ("SWWAN supported");
ctx->self->priv->swwan_support = FeatureSupported; ctx->self->priv->swwan_support = FEATURE_SUPPORTED;
} }
else { else {
mm_dbg ("SWWAN unsupported"); mm_dbg ("SWWAN unsupported");
ctx->self->priv->swwan_support = FeatureNotSupported; ctx->self->priv->swwan_support = FEATURE_NOT_SUPPORTED;
} }
if (error) /* Error is not valid */ if (error) /* Error is not valid */
@@ -1829,7 +1829,7 @@ static void
create_bearer_for_net_port (CreateBearerContext *ctx) create_bearer_for_net_port (CreateBearerContext *ctx)
{ {
switch (ctx->self->priv->swwan_support) { switch (ctx->self->priv->swwan_support) {
case FeatureNotSupported: case FEATURE_NOT_SUPPORTED:
mm_dbg ("^SWWAN not supported, creating default bearer..."); mm_dbg ("^SWWAN not supported, creating default bearer...");
mm_broadband_bearer_new (MM_BROADBAND_MODEM (ctx->self), mm_broadband_bearer_new (MM_BROADBAND_MODEM (ctx->self),
ctx->properties, ctx->properties,
@@ -1837,7 +1837,7 @@ create_bearer_for_net_port (CreateBearerContext *ctx)
(GAsyncReadyCallback)broadband_bearer_new_ready, (GAsyncReadyCallback)broadband_bearer_new_ready,
ctx); ctx);
return; return;
case FeatureSupported: case FEATURE_SUPPORTED:
mm_dbg ("^SWWAN supported, creating cinterion bearer..."); mm_dbg ("^SWWAN supported, creating cinterion bearer...");
mm_broadband_bearer_cinterion_new (MM_BROADBAND_MODEM_CINTERION (ctx->self), mm_broadband_bearer_cinterion_new (MM_BROADBAND_MODEM_CINTERION (ctx->self),
ctx->properties, ctx->properties,
@@ -1897,7 +1897,7 @@ mm_broadband_modem_cinterion_init (MMBroadbandModemCinterion *self)
/* Initialize private variables */ /* Initialize private variables */
self->priv->sind_psinfo = TRUE; /* Initially, always try to get psinfo */ self->priv->sind_psinfo = TRUE; /* Initially, always try to get psinfo */
self->priv->swwan_support = FeatureSupportUnknown; self->priv->swwan_support = FEATURE_SUPPORT_UNKNOWN;
} }
static void static void