All of lore.kernel.org
 help / color / mirror / Atom feed
* [V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package
  2011-02-12  9:41 [V3 PATCH 1/3] PPP: Fix transmit ACCM and receive ACCM setting issue martin.xu
@ 2011-02-12  9:41 ` martin.xu
  2011-02-14 20:26   ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: martin.xu @ 2011-02-12  9:41 UTC (permalink / raw)
  To: ofono

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

From: Martin Xu <martin.xu@intel.com>

Using my Huawei EM770W modem, if set ACCM as 0x00000000, RXJ-
event breaks PPP link, after IP package transmit for a while.
Using default ACCM, the issue can be fixed.
I tested it at China Unicom networks.
---
 gatchat/ppp_lcp.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
index cc3e231..91a8b67 100644
--- a/gatchat/ppp_lcp.c
+++ b/gatchat/ppp_lcp.c
@@ -105,8 +105,7 @@ static void lcp_generate_config_options(struct lcp_data *lcp)
 
 static void lcp_reset_config_options(struct lcp_data *lcp)
 {
-	lcp->req_options = REQ_OPTION_ACCM;
-	lcp->accm = 0;
+	/* Using the default ACCM */
 
 	lcp_generate_config_options(lcp);
 }
@@ -147,6 +146,7 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet)
 	ppp_option_iter_init(&iter, packet);
 
 	while (ppp_option_iter_next(&iter) == TRUE) {
+		const guint8 *data = ppp_option_iter_get_data(&iter);
 		switch (ppp_option_iter_get_type(&iter)) {
 		case ACCM:
 			/*
@@ -155,7 +155,9 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet)
 			 * which control characters MUST remain mapped when
 			 * the peer sends them.
 			 */
-			ppp_set_recv_accm(pppcp_get_ppp(pppcp), 0);
+
+			ppp_set_recv_accm(pppcp_get_ppp(pppcp),
+					pppcpget_host_long(data));
 			break;
 		default:
 			break;
-- 
1.6.1.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package
  2011-02-12  9:41 ` [V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package martin.xu
@ 2011-02-14 20:26   ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2011-02-14 20:26 UTC (permalink / raw)
  To: ofono

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

Hi Martin,

On 02/12/2011 03:41 AM, martin.xu(a)intel.com wrote:
> From: Martin Xu <martin.xu@intel.com>
> 
> Using my Huawei EM770W modem, if set ACCM as 0x00000000, RXJ-
> event breaks PPP link, after IP package transmit for a while.
> Using default ACCM, the issue can be fixed.
> I tested it at China Unicom networks.
> ---
>  gatchat/ppp_lcp.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
> index cc3e231..91a8b67 100644
> --- a/gatchat/ppp_lcp.c
> +++ b/gatchat/ppp_lcp.c
> @@ -105,8 +105,7 @@ static void lcp_generate_config_options(struct lcp_data *lcp)
>  
>  static void lcp_reset_config_options(struct lcp_data *lcp)
>  {
> -	lcp->req_options = REQ_OPTION_ACCM;
> -	lcp->accm = 0;
> +	/* Using the default ACCM */
>  
>  	lcp_generate_config_options(lcp);
>  }
> @@ -147,6 +146,7 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet)
>  	ppp_option_iter_init(&iter, packet);
>  
>  	while (ppp_option_iter_next(&iter) == TRUE) {
> +		const guint8 *data = ppp_option_iter_get_data(&iter);
>  		switch (ppp_option_iter_get_type(&iter)) {
>  		case ACCM:
>  			/*
> @@ -155,7 +155,9 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet)
>  			 * which control characters MUST remain mapped when
>  			 * the peer sends them.
>  			 */
> -			ppp_set_recv_accm(pppcp_get_ppp(pppcp), 0);
> +
> +			ppp_set_recv_accm(pppcp_get_ppp(pppcp),
> +					pppcpget_host_long(data));

make --no-print-directory all-am
  CC     gatchat/ppp_lcp.o
cc1: warnings being treated as errors
gatchat/ppp_lcp.c: In function ‘lcp_rca’:
gatchat/ppp_lcp.c:160: error: implicit declaration of function
‘pppcpget_host_long’
make[1]: *** [gatchat/ppp_lcp.o] Error 1
make: *** [all] Error 2


>  			break;
>  		default:
>  			break;

Regards,
-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package
@ 2011-02-15  6:53 martin.xu
  2011-02-16 18:02 ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: martin.xu @ 2011-02-15  6:53 UTC (permalink / raw)
  To: ofono

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

From: Martin Xu <martin.xu@intel.com>

Using my Huawei EM770W modem, if set ACCM as 0x00000000, RXJ-
event breaks PPP link, after IP package transmit for a while.
Using default ACCM, the issue can be fixed.
I tested it at China Unicom networks.
---
 gatchat/ppp_lcp.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
index cc3e231..91a8b67 100644
--- a/gatchat/ppp_lcp.c
+++ b/gatchat/ppp_lcp.c
@@ -105,8 +105,7 @@ static void lcp_generate_config_options(struct lcp_data *lcp)
 
 static void lcp_reset_config_options(struct lcp_data *lcp)
 {
-	lcp->req_options = REQ_OPTION_ACCM;
-	lcp->accm = 0;
+	/* Using the default ACCM */
 
 	lcp_generate_config_options(lcp);
 }
@@ -147,6 +146,7 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet)
 	ppp_option_iter_init(&iter, packet);
 
 	while (ppp_option_iter_next(&iter) == TRUE) {
+		const guint8 *data = ppp_option_iter_get_data(&iter);
 		switch (ppp_option_iter_get_type(&iter)) {
 		case ACCM:
 			/*
@@ -155,7 +155,9 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet)
 			 * which control characters MUST remain mapped when
 			 * the peer sends them.
 			 */
-			ppp_set_recv_accm(pppcp_get_ppp(pppcp), 0);
+
+			ppp_set_recv_accm(pppcp_get_ppp(pppcp),
+					get_host_long(data));
 			break;
 		default:
 			break;
-- 
1.6.1.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package
  2011-02-15  6:53 [V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package martin.xu
@ 2011-02-16 18:02 ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2011-02-16 18:02 UTC (permalink / raw)
  To: ofono

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

Hi Martin,

On 02/15/2011 12:53 AM, martin.xu(a)intel.com wrote:
> From: Martin Xu <martin.xu@intel.com>
> 
> Using my Huawei EM770W modem, if set ACCM as 0x00000000, RXJ-
> event breaks PPP link, after IP package transmit for a while.
> Using default ACCM, the issue can be fixed.
> I tested it at China Unicom networks.
> ---
>  gatchat/ppp_lcp.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-16 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15  6:53 [V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package martin.xu
2011-02-16 18:02 ` Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2011-02-12  9:41 [V3 PATCH 1/3] PPP: Fix transmit ACCM and receive ACCM setting issue martin.xu
2011-02-12  9:41 ` [V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package martin.xu
2011-02-14 20:26   ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.