<p dir="ltr"></p>
<p dir="ltr">On Aug 4, 2016 6:27 PM, "Pavel Pisa" <<a href="mailto:ppisa4lists@pikron.com">ppisa4lists@pikron.com</a>> wrote:<br>
><br>
> Hello Joel,<br>
><br>
> On Thursday 04 of August 2016 23:53:16 Joel Sherrill wrote:<br>
> > This sounds and looks reasonable.<br>
><br>
> If you think, that it is OK, I can push that tomorrow<br>
> morning. I am not sure if isOn is really not used now/can be NULL.<br>
> Other option is to define these functions as NoOp<br>
> and return one (or zero?) always.<br>
><br>
> Have you some opinion there?</p>
<p dir="ltr">I have no idea honestly but it needs to move to the newer interrupt model so when we finally get APIC support, there isn't a larger change set.</p>
<p dir="ltr">Fwiw I would expect that the old stack is still testable with the old Intel NIC driver and qemu for PC but the stack needs newer drivers for any modern NIC.</p>
<p dir="ltr">> I have tried to test integrated networking to help<br>
> Saeed with dlopen and networking. I have tested<br>
> x86 as sidestep but I have not been too much sucesfull.<br>
><br>
> For<br>
><br>
> static struct rtems_bsdnet_ifconfig netdriver_config = {<br>
> .name = (char *)BSP_NE2000_NETWORK_DRIVER_NAME,<br>
> .attach = BSP_NE2000_NETWORK_DRIVER_ATTACH,<br>
> .next = NULL,<br>
> .ip_address = "192.168.3.66",<br>
> .ip_netmask = "255.255.255.0",<br>
> .hardware_address = ethernet_address,<br>
> .ignore_broadcast = 0,<br>
> .mtu = 0,<br>
> .rbuf_count = 0,<br>
> .xbuf_count = 0,<br>
> .port = 0x300,<br>
> .irno = 9,<br>
> .bpar = 0,<br>
> .drv_ctrl = NULL<br>
> };<br>
><br>
> struct rtems_bsdnet_config rtems_bsdnet_config = {<br>
> .ifconfig = &netdriver_config,<br>
> /* .bootp = rtems_bsdnet_do_bootp,*/<br>
> /* .bootp = rtems_bsdnet_do_dhcp,*/<br>
> .bootp = rtems_bsdnet_do_dhcp_failsafe,<br>
> .network_task_priority = 0, /* 100 */<br>
> .mbuf_bytecount = 256 * 1024, /* 64 kbytes */<br>
> .mbuf_cluster_bytecount = 256 * 1024, /* 128 kbytes */<br>
> .hostname = NULL,<br>
> .domainname = NULL,<br>
> .gateway = "192.168.3.1",<br>
> .log_host = NULL,<br>
> .name_server = { "NULL" },<br>
> .ntp_server = { "NULL" },<br>
> .sb_efficiency = 0,<br>
> .udp_tx_buf_size = 0, /* UDP TX: 9216 bytes */<br>
> .udp_rx_buf_size = 0, /* UDP RX: 40 * (1024 + sizeof(struct sockaddr_in)) */<br>
> .tcp_tx_buf_size = 0, /* TCP TX: 16 * 1024 bytes */<br>
> .tcp_rx_buf_size = 0, /* TCP TX: 16 * 1024 bytes */<br>
> };<br>
><br>
> and<br>
><br>
> qemu-system-x86_64 -enable-kvm -kernel $APP_BINARY \<br>
> -vga cirrus \<br>
> -net nic,vlan=0,macaddr=00:80:7F:22:61:77,model=ne2k_isa -net user,vlan=0 \<br>
> -append "--console=/dev/com1" \<br>
> -serial stdio \<br>
><br>
> I get address from internal QEMU DHCP server but TFTP does not<br>
> seem to work even that I use same QEMU setup with user (internal<br>
> UDP/TCP only) NAT successfully for other systems.<br>
><br>
> I would like to switch to PCI, so I have tested<br>
><br>
> int rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching);<br>
><br>
> static struct rtems_bsdnet_ifconfig netdriver_config = {<br>
> .name = "fxp1",<br>
> .attach = rtems_fxp_attach,<br>
><br>
><br>
> qemu-system-x86_64 -enable-kvm -kernel $APP_BINARY \<br>
> -vga cirrus \<br>
> -net nic,vlan=0,model=i82557b -net user,vlan=0 \<br>
> -append "--console=/dev/com1" \<br>
> -serial stdio \<br>
><br>
> which finds card on PCI but the it does not work.<br>
> Is it possible that interrupts are not correctly<br>
> routed, registered?<br>
><br>
> Can be IRQ number obtained from<br>
><br>
> bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,<br>
> RF_SHAREABLE | RF_ACTIVE);<br>
><br>
> used directly in<br>
><br>
> BSP_install_rtems_irq_handler<br>
><br>
> or<br>
><br>
> rtems_interrupt_handler_install<br>
><br>
> or some mapping is required?<br>
><br>
> Has nomebody tested some of these PCI drivers with QEMU?<br>
><br>
><br>
> Best wishes,<br>
><br>
> Pavel<br>
><br>
> > The old stack needs to be moved into its own build tree.<br>
> ><br>
> > On Aug 4, 2016 5:43 PM, "Pavel Pisa" <<a href="mailto:ppisa4lists@pikron.com">ppisa4lists@pikron.com</a>> wrote:<br>
> > > This change is required to build RTEMS with classic "--enable-networking"<br>
> > > and link applications/tests which reference RTEMS_BSP_NETWORK_DRIVER_<br>
> > > ATTACH.<br>
> > > ---<br>
> > > c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c | 10 +---------<br>
> > > c/src/libchip/network/dec21140.c | 7 +------<br>
> > > c/src/libchip/network/elnk.c | 12 +-----------<br>
> > > c/src/libchip/network/if_dc.c | 9 +--------<br>
> > > c/src/libchip/network/if_fxp.c | 7 +------<br>
> > > 5 files changed, 5 insertions(+), 40 deletions(-)<br>
> > ><br>
> > > Discussion: I have stumbled over problem to build some external tests<br>
> > > for i386 because original integrated Ethernet drivers cannot be linked<br>
> > > into application. Even that libbsd is a future goal it worth to correct<br>
> > > this at least for testing. It seems that original i8259s concept<br>
> > > handling is finally overcome by generic approach.<br>
> > > I hope that field isOn is no longer referenced by any architecture<br>
> > > or if referenced, that NULL is valid option.<br>
> > ><br>
> > > I am leaving for next week so I would not push this change probably.<br>
> > ><br>
> > > In the longer perspective, I think that even for these deprecated<br>
> > > drivers rtems_interrupt_handler_install generic concept could/should be<br>
> > > used. If it is agreed that it is right change then I can prepare patch<br>
> > > for that in future.<br>
> > ><br>
> > > But I think that correction of the builds in meantime worth<br>
> > > to be pushed.<br>
> > ><br>
> > > diff --git a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c<br>
> > > b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c<br>
> > > index 5a13b29..d757e27 100644<br>
> > > --- a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c<br>
> > > +++ b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c<br>
> > > @@ -428,14 +428,6 @@ ne_interrupt_off (const rtems_irq_connect_data *irq)<br>
> > > outport_byte (sc->port + IMR, 0);<br>
> > > }<br>
> > ><br>
> > > -/* Return whether NE2000 interrupts are on. */<br>
> > > -<br>
> > > -static int<br>
> > > -ne_interrupt_is_on (const rtems_irq_connect_data *irq)<br>
> > > -{<br>
> > > - return BSP_irq_enabled_at_i8259s (irq->name);<br>
> > > -}<br>
> > > -<br>
> > > /* Initialize the NE2000 hardware. */<br>
> > ><br>
> > > static void<br>
> > > @@ -526,7 +518,7 @@ ne_init_irq_handler(int irno)<br>
> > > irq.handle = (rtems_irq_hdl) irno;<br>
> > > irq.on = ne_interrupt_on;<br>
> > > irq.off = ne_interrupt_off;<br>
> > > - irq.isOn = ne_interrupt_is_on;<br>
> > > + irq.isOn = NULL;<br>
> > ><br>
> > > if (!BSP_install_rtems_irq_handler (&irq))<br>
> > > rtems_panic ("Can't attach NE interrupt handler for irq %d\n",<br>
> > > irno); diff --git a/c/src/libchip/network/dec21140.c<br>
> > > b/c/src/libchip/network/ dec21140.c<br>
> > > index aa6be29..3bfc91d 100644<br>
> > > --- a/c/src/libchip/network/dec21140.c<br>
> > > +++ b/c/src/libchip/network/dec21140.c<br>
> > > @@ -345,11 +345,6 @@ static void no_op(const rtems_irq_connect_data* irq)<br>
> > > return;<br>
> > > }<br>
> > ><br>
> > > -static int dec21140IsOn(const rtems_irq_connect_data* irq)<br>
> > > -{<br>
> > > - return BSP_irq_enabled_at_i8259s (irq->name);<br>
> > > -}<br>
> > > -<br>
> > > /*<br>
> > > * DEC21140 interrupt handler<br>
> > > */<br>
> > > @@ -539,7 +534,7 @@ dec21140Enet_initialize_hardware (struct<br>
> > > dec21140_softc *sc)<br>
> > > sc->irqInfo.hdl = (rtems_irq_hdl)dec21140Enet_<br>
> > > interrupt_handler_entry;<br>
> > > sc->irqInfo.on = no_op;<br>
> > > sc->irqInfo.off = no_op;<br>
> > > - sc->irqInfo.isOn = dec21140IsOn;<br>
> > > + sc->irqInfo.isOn = NULL;<br>
> > ><br>
> > > #ifdef DEC_DEBUG<br>
> > > printk( "dec2114x: Installing IRQ %d\n", sc->irqInfo.name );<br>
> > > diff --git a/c/src/libchip/network/elnk.c b/c/src/libchip/network/elnk.c<br>
> > > index 06ece5b..1c63e35 100644<br>
> > > --- a/c/src/libchip/network/elnk.c<br>
> > > +++ b/c/src/libchip/network/elnk.c<br>
> > > @@ -1875,16 +1875,6 @@ static void no_op(const rtems_irq_connect_data*<br>
> > > irq)<br>
> > ><br>
> > ><br>
> > ><br>
> > > -static int elnkIsOn(const rtems_irq_connect_data* irq)<br>
> > > -{<br>
> > > - return BSP_irq_enabled_at_i8259s (irq->name);<br>
> > > -}<br>
> > > -<br>
> > > -<br>
> > > -<br>
> > > -<br>
> > > -<br>
> > > -<br>
> > > static void<br>
> > > elnk_start_txchain( struct elnk_softc *sc, struct TXMD *chainhead )<br>
> > > {<br>
> > > @@ -2214,7 +2204,7 @@ elnk_initialize_hardware (struct elnk_softc *sc)<br>
> > > sc->irqInfo.hdl = (rtems_irq_hdl)elnk_interrupt_handler_entry;<br>
> > > sc->irqInfo.on = no_op;<br>
> > > sc->irqInfo.off = no_op;<br>
> > > - sc->irqInfo.isOn = elnkIsOn;<br>
> > > + sc->irqInfo.isOn = NULL;<br>
> > ><br>
> > > if( sc->irqInfo.name != 255 )<br>
> > > {<br>
> > > diff --git a/c/src/libchip/network/if_dc.c<br>
> > > b/c/src/libchip/network/if_dc.c index 1563be5..24f2fc1 100644<br>
> > > --- a/c/src/libchip/network/if_dc.c<br>
> > > +++ b/c/src/libchip/network/if_dc.c<br>
> > > @@ -1893,13 +1893,6 @@ nop(const rtems_irq_connect_data* unused)<br>
> > > {<br>
> > > }<br>
> > ><br>
> > > -static int<br>
> > > -decISON(const rtems_irq_connect_data* irq)<br>
> > > -{<br>
> > > - return (BSP_irq_enabled_at_i8259s(irq->name));<br>
> > > -}<br>
> > > -<br>
> > > -<br>
> > > /*<br>
> > > * Attach the interface. Allocate softc structures, do ifmedia<br>
> > > * setup and ethernet/BPF attach.<br>
> > > @@ -2023,7 +2016,7 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig<br>
> > > *config, int attaching)<br>
> > > sc->irqInfo.handle = (void *)sc; /* new parameter */<br>
> > > sc->irqInfo.on = nop;<br>
> > > sc->irqInfo.off = nop;<br>
> > > - sc->irqInfo.isOn = decISON;<br>
> > > + sc->irqInfo.isOn = NULL;<br>
> > ><br>
> > > #ifdef BSP_SHARED_HANDLER_SUPPORT<br>
> > > rc = BSP_install_rtems_shared_irq_handler( &sc->irqInfo );<br>
> > > diff --git a/c/src/libchip/network/if_fxp.c b/c/src/libchip/network/if_<br>
> > > fxp.c<br>
> > > index ce59db1..35d7c07 100644<br>
> > > --- a/c/src/libchip/network/if_fxp.c<br>
> > > +++ b/c/src/libchip/network/if_fxp.c<br>
> > > @@ -431,11 +431,6 @@ static void nopOn(const rtems_irq_connect_data*<br>
> > > notUsed)<br>
> > > */<br>
> > > }<br>
> > ><br>
> > > -static int fxpIsOn(const rtems_irq_connect_data* irq)<br>
> > > -{<br>
> > > - return BSP_irq_enabled_at_i8259s (irq->name);<br>
> > > -}<br>
> > > -<br>
> > > int<br>
> > > rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)<br>
> > > {<br>
> > > @@ -1933,7 +1928,7 @@ rtems_task_wake_after(100);<br>
> > > sc->irqInfo.hdl = (rtems_irq_hdl)fxp_intr;<br>
> > > sc->irqInfo.on = nopOn;<br>
> > > sc->irqInfo.off = nopOn;<br>
> > > - sc->irqInfo.isOn = fxpIsOn;<br>
> > > + sc->irqInfo.isOn = NULL;<br>
> > > rv = BSP_install_rtems_irq_handler (&sc->irqInfo);<br>
> > > if (rv != 1) {<br>
> > > rtems_panic ("Can't attach fxp interrupt handler for<br>
> > > irq %d\n",<br>
> > > --<br>
> > > 1.9.1<br>
> > ><br>
> > > _______________________________________________<br>
> > > devel mailing list<br>
> > > <a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
> > > <a href="http://lists.rtems.org/mailman/listinfo/devel">http://lists.rtems.org/mailman/listinfo/devel</a><br>
></p>