Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: MaxLyubimov <m.lyubimov@aqsi.ru>, ofono@lists.linux.dev
Subject: Re: [PATCH 03/15] plugins: adding support for the SIMCom A7605E-H
Date: Wed, 18 Oct 2023 20:42:12 -0500	[thread overview]
Message-ID: <2d194620-ed30-4763-aced-ca89b450132c@gmail.com> (raw)
In-Reply-To: <20231017104902.717947-3-m.lyubimov@aqsi.ru>

Hi Maxim,

On 10/17/23 05:48, MaxLyubimov wrote:
> The udevng plugin has been modified to detect the SIMCom A7605E-H modem and the simcom_a76xx plugin has been added to work with it
> ---
>   plugins/simcom_a76xx.c | 323 +++++++++++++++++++++++++++++++++++++++++
>   plugins/udevng.c       |  55 +++++++

Please see HACKING, 'Submitting patches' section, item 3.

>   2 files changed, 378 insertions(+)
>   create mode 100644 plugins/simcom_a76xx.c
> 
> diff --git a/plugins/simcom_a76xx.c b/plugins/simcom_a76xx.c
> new file mode 100644
> index 00000000..059773b5
> --- /dev/null
> +++ b/plugins/simcom_a76xx.c
> @@ -0,0 +1,323 @@
> +/*
> + *
> + *  oFono - Open Source Telephony
> + *
> + *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
> + *  Copyright (C) 2009  Collabora Ltd. All rights reserved.
> + *  Copyright 2018 Purism SPC

Copyrights seem suspect?

> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License version 2 as
> + *  published by the Free Software Foundation.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + *
> + */
> +
> +/*
> + * This file was originally copied from g1.c and
> + * modified by Bob Ham <bob.ham@puri.sm>
> + */
> +

In fact this looks 95% the same to plugins/simcom7100.c.  Can we unify the two?

Also, you still have lines > 80 chars here.

<snip>

> +#ifdef HAVE_CONFIG_H> diff --git a/plugins/udevng.c b/plugins/udevng.c
> index f6580aba..7fccf670 100644
> --- a/plugins/udevng.c
> +++ b/plugins/udevng.c
> @@ -1554,6 +1554,59 @@ static gboolean setup_sim7x00(struct modem_info *modem)
>   	return TRUE;
>   }
>   
> +static gboolean setup_simcom_a76xx(struct modem_info *modem)
> +{
> +	const char *diag = NULL, *gps = NULL;
> +	const char *mdm = NULL, *ppp = NULL;
> +	GSList *list;
> +
> +	DBG("%s", modem->syspath);
> +
> +	for (list = modem->devices; list; list = list->next) {
> +		struct device_info *info = list->data;
> +		const char *subsystem =
> +				udev_device_get_subsystem(info->udev_device);
> +
> +		DBG("%s %s %s %s %s %s", info->devnode, info->interface,
> +						info->number, info->label,
> +						info->sysattr, subsystem);
> +
> +		/*
> +		 * SIMCom a76xx serial port layout:
> +		 * 2: DIAG
> +		 * 3: NMEA
> +		 * 4: AT
> +		 * 5: AT/PPP
> +		 */
> +		if (g_strcmp0(subsystem, "tty") == 0) {
> +			if (g_strcmp0(info->interface, "255/0/0") == 0) {
> +				if (g_strcmp0(info->number, "02") == 0)
> +					diag = info->devnode;
> +				else if (g_strcmp0(info->number, "03") == 0)
> +					gps = info->devnode;
> +				else if (g_strcmp0(info->number, "04") == 0)
> +					mdm = info->devnode;
> +				else if (g_strcmp0(info->number, "05") == 0)
> +					ppp = info->devnode;

Again, this block seems rather similar to what is in setup_simcom.  Just the 
interface numbers are different.  Please unify the two.

Regards,
-Denis

  reply	other threads:[~2023-10-19  1:42 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 10:48 [PATCH 01/15] Skipping AT+CUAD sending for QUECTEL_EC2X vendor MaxLyubimov
2023-10-17 10:48 ` [PATCH 02/15] drivers: adding support for the SIMCom A7605E-H MaxLyubimov
2023-10-19  1:30   ` Denis Kenzior
2023-10-27  7:52     ` Любимов Максим
2023-10-29 21:16       ` Denis Kenzior
2023-10-17 10:48 ` [PATCH 03/15] plugins: " MaxLyubimov
2023-10-19  1:42   ` Denis Kenzior [this message]
2023-10-27  9:01     ` Любимов Максим
2023-10-29 20:41       ` Denis Kenzior
2023-10-30  7:11         ` Любимов Максим
2023-10-17 10:48 ` [PATCH 04/15] build: " MaxLyubimov
2023-10-17 10:48 ` [PATCH 05/15] drivers: quectel: Add radio settings MaxLyubimov
2023-10-19  1:49   ` Denis Kenzior
2023-10-17 10:48 ` [PATCH 06/15] build: Add quectel radio settings rules MaxLyubimov
2023-10-17 10:48 ` [PATCH 07/15] plugins: quectel: Add radio settings MaxLyubimov
2023-10-19  2:00   ` Denis Kenzior
2023-10-17 10:48 ` [PATCH 08/15] drivers: gemalto: Add models list MaxLyubimov
2023-10-17 10:48 ` [PATCH 09/15] plugins: gemalto: Include " MaxLyubimov
2023-10-17 10:48 ` [PATCH 10/15] plugins: udevng: Add support gemalto EHS5-E MaxLyubimov
2023-10-17 10:48 ` [PATCH 11/15] gemalto: radio-settings: Add support EHS5-E MaxLyubimov
2023-10-17 10:48 ` [PATCH 12/15] Fix PPP LCP Configure-Reject MaxLyubimov
2023-10-19  2:08   ` Denis Kenzior
2023-10-17 10:49 ` [PATCH 13/15] atmodem: added context deactivation event handling MaxLyubimov
2023-10-19  2:13   ` Denis Kenzior
2023-10-17 10:49 ` [PATCH 14/15] gatchat: added command completion by timeout MaxLyubimov
2023-10-19  2:21   ` Denis Kenzior
2023-10-27  9:45     ` Любимов Максим
2023-10-29 20:59       ` Denis Kenzior
2023-10-30  7:04         ` Любимов Максим
2023-10-30 14:29           ` Denis Kenzior
2023-10-17 10:49 ` [PATCH 15/15] ppp: message tracing MaxLyubimov
2023-10-19  2:22   ` Denis Kenzior
2023-10-27 10:01     ` Любимов Максим
2023-10-29 21:05       ` Denis Kenzior
2023-10-30  6:34         ` Любимов Максим
2023-10-30 14:30           ` Denis Kenzior
2023-10-19  1:28 ` [PATCH 01/15] Skipping AT+CUAD sending for QUECTEL_EC2X vendor Denis Kenzior

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=2d194620-ed30-4763-aced-ca89b450132c@gmail.com \
    --to=denkenz@gmail.com \
    --cc=m.lyubimov@aqsi.ru \
    --cc=ofono@lists.linux.dev \
    /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