5 #define DSD_START_OFFSET 0x0200
6 #define EEPROM_VERSION_OFFSET 0x020E
7 #define EEPROM_HW_PARAM_POINTER_ADDRESS 0x0218
8 #define EEPROM_HW_PARAM_POINTER_ADDRRES_MAP5 0x0220
9 #define GPIO_SECTION_START_OFFSET 0x03
10 #define COMPATIBILITY_SECTION_LENGTH 42
11 #define COMPATIBILITY_SECTION_LENGTH_MAP5 84
12 #define EEPROM_MAP5_MAJORVERSION 5
13 #define EEPROM_MAP5_MINORVERSION 0
14 #define MAX_NUM_OF_BLINKS 10
15 #define NUM_OF_GPIO_PINS 16
16 #define DISABLE_GPIO_NUM 0xFF
17 #define EVENT_SIGNALED 1
18 #define MAX_FILE_NAME_BUFFER_SIZE 100
20 #define TURN_ON_LED(GPIO, index) do { \
21 UINT gpio_val = GPIO; \
22 (Adapter->LEDInfo.LEDState[index].BitPolarity == 1) ? \
23 wrmaltWithLock(Adapter, BCM_GPIO_OUTPUT_SET_REG, &gpio_val, sizeof(gpio_val)) : \
24 wrmaltWithLock(Adapter, BCM_GPIO_OUTPUT_CLR_REG, &gpio_val, sizeof(gpio_val)); \
27 #define TURN_OFF_LED(GPIO, index) do { \
28 UINT gpio_val = GPIO; \
29 (Adapter->LEDInfo.LEDState[index].BitPolarity == 1) ? \
30 wrmaltWithLock(Adapter, BCM_GPIO_OUTPUT_CLR_REG, &gpio_val, sizeof(gpio_val)) : \
31 wrmaltWithLock(Adapter, BCM_GPIO_OUTPUT_SET_REG, &gpio_val, sizeof(gpio_val)); \
34 #define B_ULONG32 unsigned long
36 typedef enum _LEDColors {
41 } LEDColors; /* Enumerated values of different LED types */
43 typedef enum LedEvents {
47 FW_DOWNLOAD_DONE = 0x4,
48 NO_NETWORK_ENTRY = 0x8,
49 NORMAL_OPERATION = 0x10,
50 LOWPOWER_MODE_ENTER = 0x20,
51 IDLEMODE_CONTINUE = 0x40,
53 LED_THREAD_INACTIVE = 0x100, /* Makes the LED thread Inactivce. It wil be equivallent to putting the thread on hold. */
54 LED_THREAD_ACTIVE = 0x200, /* Makes the LED Thread Active back. */
56 } LedEventInfo_t; /* Enumerated values of different driver states */
59 * Structure which stores the information of different LED types
60 * and corresponding LED state information of driver states
62 typedef struct LedStateInfo_t {
63 unsigned char LED_Type; /* specify GPIO number - use 0xFF if not used */
64 unsigned char LED_On_State; /* Bits set or reset for different states */
65 unsigned char LED_Blink_State; /* Bits set or reset for blinking LEDs for different states */
66 unsigned char GPIO_Num;
67 unsigned char BitPolarity; /* To represent whether H/W is normal polarity or reverse polarity */
68 } LEDStateInfo, *pLEDStateInfo;
70 typedef struct _LED_INFO_STRUCT {
71 LEDStateInfo LEDState[NUM_OF_LEDS];
72 bool bIdleMode_tx_from_host; /* Variable to notify whether driver came out from idlemode due to Host or target */
74 wait_queue_head_t notify_led_event;
75 wait_queue_head_t idleModeSyncEvent;
76 struct task_struct *led_cntrl_threadid;
77 int led_thread_running;
80 } LED_INFO_STRUCT, *PLED_INFO_STRUCT;
82 /* LED Thread state. */
83 #define BCM_LED_THREAD_DISABLED 0 /* LED Thread is not running. */
84 #define BCM_LED_THREAD_RUNNING_ACTIVELY 1 /* LED thread is running. */
85 #define BCM_LED_THREAD_RUNNING_INACTIVELY 2 /* LED thread has been put on hold */