ath5k: support LEDs on Acer Aspire One netbook
[pandora-kernel.git] / drivers / net / wireless / ath5k / base.c
index 4af2607..fdf7733 100644 (file)
@@ -232,7 +232,7 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
                int mc_count, struct dev_mc_list *mclist);
 static int ath5k_set_key(struct ieee80211_hw *hw,
                enum set_key_cmd cmd,
-               const u8 *local_addr, const u8 *addr,
+               struct ieee80211_vif *vif, struct ieee80211_sta *sta,
                struct ieee80211_key_conf *key);
 static int ath5k_get_stats(struct ieee80211_hw *hw,
                struct ieee80211_low_level_stats *stats);
@@ -2596,6 +2596,13 @@ ath5k_init_leds(struct ath5k_softc *sc)
                sc->led_pin = 1;
                sc->led_on = 1;  /* active high */
        }
+       /* Pin 3 on Foxconn chips used in Acer Aspire One (0x105b:e008) */
+       if (pdev->subsystem_vendor == PCI_VENDOR_ID_FOXCONN) {
+               __set_bit(ATH_STAT_LEDSOFT, sc->status);
+               sc->led_pin = 3;
+               sc->led_on = 0;  /* active low */
+       }
+
        if (!test_bit(ATH_STAT_LEDSOFT, sc->status))
                goto out;
 
@@ -2644,7 +2651,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
                if (skb_headroom(skb) < padsize) {
                        ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough"
                                  " headroom to pad %d\n", hdrlen, padsize);
-                       return -1;
+                       return NETDEV_TX_BUSY;
                }
                skb_push(skb, padsize);
                memmove(skb->data, skb->data+padsize, hdrlen);
@@ -2655,7 +2662,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
                ATH5K_ERR(sc, "no further txbuf available, dropping packet\n");
                spin_unlock_irqrestore(&sc->txbuflock, flags);
                ieee80211_stop_queue(hw, skb_get_queue_mapping(skb));
-               return -1;
+               return NETDEV_TX_BUSY;
        }
        bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list);
        list_del(&bf->list);
@@ -2673,10 +2680,10 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
                sc->txbuf_len++;
                spin_unlock_irqrestore(&sc->txbuflock, flags);
                dev_kfree_skb_any(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static int
@@ -2991,8 +2998,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
 
 static int
 ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
-               const u8 *local_addr, const u8 *addr,
-               struct ieee80211_key_conf *key)
+             struct ieee80211_vif *vif, struct ieee80211_sta *sta,
+             struct ieee80211_key_conf *key)
 {
        struct ath5k_softc *sc = hw->priv;
        int ret = 0;
@@ -3015,7 +3022,8 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 
        switch (cmd) {
        case SET_KEY:
-               ret = ath5k_hw_set_key(sc->ah, key->keyidx, key, addr);
+               ret = ath5k_hw_set_key(sc->ah, key->keyidx, key,
+                                      sta ? sta->addr : NULL);
                if (ret) {
                        ATH5K_ERR(sc, "can't set the key\n");
                        goto unlock;