From: Stefano Babic <stefano.babic@babic.homelinux.org>
To: "Sjur Brændeland" <sjur.brandeland@stericsson.com>
Cc: netdev@vger.kernel.org,
Kim Lilliestierna XX <kim.xx.lilliestierna@stericsson.com>
Subject: Re: [7/8,RFC] CAIF Protocol Stack
Date: Thu, 08 Oct 2009 16:03:22 +0200 [thread overview]
Message-ID: <4ACDF12A.6030906@babic.homelinux.org> (raw)
In-Reply-To: <61D8D34BB13CFE408D154529C120E07902ED671E@eseldmw101.eemea.ericsson.se>
Sjur Brændeland wrote:
> If pser_tty->ops->write() returns zero it will loop infinetly.
> I guess the proper solution would be not to loop, but to implement a write_wakeup function for the tty...?
I discovered there is a production bug in the Makefile and the setup of
the extract function in cfcnfg_get_packet_funcs() is inconsistent.
Indeed, I traced the address of the extract function and I can find that
the address does not point to cfpkt_extract(), as I assumed.
The problem is due to the usage of the define CAIF_USE_SKB. This is used
in caif_layer.h, but some files (net/caif/*) are compiled with the macro
defined, while the drivers (drivers/net/caif/*) not.
Rather I did not get an "oops", because a valid pointer was set....but
to the wrong function !
I have also seen that CAIF_USE_SKB is not used in
cfpkt_get_packet_funcs, and this generates a problem if CAIF_USE_SKB is
not set, because the "fromnative" and "tonative" functions are always
set, even if they do not belong to the structure.
IMHO should be possible to get rid of the usage of CAIF_USE_SKB in the
structure definition (in caif_layer.h) and to provide always the same
structure definition in both case. I would prefer to set the values of
cfpkt_fromnative and cfpkt_tonative to NULL, instead of reducing the
size of the structure.
I mean, something like this:
void cfpkt_get_packet_funcs(caif_packet_funcs_t *f)
{
#ifdef CAIF_USE_SKB
f->cfpkt_fromnative = cfpkt_fromnative;
f->cfpkt_tonative = cfpkt_tonative;
#else
f->cfpkt_fromnative = NULL;
f->cfpkt_tonative = NULL;
#endif
I am not sure I understood the meaning of using this structure, because
at the moment the setup is fixed and I cannot find any point in code
where the structure is assigned to another set of functions. Probably
you arrange to have multiple choices in future, I can suppose.
What about to pass directly the pointer to the structure instead of
copying returning its value ? It seems not necessary to me, I changed
cfpkt_get_packet_funcs in this direction.
Meanwhile, it seems some bytes are sent now to the physical interface.
<caif_chropen:797, TRACE> [caif_chropen:797] WAIT FOR CONNECT RESPONSE
<caif_chropen:820, TRACE> caif_open: connect timed out
However, I get no connection, but probably this is another problem....
Best Regards,
Stefano Babic
--
stefano <stefano.babic@babic.homelinux.org>
GPG Key: 0x55814DDE
Fingerprint 4E85 2A66 4CBA 497A 2A7B D3BF 5973 F216 5581 4DDE
next prev parent reply other threads:[~2009-10-08 14:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-23 17:31 [PATCH 7/8] [RFC] CAIF Protocol Stack sjur.brandeland
2009-10-05 16:22 ` [7/8,RFC] " Stefano Babic
2009-10-06 19:41 ` Sjur Brændeland
2009-10-08 9:48 ` Stefano Babic
2009-10-08 14:03 ` Stefano Babic [this message]
2009-10-09 12:37 ` Sjur Brændeland
2009-10-10 16:09 ` Stefano Babic
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=4ACDF12A.6030906@babic.homelinux.org \
--to=stefano.babic@babic.homelinux.org \
--cc=kim.xx.lilliestierna@stericsson.com \
--cc=netdev@vger.kernel.org \
--cc=sjur.brandeland@stericsson.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