iface-modem: don't flash port during disable

At least just for now. Flashing should be done as part of the disconnection.
This commit is contained in:
Aleksander Morgado
2011-11-30 15:57:22 +01:00
parent a170c0841d
commit 289057bf92

View File

@@ -897,7 +897,7 @@ mm_iface_modem_signal_quality_check (MMIfaceModem *self,
typedef enum {
DISABLING_STEP_FIRST,
DISABLING_STEP_FLASH_PORT,
/* DISABLING_STEP_FLASH_PORT, */
DISABLING_STEP_MODEM_POWER_DOWN,
DISABLING_STEP_CLOSE_PORT,
DISABLING_STEP_LAST
@@ -994,23 +994,23 @@ mm_iface_modem_disable_finish (MMIfaceModem *self,
VOID_REPLY_READY_FN (modem_power_down)
static void
interface_disabling_flash_done (MMSerialPort *port,
GError *error,
gpointer user_data)
{
DisablingContext *ctx = user_data;
/* static void */
/* interface_disabling_flash_done (MMSerialPort *port, */
/* GError *error, */
/* gpointer user_data) */
/* { */
/* DisablingContext *ctx = user_data; */
if (error) {
g_simple_async_result_set_from_error (ctx->result, error);
disabling_context_complete_and_free (ctx);
return;
}
/* if (error) { */
/* g_simple_async_result_set_from_error (ctx->result, error); */
/* disabling_context_complete_and_free (ctx); */
/* return; */
/* } */
/* Go on to next step */
ctx->step++;
interface_disabling_step (ctx);
}
/* /\* Go on to next step *\/ */
/* ctx->step++; */
/* interface_disabling_step (ctx); */
/* } */
static void
interface_disabling_step (DisablingContext *ctx)
@@ -1020,18 +1020,18 @@ interface_disabling_step (DisablingContext *ctx)
/* Fall down to next step */
ctx->step++;
case DISABLING_STEP_FLASH_PORT:
/* If primary port connected, flash port */
if (mm_port_get_connected (MM_PORT (ctx->primary))) {
mm_serial_port_flash (MM_SERIAL_PORT (ctx->primary),
100,
TRUE,
interface_disabling_flash_done,
ctx);
return;
}
/* Fall down to next step */
ctx->step++;
/* case DISABLING_STEP_FLASH_PORT: */
/* /\* If primary port connected, flash port *\/ */
/* if (mm_port_get_connected (MM_PORT (ctx->primary))) { */
/* mm_serial_port_flash (MM_SERIAL_PORT (ctx->primary), */
/* 100, */
/* TRUE, */
/* interface_disabling_flash_done, */
/* ctx); */
/* return; */
/* } */
/* /\* Fall down to next step *\/ */
/* ctx->step++; */
case DISABLING_STEP_MODEM_POWER_DOWN:
/* CFUN=0 is dangerous and often will shoot devices in the head (that's