Exemplo n.º 1
0
// toggle the LED
static void ledToggle(PLED_CTRL pLed)
{
    short led_gpio;

    led_gpio = pLed->ledGreenGpio;

    if (led_gpio == -1)
        return;

#if defined(CONFIG_BCM96328) || defined(CONFIG_BCM96362) || defined(CONFIG_BCM963268) || defined(CONFIG_BCM96318)|| defined(CONFIG_BCM96828)
    LED->ledMode ^= (LED_MODE_MASK << GPIO_NUM_TO_LED_MODE_SHIFT(led_gpio));
#else

    if (led_gpio & BP_GPIO_SERIAL) {
        while (GPIO->SerialLedCtrl & SER_LED_BUSY);
        GPIO->SerialLed ^= GPIO_NUM_TO_MASK(led_gpio);
    }
    else {
        unsigned long flags;

        spin_lock_irqsave(&bcm_gpio_spinlock, flags);
        GPIO->GPIODir |= GPIO_NUM_TO_MASK(led_gpio);
        GPIO->GPIOio ^= GPIO_NUM_TO_MASK(led_gpio);
        spin_unlock_irqrestore(&bcm_gpio_spinlock, flags);
    }

#endif
}   
Exemplo n.º 2
0
// turn led on and set the ledState
static void setLed (PLED_CTRL pLed, unsigned short led_state, unsigned short led_type)
{
    short led_gpio;
    unsigned short gpio_state;

    if (led_type == kLedRed)
        led_gpio = pLed->ledRedGpio;
    else
        led_gpio = pLed->ledGreenGpio;

    if (led_gpio == -1)
        return;

    if (((led_gpio & BP_ACTIVE_LOW) && (led_state == kLedOn)) || 
        (!(led_gpio & BP_ACTIVE_LOW) && (led_state == kLedOff)))
        gpio_state = 0;
    else
        gpio_state = 1;

#if defined(CONFIG_BCM96328)
    /* Enable LED controller to drive this GPIO */
    if (!(led_gpio & BP_GPIO_SERIAL))
        GPIO->GPIOMode |= GPIO_NUM_TO_MASK(led_gpio);
#endif

#if defined(CONFIG_BCM96362)
    /* Enable LED controller to drive this GPIO */
    if (!(led_gpio & BP_GPIO_SERIAL))
        GPIO->LEDCtrl |= GPIO_NUM_TO_MASK(led_gpio);
#endif

#if defined(CONFIG_BCM96328) || defined(CONFIG_BCM96362)
    LED->ledMode &= ~(LED_MODE_MASK << GPIO_NUM_TO_LED_MODE_SHIFT(led_gpio));
    if( gpio_state )
        LED->ledMode |= (LED_MODE_OFF << GPIO_NUM_TO_LED_MODE_SHIFT(led_gpio));
    else
        LED->ledMode |= (LED_MODE_ON << GPIO_NUM_TO_LED_MODE_SHIFT(led_gpio));

#else
    if (led_gpio & BP_GPIO_SERIAL) {
        while (GPIO->SerialLedCtrl & SER_LED_BUSY);
        if( gpio_state )
            GPIO->SerialLed |= GPIO_NUM_TO_MASK(led_gpio);
        else
            GPIO->SerialLed &= ~GPIO_NUM_TO_MASK(led_gpio);
    }
    else {
        GPIO->GPIODir |= GPIO_NUM_TO_MASK(led_gpio);
        if( gpio_state )
            GPIO->GPIOio |= GPIO_NUM_TO_MASK(led_gpio);
        else
            GPIO->GPIOio &= ~GPIO_NUM_TO_MASK(led_gpio);
    }
#endif
}
Exemplo n.º 3
0
//**************************************************************************
// Function Name: BcmAdsl_Initialize
// Description  : Initializes ADSL PHY.
// Returns      : STS_SUCCESS if successful or error status.
//**************************************************************************
BCMADSL_STATUS BcmAdsl_Initialize(ADSL_FN_NOTIFY_CB pFnNotifyCb, UINT32 ulParm, adslCfgProfile *pAdslCfg)
{

    printk("BcmAdsl_Initialize=0x%08X, g_pFnNotifyCallback=0x%08X\n", (int)BcmAdsl_Initialize, (int) &g_pFnNotifyCallback);

    if (g_nAdslInitialized != 0) {
		BcmAdslCoreConfigure(pAdslCfg);
		return BCMADSL_STATUS_SUCCESS;
	}

    BcmOsInitialize ();
#ifndef DYING_GASP_API
	{
	unsigned long	ulIntr;
#if defined(CONFIG_BCM963x8)
#if defined(__KERNEL__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
    if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) 
#endif
	{
		BcmHalMapInterrupt((void *)BcmDyingGaspIsr, 0, INTERRUPT_ID_DG);
		BcmHalInterruptEnable( INTERRUPT_ID_DG );
    }
#endif
	}
