netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Martinez, Ricardo" <ricardo.martinez@linux.intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Netdev <netdev@vger.kernel.org>,
	linux-wireless@vger.kernel.org, kuba@kernel.org,
	davem@davemloft.net, johannes@sipsolutions.net,
	ryazanov.s.a@gmail.com, loic.poulain@linaro.org,
	m.chetan.kumar@intel.com, chandrashekar.devegowda@intel.com,
	linuxwwan@intel.com, chiranjeevi.rapolu@linux.intel.com,
	haijun.liu@mediatek.com, amir.hanania@intel.com,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	dinesh.sharma@intel.com, eliot.lee@intel.com,
	moises.veleta@intel.com, pierre-louis.bossart@intel.com,
	muralidharan.sethuraman@intel.com,
	Soumya.Prakash.Mishra@intel.com, sreehari.kancharla@intel.com,
	madhusmita.sahu@intel.com
Subject: Re: [PATCH net-next v6 05/13] net: wwan: t7xx: Add control port
Date: Wed, 13 Apr 2022 16:00:42 -0700	[thread overview]
Message-ID: <a3c98699-c9f1-ff96-1c66-5bb93e20b6ff@linux.intel.com> (raw)
In-Reply-To: <20ed7cce-6ba0-29fa-2cb0-89b02f31ce6f@linux.intel.com>


