iov_base to iov_phys

Hi,

I read it few times and still I haven’t figured out how to fill the iov_phys
field while allocating new buffer.
Meaning I’m doing:

MYnet_iov->iov_base = (void*)malloc(DataSize);
MYnet_iov->iov_phys = ???


Help ?!?

Benzy Gabay
R&D
Everbee Wireless
mailto:bgabay@everbee.com
tel. +972-9-956-0135
fax. +972-9-955-9654

Ben Gabay <bgabay@everbee.com> wrote:
: Hi,

: I read it few times and still I haven’t figured out how to fill the iov_phys
: field while allocating new buffer.
: Meaning I’m doing:

: MYnet_iov->iov_base = (void*)malloc(DataSize);
: MYnet_iov->iov_phys = ???

You shouldn’t use malloc(). Use the allocator provided by io-net.

iov_base = ion->alloc(size, 0);
iov_phys = ion->mphys(iov_base);

-seanb

Benzy Gabay <bgabay@everbee.com> wrote:

Hi,

you said:
You shouldn’t use malloc(). Use the allocator provided by io-net.

But inside the receive/transmit registries functions I don’t have the
contact of io-net, where can I get it from? or is it a global static
variable?

It is passed to your init() function, it’s your resposibility to store
it, and use it later.

-xtang

Benzy Gabay,
R&D
Everbee Wireless
6 Galgalei Haplada, POB 12899
Herzlia Pituah 46733, Israel
Tel: + 972 9 956 01 35 Fax: + 972 9 955 96 54
mailto:> bgabay@everbee.com
icq: 3294860
msn: > benzyg@hotmail.com

“Sean Boudreau” <> seanb@qnx.com> > wrote in message
news:9ice9s$bi2$> 1@nntp.qnx.com> …
Ben Gabay <> bgabay@everbee.com> > wrote:
: Hi,

: I read it few times and still I haven’t figured out how to fill the
iov_phys
: field while allocating new buffer.
: Meaning I’m doing:

: MYnet_iov->iov_base = (void*)malloc(DataSize);
: MYnet_iov->iov_phys = ???

You shouldn’t use malloc(). Use the allocator provided by io-net.

iov_base = ion->alloc(size, 0);
iov_phys = ion->mphys(iov_base);

-seanb

Hi,

you said:

You shouldn’t use malloc(). Use the allocator provided by io-net.

But inside the receive/transmit registries functions I don’t have the
contact of io-net, where can I get it from? or is it a global static
variable?

Benzy Gabay,
R&D
Everbee Wireless
6 Galgalei Haplada, POB 12899
Herzlia Pituah 46733, Israel
Tel: + 972 9 956 01 35 Fax: + 972 9 955 96 54
mailto:bgabay@everbee.com
icq: 3294860
msn: benzyg@hotmail.com

“Sean Boudreau” <seanb@qnx.com> wrote in message
news:9ice9s$bi2$1@nntp.qnx.com

Ben Gabay <> bgabay@everbee.com> > wrote:
: Hi,

: I read it few times and still I haven’t figured out how to fill the
iov_phys
: field while allocating new buffer.
: Meaning I’m doing:

: MYnet_iov->iov_base = (void*)malloc(DataSize);
: MYnet_iov->iov_phys = ???

You shouldn’t use malloc(). Use the allocator provided by io-net.

iov_base = ion->alloc(size, 0);
iov_phys = ion->mphys(iov_base);

-seanb