struct hostap_ieee80211_hdr *hdr; 
struct ieee80211_hdr *hdr; 
ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx){	struct sta_info *sta = NULL;	struct sk_buff *skb = tx->skb;	int set_tim, ret;	struct hostap_ieee80211_hdr *hdr;	struct hostap_skb_tx_data *meta;	meta = (struct hostap_skb_tx_data *) skb->cb;	ret = AP_TX_CONTINUE;	if (local->ap == NULL || skb->len < 10 ||	    meta->iface->type == HOSTAP_INTERFACE_STA)		goto out;	hdr = (struct hostap_ieee80211_hdr *) skb->data;	if (hdr->addr1[0] & 0x01) {		/* broadcast/multicast frame - no AP related processing */		goto out;	}	/* unicast packet - check whether destination STA is associated */	spin_lock(&local->ap->sta_table_lock);	sta = ap_get_sta(local->ap, hdr->addr1);	if (sta)		atomic_inc(&sta->users);	spin_unlock(&local->ap->sta_table_lock);	if (local->iw_mode == IW_MODE_MASTER && sta == NULL &&	    !(meta->flags & HOSTAP_TX_FLAGS_WDS) &&	    meta->iface->type != HOSTAP_INTERFACE_MASTER &&	    meta->iface->type != HOSTAP_INTERFACE_AP) {#if 0		/* This can happen, e.g., when wlan0 is added to a bridge and		 * bridging code does not know which port is the correct target		 * for a unicast frame. In this case, the packet is send to all		 * ports of the bridge. Since this is a valid scenario, do not		 * print out any errors here. */		if (net_ratelimit()) {			printk(KERN_DEBUG "AP: drop packet to non-associated "			       "STA " MACSTR "\n", MAC2STR(hdr->addr1));		}#endif		local->ap->tx_drop_nonassoc++;		ret = AP_TX_DROP;		goto out;	}	if (sta == NULL)		goto out;	if (!(sta->flags & WLAN_STA_AUTHORIZED))		ret = AP_TX_CONTINUE_NOT_AUTHORIZED;	/* Set tx_rate if using host-based TX rate control */	if (!local->fw_tx_rate_control)		local->ap->last_tx_rate = meta->rate =			ap_update_sta_tx_rate(sta, local->dev);	if (local->iw_mode != IW_MODE_MASTER)		goto out;	if (!(sta->flags & WLAN_STA_PS))		goto out;	if (meta->flags & HOSTAP_TX_FLAGS_ADD_MOREDATA) {		/* indicate to STA that more frames follow */		hdr->frame_control |= __constant_cpu_to_le16(WLAN_FC_MOREDATA);	}	if (meta->flags & HOSTAP_TX_FLAGS_BUFFERED_FRAME) {		/* packet was already buffered and now send due to		 * PS poll, so do not rebuffer it */		goto out;	}	if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) {		PDEBUG(DEBUG_PS, "%s: No more space in STA (" MACSTR ")'s PS "		       "mode buffer\n", local->dev->name, MAC2STR(sta->addr));		/* Make sure that TIM is set for the station (it might not be		 * after AP wlan hw reset). */		/* FIX: should fix hw reset to restore bits based on STA		 * buffer state.. */		hostap_set_tim(local, sta->aid, 1);		sta->flags |= WLAN_STA_TIM;		ret = AP_TX_DROP;		goto out;	}	/* STA in PS mode, buffer frame for later delivery */	set_tim = skb_queue_empty(&sta->tx_buf);	skb_queue_tail(&sta->tx_buf, skb);	/* FIX: could save RX time to skb and expire buffered frames after	 * some time if STA does not poll for them */	if (set_tim) {		if (sta->flags & WLAN_STA_TIM)			PDEBUG(DEBUG_PS2, "Re-setting TIM for aid %d\n",			       sta->aid);		hostap_set_tim(local, sta->aid, 1);		sta->flags |= WLAN_STA_TIM;	}	ret = AP_TX_BUFFERED; out:	if (sta != NULL) {		if (ret == AP_TX_CONTINUE ||		    ret == AP_TX_CONTINUE_NOT_AUTHORIZED) {			sta->tx_packets++;			sta->tx_bytes += skb->len;			sta->last_tx = jiffies;		}		if ((ret == AP_TX_CONTINUE ||		     ret == AP_TX_CONTINUE_NOT_AUTHORIZED) &&		    sta->crypt && tx->host_encrypt) {			tx->crypt = sta->crypt;			tx->sta_ptr = sta; /* hostap_handle_sta_release() will					    * be called to release sta info					    * later */		} else			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