firmware/build_patches/dir300/990_fix_wifi_led.patch

76 lines
1.8 KiB
Diff

--- a/drivers/net/wireless/ath/ath5k/led.c 2012-01-07 22:00:48.498399679 +0100
+++ b/drivers/net/wireless/ath/ath5k/led.c 2012-01-07 22:04:06.783382922 +0100
@@ -41,6 +41,7 @@
#include <linux/pci.h>
#include "ath5k.h"
+#include <gpio.h>
#define ATH_SDEVICE(subv, subd) \
.vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
@@ -97,14 +98,22 @@
{
if (!test_bit(ATH_STAT_LEDSOFT, ah->status))
return;
+#ifdef CONFIG_ATHEROS_AR231X
+ gpio_set_value(ah->led_pin, ah->led_on);
+#else
ath5k_hw_set_gpio(ah, ah->led_pin, ah->led_on);
+#endif
}
void ath5k_led_off(struct ath5k_hw *ah)
{
if (!test_bit(ATH_STAT_LEDSOFT, ah->status))
return;
+#ifdef CONFIG_ATHEROS_AR231X
+ gpio_set_value(ah->led_pin, !ah->led_on);
+#else
ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on);
+#endif
}
static void
@@ -160,29 +169,33 @@
{
int ret = 0;
struct ieee80211_hw *hw = ah->hw;
-#ifndef CONFIG_ATHEROS_AR231X
- struct pci_dev *pdev = ah->pdev;
-#endif
char name[ATH5K_LED_MAX_NAME_LEN + 1];
const struct pci_device_id *match;
- if (!ah->pdev)
- return 0;
-
+ printk(KERN_ERR "ath5k: init_leds\n");
#ifdef CONFIG_ATHEROS_AR231X
match = NULL;
+ __set_bit(ATH_STAT_LEDSOFT, ah->status);
+ ah->led_pin = 2;
+ ah->led_on = 0;
+
+ gpio_direction_output(ah->led_pin, 1);
#else
- match = pci_match_id(&ath5k_led_devices[0], pdev);
-#endif
+ if (!ah->pdev)
+ return 0;
+
+ match = pci_match_id(&ath5k_led_devices[0], ah->pdev);
if (match) {
__set_bit(ATH_STAT_LEDSOFT, ah->status);
ah->led_pin = ATH_PIN(match->driver_data);
ah->led_on = ATH_POLARITY(match->driver_data);
}
+#endif
if (!test_bit(ATH_STAT_LEDSOFT, ah->status))
goto out;
+ printk(KERN_ERR "ath5k: enable led\n");
ath5k_led_enable(ah);
snprintf(name, sizeof(name), "ath5k-%s::rx", wiphy_name(hw->wiphy));