Lines Matching refs:dev

21 static void b43_led_turn_on(struct b43_wldev *dev, u8 led_index,  in b43_led_turn_on()  argument
26 ctl = b43_read16(dev, B43_MMIO_GPIO_CONTROL); in b43_led_turn_on()
31 b43_write16(dev, B43_MMIO_GPIO_CONTROL, ctl); in b43_led_turn_on()
34 static void b43_led_turn_off(struct b43_wldev *dev, u8 led_index, in b43_led_turn_off() argument
39 ctl = b43_read16(dev, B43_MMIO_GPIO_CONTROL); in b43_led_turn_off()
44 b43_write16(dev, B43_MMIO_GPIO_CONTROL, ctl); in b43_led_turn_off()
47 static void b43_led_update(struct b43_wldev *dev, in b43_led_update() argument
56 radio_enabled = (dev->phy.radio_on && dev->radio_hw_enable); in b43_led_update()
70 b43_led_turn_on(dev, led->index, led->activelow); in b43_led_update()
72 b43_led_turn_off(dev, led->index, led->activelow); in b43_led_update()
79 struct b43_wldev *dev; in b43_leds_work() local
82 dev = wl->current_dev; in b43_leds_work()
83 if (unlikely(!dev || b43_status(dev) < B43_STAT_STARTED)) in b43_leds_work()
86 b43_led_update(dev, &wl->leds.led_tx); in b43_leds_work()
87 b43_led_update(dev, &wl->leds.led_rx); in b43_leds_work()
88 b43_led_update(dev, &wl->leds.led_radio); in b43_leds_work()
89 b43_led_update(dev, &wl->leds.led_assoc); in b43_leds_work()
108 static int b43_register_led(struct b43_wldev *dev, struct b43_led *led, in b43_register_led() argument
118 led->wl = dev->wl; in b43_register_led()
128 err = led_classdev_register(dev->dev->dev, &led->led_dev); in b43_register_led()
130 b43warn(dev->wl, "LEDs: Failed to register %s\n", name); in b43_register_led()
146 static void b43_map_led(struct b43_wldev *dev, in b43_map_led() argument
151 struct ieee80211_hw *hw = dev->wl->hw; in b43_map_led()
166 b43_register_led(dev, &dev->wl->leds.led_tx, name, in b43_map_led()
171 b43_register_led(dev, &dev->wl->leds.led_rx, name, in b43_map_led()
181 b43_register_led(dev, &dev->wl->leds.led_radio, name, in b43_map_led()
189 b43_register_led(dev, &dev->wl->leds.led_assoc, name, in b43_map_led()
194 b43warn(dev->wl, "LEDs: Unknown behaviour 0x%02X\n", in b43_map_led()
200 static void b43_led_get_sprominfo(struct b43_wldev *dev, in b43_led_get_sprominfo() argument
207 sprom[0] = dev->dev->bus_sprom->gpio0; in b43_led_get_sprominfo()
208 sprom[1] = dev->dev->bus_sprom->gpio1; in b43_led_get_sprominfo()
209 sprom[2] = dev->dev->bus_sprom->gpio2; in b43_led_get_sprominfo()
210 sprom[3] = dev->dev->bus_sprom->gpio3; in b43_led_get_sprominfo()
220 if (dev->dev->board_vendor == PCI_VENDOR_ID_COMPAQ) in b43_led_get_sprominfo()
225 if (dev->dev->board_vendor == PCI_VENDOR_ID_ASUSTEK) in b43_led_get_sprominfo()
249 void b43_leds_init(struct b43_wldev *dev) in b43_leds_init() argument
257 led = &dev->wl->leds.led_radio; in b43_leds_init()
259 if (dev->phy.radio_on && b43_is_hw_radio_enabled(dev)) { in b43_leds_init()
260 b43_led_turn_on(dev, led->index, led->activelow); in b43_leds_init()
264 b43_led_turn_off(dev, led->index, led->activelow); in b43_leds_init()
271 led = &dev->wl->leds.led_tx; in b43_leds_init()
273 b43_led_turn_off(dev, led->index, led->activelow); in b43_leds_init()
277 led = &dev->wl->leds.led_rx; in b43_leds_init()
279 b43_led_turn_off(dev, led->index, led->activelow); in b43_leds_init()
283 led = &dev->wl->leds.led_assoc; in b43_leds_init()
285 b43_led_turn_off(dev, led->index, led->activelow); in b43_leds_init()
292 b43_led_get_sprominfo(dev, i, &behaviour, &activelow); in b43_leds_init()
295 b43_led_turn_off(dev, i, activelow); in b43_leds_init()
298 b43_led_turn_on(dev, i, activelow); in b43_leds_init()
306 dev->wl->leds.stop = 0; in b43_leds_init()
309 void b43_leds_exit(struct b43_wldev *dev) in b43_leds_exit() argument
311 struct b43_leds *leds = &dev->wl->leds; in b43_leds_exit()
313 b43_led_turn_off(dev, leds->led_tx.index, leds->led_tx.activelow); in b43_leds_exit()
314 b43_led_turn_off(dev, leds->led_rx.index, leds->led_rx.activelow); in b43_leds_exit()
315 b43_led_turn_off(dev, leds->led_assoc.index, leds->led_assoc.activelow); in b43_leds_exit()
316 b43_led_turn_off(dev, leds->led_radio.index, leds->led_radio.activelow); in b43_leds_exit()
319 void b43_leds_stop(struct b43_wldev *dev) in b43_leds_stop() argument
321 struct b43_leds *leds = &dev->wl->leds; in b43_leds_stop()
327 void b43_leds_register(struct b43_wldev *dev) in b43_leds_register() argument
333 INIT_WORK(&dev->wl->leds.work, b43_leds_work); in b43_leds_register()
337 b43_led_get_sprominfo(dev, i, &behaviour, &activelow); in b43_leds_register()
338 b43_map_led(dev, i, behaviour, activelow); in b43_leds_register()