forked from sailfishos/ofono
Compare commits
2 Commits
mer/1.23+g
...
mer/1.23+g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b27dce313 | ||
|
|
c0e67eee01 |
@@ -960,12 +960,6 @@ static gboolean ril_data_call_setup_submit(struct ril_data_request *req)
|
|||||||
RADIO_TECH_LTE : priv->network->data.ril_tech;
|
RADIO_TECH_LTE : priv->network->data.ril_tech;
|
||||||
if (tech > 2) {
|
if (tech > 2) {
|
||||||
tech += 2;
|
tech += 2;
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* This value used to be hardcoded, let's keep using it
|
|
||||||
* as the default.
|
|
||||||
*/
|
|
||||||
tech = RADIO_TECH_HSPA;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setup->username && setup->username[0]) {
|
if (setup->username && setup->username[0]) {
|
||||||
|
|||||||
@@ -994,18 +994,17 @@ static void bac_cb(GAtServer *server, GAtServerRequestType type,
|
|||||||
/*
|
/*
|
||||||
* CVSD codec is mandatory and must come first.
|
* CVSD codec is mandatory and must come first.
|
||||||
* See HFP v1.6 4.34.1
|
* See HFP v1.6 4.34.1
|
||||||
|
* However, some headsets send the list in wrong order,
|
||||||
|
* but function fine otherwise, so to get those working
|
||||||
|
* let's not be pedantic about the codec order.
|
||||||
*/
|
*/
|
||||||
if (g_at_result_iter_next_number(&iter, &val) == FALSE ||
|
|
||||||
val != HFP_CODEC_CVSD)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
em->bac_received = TRUE;
|
|
||||||
|
|
||||||
em->negotiated_codec = 0;
|
|
||||||
em->r_codecs[CVSD_OFFSET].supported = TRUE;
|
|
||||||
|
|
||||||
while (g_at_result_iter_next_number(&iter, &val)) {
|
while (g_at_result_iter_next_number(&iter, &val)) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
|
case HFP_CODEC_CVSD:
|
||||||
|
em->bac_received = TRUE;
|
||||||
|
em->negotiated_codec = 0;
|
||||||
|
em->r_codecs[CVSD_OFFSET].supported = TRUE;
|
||||||
|
break;
|
||||||
case HFP_CODEC_MSBC:
|
case HFP_CODEC_MSBC:
|
||||||
em->r_codecs[MSBC_OFFSET].supported = TRUE;
|
em->r_codecs[MSBC_OFFSET].supported = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -1015,6 +1014,11 @@ static void bac_cb(GAtServer *server, GAtServerRequestType type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!em->bac_received) {
|
||||||
|
DBG("Mandatory codec %d not received.", HFP_CODEC_CVSD);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
|
g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -405,18 +405,18 @@ static void sim_fs_op_read_block_cb(const struct ofono_error *error,
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_block = op->offset / 256;
|
start_block = op->offset / 256;
|
||||||
end_block = op->num_bytes ? (op->offset + op->num_bytes - 1) / 256 :
|
end_block = (op->offset + (op->num_bytes - 1)) / 256;
|
||||||
start_block;
|
|
||||||
|
|
||||||
if (op->current == start_block) {
|
if (op->current == start_block) {
|
||||||
bufoff = 0;
|
bufoff = 0;
|
||||||
dataoff = op->offset % 256;
|
dataoff = op->offset % 256;
|
||||||
tocopy = MIN(256 - dataoff, op->num_bytes);
|
tocopy = MIN(256 - op->offset % 256,
|
||||||
|
op->num_bytes - op->current * 256);
|
||||||
} else {
|
} else {
|
||||||
bufoff = (op->current - start_block) * 256 -
|
bufoff = (op->current - start_block - 1) * 256 +
|
||||||
op->offset % 256;
|
op->offset % 256;
|
||||||
dataoff = 0;
|
dataoff = 0;
|
||||||
tocopy = MIN(256, op->num_bytes - bufoff);
|
tocopy = MIN(256, op->num_bytes - op->current * 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG("bufoff: %d, dataoff: %d, tocopy: %d",
|
DBG("bufoff: %d, dataoff: %d, tocopy: %d",
|
||||||
@@ -485,12 +485,13 @@ static gboolean sim_fs_op_read_block(gpointer user_data)
|
|||||||
bufoff = 0;
|
bufoff = 0;
|
||||||
seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256 +
|
seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256 +
|
||||||
op->offset % 256;
|
op->offset % 256;
|
||||||
toread = MIN(256 - op->offset % 256, op->num_bytes);
|
toread = MIN(256 - op->offset % 256,
|
||||||
|
op->num_bytes - op->current * 256);
|
||||||
} else {
|
} else {
|
||||||
bufoff = (op->current - start_block) * 256 -
|
bufoff = (op->current - start_block - 1) * 256 +
|
||||||
op->offset % 256;
|
op->offset % 256;
|
||||||
seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256;
|
seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256;
|
||||||
toread = MIN(256, op->num_bytes - bufoff);
|
toread = MIN(256, op->num_bytes - op->current * 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG("bufoff: %d, seekoff: %d, toread: %d",
|
DBG("bufoff: %d, seekoff: %d, toread: %d",
|
||||||
|
|||||||
Reference in New Issue
Block a user