Did you test this diff yourself before you posted it?

> A diff for the ep(4) 3Com EtherLink III driver to clean up the ioctl handler
> code a bit and eliminate unnecessary resets when reconfiguring IP addresses.
> 
> Please test and provide a dmesg.
> 
> 
> Index: elink3.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/elink3.c,v
> retrieving revision 1.76
> diff -u -p -r1.76 elink3.c
> --- elink3.c  24 Nov 2009 18:12:39 -0000      1.76
> +++ elink3.c  23 Dec 2009 22:57:06 -0000
> @@ -1462,48 +1462,32 @@ epioctl(ifp, cmd, data)
>       switch (cmd) {
>       case SIOCSIFADDR:
>               ifp->if_flags |= IFF_UP;
> +             if (!(ifp->if_flags & IFF_RUNNING))
> +                     epinit(sc);
>  
> -             switch (ifa->ifa_addr->sa_family) {
>  #ifdef INET
> -             case AF_INET:
> -                     epinit(sc);
> +             if (ifa->ifa_addr->sa_family == AF_INET)
>                       arp_ifinit(&sc->sc_arpcom, ifa);
> -                     break;
>  #endif
> -             default:
> -                     epinit(sc);
> -                     break;
> +             break;
> +
> +     case SIOCSIFFLAGS:
> +             if (ifp->if_flags & IFF_UP) {
> +                     if (ifp->if_flags & IFF_RUNNING)
> +                             error = ENETRESET;
> +                     else
> +                             epinit(sc);
> +             } else {
> +                     if (ifp->if_flags & IFF_RUNNING) {
> +                             epstop(sc);
> +                             ifp->if_flags &= ~IFF_RUNNING;
> +                     }
>               }
>               break;
>  
>       case SIOCSIFMEDIA:
>       case SIOCGIFMEDIA:
>               error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
> -             break;
> -
> -     case SIOCSIFFLAGS:
> -             if ((ifp->if_flags & IFF_UP) == 0 &&
> -                 (ifp->if_flags & IFF_RUNNING) != 0) {
> -                     /*
> -                      * If interface is marked down and it is running, then
> -                      * stop it.
> -                      */
> -                     epstop(sc);
> -                     ifp->if_flags &= ~IFF_RUNNING;
> -             } else if ((ifp->if_flags & IFF_UP) != 0 &&
> -                        (ifp->if_flags & IFF_RUNNING) == 0) {
> -                     /*
> -                      * If interface is marked up and it is stopped, then
> -                      * start it.
> -                      */
> -                     epinit(sc);
> -             } else if ((ifp->if_flags & IFF_UP) != 0) {
> -                     /*
> -                      * Reset the interface to pick up changes in any other
> -                      * flags that affect hardware registers.
> -                      */
> -                     epinit(sc);
> -             }
>               break;
>  
>       default:
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

Reply via email to