@@ -73,24 +73,23 @@ static void qmimodem_lte_set_default_attach_info(const struct ofono_lte *lte,
uint8_t type;
uint8_t index;
} __attribute__((packed)) p = {
- .type = 0, /* 3GPP */
+ .type = QMI_WDS_PROFILE_TYPE_3GPP,
+ .index = ldd->default_profile,
};
DBG("");
- p.index = ldd->default_profile;
-
param = qmi_param_new();
/* Profile selector */
- qmi_param_append(param, 0x01, sizeof(p), &p);
+ qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p);
/* WDS APN Name */
qmi_param_append(param, QMI_WDS_PARAM_APN,
strlen(info->apn), info->apn);
/* Modify profile */
- if (qmi_service_send(ldd->wds, 0x28, param,
+ if (qmi_service_send(ldd->wds, QMI_WDS_MODIFY_PROFILE, param,
modify_profile_cb, cbd, l_free) > 0)
return;
@@ -114,6 +113,7 @@ static void reset_profile_cb(struct qmi_result *result, void *user_data)
static void get_default_profile_cb(struct qmi_result *result, void *user_data)
{
+ static const uint8_t RESULT_DEFAULT_PROFILE_NUMBER = 0x1;
struct ofono_lte *lte = user_data;
struct lte_data *ldd = ofono_lte_get_data(lte);
uint16_t error;
@@ -123,7 +123,7 @@ static void get_default_profile_cb(struct qmi_result *result, void *user_data)
uint8_t type;
uint8_t index;
} __attribute__((packed)) p = {
- .type = 0, /* 3GPP */
+ .type = QMI_WDS_PROFILE_TYPE_3GPP,
};
DBG("");
@@ -134,7 +134,8 @@ static void get_default_profile_cb(struct qmi_result *result, void *user_data)
}
/* Profile index */
- if (!qmi_result_get_uint8(result, 0x01, &index)) {
+ if (!qmi_result_get_uint8(result, RESULT_DEFAULT_PROFILE_NUMBER,
+ &index)) {
ofono_error("Failed query default profile");
goto error;
}
@@ -148,10 +149,10 @@ static void get_default_profile_cb(struct qmi_result *result, void *user_data)
param = qmi_param_new();
/* Profile selector */
- qmi_param_append(param, 0x01, sizeof(p), &p);
+ qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p);
/* Reset profile */
- if (qmi_service_send(ldd->wds, 0x4b, param,
+ if (qmi_service_send(ldd->wds, QMI_WDS_RESET_PROFILE, param,
reset_profile_cb, lte, NULL) > 0)
return;
@@ -171,8 +172,8 @@ static void create_wds_cb(struct qmi_service *service, void *user_data)
uint8_t type;
uint8_t family;
} __attribute((packed)) p = {
- .type = 0, /* 3GPP */
- .family = 0, /* embedded */
+ .type = QMI_WDS_PROFILE_TYPE_3GPP,
+ .family = QMI_WDS_PROFILE_FAMILY_EMBEDDED,
};
DBG("");
@@ -189,11 +190,11 @@ static void create_wds_cb(struct qmi_service *service, void *user_data)
param = qmi_param_new();
/* Profile type */
- qmi_param_append(param, 0x1, sizeof(p), &p);
+ qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p);
/* Get default profile */
- if (qmi_service_send(ldd->wds, 0x49, param,
- get_default_profile_cb, lte, NULL) > 0)
+ if (qmi_service_send(ldd->wds, QMI_WDS_GET_DEFAULT_PROFILE_NUMBER,
+ param, get_default_profile_cb, lte, NULL) > 0)
return;
qmi_param_free(param);
@@ -20,13 +20,13 @@
*/
/* Start WDS network interface */
+#define QMI_WDS_PARAM_PROFILE_TYPE 0x01
#define QMI_WDS_PARAM_APN 0x14 /* string */
#define QMI_WDS_PARAM_IP_FAMILY 0x19 /* uint8 */
#define QMI_WDS_PARAM_USERNAME 0x17 /* string */
#define QMI_WDS_PARAM_PASSWORD 0x18 /* string */
#define QMI_WDS_PARAM_AUTHENTICATION_PREFERENCE 0x16 /* uint8 */
-
enum qmi_wds_authentication {
QMI_WDS_AUTHENTICATION_PAP = 0x1,
QMI_WDS_AUTHENTICATION_CHAP = 0x2,
@@ -57,6 +57,17 @@ enum qmi_wds_client_type {
QMI_WDS_CLIENT_TYPE_TETHERED = 0x01,
};
+enum qmi_wds_profile_type {
+ QMI_WDS_PROFILE_TYPE_3GPP = 0x00,
+ QMI_WDS_PROFILE_TYPE_3GPP2 = 0x01,
+ QMI_WDS_PROFILE_TYPE_EPC = 0x02,
+};
+
+enum qmi_wds_profile_family {
+ QMI_WDS_PROFILE_FAMILY_EMBEDDED = 0x00,
+ QMI_WDS_PROFILE_FAMILY_TETHERED = 0x01,
+};
+
enum qmi_wds_command {
QMI_WDS_RESET = 0x00,
QMI_WDS_EVENT_REPORT = 0x01,
@@ -83,6 +94,7 @@ enum qmi_wds_command {
QMI_WDS_GET_CURRENT_DATA_BEARER_TECHNOLOGY = 0x44,
QMI_WDS_GET_DEFAULT_PROFILE_NUMBER = 0x49,
QMI_WDS_SET_DEFAULT_PROFILE_NUMBER = 0x4A,
+ QMI_WDS_RESET_PROFILE = 0x4B,
QMI_WDS_SET_IP_FAMILY = 0x4D,
QMI_WDS_SET_AUTOCONNECT_SETTINGS = 0x51,
QMI_WDS_GET_PDN_THROTTLE_INFO = 0x6C,