[V3 PATCH 1/3] PPP: Fix transmit ACCM and receive ACCM setting issue

2011-02-12 Thread martin . xu
From: Martin Xu martin...@intel.com

Tramsmit ACCM and receive ACCM is mixed up.
According to RFC1662 Section 7.1, ACCM Configuration Option is
used to inform the peer which control characters MUST remain
mapped when the peer sends them.
---
 gatchat/ppp_lcp.c |   16 ++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
index 3a80a62..cc3e231 100644
--- a/gatchat/ppp_lcp.c
+++ b/gatchat/ppp_lcp.c
@@ -149,7 +149,13 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct 
pppcp_packet *packet)
while (ppp_option_iter_next(iter) == TRUE) {
switch (ppp_option_iter_get_type(iter)) {
case ACCM:
-   ppp_set_xmit_accm(pppcp_get_ppp(pppcp), 0);
+   /*
+* RFC1662 Section 7.1
+* The Configuration Option is used to inform the peer
+* which control characters MUST remain mapped when
+* the peer sends them.
+*/
+   ppp_set_recv_accm(pppcp_get_ppp(pppcp), 0);
break;
default:
break;
@@ -263,7 +269,13 @@ static enum rcr_result lcp_rcr(struct pppcp_data *pppcp,
while (ppp_option_iter_next(iter) == TRUE) {
switch (ppp_option_iter_get_type(iter)) {
case ACCM:
-   ppp_set_recv_accm(ppp,
+   /*
+* RFC1662 Section 7.1
+* The Configuration Option is used to inform the peer
+* which control characters MUST remain mapped when
+* the peer sends them.
+*/
+   ppp_set_xmit_accm(ppp,
get_host_long(ppp_option_iter_get_data(iter)));
break;
case AUTH_PROTO:
-- 
1.6.1.3

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[V3 PATCH 2/3] PPP: Use default ACCM (0xffffffff) to trasmit package

2011-02-12 Thread martin . xu
From: Martin Xu martin...@intel.com

Using my Huawei EM770W modem, if set ACCM as 0x, 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

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[V3 PATCH 3/3] Huawei: set Huawei EM770W modem device to 00

2011-02-12 Thread martin . xu
From: Martin Xu martin...@intel.com

Device 00 is ppp port. Setting it as 01, my Huawei EM770W modem PPP
connection can't work
---
 plugins/ofono.rules |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 111f071..7dec243 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -37,7 +37,7 @@ ATTRS{idVendor}==12d1, ATTRS{idProduct}==1401, 
ENV{OFONO_IFACE_NUM}==02, E
 ATTRS{idVendor}==12d1, ATTRS{idProduct}==1402, ENV{OFONO_IFACE_NUM}==00, 
ENV{OFONO_HUAWEI_TYPE}=Modem
 ATTRS{idVendor}==12d1, ATTRS{idProduct}==1402, ENV{OFONO_IFACE_NUM}==02, 
ENV{OFONO_HUAWEI_TYPE}=Pcui
 
-ATTRS{idVendor}==12d1, ATTRS{idProduct}==1404, ENV{OFONO_IFACE_NUM}==01, 
ENV{OFONO_HUAWEI_TYPE}=Modem
+ATTRS{idVendor}==12d1, ATTRS{idProduct}==1404, ENV{OFONO_IFACE_NUM}==00, 
ENV{OFONO_HUAWEI_TYPE}=Modem
 ATTRS{idVendor}==12d1, ATTRS{idProduct}==1404, ENV{OFONO_IFACE_NUM}==02, 
ENV{OFONO_HUAWEI_TYPE}=Pcui
 ATTRS{idVendor}==12d1, ATTRS{idProduct}==1404, ENV{OFONO_HUAWEI_VOICE}=1
 
-- 
1.6.1.3

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono