]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'fixes-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Nov 2007 12:29:27 +0000 (23:29 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Nov 2007 12:29:27 +0000 (23:29 +1100)
net/ieee80211/ieee80211_tx.c
net/mac80211/ieee80211.c
net/mac80211/rx.c
net/mac80211/wep.c
net/rfkill/rfkill.c

index a4c3c51140a3a3cb55533f7842cc673fe50bd6a7..6d06f1385e2803cd1f263917e8bd6f8d2684a834 100644 (file)
@@ -144,7 +144,8 @@ static int ieee80211_copy_snap(u8 * data, u16 h_proto)
        snap->oui[1] = oui[1];
        snap->oui[2] = oui[2];
 
-       *(u16 *) (data + SNAP_SIZE) = htons(h_proto);
+       h_proto = htons(h_proto);
+       memcpy(data + SNAP_SIZE, &h_proto, sizeof(u16));
 
        return SNAP_SIZE + sizeof(u16);
 }
index 59350b8727ecdcb97230f5e8e3530d886021fdaa..505af1f067ab06620fcb2050a2725a711c321f66 100644 (file)
@@ -216,6 +216,7 @@ static int ieee80211_open(struct net_device *dev)
                        res = local->ops->start(local_to_hw(local));
                if (res)
                        return res;
+               ieee80211_hw_config(local);
        }
 
        switch (sdata->type) {
@@ -232,7 +233,6 @@ static int ieee80211_open(struct net_device *dev)
                        netif_tx_unlock_bh(local->mdev);
 
                        local->hw.conf.flags |= IEEE80211_CONF_RADIOTAP;
-                       ieee80211_hw_config(local);
                }
                break;
        case IEEE80211_IF_TYPE_STA:
@@ -334,8 +334,7 @@ static int ieee80211_stop(struct net_device *dev)
                        ieee80211_configure_filter(local);
                        netif_tx_unlock_bh(local->mdev);
 
-                       local->hw.conf.flags |= IEEE80211_CONF_RADIOTAP;
-                       ieee80211_hw_config(local);
+                       local->hw.conf.flags &= ~IEEE80211_CONF_RADIOTAP;
                }
                break;
        case IEEE80211_IF_TYPE_STA:
@@ -357,6 +356,11 @@ static int ieee80211_stop(struct net_device *dev)
                        cancel_delayed_work(&local->scan_work);
                }
                flush_workqueue(local->hw.workqueue);
+
+               sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED;
+               kfree(sdata->u.sta.extra_ie);
+               sdata->u.sta.extra_ie = NULL;
+               sdata->u.sta.extra_ie_len = 0;
                /* fall through */
        default:
                conf.if_id = dev->ifindex;
index 428a9fcf57d62c90c6537490fd193d6342b47ee7..00f908d9275e3e69a92daf1cc4d6741015d051d5 100644 (file)
@@ -997,7 +997,7 @@ ieee80211_rx_h_drop_unencrypted(struct ieee80211_txrx_data *rx)
        if (unlikely(!(rx->fc & IEEE80211_FCTL_PROTECTED) &&
                     (rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA &&
                     (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_NULLFUNC &&
-                    rx->sdata->drop_unencrypted &&
+                    (rx->key || rx->sdata->drop_unencrypted) &&
                     (rx->sdata->eapol == 0 || !ieee80211_is_eapol(rx->skb)))) {
                if (net_ratelimit())
                        printk(KERN_DEBUG "%s: RX non-WEP frame, but expected "
index 9bf0e1cc530ad5e9c8975d50cbca6cefddd673e3..b5f3413403bd27c0d2646f2b210bfc36123cc8c8 100644 (file)
@@ -265,7 +265,8 @@ int ieee80211_wep_decrypt(struct ieee80211_local *local, struct sk_buff *skb,
        if (ieee80211_wep_decrypt_data(local->wep_rx_tfm, rc4key, klen,
                                       skb->data + hdrlen + WEP_IV_LEN,
                                       len)) {
-               printk(KERN_DEBUG "WEP decrypt failed (ICV)\n");
+               if (net_ratelimit())
+                       printk(KERN_DEBUG "WEP decrypt failed (ICV)\n");
                ret = -1;
        }
 
index 73d60a307129110de0aec93b57c6fdacd76d1b88..4469a7be006c270c4be87700cdf7364aa0a5d765 100644 (file)
@@ -60,11 +60,7 @@ static void rfkill_led_trigger(struct rfkill *rfkill,
 static int rfkill_toggle_radio(struct rfkill *rfkill,
                                enum rfkill_state state)
 {
-       int retval;
-
-       retval = mutex_lock_interruptible(&rfkill->mutex);
-       if (retval)
-               return retval;
+       int retval = 0;
 
        if (state != rfkill->state) {
                retval = rfkill->toggle_radio(rfkill->data, state);
@@ -74,7 +70,6 @@ static int rfkill_toggle_radio(struct rfkill *rfkill,
                }
        }
 
-       mutex_unlock(&rfkill->mutex);
        return retval;
 }
 
@@ -158,12 +153,13 @@ static ssize_t rfkill_state_store(struct device *dev,
        if (!capable(CAP_NET_ADMIN))
                return -EPERM;
 
+       if (mutex_lock_interruptible(&rfkill->mutex))
+               return -ERESTARTSYS;
        error = rfkill_toggle_radio(rfkill,
                        state ? RFKILL_STATE_ON : RFKILL_STATE_OFF);
-       if (error)
-               return error;
+       mutex_unlock(&rfkill->mutex);
 
-       return count;
+       return error ? error : count;
 }
 
 static ssize_t rfkill_claim_show(struct device *dev,