aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath5k/base.c140
1 files changed, 0 insertions, 140 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index f2e5c3936f06..cad3ccf61b00 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -370,11 +370,6 @@ static irqreturn_t ath5k_intr(int irq, void *dev_id);
370static void ath5k_tasklet_reset(unsigned long data); 370static void ath5k_tasklet_reset(unsigned long data);
371 371
372static void ath5k_calibrate(unsigned long data); 372static void ath5k_calibrate(unsigned long data);
373/* LED functions */
374static int ath5k_init_leds(struct ath5k_softc *sc);
375static void ath5k_led_enable(struct ath5k_softc *sc);
376static void ath5k_led_off(struct ath5k_softc *sc);
377static void ath5k_unregister_leds(struct ath5k_softc *sc);
378 373
379/* 374/*
380 * Module init/exit functions 375 * Module init/exit functions
@@ -2530,141 +2525,6 @@ ath5k_calibrate(unsigned long data)
2530} 2525}
2531 2526
2532 2527
2533
2534/***************\
2535* LED functions *
2536\***************/
2537
2538static void
2539ath5k_led_enable(struct ath5k_softc *sc)
2540{
2541 if (test_bit(ATH_STAT_LEDSOFT, sc->status)) {
2542 ath5k_hw_set_gpio_output(sc->ah, sc->led_pin);
2543 ath5k_led_off(sc);
2544 }
2545}
2546
2547static void
2548ath5k_led_on(struct ath5k_softc *sc)
2549{
2550 if (!test_bit(ATH_STAT_LEDSOFT, sc->status))
2551 return;
2552 ath5k_hw_set_gpio(sc->ah, sc->led_pin, sc->led_on);
2553}
2554
2555static void
2556ath5k_led_off(struct ath5k_softc *sc)
2557{
2558 if (!test_bit(ATH_STAT_LEDSOFT, sc->status))
2559 return;
2560 ath5k_hw_set_gpio(sc->ah, sc->led_pin, !sc->led_on);
2561}
2562
2563static void
2564ath5k_led_brightness_set(struct led_classdev *led_dev,
2565 enum led_brightness brightness)
2566{
2567 struct ath5k_led *led = container_of(led_dev, struct ath5k_led,
2568 led_dev);
2569
2570 if (brightness == LED_OFF)
2571 ath5k_led_off(led->sc);
2572 else
2573 ath5k_led_on(led->sc);
2574}
2575
2576static int
2577ath5k_register_led(struct ath5k_softc *sc, struct ath5k_led *led,
2578 const char *name, char *trigger)
2579{
2580 int err;
2581
2582 led->sc = sc;
2583 strncpy(led->name, name, sizeof(led->name));
2584 led->led_dev.name = led->name;
2585 led->led_dev.default_trigger = trigger;
2586 led->led_dev.brightness_set = ath5k_led_brightness_set;
2587
2588 err = led_classdev_register(&sc->pdev->dev, &led->led_dev);
2589 if (err) {
2590 ATH5K_WARN(sc, "could not register LED %s\n", name);
2591 led->sc = NULL;
2592 }
2593 return err;
2594}
2595
2596static void
2597ath5k_unregister_led(struct ath5k_led *led)
2598{
2599 if (!led->sc)
2600 return;
2601 led_classdev_unregister(&led->led_dev);
2602 ath5k_led_off(led->sc);
2603 led->sc = NULL;
2604}
2605
2606static void
2607ath5k_unregister_leds(struct ath5k_softc *sc)
2608{
2609 ath5k_unregister_led(&sc->rx_led);
2610 ath5k_unregister_led(&sc->tx_led);
2611}
2612
2613
2614static int
2615ath5k_init_leds(struct ath5k_softc *sc)
2616{
2617 int ret = 0;
2618 struct ieee80211_hw *hw = sc->hw;
2619 struct pci_dev *pdev = sc->pdev;
2620 char name[ATH5K_LED_MAX_NAME_LEN + 1];
2621
2622 /*
2623 * Auto-enable soft led processing for IBM cards and for
2624 * 5211 minipci cards.
2625 */
2626 if (pdev->device == PCI_DEVICE_ID_ATHEROS_AR5212_IBM ||
2627 pdev->device == PCI_DEVICE_ID_ATHEROS_AR5211) {
2628 __set_bit(ATH_STAT_LEDSOFT, sc->status);
2629 sc->led_pin = 0;
2630 sc->led_on = 0; /* active low */
2631 }
2632 /* Enable softled on PIN1 on HP Compaq nc6xx, nc4000 & nx5000 laptops */
2633 if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ) {
2634 __set_bit(ATH_STAT_LEDSOFT, sc->status);
2635 sc->led_pin = 1;
2636 sc->led_on = 1; /* active high */
2637 }
2638 /*
2639 * Pin 3 on Foxconn chips used in Acer Aspire One (0x105b:e008) and
2640 * in emachines notebooks with AMBIT subsystem.
2641 */
2642 if (pdev->subsystem_vendor == PCI_VENDOR_ID_FOXCONN ||
2643 pdev->subsystem_vendor == PCI_VENDOR_ID_AMBIT) {
2644 __set_bit(ATH_STAT_LEDSOFT, sc->status);
2645 sc->led_pin = 3;
2646 sc->led_on = 0; /* active low */
2647 }
2648
2649 if (!test_bit(ATH_STAT_LEDSOFT, sc->status))
2650 goto out;
2651
2652 ath5k_led_enable(sc);
2653
2654 snprintf(name, sizeof(name), "ath5k-%s::rx", wiphy_name(hw->wiphy));
2655 ret = ath5k_register_led(sc, &sc->rx_led, name,
2656 ieee80211_get_rx_led_name(hw));
2657 if (ret)
2658 goto out;
2659
2660 snprintf(name, sizeof(name), "ath5k-%s::tx", wiphy_name(hw->wiphy));
2661 ret = ath5k_register_led(sc, &sc->tx_led, name,
2662 ieee80211_get_tx_led_name(hw));
2663out:
2664 return ret;
2665}
2666
2667
2668/********************\ 2528/********************\
2669* Mac80211 functions * 2529* Mac80211 functions *
2670\********************/ 2530\********************/