Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cf966838cd5596ca61d3e9949050442a943f6238
Commit:     cf966838cd5596ca61d3e9949050442a943f6238
Parent:     eb063c1702a84d58eb4c05a032bbff6f1c29049d
Author:     Johannes Berg <[EMAIL PROTECTED]>
AuthorDate: Tue Aug 28 17:01:54 2007 -0400
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:48:48 2007 -0700

    [MAC80211]: use switch statement in tx code
    
    The transmit code needs to set the addresses depending on the
    interface type, a likely() for AP/VLAN is quite wrong since
    most people will be using STA; convert to a switch statement
    to make it look nicer.
    
    Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
    Acked-by: Michael Wu <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/mac80211/tx.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c9b909d..53efcf6 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1363,15 +1363,17 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
        /* TODO: handling for 802.1x authorized/unauthorized port */
        fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA;
 
-       if (likely(sdata->type == IEEE80211_IF_TYPE_AP ||
-                  sdata->type == IEEE80211_IF_TYPE_VLAN)) {
+       switch (sdata->type) {
+       case IEEE80211_IF_TYPE_AP:
+       case IEEE80211_IF_TYPE_VLAN:
                fc |= IEEE80211_FCTL_FROMDS;
                /* DA BSSID SA */
                memcpy(hdr.addr1, skb->data, ETH_ALEN);
                memcpy(hdr.addr2, dev->dev_addr, ETH_ALEN);
                memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN);
                hdrlen = 24;
-       } else if (sdata->type == IEEE80211_IF_TYPE_WDS) {
+               break;
+       case IEEE80211_IF_TYPE_WDS:
                fc |= IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS;
                /* RA TA DA SA */
                memcpy(hdr.addr1, sdata->u.wds.remote_addr, ETH_ALEN);
@@ -1379,20 +1381,23 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
                memcpy(hdr.addr3, skb->data, ETH_ALEN);
                memcpy(hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN);
                hdrlen = 30;
-       } else if (sdata->type == IEEE80211_IF_TYPE_STA) {
+               break;
+       case IEEE80211_IF_TYPE_STA:
                fc |= IEEE80211_FCTL_TODS;
                /* BSSID SA DA */
                memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN);
                memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
                memcpy(hdr.addr3, skb->data, ETH_ALEN);
                hdrlen = 24;
-       } else if (sdata->type == IEEE80211_IF_TYPE_IBSS) {
+               break;
+       case IEEE80211_IF_TYPE_IBSS:
                /* DA SA BSSID */
                memcpy(hdr.addr1, skb->data, ETH_ALEN);
                memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
                memcpy(hdr.addr3, sdata->u.sta.bssid, ETH_ALEN);
                hdrlen = 24;
-       } else {
+               break;
+       default:
                ret = 0;
                goto fail;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to