[PATCH] classic networking: do not reference

Joel Sherrill joel at rtems.org
Thu Aug 4 21:53:16 UTC 2016


This sounds and looks reasonable.

The old stack needs to be moved into its own build tree.

On Aug 4, 2016 5:43 PM, "Pavel Pisa" <ppisa4lists at pikron.com> wrote:

> This change is required to build RTEMS with classic "--enable-networking"
> and link applications/tests which reference RTEMS_BSP_NETWORK_DRIVER_
> ATTACH.
> ---
>  c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c | 10 +---------
>  c/src/libchip/network/dec21140.c            |  7 +------
>  c/src/libchip/network/elnk.c                | 12 +-----------
>  c/src/libchip/network/if_dc.c               |  9 +--------
>  c/src/libchip/network/if_fxp.c              |  7 +------
>  5 files changed, 5 insertions(+), 40 deletions(-)
>
>  Discussion: I have stumbled over problem to build some external tests
>  for i386 because original integrated Ethernet drivers cannot be linked
>  into application. Even that libbsd is a future goal it worth to correct
>  this at least for testing. It seems that original i8259s concept
>  handling is finally overcome by generic approach.
>  I hope that field isOn is no longer referenced by any architecture
>  or if referenced, that NULL is valid option.
>
>  I am leaving for next week so I would not push this change probably.
>
>  In the longer perspective, I think that even for these deprecated drivers
>  rtems_interrupt_handler_install generic concept could/should be used.
>  If it is agreed that it is right change then I can prepare patch
>  for that in future.
>
>  But I think that correction of the builds in meantime worth
>  to be pushed.
>
> diff --git a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c
> b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c
> index 5a13b29..d757e27 100644
> --- a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c
> +++ b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c
> @@ -428,14 +428,6 @@ ne_interrupt_off (const rtems_irq_connect_data *irq)
>      outport_byte (sc->port + IMR, 0);
>  }
>
> -/* Return whether NE2000 interrupts are on.  */
> -
> -static int
> -ne_interrupt_is_on (const rtems_irq_connect_data *irq)
> -{
> -  return BSP_irq_enabled_at_i8259s (irq->name);
> -}
> -
>  /* Initialize the NE2000 hardware.  */
>
>  static void
> @@ -526,7 +518,7 @@ ne_init_irq_handler(int irno)
>    irq.handle = (rtems_irq_hdl) irno;
>    irq.on = ne_interrupt_on;
>    irq.off = ne_interrupt_off;
> -  irq.isOn = ne_interrupt_is_on;
> +  irq.isOn = NULL;
>
>    if (!BSP_install_rtems_irq_handler (&irq))
>      rtems_panic ("Can't attach NE interrupt handler for irq %d\n", irno);
> diff --git a/c/src/libchip/network/dec21140.c b/c/src/libchip/network/
> dec21140.c
> index aa6be29..3bfc91d 100644
> --- a/c/src/libchip/network/dec21140.c
> +++ b/c/src/libchip/network/dec21140.c
> @@ -345,11 +345,6 @@ static void no_op(const rtems_irq_connect_data* irq)
>     return;
>  }
>
> -static int dec21140IsOn(const rtems_irq_connect_data* irq)
> -{
> -  return BSP_irq_enabled_at_i8259s (irq->name);
> -}
> -
>  /*
>   * DEC21140 interrupt handler
>   */
> @@ -539,7 +534,7 @@ dec21140Enet_initialize_hardware (struct
> dec21140_softc *sc)
>     sc->irqInfo.hdl  = (rtems_irq_hdl)dec21140Enet_
> interrupt_handler_entry;
>     sc->irqInfo.on   = no_op;
>     sc->irqInfo.off  = no_op;
> -   sc->irqInfo.isOn = dec21140IsOn;
> +   sc->irqInfo.isOn = NULL;
>
>  #ifdef DEC_DEBUG
>     printk( "dec2114x: Installing IRQ %d\n", sc->irqInfo.name );
> diff --git a/c/src/libchip/network/elnk.c b/c/src/libchip/network/elnk.c
> index 06ece5b..1c63e35 100644
> --- a/c/src/libchip/network/elnk.c
> +++ b/c/src/libchip/network/elnk.c
> @@ -1875,16 +1875,6 @@ static void no_op(const rtems_irq_connect_data* irq)
>
>
>
> -static int elnkIsOn(const rtems_irq_connect_data* irq)
> -{
> -  return BSP_irq_enabled_at_i8259s (irq->name);
> -}
> -
> -
> -
> -
> -
> -
>  static void
>  elnk_start_txchain( struct elnk_softc *sc, struct TXMD *chainhead )
>  {
> @@ -2214,7 +2204,7 @@ elnk_initialize_hardware (struct elnk_softc *sc)
>     sc->irqInfo.hdl  = (rtems_irq_hdl)elnk_interrupt_handler_entry;
>     sc->irqInfo.on   = no_op;
>     sc->irqInfo.off  = no_op;
> -   sc->irqInfo.isOn = elnkIsOn;
> +   sc->irqInfo.isOn = NULL;
>
>     if( sc->irqInfo.name != 255 )
>     {
> diff --git a/c/src/libchip/network/if_dc.c b/c/src/libchip/network/if_dc.c
> index 1563be5..24f2fc1 100644
> --- a/c/src/libchip/network/if_dc.c
> +++ b/c/src/libchip/network/if_dc.c
> @@ -1893,13 +1893,6 @@ nop(const rtems_irq_connect_data* unused)
>  {
>  }
>
> -static int
> -decISON(const rtems_irq_connect_data* irq)
> -{
> -       return (BSP_irq_enabled_at_i8259s(irq->name));
> -}
> -
> -
>  /*
>   * Attach the interface. Allocate softc structures, do ifmedia
>   * setup and ethernet/BPF attach.
> @@ -2023,7 +2016,7 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig
> *config, int attaching)
>         sc->irqInfo.handle = (void *)sc; /* new parameter */
>         sc->irqInfo.on = nop;
>         sc->irqInfo.off = nop;
> -       sc->irqInfo.isOn = decISON;
> +       sc->irqInfo.isOn = NULL;
>
>  #ifdef BSP_SHARED_HANDLER_SUPPORT
>         rc = BSP_install_rtems_shared_irq_handler( &sc->irqInfo );
> diff --git a/c/src/libchip/network/if_fxp.c b/c/src/libchip/network/if_
> fxp.c
> index ce59db1..35d7c07 100644
> --- a/c/src/libchip/network/if_fxp.c
> +++ b/c/src/libchip/network/if_fxp.c
> @@ -431,11 +431,6 @@ static void nopOn(const rtems_irq_connect_data*
> notUsed)
>     */
>  }
>
> -static int fxpIsOn(const rtems_irq_connect_data* irq)
> -{
> -  return BSP_irq_enabled_at_i8259s (irq->name);
> -}
> -
>  int
>  rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
>  {
> @@ -1933,7 +1928,7 @@ rtems_task_wake_after(100);
>                 sc->irqInfo.hdl = (rtems_irq_hdl)fxp_intr;
>                 sc->irqInfo.on  = nopOn;
>                 sc->irqInfo.off = nopOn;
> -               sc->irqInfo.isOn = fxpIsOn;
> +               sc->irqInfo.isOn = NULL;
>                 rv = BSP_install_rtems_irq_handler (&sc->irqInfo);
>                 if (rv != 1) {
>                   rtems_panic ("Can't attach fxp interrupt handler for irq
> %d\n",
> --
> 1.9.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20160804/742d1ce5/attachment.html>


More information about the devel mailing list