65 #ifdef CONFIG_CARL9170_LEDS
69 int i,
tmp = 300, blink_delay = 1000;
79 if (ar->leds[i].last_state ||
80 ar->leds[i].toggled) {
82 if (ar->leds[i].toggled)
83 tmp = 70 + 200 / (ar->leds[
i].toggled);
85 if (tmp < blink_delay)
89 ar->leds[
i].toggled = 0;
109 struct carl9170_led *arl =
container_of(led,
struct carl9170_led,
l);
110 struct ar9170 *ar = arl->ar;
112 if (!arl->registered)
115 if (arl->last_state != !!brightness) {
124 static int carl9170_led_register_led(
struct ar9170 *ar,
int i,
char *
name,
129 snprintf(ar->leds[i].name,
sizeof(ar->leds[i].name),
130 "carl9170-%s::%s", wiphy_name(ar->
hw->wiphy), name);
133 ar->leds[
i].l.name = ar->leds[
i].name;
134 ar->leds[
i].l.brightness_set = carl9170_led_set_brightness;
135 ar->leds[
i].l.brightness = 0;
136 ar->leds[
i].l.default_trigger =
trigger;
141 wiphy_err(ar->
hw->wiphy,
"failed to register %s LED (%d).\n",
142 ar->leds[i].name, err);
150 void carl9170_led_unregister(
struct ar9170 *ar)
158 ar->leds[
i].toggled = 0;
164 int carl9170_led_register(
struct ar9170 *ar)
170 err = carl9170_led_register_led(ar, 0,
"tx",
171 ieee80211_get_tx_led_name(ar->
hw));
178 err = carl9170_led_register_led(ar, 1,
"assoc",
179 ieee80211_get_assoc_led_name(ar->
hw));
186 carl9170_led_unregister(ar);