Hi Simon,
A colleague and I tried this with the following results: With the
older CS8900 card (10-base, used in the original Nios Ethernet Kit),
everything worked without errors. However, in the newer daughter card
(LAN91C111) we saw the same behavior.
This is really due to how we reset the two chips. With the original
Ethernet Kit, we would boot the MAC into "promiscuous mode" to receive
all packets, whether they were intended for our Nios board or not.
Primarily for reasons of efficiency (fewer interrupts, less CPU
overhead), we disabled promiscuous mode during bootup in the LAN91C111
driver. For applications such as nedk_bridge (where we just blindly
pass packets between the two Ethernet MACs), this causes some of the
packets to be igored, leading to the behavior you saw.
To get around this, call "set promiscuous" routine that is built into
our low-level MAC driver (lan91c111.c). Here is the modification to
nedk_bridge.c:
int main(void)
{
int result;
globals g; // How polite we are, the globals aren't really
global!
int i;
// Snip: code to reset each Ethernet MAC & do error check
// Set promiscuous "on" for "lan91c111_0"
nr_lan91c111_set_promiscuous(na_lan91c111_0,0,1);
// Set promiscuous "on" for "lan91c111_1"
nr_lan91c111_set_promiscuous(na_lan91c111_1,0,1);
// Rest of the code un-changed....
...
}
Good luck with your project.
Jesse Kempa
Altera Corp.
jkempa at altera dot com
"Simon Graham" <
[email protected]> wrote in message news:<Ud0Xa.104068$
[email protected]>...
> Hi,
>
> I'm trying to use stacked 100Mbit ethernet modules with the Nios Development
> Kit (Apex 20K) to create a secure firewall/bridge device for a university
> project.
>
> However, I can't even get the example application included with the kit,
> "nedk_bridge.c" to work.
>
> I have the nedk_bridge program running on the Apex board. Each ethernet
> module is connected via crossover cable to a PC. I then try doing a simple
> ping from one PC to the other and view the results using the Ethereal packet
> sniffer:
>
<snip>
> The 1st PC sends the ARP request, the 2nd PC receives it, replies to the
> request, but the 1st PC never recieves the reply. The Nios for some reason
> never sends the final packet. If I initiate the ping from the other PC, the
> same thing happens - the first three packets are sent, but the last one is
> dropped.
>
> Is the Nios even capable of functioning for the purpose I want to use it
> for? I noticed that the Nios always initializes the ethernet modules in
> half-duplex mode. Altera themselves give frustratingly little info about
> this.
>
> I am using Quartus II 2.2, SOPC builder 2.52 (Nios CPU version 2.1), and
> Nios EDK 2.0 (LAN91C111 modules).
>
> Thanks,
>
> Simon