Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v3, Part2, 1/3] nokiacdma: Add plugin and CDMA MO Call Support
Date: Wed, 22 Dec 2010 20:31:21 -0600	[thread overview]
Message-ID: <4D12B479.4020401@gmail.com> (raw)
In-Reply-To: <1292959410-6566-2-git-send-email-dara.spieker-doyle@nokia.com>

[-- Attachment #1: Type: text/plain, Size: 3378 bytes --]

Hi Dara,

<snip>

> +struct nokiacdma_data {
> +	GAtChat *chat;
> +	ofono_bool_t online;
> +	ofono_bool_t registration_status;

What is the purpose of the above two variables?

<snip>

> +static void nokiacdma_disconnect(gpointer user_data)
> +{
> +	struct ofono_modem *modem = user_data;
> +	struct nokiacdma_data *data = ofono_modem_get_data(modem);
> +
> +	DBG("%p", modem);
> +
> +	g_at_chat_unref(data->chat);
> +	data->chat = NULL;
> +
> +	data->chat = open_device(modem, "Device", "CDMA Device: ");
> +	if (data->chat == NULL)
> +		return;
> +
> +	g_at_chat_set_disconnect_function(data->chat,
> +			nokiacdma_disconnect, modem);
> +}

What are you trying to accomplish in this one?  on the huawei driver
this is used to re-open the tty because it is HUP-ed when the ppp
session ends (their way of signaling NO CARRIER).  However, I don't see
you doing PPP yet, so I'm not so sure of the purpose here?

> +
> +/* power up hardware */
> +static int nokiacdma_enable(struct ofono_modem *modem)
> +{
> +	struct nokiacdma_data *data = ofono_modem_get_data(modem);
> +
> +	DBG("%p", modem);
> +
> +	ofono_modem_set_boolean(modem, "no_sim_required", TRUE);
> +
> +	data->chat = open_device(modem, "Device", "CDMA Device: ");
> +	if (data->chat == NULL)
> +		return -EINVAL;
> +
> +	g_at_chat_set_disconnect_function(data->chat,
> +			nokiacdma_disconnect, modem);
> +
> +	if (getenv("OFONO_AT_DEBUG"))
> +		g_at_chat_set_debug(data->chat, nokiacdma_debug,
> +				"CDMA Generic: ");
> +
> +	return 0;
> +}
> +
> +static int nokiacdma_disable(struct ofono_modem *modem)
> +{
> +	struct nokiacdma_data *data = ofono_modem_get_data(modem);
> +
> +	DBG("%p", modem);
> +
> +	if (data->chat) {
> +		g_at_chat_cancel_all(data->chat);
> +		g_at_chat_unregister_all(data->chat);
> +		g_at_chat_unref(data->chat);
> +		data->chat = NULL;
> +	}
> +
> +	return 0;

So enable and disable just open up the ports?

> +}
> +
> +static void nokiacdma_pre_sim(struct ofono_modem *modem)
> +{
> +	struct nokiacdma_data *data = ofono_modem_get_data(modem);
> +
> +	ofono_cdma_voicecall_create(modem, 0, "cdmamodem",
> +				data->chat);
> +}
> +
> +static void nokiacdma_post_sim(struct ofono_modem *modem)
> +{
> +}
> +
> +static gboolean nokiacdma_set_online_cb(gpointer cb_data)
> +{
> +	struct cb_data *cbd = cb_data;
> +	ofono_modem_online_cb_t cb = cbd->cb;
> +
> +	CALLBACK_WITH_SUCCESS(cb, cbd->data);
> +
> +	g_free(cbd);
> +
> +	/* do not call again */
> +	return FALSE;
> +}
> +
> +static void nokiacdma_set_online(struct ofono_modem *modem, ofono_bool_t online,
> +				ofono_modem_online_cb_t cb, void *user_data)
> +{
> +	struct nokiacdma_data *data = ofono_modem_get_data(modem);
> +	struct cb_data *cbd = cb_data_new(cb, user_data);
> +
> +	DBG("modem %p %s", modem, online ? "online" : "offline");
> +
> +	if (cbd == NULL)
> +		goto error;
> +
> +	data->online = online;
> +
> +	/* TODO: Fix this when network registration implemented */
> +	if (online)
> +		data->registration_status =
> +		    NETWORK_REGISTRATION_STATUS_REGISTERED;
> +
> +	nokiacdma_set_online_cb(cbd);
> +	return;
> +
> +error:
> +	g_free(cbd);
> +
> +	CALLBACK_WITH_FAILURE(cb, cbd->data);
> +}

I'm lost here.  What are you trying to accomplish?

<snip>

Regards,
-Denis

  reply	other threads:[~2010-12-23  2:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-21 19:23 [PATCH v3, Part2, 1/3] nokiacdma: Add plugin and CDMA MO Call Support Dara Spieker-Doyle
2010-12-23  2:31 ` Denis Kenzior [this message]
2010-12-23 23:41   ` Dara Spieker-Doyle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D12B479.4020401@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox