Network Driver - Beta release- Doubts on the example code!!!

In the example code:
For reception,
A thread is created, which sleeps for 1 second and sends the packet up to
io-net, by which we can check the reception flow. Similarly, For the
transmission, How can i check the same?
I gave
$echo Hello > /dev/null.

But my Tx Fxn in the io_net_registrant_funcs_t (null_send_packets () is not
getting invoked.

Please help!!

Jalaja <jganapat@storage.com> wrote:

In the example code:
For reception,
A thread is created, which sleeps for 1 second and sends the packet up to
io-net, by which we can check the reception flow. Similarly, For the
transmission, How can i check the same?
I gave
$echo Hello > /dev/null.

/dev/null is a device exported from proc, not an entry in the filesystem
for talking to the NULL driver in the ddk. The only way to test the
transmission flow is to have something “over” the driver send down packet
data. Normally this would be the tcp or qnet stacks and they normally
talk via /dev/socket or an entry in /dev/io-net/.


chris

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

So, Can I do something like this to test the Transmission path, which is
similar to linux?

  1. Configure the interface using ifconfig.
  2. Do a ping from the command prompt on the ip address.

As per my understanding the driver interacts with the io-net module, which
in turn communicates with the upper level stacks, in this case TCP/IP. So,
Could you plz tell me whether the above steps will work, calling my Tx
function of my Network Driver??

Thanks
Jalaja

“Chris McKillop” <cdm@qnx.com> wrote in message
news:97jm0q$5im$1@nntp.qnx.com

Jalaja <> jganapat@storage.com> > wrote:

In the example code:
For reception,
A thread is created, which sleeps for 1 second and sends the packet up
to
io-net, by which we can check the reception flow. Similarly, For the
transmission, How can i check the same?
I gave
$echo Hello > /dev/null.


/dev/null is a device exported from proc, not an entry in the filesystem
for talking to the NULL driver in the ddk. The only way to test the
transmission flow is to have something “over” the driver send down packet
data. Normally this would be the tcp or qnet stacks and they normally
talk via /dev/socket or an entry in /dev/io-net/.


chris

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL

Will this work both for tiny tcpip and the bigger one??


“Chris McKillop” <cdm@qnx.com> wrote in message
news:97m3sr$k05$1@nntp.qnx.com

Jalaja <> jganapat@storage.com> > wrote:

So, Can I do something like this to test the Transmission path, which is
similar to linux?

  1. Configure the interface using ifconfig.
  2. Do a ping from the command prompt on the ip address.

As per my understanding the driver interacts with the io-net module,
which
in turn communicates with the upper level stacks, in this case TCP/IP.
So,
Could you plz tell me whether the above steps will work, calling my Tx
function of my Network Driver??


Yes. If you configure your interface to a given IP address and then
run ping the stack will push packets down io-net and into your driver.
If you let the ping run too long the ARP will timeout and you will
get “send_to -1: Host is Down” errors from ping (or something close
to that anyways).

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL

Jalaja <jganapat@storage.com> wrote:

So, Can I do something like this to test the Transmission path, which is
similar to linux?

  1. Configure the interface using ifconfig.
  2. Do a ping from the command prompt on the ip address.

As per my understanding the driver interacts with the io-net module, which
in turn communicates with the upper level stacks, in this case TCP/IP. So,
Could you plz tell me whether the above steps will work, calling my Tx
function of my Network Driver??

Yes. If you configure your interface to a given IP address and then
run ping the stack will push packets down io-net and into your driver.
If you let the ping run too long the ARP will timeout and you will
get “send_to -1: Host is Down” errors from ping (or something close
to that anyways).

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Jalaja <jganapat@storage.com> wrote:

Will this work both for tiny tcpip and the bigger one??

It should work the same. The only big difference is that you will
probably want to pass in your IP and network on the command line
with the tiny stack and use ifconfig with the big stack.

chris

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I have another question related to this. I am porting a Linux based PCI
driver into QNX.

  1. How can i register my interface name (say etho0, eth1) with the OS.
    In linux, it is done using reg_netdev (“eth0”).
    So, if i do a ifconfig x.x.x.x eth0 up and do a ping on x.x.x.x, it would
    call my drivers’ Tx Fxn.How can i do the same in QNX?

  2. If i do ifconfig, In linux, my drivers open entry point will get invoked.
    But Here in QNX, we don’t have the open entry point. Should I MOVE all the
    Open Entry point code in the init Fxn itself?

So, Are there only three major parts like Initialization, Tx and Rx in QNX
(Apart from shutdown)??

So, I am kindaa confused about the Tx Flow. I could not find any documents
related to this outwardly.




“Chris McKillop” <cdm@qnx.com> wrote in message
news:97m44j$k05$2@nntp.qnx.com

Jalaja <> jganapat@storage.com> > wrote:

Will this work both for tiny tcpip and the bigger one??


It should work the same. The only big difference is that you will
probably want to pass in your IP and network on the command line
with the tiny stack and use ifconfig with the big stack.

chris

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL

Jalaja <jganapat@storage.com> wrote:

  1. How can i register my interface name (say etho0, eth1) with the OS.
    In linux, it is done using reg_netdev (“eth0”).
    So, if i do a ifconfig x.x.x.x eth0 up and do a ping on x.x.x.x, it would
    call my drivers’ Tx Fxn.How can i do the same in QNX?

You only get to register the the first part under QNX. Traditionally
this would be en for an ethernet driver. Assuming you only had a single
driver loaded in io-net you would get en0 assigned to your device. Your
driver will know which number it will be assinged based on the lan value
returned from the register.


  1. If i do ifconfig, In linux, my drivers open entry point will get invoked.
    But Here in QNX, we don’t have the open entry point. Should I MOVE all the
    Open Entry point code in the init Fxn itself?

The ifconfig talks to the stack - it really isn’t a driver issue.

So, Are there only three major parts like Initialization, Tx and Rx in QNX
(Apart from shutdown)??

The major parts are broken out into the different files (if you look
at the source to the pcnet). Tx, Rx, events (interrupts/timers),
shutdown, devctl()'s, init, shutdown…you get the picture.

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<