-/**************************************************************************
- * qla2x00_blink_led
- *
- * Description:
- * This function sets the colour of the LED while preserving the
- * unsued GPIO pins every sec.
- *
- * Input:
- * ha - Host adapter structure
- *
- * Return:
- * None
- *
- * Context: qla2x00_timer() Interrupt
- ***************************************************************************/
-void
-qla2x00_blink_led(scsi_qla_host_t *ha)
-{
- uint16_t gpio_enable, gpio_data, led_color;
- unsigned long cpu_flags = 0;
- device_reg_t *reg = ha->iobase;
-
- /* Save the Original GPIOE */
- spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
- gpio_enable = RD_REG_WORD(®->gpioe);
- gpio_data = RD_REG_WORD(®->gpiod);
- spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
-
- DEBUG2(printk("%s Original data of gpio_enable_reg=0x%x"
- " gpio_data_reg=0x%x\n",
- __func__,gpio_enable,gpio_data));
-
- if (ha->beacon_green_on){
- led_color = GPIO_LED_GREEN_ON_AMBER_OFF;
- ha->beacon_green_on = 0;
- } else {
- led_color = GPIO_LED_GREEN_OFF_AMBER_OFF;
- ha->beacon_green_on = 1;
- }
-
- /* Set the modified gpio_enable values */
- gpio_enable |= GPIO_LED_GREEN_ON_AMBER_OFF;
-
- DEBUG2(printk("%s Before writing enable : gpio_enable_reg=0x%x"
- " gpio_data_reg=0x%x led_color=0x%x\n",
- __func__, gpio_enable, gpio_data, led_color));
-
- spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
- WRT_REG_WORD(®->gpioe,gpio_enable);
- spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
-
- /* Clear out the previously set LED colour */
- gpio_data &= ~GPIO_LED_GREEN_ON_AMBER_OFF;
-
- /* Set the new input LED colour to GPIOD */
- gpio_data |= led_color;
-
- DEBUG2(printk("%s Before writing data: gpio_enable_reg=0x%x"
- " gpio_data_reg=0x%x led_color=0x%x\n",
- __func__,gpio_enable,gpio_data,led_color));
-
- /* Set the modified gpio_data values */
- spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
- WRT_REG_WORD(®->gpiod,gpio_data);
- spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
-}
-