"version %d\n", dev->name, fc & WLAN_FC_PVER); 
"version %d\n", dev->name, fc & IEEE80211_FCTL_VERS); 
int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,		    struct hostap_80211_rx_status *rx_stats, int type){	struct hostap_interface *iface;	local_info_t *local;	int hdrlen, phdrlen, head_need, tail_need;	u16 fc;	int prism_header, ret;	struct ieee80211_hdr *hdr;	iface = netdev_priv(dev);	local = iface->local;	dev->last_rx = jiffies;	if (dev->type == ARPHRD_IEEE80211_PRISM) {		if (local->monitor_type == PRISM2_MONITOR_PRISM) {			prism_header = 1;			phdrlen = sizeof(struct linux_wlan_ng_prism_hdr);		} else { /* local->monitor_type == PRISM2_MONITOR_CAPHDR */			prism_header = 2;			phdrlen = sizeof(struct linux_wlan_ng_cap_hdr);		}	} else {		prism_header = 0;		phdrlen = 0;	}	hdr = (struct ieee80211_hdr *) skb->data;	fc = le16_to_cpu(hdr->frame_ctl);	if (type == PRISM2_RX_MGMT && (fc & WLAN_FC_PVER)) {		printk(KERN_DEBUG "%s: dropped management frame with header "		       "version %d\n", dev->name, fc & WLAN_FC_PVER);		dev_kfree_skb_any(skb);		return 0;	}	hdrlen = hostap_80211_get_hdrlen(fc);	/* check if there is enough room for extra data; if not, expand skb	 * buffer to be large enough for the changes */	head_need = phdrlen;	tail_need = 0;#ifdef PRISM2_ADD_BOGUS_CRC	tail_need += 4;#endif /* PRISM2_ADD_BOGUS_CRC */	head_need -= skb_headroom(skb);	tail_need -= skb_tailroom(skb);	if (head_need > 0 || tail_need > 0) {		if (pskb_expand_head(skb, head_need > 0 ? head_need : 0,				     tail_need > 0 ? tail_need : 0,				     GFP_ATOMIC)) {			printk(KERN_DEBUG "%s: prism2_rx_80211 failed to "			       "reallocate skb buffer\n", dev->name);			dev_kfree_skb_any(skb);			return 0;		}	}	/* We now have an skb with enough head and tail room, so just insert	 * the extra data */#ifdef PRISM2_ADD_BOGUS_CRC	memset(skb_put(skb, 4), 0xff, 4); /* Prism2 strips CRC */#endif /* PRISM2_ADD_BOGUS_CRC */	if (prism_header == 1) {		struct linux_wlan_ng_prism_hdr *hdr;		hdr = (struct linux_wlan_ng_prism_hdr *)			skb_push(skb, phdrlen);		memset(hdr, 0, phdrlen);		hdr->msgcode = LWNG_CAP_DID_BASE;		hdr->msglen = sizeof(*hdr);		memcpy(hdr->devname, dev->name, sizeof(hdr->devname));#define LWNG_SETVAL(f,i,s,l,d) \hdr->f.did = LWNG_CAP_DID_BASE | (i << 12); \hdr->f.status = s; hdr->f.len = l; hdr->f.data = d		LWNG_SETVAL(hosttime, 1, 0, 4, jiffies);		LWNG_SETVAL(mactime, 2, 0, 4, rx_stats->mac_time);		LWNG_SETVAL(channel, 3, 1 /* no value */, 4, 0);		LWNG_SETVAL(rssi, 4, 1 /* no value */, 4, 0);		LWNG_SETVAL(sq, 5, 1 /* no value */, 4, 0);		LWNG_SETVAL(signal, 6, 0, 4, rx_stats->signal);		LWNG_SETVAL(noise, 7, 0, 4, rx_stats->noise);		LWNG_SETVAL(rate, 8, 0, 4, rx_stats->rate / 5);		LWNG_SETVAL(istx, 9, 0, 4, 0);		LWNG_SETVAL(frmlen, 10, 0, 4, skb->len - phdrlen);#undef LWNG_SETVAL	} else if (prism_header == 2) {		struct linux_wlan_ng_cap_hdr *hdr;		hdr = (struct linux_wlan_ng_cap_hdr *)			skb_push(skb, phdrlen);		memset(hdr, 0, phdrlen);		hdr->version    = htonl(LWNG_CAPHDR_VERSION);		hdr->length     = htonl(phdrlen);		hdr->mactime    = __cpu_to_be64(rx_stats->mac_time);		hdr->hosttime   = __cpu_to_be64(jiffies);		hdr->phytype    = htonl(4); /* dss_dot11_b */		hdr->channel    = htonl(local->channel);		hdr->datarate   = htonl(rx_stats->rate);		hdr->antenna    = htonl(0); /* unknown */		hdr->priority   = htonl(0); /* unknown */		hdr->ssi_type   = htonl(3); /* raw */		hdr->ssi_signal = htonl(rx_stats->signal);		hdr->ssi_noise  = htonl(rx_stats->noise);		hdr->preamble   = htonl(0); /* unknown */		hdr->encoding   = htonl(1); /* cck */	}	ret = skb->len - phdrlen;	skb->dev = dev;	skb->mac.raw = skb->data;	skb_pull(skb, hdrlen);	if (prism_header)		skb_pull(skb, phdrlen);	skb->pkt_type = PACKET_OTHERHOST;	skb->protocol = __constant_htons(ETH_P_802_2);	memset(skb->cb, 0, sizeof(skb->cb));	netif_rx(skb);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b2f4a2e3b1620667da9654f9e220c92ea52bdbe4/hostap_80211_rx.c/buggy/drivers/net/wireless/hostap/hostap_80211_rx.c