From: Johannes Berg <[EMAIL PROTECTED]>
Date: Fri Jan 6 18:11:23 2006 +0100
Subject: [PATCH] softmac: correctly use netif_carrier_{on,off}
TODO: add callbacks for ifup/ifdown (see mailing list)
Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
net/ieee80211/softmac/ieee80211softmac_assoc.c | 4 ++--
net/ieee80211/softmac/ieee80211softmac_auth.c | 2 ++
net/ieee80211/softmac/ieee80211softmac_module.c | 15 ++-------------
3 files changed, 6 insertions(+), 15 deletions(-)
58740675572ab5811a48dbbdbb8278ee6a13ba49
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c
b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index 9848744..085022f 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -268,7 +268,7 @@ ieee80211softmac_associated(struct ieee8
if (mac->set_bssid_filter)
mac->set_bssid_filter(mac->dev, net->bssid);
memcpy(mac->ieee->bssid, net->bssid, ETH_ALEN);
- mac->dev->flags |= IFF_RUNNING;
+ netif_carrier_on(mac->dev);
mac->association_id = le16_to_cpup(&resp->aid);
}
@@ -346,7 +346,7 @@ ieee80211softmac_handle_disassoc(struct
struct ieee80211softmac_device *mac = ieee80211_priv(dev);
unsigned long flags;
dprintk(KERN_INFO PFX "got disassoc frame\n");
-
+ netif_carrier_off(dev);
spin_lock_irqsave(&mac->lock, flags);
mac->associnfo.bssvalid = 0;
mac->associated = 0;
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c
b/net/ieee80211/softmac/ieee80211softmac_auth.c
index 5a77352..6eab2be 100644
--- a/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ b/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -278,6 +278,8 @@ ieee80211softmac_deauth_from_net(struct
kfree(net->challenge);
kfree(net);
+ /* can't transmit data right now... */
+ netif_carrier_off(mac->dev);
/* let's try to re-associate */
schedule_work(&mac->associnfo.work);
spin_unlock_irqrestore(&mac->lock, flags);
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c
b/net/ieee80211/softmac/ieee80211softmac_module.c
index 79ef959..ea4a19e 100644
--- a/net/ieee80211/softmac/ieee80211softmac_module.c
+++ b/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -40,21 +40,10 @@ struct net_device *alloc_ieee80211softma
softmac->txrates.default_rate = IEEE80211_CCK_RATE_1MB;
softmac->txrates.default_fallback = IEEE80211_CCK_RATE_1MB;
- /* should we also assign softmac->mgmt_xmit here so
- * that it is always valid? If so, we probably want
- * to define a new function for that which just
- * wraps ieee80211_tx_frame
- */
+ /* to start with, we can't send anything ... */
+ netif_carrier_off(dev);
- /* until associated, we're not ready */
- dev->flags &= ~IFF_RUNNING;
-
return dev;
-
-err_free_ieee80211:
- free_ieee80211(dev);
-
- return NULL;
}
/* Clears the pending work queue items, stops all scans, etc. */
--
1.2.4
--
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html