On 4/12/2022 5:04 AM, Ilpo Järvinen wrote:
> On Thu, 7 Apr 2022, Ricardo Martinez wrote:
>
>> From: Haijun Liu <haijun.liu@mediatek.com>
>>
>> Control Port implements driver control messages such as modem-host
>> handshaking, controls port enumeration, and handles exception messages.
>>
>> The handshaking process between the driver and the modem happens during
>> the init sequence. The process involves the exchange of a list of
>> supported runtime features to make sure that modem and host are ready
>> to provide proper feature lists including port enumeration. Further
>> features can be enabled and controlled in this handshaking process.
>>
>> Signed-off-by: Haijun Liu <haijun.liu@mediatek.com>
>> Signed-off-by: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
>> Co-developed-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
>> Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
>>
>> >From a WWAN framework perspective:
>> Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
>>
>> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>> +static int t7xx_prepare_device_rt_data(struct t7xx_sys_info *core, struct device *dev,
>> +				       void *data)
>> +{
>> +	struct feature_query *md_feature = data;
>> +	struct mtk_runtime_feature *rt_feature;
>> +	unsigned int i, rt_data_len = 0;
>> +	struct sk_buff *skb;
>> +
>> +	/* Parse MD runtime data query */
>> +	if (le32_to_cpu(md_feature->head_pattern) != MD_FEATURE_QUERY_ID ||
>> +	    le32_to_cpu(md_feature->tail_pattern) != MD_FEATURE_QUERY_ID) {
>> +		dev_err(dev, "Invalid feature pattern: head 0x%x, tail 0x%x\n",
>> +			le32_to_cpu(md_feature->head_pattern),
>> +			le32_to_cpu(md_feature->tail_pattern));
>> +		return -EINVAL;
>> +	}
>> +
>> +	for (i = 0; i < FEATURE_COUNT; i++) {
>> +		if (FIELD_GET(FEATURE_MSK, md_feature->feature_set[i]) !=
>> +		    MTK_FEATURE_MUST_BE_SUPPORTED)
>> +			rt_data_len += sizeof(*rt_feature);
>> +	}
>> +
>> +	skb = t7xx_ctrl_alloc_skb(rt_data_len);
>> +	if (!skb)
>> +		return -ENOMEM;
>> +
>> +	rt_feature  = skb_put(skb, rt_data_len);
>> +	memset(rt_feature, 0, rt_data_len);
>> +
>> +	/* Fill runtime feature */
>> +	for (i = 0; i < FEATURE_COUNT; i++) {
>> +		u8 md_feature_mask = FIELD_GET(FEATURE_MSK, md_feature->feature_set[i]);
>> +
>> +		if (md_feature_mask == MTK_FEATURE_MUST_BE_SUPPORTED)
>> +			continue;
>> +
>> +		rt_feature->feature_id = i;
>> +		if (md_feature_mask == MTK_FEATURE_DOES_NOT_EXIST)
>> +			rt_feature->support_info = md_feature->feature_set[i];
>> +
>> +		rt_feature++;
>> +	}
>> +
>> +	/* Send HS3 message to device */
>> +	t7xx_port_send_ctl_skb(core->ctl_port, skb, CTL_ID_HS3_MSG, 0);
>> +	return 0;
>> +}
>> +
>> +static int t7xx_parse_host_rt_data(struct t7xx_fsm_ctl *ctl, struct t7xx_sys_info *core,
>> +				   struct device *dev, void *data, int data_length)
>> +{
>> +	enum mtk_feature_support_type ft_spt_st, ft_spt_cfg;
>> +	struct mtk_runtime_feature *rt_feature;
>> +	int i, offset;
>> +
>> +	offset = sizeof(struct feature_query);
>> +	for (i = 0; i < FEATURE_COUNT && offset < data_length; i++) {
>> +		rt_feature = data + offset;
>> +		offset += sizeof(*rt_feature) + le32_to_cpu(rt_feature->data_len);
>> +
>> +		ft_spt_cfg = FIELD_GET(FEATURE_MSK, core->feature_set[i]);
>> +		if (ft_spt_cfg != MTK_FEATURE_MUST_BE_SUPPORTED)
>> +			continue;
> Do MTK_FEATURE_MUST_BE_SUPPORTED appear in the host rt_features
> (unlike in the device rt_features)?
>
Yes, in the first step of the handshake protocol, the host creates its
rt_feature list with the proper support label and sends the list to the device.
t7xx_parse_host_rt_data() is part of the handshake step 2, the host received the
response from the device and now it will verify that the host rt_features
labeled as MTK_FEATURE_MUST_BE_SUPPORTED are also supported in the device rt_features.


  reply	other threads:[~2022-04-13 23:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 22:36 [PATCH net-next v6 00/13] net: wwan: t7xx: PCIe driver for MediaTek M.2 modem Ricardo Martinez
2022-04-07 22:36 ` [PATCH net-next v6 01/13] list: Add list_next_entry_circular() and list_prev_entry_circular() Ricardo Martinez
2022-04-07 22:36 ` [PATCH net-next v6 02/13] net: wwan: t7xx: Add control DMA interface Ricardo Martinez
2022-04-21 11:55   ` Ilpo Järvinen
2022-04-25 23:52   ` Sergey Ryazanov
2022-04-26  0:19   ` Sergey Ryazanov
2022-04-27 12:34     ` Loic Poulain
2022-04-27 13:17       ` Sergey Ryazanov
2022-04-07 22:36 ` [PATCH net-next v6 03/13] net: wwan: t7xx: Add core components Ricardo Martinez
2022-04-11 10:18   ` Ilpo Järvinen
2022-04-25 23:52   ` Sergey Ryazanov
2022-04-07 22:36 ` [PATCH net-next v6 04/13] net: wwan: t7xx: Add port proxy infrastructure Ricardo Martinez
2022-04-12 11:13   ` Ilpo Järvinen
2022-04-25 23:53   ` Sergey Ryazanov
     [not found]     ` <MWHPR1101MB231920A2152DC2FC7B2FBB3CE0FB9@MWHPR1101MB2319.namprd11.prod.outlook.com>
2022-04-26 23:06       ` Sergey Ryazanov
     [not found]         ` <MWHPR1101MB2319F7A27B51ECD998855494E0FA9@MWHPR1101MB2319.namprd11.prod.outlook.com>
2022-04-27  1:35           ` Sergey Ryazanov
2022-04-07 22:36 ` [PATCH net-next v6 05/13] net: wwan: t7xx: Add control port Ricardo Martinez
2022-04-12 12:04   ` Ilpo Järvinen
2022-04-13 23:00     ` Martinez, Ricardo [this message]
2022-04-25 23:54   ` Sergey Ryazanov
2022-04-07 22:36 ` [PATCH net-next v6 06/13] net: wwan: t7xx: Add AT and MBIM WWAN ports Ricardo Martinez
2022-04-12 12:54   ` Ilpo Järvinen
2022-04-25 23:54   ` Sergey Ryazanov
2022-04-07 22:36 ` [PATCH net-next v6 07/13] net: wwan: t7xx: Data path HW layer Ricardo Martinez
2022-04-12 13:01   ` Ilpo Järvinen
2022-04-25 23:54   ` Sergey Ryazanov
2022-04-07 22:36 ` [PATCH net-next v6 08/13] net: wwan: t7xx: Add data path interface Ricardo Martinez
2022-04-21 10:54   ` Ilpo Järvinen
2022-04-25 23:55   ` Sergey Ryazanov
2022-04-26  7:29     ` Ilpo Järvinen
2022-04-26  8:00       ` Sergey Ryazanov
2022-05-02 16:51         ` Martinez, Ricardo
2022-05-02 17:40           ` Sergey Ryazanov
2022-04-07 22:36 ` [PATCH net-next v6 09/13] net: wwan: t7xx: Add WWAN network interface Ricardo Martinez
2022-04-21 10:56   ` Ilpo Järvinen
2022-04-25 23:55   ` Sergey Ryazanov
2022-04-07 22:36 ` [PATCH net-next v6 10/13] net: wwan: t7xx: Introduce power management Ricardo Martinez
2022-04-21 11:01   ` Ilpo Järvinen
2022-04-07 22:36 ` [PATCH net-next v6 11/13] net: wwan: t7xx: Runtime PM Ricardo Martinez
2022-04-21 11:03   ` Ilpo Järvinen
2022-04-07 22:36 ` [PATCH net-next v6 12/13] net: wwan: t7xx: Device deep sleep lock/unlock Ricardo Martinez
2022-04-21 11:47   ` Ilpo Järvinen
2022-04-07 22:36 ` [PATCH net-next v6 13/13] net: wwan: t7xx: Add maintainers and documentation Ricardo Martinez
2022-04-21 12:01   ` Ilpo Järvinen
2022-04-25 23:55   ` Sergey Ryazanov
2022-04-08  4:15 ` [PATCH net-next v6 00/13] net: wwan: t7xx: PCIe driver for MediaTek M.2 modem Jakub Kicinski

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=a3c98699-c9f1-ff96-1c66-5bb93e20b6ff@linux.intel.com \
    --to=ricardo.martinez@linux.intel.com \
    --cc=Soumya.Prakash.Mishra@intel.com \
    --cc=amir.hanania@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=chandrashekar.devegowda@intel.com \
    --cc=chiranjeevi.rapolu@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=dinesh.sharma@intel.com \
    --cc=eliot.lee@intel.com \
    --cc=haijun.liu@mediatek.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linuxwwan@intel.com \
    --cc=loic.poulain@linaro.org \
    --cc=m.chetan.kumar@intel.com \
    --cc=madhusmita.sahu@intel.com \
    --cc=moises.veleta@intel.com \
    --cc=muralidharan.sethuraman@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pierre-louis.bossart@intel.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=sreehari.kancharla@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).