fc = le16_to_cpu(hdr->frame_control); 
fc = le16_to_cpu(hdr->frame_ctl); 
ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,			       struct sk_buff *skb,			       struct hostap_80211_rx_status *rx_stats,			       int wds){	int ret;	struct sta_info *sta;	u16 fc, type, stype;	struct hostap_ieee80211_hdr *hdr;	if (local->ap == NULL)		return AP_RX_CONTINUE;	hdr = (struct hostap_ieee80211_hdr *) skb->data;	fc = le16_to_cpu(hdr->frame_control);	type = HOSTAP_FC_GET_TYPE(fc);	stype = HOSTAP_FC_GET_STYPE(fc);	spin_lock(&local->ap->sta_table_lock);	sta = ap_get_sta(local->ap, hdr->addr2);	if (sta)		atomic_inc(&sta->users);	spin_unlock(&local->ap->sta_table_lock);	if (sta && !(sta->flags & WLAN_STA_AUTHORIZED))		ret = AP_RX_CONTINUE_NOT_AUTHORIZED;	else		ret = AP_RX_CONTINUE;	if (fc & WLAN_FC_TODS) {		if (!wds && (sta == NULL || !(sta->flags & WLAN_STA_ASSOC))) {			if (local->hostapd) {				prism2_rx_80211(local->apdev, skb, rx_stats,						PRISM2_RX_NON_ASSOC);#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT			} else {				printk(KERN_DEBUG "%s: dropped received packet"				       " from non-associated STA " MACSTR				       " (type=0x%02x, subtype=0x%02x)\n",				       dev->name, MAC2STR(hdr->addr2), type,				       stype);				hostap_rx(dev, skb, rx_stats);#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */			}			ret = AP_RX_EXIT;			goto out;		}	} else if (fc & WLAN_FC_FROMDS) {		if (!wds) {			/* FromDS frame - not for us; probably			 * broadcast/multicast in another BSS - drop */			if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) {				printk(KERN_DEBUG "Odd.. FromDS packet "				       "received with own BSSID\n");				hostap_dump_rx_80211(dev->name, skb, rx_stats);			}			ret = AP_RX_DROP;			goto out;		}	} else if (stype == WLAN_FC_STYPE_NULLFUNC && sta == NULL &&		   memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) {		if (local->hostapd) {			prism2_rx_80211(local->apdev, skb, rx_stats,					PRISM2_RX_NON_ASSOC);#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT		} else {			/* At least Lucent f/w seems to send data::nullfunc			 * frames with no ToDS flag when the current AP returns			 * after being unavailable for some time. Speed up			 * re-association by informing the station about it not			 * being associated. */			printk(KERN_DEBUG "%s: rejected received nullfunc "			       "frame without ToDS from not associated STA "			       MACSTR "\n",			       dev->name, MAC2STR(hdr->addr2));			hostap_rx(dev, skb, rx_stats);#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */		}		ret = AP_RX_EXIT;		goto out;	} else if (stype == WLAN_FC_STYPE_NULLFUNC) {		/* At least Lucent cards seem to send periodic nullfunc		 * frames with ToDS. Let these through to update SQ		 * stats and PS state. Nullfunc frames do not contain		 * any data and they will be dropped below. */	} else {		/* If BSSID (Addr3) is foreign, this frame is a normal		 * broadcast frame from an IBSS network. Drop it silently.		 * If BSSID is own, report the dropping of this frame. */		if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) {			printk(KERN_DEBUG "%s: dropped received packet from "			       MACSTR " with no ToDS flag (type=0x%02x, "			       "subtype=0x%02x)\n", dev->name,			       MAC2STR(hdr->addr2), type, stype);			hostap_dump_rx_80211(dev->name, skb, rx_stats);		}		ret = AP_RX_DROP;		goto out;	}	if (sta) {		hostap_update_sta_ps2(local, sta, fc & WLAN_FC_PWRMGT,				      type, stype);		sta->rx_packets++;		sta->rx_bytes += skb->len;		sta->last_rx = jiffies;	}	if (local->ap->nullfunc_ack && stype == WLAN_FC_STYPE_NULLFUNC &&	    fc & WLAN_FC_TODS) {		if (local->hostapd) {			prism2_rx_80211(local->apdev, skb, rx_stats,					PRISM2_RX_NULLFUNC_ACK);#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT		} else {			/* some STA f/w's seem to require control::ACK frame			 * for data::nullfunc, but Prism2 f/w 0.8.0 (at least			 * from Compaq) does not send this.. Try to generate			 * ACK for these frames from the host driver to make			 * power saving work with, e.g., Lucent WaveLAN f/w */			hostap_rx(dev, skb, rx_stats);#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */		}		ret = AP_RX_EXIT;		goto out;	} out:	if (sta)		atomic_dec(&sta->users);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c0f72ca8e4f1b459b5582c1c8dcaf7e53151f069/hostap_ap.c/clean/drivers/net/wireless/hostap/hostap_ap.c