Re: undi for 10G Nic

Luca <[email protected]> Thu, 8 Oct 2009 16:50:37 -0700
Newsgroups gmane.network.etherboot.user
Message-ID <[email protected]>
I had two NICs, both of them with undi. Using undi.iso I noticed that the
first NIC was correctly initialized. The second one was disabled so of
course the initialization process failed. During the init process for the
second NIC though, the variable undinet_entry_point was set by the function
undinet_probe with values relative to the second NIC (the disabled one).
So when after I did the ifopen for the first NIC, that failed.

This is how I changed the function  static int undinet_open ( struct
net_device *netdev )  in arch/i386/drivers/net/undinet.c and fixed the
problem.


static int undinet_open ( struct net_device *netdev ) {
    struct undi_nic *undinic = netdev->priv;
    struct s_PXENV_UNDI_SET_STATION_ADDRESS undi_set_address;
    struct s_PXENV_UNDI_OPEN undi_open;
    int rc;

   //Added the following three lines
    struct undi_device *undi =
        container_of ( netdev->dev, struct undi_device, dev );
    undinet_entry_point = undi->entry;

    /* Hook interrupt service routine and enable interrupt */
    undinet_hook_isr ( undinic->irq );
    enable_irq ( undinic->irq );
    send_eoi ( undinic->irq );


It works now for me.

Thanks,
 Luca


On Thu, Oct 8, 2009 at 12:10 PM, Luca <[email protected]> wrote:

> I have finally found the problem. When there is more than one NIC,
> undinet_entry_point contains the values of the last NIC (its value is set by
> the function undinet_probe).
>
> In my case, the second NIC is disabled so the undinet_probe for the second
> NIC fails, yet undinet_entry_point cointains the values for this second NIC.
>
> When I do ifopen for the first NIC (which has been initialized correctly by
> undinet_probe) the undinet_call is invoked.
>
> undinet_call uses undinet_entry_point which contains the values for the
> second NIC, so the ifopen for the first NIC fails.
>
> Setting undinet_entry_point to the correct values (i.e. the ones referring
> to the right NIC), ifopen works.
>
> Once I clean up the code, I can provide the mailing list with the fix if
> you guys are interested.
>
> Thanks,
>  Luca
>
>
> On Thu, Oct 8, 2009 at 9:48 AM, Luca <[email protected]> wrote:
>
>> I'm using undi.iso.
>>
>> I noticed that the problem is due because I have two NICs, and both of
>> them have undi support. If I don't execute the function undinet_probe for
>> the second NIC, everything works (I do not see any error).
>>
>> That's the first time I use gPXE on a workstation with two NICs with undi
>> support. Has anyone had the same problem?
>>
>> Thanks.
>>
>> Luca
>>
>>
>> On Thu, Oct 8, 2009 at 4:03 AM, Stefan Hajnoczi <[email protected]>wrote:
>>
>>> On Wed, Oct 7, 2009 at 7:27 PM, Luca <[email protected]> wrote:
>>> > Actually the PXENV_UNDI_INITIALIZE works fine.
>>> > I do not get any error. gPXE finds the NIC and initializes it but when
>>> I try
>>> > to do ifopen I see that undinet_call with PXENV_UNDI_OPEN fails with
>>> error
>>> > 0x6a (i.e. invalid state)
>>>
>>> Which gPXE image are you using (e.g. undionly.usb)?
>>>
>>> Stefan
>>>
>>
>>
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

_______________________________________________
Etherboot-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/etherboot-discuss