#endif
    if( BpGetRj11InnerOuterPairGpios(&g_GpioInnerPair, &g_GpioOuterPair) == BP_SUCCESS ) {
        g_GpioInnerPair = GPIO_NUM_TO_MASK(g_GpioInnerPair);
        g_GpioOuterPair = GPIO_NUM_TO_MASK(g_GpioOuterPair);
    }
    else {
        g_GpioInnerPair = 0xffff;
        g_GpioOuterPair = 0xffff;
    }
    g_BoardType = 0;
    g_pFnNotifyCallback = (pFnNotifyCb != NULL) ? pFnNotifyCb : IdleNotifyCallback;
    g_ulNotifyCallbackParm = ulParm;

    BcmAdslCoreSetSDRAMBaseAddr((void *) (((unsigned long) kerSysGetSdramSize() - 0x40000) | 0xA0000000));
	BcmAdslCoreConfigure(pAdslCfg);

    BcmAdslCoreInit();
    g_LinkState = BCM_ADSL_LINK_DOWN;
    g_nAdslExit = 0;
	g_nAdslInitialized = 1;
	g_TimerHandle = bcmOsTimerCreate(BcmAdsl_Timer, NULL);
	if (NULL != g_TimerHandle)
		bcmOsTimerStart(g_TimerHandle, 1000);

    
	return BCMADSL_STATUS_SUCCESS;
}
Exemplo n.º 4
0
// toggle the LED
static void ledToggle(PLED_CTRL pLed)
{
    short led_gpio;

    led_gpio = pLed->ledGreenGpio;

    if (led_gpio == -1)
        return;

#if defined(CONFIG_BCM96328) || defined(CONFIG_BCM96362)
    LED->ledMode ^= (LED_MODE_MASK << GPIO_NUM_TO_LED_MODE_SHIFT(led_gpio));
#else

    if (led_gpio & BP_GPIO_SERIAL) {
        while (GPIO->SerialLedCtrl & SER_LED_BUSY);
        GPIO->SerialLed ^= GPIO_NUM_TO_MASK(led_gpio);
    }
    else {
        GPIO->GPIODir |= GPIO_NUM_TO_MASK(led_gpio);
        GPIO->GPIOio ^= GPIO_NUM_TO_MASK(led_gpio);
    }

#endif
}   
Exemplo n.º 5
0
int mii_init(struct net_device *dev)
{
    BcmEnet_devctrl *pDevCtrl = netdev_priv(dev);
    volatile EmacRegisters *emac;
    int data32;
    uint16 data16;
#if defined (CONFIG_BCM96338) || defined (CONFIG_BCM96348)
    uint16 blkEnables;
#endif
    uint8 data8;
    int i;
    char *phytype = "";
    char *setup = "";

    

    switch(pDevCtrl->EnetInfo.ucPhyType) {
        case BP_ENET_INTERNAL_PHY:
            phytype = "Internal PHY";
            break;

        case BP_ENET_EXTERNAL_PHY:
            phytype = "External PHY";
            break;

        case BP_ENET_EXTERNAL_SWITCH:
            phytype = "Ethernet Switch";
            break;

        default:
            printk(KERN_INFO CARDNAME ": Unknown PHY type\n");
            return -1;
    }
    switch (pDevCtrl->EnetInfo.usConfigType) {
        case BP_ENET_CONFIG_MDIO_PSEUDO_PHY:
            setup = "MDIO Pseudo PHY Interface";
            break;

        case BP_ENET_CONFIG_SPI_SSB_0:
            setup = "SPI Slave Select 0";
            break;

        case BP_ENET_CONFIG_SPI_SSB_1:
            setup = "SPI Slave Select 1";
            break;

        case BP_ENET_CONFIG_SPI_SSB_2:
            setup = "SPI Slave Select 2";
            break;

        case BP_ENET_CONFIG_SPI_SSB_3:
            setup = "SPI Slave Select 3";
            break;

        case BP_ENET_CONFIG_MDIO:
            setup = "MDIO";
            break;

         /*start of support   infineon ADM6996M LSW by l39225 20061218*/
        case  BP_ENET_CONFIG_SMI:
        	setup = "SMI";
        	break;
         /*end of support   infineon ADM6996M LSW by l39225 20061218*/

        default:
            setup = "Undefined Interface";
            break;
    }
    printk("Config %s Through %s\n", phytype, setup);

    emac = pDevCtrl->emac;
    switch(pDevCtrl->EnetInfo.ucPhyType) {

        case BP_ENET_INTERNAL_PHY:
            /* init mii clock, do soft reset of phy, default is 10Base-T */
            emac->mdioFreq = EMAC_MII_PRE_EN | EMAC_MDC;
            /* reset phy */
            mii_soft_reset(dev, pDevCtrl->EnetInfo.ucPhyAddress);
#if defined(CONFIG_BCM96338)
            pga_fix_enable(dev);
#endif
            mii_setup(dev);
            break;

        case BP_ENET_EXTERNAL_PHY:
            emac->config |= EMAC_EXT_PHY;
            emac->mdioFreq = EMAC_MII_PRE_EN | EMAC_MDC;
            /* reset phy */
            if (pDevCtrl->EnetInfo.usGpioPhyReset != BP_NOT_DEFINED) {
                data16 = GPIO_NUM_TO_MASK(pDevCtrl->EnetInfo.usGpioPhyReset);
                GPIO->GPIODir |= data16;
                if (pDevCtrl->EnetInfo.usGpioPhyReset & BP_ACTIVE_LOW) {
                    GPIO->GPIOio &= ~data16;
                    udelay(400); /* hold > 150us */
                    GPIO->GPIOio |= data16;
                }
                else {
                    GPIO->GPIOio |= data16;
                    udelay(400); /* hold > 150us */
                    GPIO->GPIOio &= ~data16;
                }
                mdelay(1100); /* wait > 1 second */
            } else {
                mii_soft_reset(dev, pDevCtrl->EnetInfo.ucPhyAddress);
            }

            data32 = mii_read(dev, pDevCtrl->EnetInfo.ucPhyAddress, MII_ADVERTISE);
            data32 |= ADVERTISE_FDFC; /* advertise flow control capbility */
            mii_write(dev, pDevCtrl->EnetInfo.ucPhyAddress, MII_ADVERTISE, data32);

            mii_setup(dev);
            break;

        case BP_ENET_EXTERNAL_SWITCH:
#if defined(CONFIG_BCM96358)
            GPIO->GPIOMode |= GPIO_MODE_EMAC2_MII_CLK_INV;
#endif
            emac->config |= EMAC_EXT_PHY;
            emac->mdioFreq = EMAC_MII_PRE_EN | EMAC_MDC;
            emac->txControl = EMAC_FD;
            switch (pDevCtrl->EnetInfo.usConfigType) 
            {
                case BP_ENET_CONFIG_MDIO_PSEUDO_PHY:
                    mii_soft_reset(dev, PSEUDO_PHY_ADDR);
                    break;

                case BP_ENET_CONFIG_SPI_SSB_0:
                case BP_ENET_CONFIG_SPI_SSB_1:
                case BP_ENET_CONFIG_SPI_SSB_2:
                case BP_ENET_CONFIG_SPI_SSB_3:
#if defined (CONFIG_BCM96338) || defined (CONFIG_BCM96348)
                    blkEnables = PERF->blkEnables;
                    if ((blkEnables & SPI_CLK_EN) == 0) {
                        blkEnables |= SPI_CLK_EN;
                        PERF->blkEnables = blkEnables;
                    }
                    pDevCtrl->ethSwitch.cid = 0xff;
                    pDevCtrl->ethSwitch.page = 0xff;
#endif
                    break;

                case BP_ENET_CONFIG_MDIO:
                    /* reset phy */
                    if (pDevCtrl->EnetInfo.numSwitchPorts) {
                        for (i = 0; i < pDevCtrl->EnetInfo.numSwitchPorts; i++) {
                            mii_soft_reset(dev, pDevCtrl->EnetInfo.ucPhyAddress | i);
                        }
                    }
                    return 0;

		  /*start of support   infineon ADM6996M LSW by l39225 20061218*/
		 case  BP_ENET_CONFIG_SMI:
		       if (pDevCtrl->EnetInfo.numSwitchPorts) 
		       {
                           for (i = 0; i < pDevCtrl->EnetInfo.numSwitchPorts; i++)
                           {
				    int val;
				    mii_write(dev, 0, SWI_PHYREG_START_ADDR+i*SWI_PHYREG_OFFSET, BMCR_RESET);
				    udelay(10); 
				    do 
				    {
				        val = mii_read(dev, 0, SWI_PHYREG_START_ADDR+i*SWI_PHYREG_OFFSET);
				    } while (val & BMCR_RESET);
                            }
                     }
		       break;
		   /*end of support   infineon ADM6996M LSW by l39225 20061218*/
 
                default:
                    printk(KERN_INFO CARDNAME ": Unknown PHY configuration type\n");
                    break;
            }
            if( pDevCtrl->EnetInfo.usConfigType != BP_ENET_CONFIG_SMI)
            {
	            if (pDevCtrl->EnetInfo.numSwitchPorts) {
	                data8 = 0;
	                switch (pDevCtrl->EnetInfo.numSwitchPorts) {
	                    case 5:
	                        data8 |= REG_POWER_DOWN_MODE_PORT5_PHY_DISABLE;
	                    case 4:
	                        data8 |= REG_POWER_DOWN_MODE_PORT4_PHY_DISABLE;
	                    case 3:
	                        data8 |= REG_POWER_DOWN_MODE_PORT3_PHY_DISABLE;
	                    case 2:
	                        data8 |= REG_POWER_DOWN_MODE_PORT2_PHY_DISABLE;
	                    case 1:
	                        /* 
	                         * y42304 delete: Do not set bit 0 to a 1 , Doing so 
	                         * disable pll power and lanswitch function 
	                         */
	                        //data8 |= REG_POWER_DOWN_MODE_PORT1_PHY_DISABLE; 
	                        break;
	                    default:
	                        break;
	                }

	                /* start of enet y42304 modified 20060711: power down port 5*/
	                data8 |= REG_POWER_DOWN_MODE_PORT5_PHY_DISABLE;
	                /* disable Switch port PHY */
	                ethsw_wreg(dev, PAGE_CONTROL, REG_POWER_DOWN_MODE, (uint8 *)&data8, sizeof(data8));
	                
	                /* enable Switch port 0-3 PHY */
	                data8 |= REG_POWER_DOWN_MODE_PORT1_PHY_DISABLE;
	                data8 = ((~data8) | REG_POWER_DOWN_MODE_PORT5_PHY_DISABLE);                           
	                ethsw_wreg(dev, PAGE_CONTROL, REG_POWER_DOWN_MODE, (uint8 *)&data8, sizeof(data8));                
	                /* end of enet y42304 modified 20060711: power down port 5*/
	            }

	            /* setup Switch MII1 port state override */
	            ethsw_rreg(dev, PAGE_CONTROL, REG_CONTROL_MII1_PORT_STATE_OVERRIDE, &data8, sizeof(data8));

	            if (pDevCtrl->EnetInfo.usReverseMii == BP_ENET_REVERSE_MII)
	                data8 |= REG_CONTROL_MPSO_REVERSE_MII;
	            data8 |= (REG_CONTROL_MPSO_MII_SW_OVERRIDE|REG_CONTROL_MPSO_LINKPASS);
	            data8 |= (REG_CONTROL_MPSO_LP_FLOW_CONTROL|REG_CONTROL_MPSO_SPEED100|REG_CONTROL_MPSO_FDX);

	            ethsw_wreg(dev, PAGE_CONTROL, REG_CONTROL_MII1_PORT_STATE_OVERRIDE, &data8, sizeof(data8));

	            /* checking Switch functional */
	            data8 = 0;
	            ethsw_rreg(dev, PAGE_CONTROL, REG_CONTROL_MII1_PORT_STATE_OVERRIDE, &data8, sizeof(data8));
	            if ((data8 & (REG_CONTROL_MPSO_MII_SW_OVERRIDE|REG_CONTROL_MPSO_LINKPASS)) !=
	                (REG_CONTROL_MPSO_MII_SW_OVERRIDE|REG_CONTROL_MPSO_LINKPASS) ||
	                (data8 == 0xff)) {
	                    printk(KERN_INFO CARDNAME ": error on Ethernet Switch setup\n");
	                    return -1;
	            }
	            if (pDevCtrl->EnetInfo.usReverseMii == BP_ENET_REVERSE_MII) {
	                if ((data8 & REG_CONTROL_MPSO_REVERSE_MII) != REG_CONTROL_MPSO_REVERSE_MII) {
	                    printk(KERN_INFO CARDNAME ": error on Ethernet Switch reverse MII setup\n");
	                    return -1;
	                }
	            }
	            pDevCtrl->ethSwitch.type = ethsw_switch_type(dev);
           }
            /*start of support   infineon ADM6996M LSW by l39225 20061218*/
           else 
           {
                int i ,v;
                for( i = 0; i< 5;i++)
                {
                    v = mii_read(dev,0,0x01+2*i);
                    v |= 0x8000;
                    mii_write(dev,0,0x01+2*i,v);
                }

                v = mii_read(dev,0,0x08);
                v |= 0x8000;
                mii_write(dev,0,0x08,v);
                
           		pDevCtrl->ethSwitch.type =  ESW_TYPE_ADM6996M;
           }
          /*end of support   infineon ADM6996M LSW by l39225 20061218*/
            break;

        default:
            break;
    }

    return 0;
}
Exemplo n.º 6
0
// led ctrl.  Maps the ledName to the corresponding ledInfoPtr and perform the led operation
void boardLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
{
    unsigned long flags;
    PLED_CTRL pLed;

    BCM_ASSERT_NOT_HAS_SPINLOCK_V(&brcm_ledlock);

    spin_lock_irqsave(&brcm_ledlock, flags);     // LED can be changed from ISR

    if( (int) ledName < kLedEnd ) {

        pLed = &gLedCtrl[ledName];

        // If the state is kLedStateFail and there is not a failure LED defined
        // in the board parameters, change the state to kLedStateSlowBlinkContinues.
        if( ledState == kLedStateFail && pLed->ledRedGpio == -1 )
            ledState = kLedStateSlowBlinkContinues;

        // Save current LED state
        pLed->ledState = ledState;

        // Start from LED Off and turn it on later as needed
        setLed (pLed, kLedOff, kLedGreen);
        setLed (pLed, kLedOff, kLedRed);

        // Disable HW control for WAN Data LED. 
        // It will be enabled only if LED state is On
#if defined(CONFIG_BCM96328) || defined(CONFIG_BCM96362) || defined(CONFIG_BCM963268) || defined(CONFIG_BCM96318)|| defined(CONFIG_BCM96828)
        if (ledName == kLedWanData)
            LED->ledHWDis |= GPIO_NUM_TO_MASK(pLed->ledGreenGpio);
#elif defined(CONFIG_BCM96368)
        if (ledName == kLedWanData) {
            GPIO->AuxLedCtrl |= AUX_HW_DISAB_2;
            if (pLed->ledGreenGpio & BP_ACTIVE_LOW)
                GPIO->AuxLedCtrl |= (LED_STEADY_ON << AUX_MODE_SHFT_2);
            else
                GPIO->AuxLedCtrl &= ~(LED_STEADY_ON << AUX_MODE_SHFT_2);
        }
#endif

        switch (ledState) {
        case kLedStateOn:
            // Enable SAR to control INET LED
#if defined(CONFIG_BCM96328) || defined(CONFIG_BCM96362) || defined(CONFIG_BCM963268) || defined(CONFIG_BCM96318)|| defined(CONFIG_BCM96828)
            if (ledName == kLedWanData)
                LED->ledHWDis &= ~GPIO_NUM_TO_MASK(pLed->ledGreenGpio);
#elif defined(CONFIG_BCM96368)
            if (ledName == kLedWanData) {
                GPIO->AuxLedCtrl &= ~AUX_HW_DISAB_2;
                if (pLed->ledGreenGpio & BP_ACTIVE_LOW)
                    GPIO->AuxLedCtrl &= ~(LED_STEADY_ON << AUX_MODE_SHFT_2);
                else
                    GPIO->AuxLedCtrl |= (LED_STEADY_ON << AUX_MODE_SHFT_2);
            }
#endif
            setLed (pLed, kLedOn, kLedGreen);
            break;

        case kLedStateOff:
            break;

        case kLedStateFail:
            setLed (pLed, kLedOn, kLedRed);
            break;

        case kLedStateSlowBlinkContinues:
            pLed->blinkCountDown = kSlowBlinkCount;
            gTimerOnRequests++;
            break;

        case kLedStateFastBlinkContinues:
            pLed->blinkCountDown = kFastBlinkCount;
            gTimerOnRequests++;
            break;

        case kLedStateUserWpsInProgress:          /* 200ms on, 100ms off */
            pLed->blinkCountDown = kFastBlinkCount;
            gLedRunningCounter = 0;
            gTimerOnRequests++;
            break;             

        case kLedStateUserWpsError:               /* 100ms on, 100ms off */
            pLed->blinkCountDown = kFastBlinkCount;
            gLedRunningCounter = 0;
            gTimerOnRequests++;
            break;        

        case kLedStateUserWpsSessionOverLap:      /* 100ms on, 100ms off, 5 times, off for 500ms */
            pLed->blinkCountDown = kFastBlinkCount;
            gTimerOnRequests++;
            break;        

        default:
            printk("Invalid led state\n");
        }
    }

    // If gTimerOn is false, that means ledTimerExpire has already finished
    // running and has not restarted the timer.  Then we can start it here.
    // Otherwise, we only leave the gTimerOnRequests > 0 which will be
    // noticed at the end of the ledTimerExpire function.
    if (!gTimerOn && gTimerOnRequests > 0)
    {
        ledTimerStart();
        gTimerOn = TRUE;
        gTimerOnRequests = 0;
    }
    spin_unlock_irqrestore(&brcm_ledlock, flags);
}
Exemplo n.º 7
0
// led ctrl.  Maps the ledName to the corresponding ledInfoPtr and perform the led operation
void boardLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
{
    unsigned long flags;
    PLED_CTRL pLed;

    spin_lock_irqsave(&brcm_ledlock, flags);     // LED can be changed from ISR

    if( (int) ledName < kLedEnd ) {

        pLed = &gLedCtrl[ledName];

        // If the state is kLedStateFail and there is not a failure LED defined
        // in the board parameters, change the state to kLedStateSlowBlinkContinues.
        if( ledState == kLedStateFail && pLed->ledRedGpio == -1 )
            ledState = kLedStateSlowBlinkContinues;

        // Save current LED state
        pLed->ledState = ledState;

        if( pLed->ledHwFunc) {
            // Handle LEDs controlled by HW specific logic
            pLed->ledHwFunc (ledState);
            if (ledState == kLedStateFail)
                setLed (pLed, kLedOn, kLedRed);
            else
                setLed (pLed, kLedOff, kLedRed);
        }
        else {
            // Handle LEDs controlled by SW
            // Start from LED Off and turn it on later as needed
            setLed (pLed, kLedOff, kLedGreen);
            setLed (pLed, kLedOff, kLedRed);

#if defined(CONFIG_BCM96328) || defined(CONFIG_BCM96362)
            // Disable HW control for WAN Data LED. 
            // It will be enabled only if LED state is On
            if (ledName == kLedWanData)
                LED->ledHWDis |= GPIO_NUM_TO_MASK(pLed->ledGreenGpio);
#endif

            switch (ledState) {
            case kLedStateOn:
#if defined(CONFIG_BCM96328) || defined(CONFIG_BCM96362)
                // Enable SAR to control INET LED
                if (ledName == kLedWanData)
                    LED->ledHWDis &= ~GPIO_NUM_TO_MASK(pLed->ledGreenGpio);
#endif
                setLed (pLed, kLedOn, kLedGreen);
                break;

            case kLedStateOff:
                break;

            case kLedStateFail:
                setLed (pLed, kLedOn, kLedRed);
                break;

            case kLedStateSlowBlinkContinues:
                pLed->blinkCountDown = kSlowBlinkCount;
                ledTimerStart();
                break;

            case kLedStateFastBlinkContinues:
                pLed->blinkCountDown = kFastBlinkCount;
                ledTimerStart();
                break;

            case kLedStateUserWpsInProgress:          /* 200ms on, 100ms off */
                pLed->blinkCountDown = kFastBlinkCount;
                gLedRunningCounter = 0;
                ledTimerStart();
                break;             

            case kLedStateUserWpsError:               /* 100ms on, 100ms off */
                pLed->blinkCountDown = kFastBlinkCount;
                gLedRunningCounter = 0;
                ledTimerStart();
                break;        

            case kLedStateUserWpsSessionOverLap:      /* 100ms on, 100ms off, 5 times, off for 500ms */
                pLed->blinkCountDown = kFastBlinkCount;
                ledTimerStart();
                break;        

            default:
                printk("Invalid led state\n");
            }
        }
    }
    spin_unlock_irqrestore(&brcm_ledlock, flags);
}