Ticket #227: madwifi-ng-led.diff

File madwifi-ng-led.diff, 2.0 kB (added by svens@gmx.de, 3 years ago)

proposed patch

  • ath/if_ath.c

    old new  
    18131816                goto done; 
    18141817        } 
    18151818 
     1819        if (sc->sc_softled) 
     1820                ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); 
    18161821        /* 
    18171822         * This is needed only to setup initial state 
    18181823         * but it's best done after a reset. 
     
    19021907                        ath_hal_intrset(ah, 0); 
    19031908                        if (sc->sc_softled) { 
    19041909                                del_timer(&sc->sc_ledtimer); 
    1905                                 ath_hal_gpioset(ah, sc->sc_ledpin, 1); 
     1910                                ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); 
     1911                                sc->sc_blinking=0; 
     1912                                sc->sc_ledstate=1; 
    19061913                        } 
    19071914                } 
    19081915                ath_draintxq(sc); 
     
    19131920                        sc->sc_rxlink = NULL; 
    19141921                ath_beacon_free(sc);            /* XXX needed? */ 
    19151922        } 
     1923        if (sc->sc_softled) 
     1924                ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); 
     1925         
    19161926        return 0; 
    19171927} 
    19181928 
     
    19881998        if (ath_startrecv(sc) != 0)     /* restart recv */ 
    19891999                printk("%s: %s: unable to start recv logic\n", 
    19902000                        dev->name, __func__); 
     2001        if (sc->sc_softled) 
     2002                ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); 
     2003 
    19912004        /* 
    19922005         * We may be doing a reset in response to an ioctl 
    19932006         * that changes the channel so update any state that 
     
    74527465                                ath_get_hal_status_desc(status), status); 
    74537466                        return EIO; 
    74547467                } 
     7468 
     7469                if (sc->sc_softled) 
     7470                        ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); 
     7471                 
    74557472                sc->sc_curchan = hchan; 
    74567473                ath_update_txpow(sc);           /* update tx power state */ 
    74577474 
     
    89648981                        case ATH_SOFTLED: 
    89658982                                if (val != sc->sc_softled) { 
    89668983                                        if (val) 
    8967                                                 ath_hal_gpioCfgOutput(ah, 
    8968                                                         sc->sc_ledpin); 
    8969                                         ath_hal_gpioset(ah, sc->sc_ledpin,!val); 
     8984                                                ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); 
     8985                                        ath_hal_gpioset(ah, sc->sc_ledpin,!sc->sc_ledon); 
    89708986                                        sc->sc_softled = val; 
    89718987                                } 
    89728988                                break;