@@ -550,16 +550,17 @@ static int qmi_gprs_context_bind_mux(struct ofono_gprs_context *gc,
return -EIO;
}
-static int qmi_gprs_context_probe(struct ofono_gprs_context *gc,
- unsigned int vendor, void *user_data)
+static int qmi_gprs_context_probev(struct ofono_gprs_context *gc,
+ unsigned int vendor, va_list args)
{
- struct qmi_service *wds = user_data;
+ int mux_id = va_arg(args, int);
+ struct qmi_service *wds = va_arg(args, struct qmi_service *);
struct gprs_context_data *data;
DBG("");
- if (vendor) {
- int r = qmi_gprs_context_bind_mux(gc, wds, vendor);
+ if (mux_id != -1) {
+ int r = qmi_gprs_context_bind_mux(gc, wds, mux_id);
if (r < 0) {
qmi_service_free(wds);
@@ -569,7 +570,7 @@ static int qmi_gprs_context_probe(struct ofono_gprs_context *gc,
data = l_new(struct gprs_context_data, 1);
data->wds = wds;
- data->mux_id = vendor;
+ data->mux_id = mux_id;
qmi_service_register(data->wds, QMI_WDS_PACKET_SERVICE_STATUS,
pkt_status_notify, gc, NULL);
@@ -593,7 +594,7 @@ static void qmi_gprs_context_remove(struct ofono_gprs_context *gc)
static const struct ofono_gprs_context_driver driver = {
.flags = OFONO_ATOM_DRIVER_FLAG_REGISTER_ON_PROBE,
- .probe = qmi_gprs_context_probe,
+ .probev = qmi_gprs_context_probev,
.remove = qmi_gprs_context_remove,
.activate_primary = qmi_activate_primary,
.deactivate_primary = qmi_deactivate_primary,
@@ -762,7 +762,7 @@ static void gobi_setup_gprs(struct ofono_modem *modem)
if (n_premux == 0) {
interface = ofono_modem_get_string(modem, "NetworkInterface");
- gc = ofono_gprs_context_create(modem, 0, "qmimodem",
+ gc = ofono_gprs_context_create(modem, 0, "qmimodem", -1,
qmi_service_clone(data->wds));
if (!gc) {
ofono_warn("Unable to create gprs-context for: %s",
@@ -788,7 +788,7 @@ static void gobi_setup_gprs(struct ofono_modem *modem)
sprintf(buf, "PremuxInterface%dMuxId", i + 1);
mux_id = ofono_modem_get_integer(modem, buf);
- gc = ofono_gprs_context_create(modem, mux_id, "qmimodem",
+ gc = ofono_gprs_context_create(modem, 0, "qmimodem", mux_id,
qmi_service_clone(data->wds));
if (!gc) {
@@ -315,7 +315,7 @@ static int setup_gprs_context(uint8_t mux_id, const char *interface,
struct qmi_qrtr_node *node = data->node;
struct ofono_gprs_context *gc;
- gc = ofono_gprs_context_create(modem, 0, "qmimodem",
+ gc = ofono_gprs_context_create(modem, 0, "qmimodem", mux_id,
qmi_qrtr_node_get_service(node, QMI_SERVICE_WDS));
if (!gc) {
ofono_warn("Unable to create gprs-context for: %s, %s[%hhu]",
@@ -347,6 +347,13 @@ static void setup_gprs(struct ofono_modem *modem)
return;
}
+ /* Upstream driver default, single interface, single context */
+ if (!n_premux) {
+ interface = ofono_modem_get_string(modem, "NetworkInterface");
+ setup_gprs_context(0, interface, gprs);
+ return;
+ }
+
for (i = 0; i < n_premux; i++) {
int mux_id;