2023-04-05 05:49:24

by D. Starke

[permalink] [raw]
Subject: [PATCH 3/9] tty: n_gsm: add missing description to gsm_config

From: Daniel Starke <[email protected]>

Currently, all available structure fields in gsmmux.h except those
for gsm_config are commented.

Fix this by adding appropriate comments to the not commented fields.

Signed-off-by: Daniel Starke <[email protected]>
---
include/uapi/linux/gsmmux.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/uapi/linux/gsmmux.h b/include/uapi/linux/gsmmux.h
index 33ee7b857c52..422a52e184b3 100644
--- a/include/uapi/linux/gsmmux.h
+++ b/include/uapi/linux/gsmmux.h
@@ -8,17 +8,17 @@

struct gsm_config
{
- unsigned int adaption;
- unsigned int encapsulation;
- unsigned int initiator;
- unsigned int t1;
- unsigned int t2;
- unsigned int t3;
- unsigned int n2;
- unsigned int mru;
- unsigned int mtu;
- unsigned int k;
- unsigned int i;
+ unsigned int adaption; /* Convergence layer type */
+ unsigned int encapsulation; /* Framing (0 = basic option, 1 = advanced option) */
+ unsigned int initiator; /* Initiator or responder */
+ unsigned int t1; /* Acknowledgment timer */
+ unsigned int t2; /* Response timer for multiplexer control channel */
+ unsigned int t3; /* Response timer for wake-up procedure */
+ unsigned int n2; /* Maximum number of retransmissions */
+ unsigned int mru; /* Maximum incoming frame payload size */
+ unsigned int mtu; /* Maximum outgoing frame payload size */
+ unsigned int k; /* Window size */
+ unsigned int i; /* Frame type (1 = UIH, 2 = UI) */
unsigned int unused[8]; /* Can not be used */
};

--
2.34.1


2023-04-05 08:32:07

by Ilpo Järvinen

[permalink] [raw]
Subject: Re: [PATCH 3/9] tty: n_gsm: add missing description to gsm_config

On Wed, 5 Apr 2023, D. Starke wrote:

> From: Daniel Starke <[email protected]>
>
> Currently, all available structure fields in gsmmux.h except those
> for gsm_config are commented.
>
> Fix this by adding appropriate comments to the not commented fields.
>
> Signed-off-by: Daniel Starke <[email protected]>
> ---
> include/uapi/linux/gsmmux.h | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/include/uapi/linux/gsmmux.h b/include/uapi/linux/gsmmux.h
> index 33ee7b857c52..422a52e184b3 100644
> --- a/include/uapi/linux/gsmmux.h
> +++ b/include/uapi/linux/gsmmux.h
> @@ -8,17 +8,17 @@
>
> struct gsm_config
> {
> - unsigned int adaption;
> - unsigned int encapsulation;
> - unsigned int initiator;
> - unsigned int t1;
> - unsigned int t2;
> - unsigned int t3;
> - unsigned int n2;
> - unsigned int mru;
> - unsigned int mtu;
> - unsigned int k;
> - unsigned int i;
> + unsigned int adaption; /* Convergence layer type */
> + unsigned int encapsulation; /* Framing (0 = basic option, 1 = advanced option) */
> + unsigned int initiator; /* Initiator or responder */
> + unsigned int t1; /* Acknowledgment timer */
> + unsigned int t2; /* Response timer for multiplexer control channel */
> + unsigned int t3; /* Response timer for wake-up procedure */
> + unsigned int n2; /* Maximum number of retransmissions */
> + unsigned int mru; /* Maximum incoming frame payload size */
> + unsigned int mtu; /* Maximum outgoing frame payload size */

I'm used to "payload" referring in networking context to "useful" part of
the frame but MTU/MRU probably includes headers too? Maybe just say "frame
size"?

> + unsigned int k; /* Window size */
> + unsigned int i; /* Frame type (1 = UIH, 2 = UI) */
> unsigned int unused[8]; /* Can not be used */
> };
>
>

--
i.

2023-04-06 05:36:07

by D. Starke

[permalink] [raw]
Subject: RE: [PATCH 3/9] tty: n_gsm: add missing description to gsm_config

> > + unsigned int mru; /* Maximum incoming frame payload size */
> > + unsigned int mtu; /* Maximum outgoing frame payload size */
>
> I'm used to "payload" referring in networking context to "useful" part of
> the frame but MTU/MRU probably includes headers too? Maybe just say
> "frame size"?

Just frame size is incorrect, as the basic/advanced option mode header and
byte stuffing do not count against this number. See 'gsm0_receive' and
'gsm1_receive' and also ch. 5.7.2 of the standard. The outgoing limit is
applied in 'gsm_dlci_data_output' and 'gsm_dlci_data_output_framed'.

Link: https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516

Best regards,
Daniel Starke