prism2_send_mgmt(local->dev, WLAN_FC_TYPE_MGMT, (deauth ? WLAN_FC_STYPE_DEAUTH : WLAN_FC_STYPE_DISASSOC), 
prism2_send_mgmt(local->dev, IEEE80211_FTYPE_MGMT | (deauth ? IEEE80211_STYPE_DEAUTH : IEEE80211_STYPE_DISASSOC), 
static void ap_handle_timer(unsigned long data){	struct sta_info *sta = (struct sta_info *) data;	local_info_t *local;	struct ap_data *ap;	unsigned long next_time = 0;	int was_assoc;	if (sta == NULL || sta->local == NULL || sta->local->ap == NULL) {		PDEBUG(DEBUG_AP, "ap_handle_timer() called with NULL data\n");		return;	}	local = sta->local;	ap = local->ap;	was_assoc = sta->flags & WLAN_STA_ASSOC;	if (atomic_read(&sta->users) != 0)		next_time = jiffies + HZ;	else if ((sta->flags & WLAN_STA_PERM) && !(sta->flags & WLAN_STA_AUTH))		next_time = jiffies + ap->max_inactivity;	if (time_before(jiffies, sta->last_rx + ap->max_inactivity)) {		/* station activity detected; reset timeout state */		sta->timeout_next = STA_NULLFUNC;		next_time = sta->last_rx + ap->max_inactivity;	} else if (sta->timeout_next == STA_DISASSOC &&		   !(sta->flags & WLAN_STA_PENDING_POLL)) {		/* STA ACKed data nullfunc frame poll */		sta->timeout_next = STA_NULLFUNC;		next_time = jiffies + ap->max_inactivity;	}	if (next_time) {		sta->timer.expires = next_time;		add_timer(&sta->timer);		return;	}	if (sta->ap)		sta->timeout_next = STA_DEAUTH;	if (sta->timeout_next == STA_DEAUTH && !(sta->flags & WLAN_STA_PERM)) {		spin_lock(&ap->sta_table_lock);		ap_sta_hash_del(ap, sta);		list_del(&sta->list);		spin_unlock(&ap->sta_table_lock);		sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC);	} else if (sta->timeout_next == STA_DISASSOC)		sta->flags &= ~WLAN_STA_ASSOC;	if (was_assoc && !(sta->flags & WLAN_STA_ASSOC) && !sta->ap)		hostap_event_expired_sta(local->dev, sta);	if (sta->timeout_next == STA_DEAUTH && sta->aid > 0 &&	    !skb_queue_empty(&sta->tx_buf)) {		hostap_set_tim(local, sta->aid, 0);		sta->flags &= ~WLAN_STA_TIM;	}	if (sta->ap) {		if (ap->autom_ap_wds) {			PDEBUG(DEBUG_AP, "%s: removing automatic WDS "			       "connection to AP " MACSTR "\n",			       local->dev->name, MAC2STR(sta->addr));			hostap_wds_link_oper(local, sta->addr, WDS_DEL);		}	} else if (sta->timeout_next == STA_NULLFUNC) {		/* send data frame to poll STA and check whether this frame		 * is ACKed */		/* FIX: WLAN_FC_STYPE_NULLFUNC would be more appropriate, but		 * it is apparently not retried so TX Exc events are not		 * received for it */		sta->flags |= WLAN_STA_PENDING_POLL;		prism2_send_mgmt(local->dev, WLAN_FC_TYPE_DATA,				 WLAN_FC_STYPE_DATA, NULL, 0,				 sta->addr, ap->tx_callback_poll);	} else {		int deauth = sta->timeout_next == STA_DEAUTH;		u16 resp;		PDEBUG(DEBUG_AP, "%s: sending %s info to STA " MACSTR		       "(last=%lu, jiffies=%lu)\n",		       local->dev->name,		       deauth ? "deauthentication" : "disassociation",		       MAC2STR(sta->addr), sta->last_rx, jiffies);		resp = cpu_to_le16(deauth ? WLAN_REASON_PREV_AUTH_NOT_VALID :				   WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY);		prism2_send_mgmt(local->dev, WLAN_FC_TYPE_MGMT,				 (deauth ? WLAN_FC_STYPE_DEAUTH :				  WLAN_FC_STYPE_DISASSOC),				 (char *) &resp, 2, sta->addr, 0);	}	if (sta->timeout_next == STA_DEAUTH) {		if (sta->flags & WLAN_STA_PERM) {			PDEBUG(DEBUG_AP, "%s: STA " MACSTR " would have been "			       "removed, but it has 'perm' flag\n",			       local->dev->name, MAC2STR(sta->addr));		} else			ap_free_sta(ap, sta);		return;	}	if (sta->timeout_next == STA_NULLFUNC) {		sta->timeout_next = STA_DISASSOC;		sta->timer.expires = jiffies + AP_DISASSOC_DELAY;	} else {		sta->timeout_next = STA_DEAUTH;		sta->timer.expires = jiffies + AP_DEAUTH_DELAY;	}	add_timer(&sta->timer);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4339d328631aa815fe2181b9164b3690ca2db4da/hostap_ap.c/clean/drivers/net/wireless/hostap/hostap_ap.c