}
while (num_of_time) {
if (currdriverstate == Adapter->DriverState)
- TURN_ON_LED(GPIO_Num, uiLedIndex);
+ TURN_ON_LED(Adapter, GPIO_Num, uiLedIndex);
/* Wait for timeout after setting on the LED */
Status = wait_event_interruptible_timeout(
"Led thread got signal to exit..hence exiting");
Adapter->LEDInfo.led_thread_running =
BCM_LED_THREAD_DISABLED;
- TURN_OFF_LED(GPIO_Num, uiLedIndex);
+ TURN_OFF_LED(Adapter, GPIO_Num, uiLedIndex);
Status = EVENT_SIGNALED;
break;
}
if (Status) {
- TURN_OFF_LED(GPIO_Num, uiLedIndex);
+ TURN_OFF_LED(Adapter, GPIO_Num, uiLedIndex);
Status = EVENT_SIGNALED;
break;
}
- TURN_OFF_LED(GPIO_Num, uiLedIndex);
+ TURN_OFF_LED(Adapter, GPIO_Num, uiLedIndex);
Status = wait_event_interruptible_timeout(
Adapter->LEDInfo.notify_led_event,
currdriverstate != Adapter->DriverState ||
}
/* Turn off both Tx and Rx LEDs before next second */
- TURN_OFF_LED(1 << GPIO_Num_tx, uiTxLedIndex);
- TURN_OFF_LED(1 << GPIO_Num_rx, uiTxLedIndex);
+ TURN_OFF_LED(Adapter, 1 << GPIO_Num_tx, uiTxLedIndex);
+ TURN_OFF_LED(Adapter, 1 << GPIO_Num_rx, uiTxLedIndex);
/*
* Read the Tx & Rx packets transmission after 1 second and
if (Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num !=
DISABLE_GPIO_NUM)
uiResetValue |= (1 << Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num);
- TURN_OFF_LED(1 << Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num,
- uiIndex);
+ TURN_OFF_LED(Adapter,
+ 1 << Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num,
+ uiIndex);
}
if (wrmalt(Adapter, GPIO_MODE_REGISTER, &uiResetValue,
sizeof(uiResetValue)) < 0)
currdriverstate);
if (GPIO_num != DISABLE_GPIO_NUM)
- TURN_ON_LED(1 << GPIO_num, uiLedIndex);
+ TURN_ON_LED(ad, 1 << GPIO_num, uiLedIndex);
break;
case FW_DOWNLOAD:
BcmGetGPIOPinInfo(ad, &GPIO_num, &dummyGPIONum,
&uiLedIndex, &dummyIndex, currdriverstate);
if (GPIO_num != DISABLE_GPIO_NUM)
- TURN_ON_LED(1 << GPIO_num, uiLedIndex);
+ TURN_ON_LED(ad, 1 << GPIO_num, uiLedIndex);
break;
case SHUTDOWN_EXIT:
BcmGetGPIOPinInfo(ad, &GPIO_num, &dummyGPIONum,
&uiLedIndex, &dummyGPIONum, currdriverstate);
if (GPIO_num != DISABLE_GPIO_NUM)
- TURN_ON_LED(1 << GPIO_num, uiLedIndex);
+ TURN_ON_LED(ad, 1 << GPIO_num, uiLedIndex);
break;
case NORMAL_OPERATION:
{
uiResetValue = 0;
for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) {
if (ad->LEDInfo.LEDState[uiIndex].GPIO_Num != DISABLE_GPIO_NUM)
- TURN_OFF_LED((1 << ad->LEDInfo.LEDState[uiIndex].GPIO_Num), uiIndex);
+ TURN_OFF_LED(ad,
+ (1 << ad->LEDInfo.LEDState[uiIndex].GPIO_Num),
+ uiIndex);
}
}
for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) {
if (ad->LEDInfo.LEDState[uiIndex].GPIO_Num !=
DISABLE_GPIO_NUM)
- TURN_OFF_LED((1 << ad->LEDInfo.LEDState[uiIndex].GPIO_Num), uiIndex);
+ TURN_OFF_LED(ad,
+ (1 << ad->LEDInfo.LEDState[uiIndex].GPIO_Num),
+ uiIndex);
}
/* ad->DriverState = DRIVER_INIT; */
break;
for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) {
if (ad->LEDInfo.LEDState[uiIndex].GPIO_Num !=
DISABLE_GPIO_NUM)
- TURN_OFF_LED((1 << ad->LEDInfo.LEDState[uiIndex].GPIO_Num), uiIndex);
+ TURN_OFF_LED(ad,
+ (1 << ad->LEDInfo.LEDState[uiIndex].GPIO_Num),
+ uiIndex);
}
break;
case LED_THREAD_ACTIVE:
"Led thread got signal to exit..hence exiting");
Adapter->LEDInfo.led_thread_running =
BCM_LED_THREAD_DISABLED;
- TURN_OFF_LED(1 << GPIO_num, uiLedIndex);
+ TURN_OFF_LED(Adapter, 1 << GPIO_num, uiLedIndex);
return; /* STATUS_FAILURE; */
}
if (GPIO_num != DISABLE_GPIO_NUM)
- TURN_OFF_LED(1 << GPIO_num, uiLedIndex);
+ TURN_OFF_LED(Adapter, 1 << GPIO_num, uiLedIndex);
if (Adapter->LEDInfo.bLedInitDone == false) {
LedGpioInit(Adapter);
#define EVENT_SIGNALED 1
#define MAX_FILE_NAME_BUFFER_SIZE 100
-#define TURN_ON_LED(GPIO, index) do { \
+#define TURN_ON_LED(ad, GPIO, index) do { \
unsigned int gpio_val = GPIO; \
- (Adapter->LEDInfo.LEDState[index].BitPolarity == 1) ? \
- wrmaltWithLock(Adapter, BCM_GPIO_OUTPUT_SET_REG, &gpio_val, sizeof(gpio_val)) : \
- wrmaltWithLock(Adapter, BCM_GPIO_OUTPUT_CLR_REG, &gpio_val, sizeof(gpio_val)); \
+ (ad->LEDInfo.LEDState[index].BitPolarity == 1) ? \
+ wrmaltWithLock(ad, BCM_GPIO_OUTPUT_SET_REG, &gpio_val, sizeof(gpio_val)) : \
+ wrmaltWithLock(ad, BCM_GPIO_OUTPUT_CLR_REG, &gpio_val, sizeof(gpio_val)); \
} while (0)
-#define TURN_OFF_LED(GPIO, index) do { \
+#define TURN_OFF_LED(ad, GPIO, index) do { \
unsigned int gpio_val = GPIO; \
- (Adapter->LEDInfo.LEDState[index].BitPolarity == 1) ? \
- wrmaltWithLock(Adapter, BCM_GPIO_OUTPUT_CLR_REG, &gpio_val, sizeof(gpio_val)) : \
- wrmaltWithLock(Adapter, BCM_GPIO_OUTPUT_SET_REG, &gpio_val, sizeof(gpio_val)); \
+ (ad->LEDInfo.LEDState[index].BitPolarity == 1) ? \
+ wrmaltWithLock(ad, BCM_GPIO_OUTPUT_CLR_REG, &gpio_val, sizeof(gpio_val)) : \
+ wrmaltWithLock(ad, BCM_GPIO_OUTPUT_SET_REG, &gpio_val, sizeof(gpio_val)); \
} while (0)
enum bcm_led_colors {