3 #include "qmi-message.h"
7 QmiWdaLinkLayerProtocol val
;
9 { "802.3", QMI_WDA_LINK_LAYER_PROTOCOL_802_3
},
10 { "raw-ip", QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP
},
13 #define cmd_wda_set_data_format_cb no_cb
15 static enum qmi_cmd_result
16 cmd_wda_set_data_format_prepare(struct qmi_dev
*qmi
, struct qmi_request
*req
, struct qmi_msg
*msg
, char *arg
)
18 struct qmi_wda_set_data_format_request data_req
= {};
21 for (i
= 0; i
< ARRAY_SIZE(link_modes
); i
++) {
22 if (strcasecmp(link_modes
[i
].name
, arg
) != 0)
25 qmi_set(&data_req
, link_layer_protocol
, link_modes
[i
].val
);
26 qmi_set_wda_set_data_format_request(msg
, &data_req
);
27 return QMI_CMD_REQUEST
;
30 uqmi_add_error("Invalid auth mode (valid: 802.3, raw-ip)");
35 cmd_wda_get_data_format_cb(struct qmi_dev
*qmi
, struct qmi_request
*req
, struct qmi_msg
*msg
)
37 struct qmi_wda_get_data_format_response res
;
38 const char *name
= "unknown";
41 qmi_parse_wda_get_data_format_response(msg
, &res
);
42 for (i
= 0; i
< ARRAY_SIZE(link_modes
); i
++) {
43 if (link_modes
[i
].val
!= res
.data
.link_layer_protocol
)
46 name
= link_modes
[i
].name
;
50 blobmsg_add_string(&status
, NULL
, name
);
53 static enum qmi_cmd_result
54 cmd_wda_get_data_format_prepare(struct qmi_dev
*qmi
, struct qmi_request
*req
, struct qmi_msg
*msg
, char *arg
)
56 qmi_set_wda_get_data_format_request(msg
);
57 return QMI_CMD_REQUEST
;