mesh_plink.c (95a0c7c2d6cfde3fb5fdb713428ed0df4d6bdd58) | mesh_plink.c (4c02d62fa37a05254a87575c7d430819f77bd6c9) |
---|---|
1/* 2 * Copyright (c) 2008, 2009 open80211s Ltd. 3 * Author: Luis Carlos Cobo <luisca@cozybit.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 */ --- 206 unchanged lines hidden (view full) --- 215{ 216 struct ieee80211_local *local = sdata->local; 217 struct sk_buff *skb; 218 struct ieee80211_tx_info *info; 219 struct ieee80211_mgmt *mgmt; 220 bool include_plid = false; 221 u16 peering_proto = 0; 222 u8 *pos, ie_len = 4; | 1/* 2 * Copyright (c) 2008, 2009 open80211s Ltd. 3 * Author: Luis Carlos Cobo <luisca@cozybit.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 */ --- 206 unchanged lines hidden (view full) --- 215{ 216 struct ieee80211_local *local = sdata->local; 217 struct sk_buff *skb; 218 struct ieee80211_tx_info *info; 219 struct ieee80211_mgmt *mgmt; 220 bool include_plid = false; 221 u16 peering_proto = 0; 222 u8 *pos, ie_len = 4; |
223 int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.self_prot) + 224 sizeof(mgmt->u.action.u.self_prot); | 223 int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.self_prot); |
225 int err = -ENOMEM; 226 227 skb = dev_alloc_skb(local->tx_headroom + 228 hdr_len + 229 2 + /* capability info */ 230 2 + /* AID */ 231 2 + 8 + /* supported rates */ 232 2 + (IEEE80211_MAX_SUPP_RATES - 8) + --- 366 unchanged lines hidden (view full) --- 599 changed = mesh_plink_open(sta); 600 601 ieee80211_mps_frame_release(sta, elems); 602out: 603 rcu_read_unlock(); 604 ieee80211_mbss_info_change_notify(sdata, changed); 605} 606 | 224 int err = -ENOMEM; 225 226 skb = dev_alloc_skb(local->tx_headroom + 227 hdr_len + 228 2 + /* capability info */ 229 2 + /* AID */ 230 2 + 8 + /* supported rates */ 231 2 + (IEEE80211_MAX_SUPP_RATES - 8) + --- 366 unchanged lines hidden (view full) --- 598 changed = mesh_plink_open(sta); 599 600 ieee80211_mps_frame_release(sta, elems); 601out: 602 rcu_read_unlock(); 603 ieee80211_mbss_info_change_notify(sdata, changed); 604} 605 |
607static void mesh_plink_timer(unsigned long data) | 606void mesh_plink_timer(struct timer_list *t) |
608{ | 607{ |
608 struct mesh_sta *mesh = from_timer(mesh, t, plink_timer); |
|
609 struct sta_info *sta; 610 u16 reason = 0; 611 struct ieee80211_sub_if_data *sdata; 612 struct mesh_config *mshcfg; 613 enum ieee80211_self_protected_actioncode action = 0; 614 615 /* 616 * This STA is valid because sta_info_destroy() will 617 * del_timer_sync() this timer after having made sure 618 * it cannot be readded (by deleting the plink.) 619 */ | 609 struct sta_info *sta; 610 u16 reason = 0; 611 struct ieee80211_sub_if_data *sdata; 612 struct mesh_config *mshcfg; 613 enum ieee80211_self_protected_actioncode action = 0; 614 615 /* 616 * This STA is valid because sta_info_destroy() will 617 * del_timer_sync() this timer after having made sure 618 * it cannot be readded (by deleting the plink.) 619 */ |
620 sta = (struct sta_info *) data; | 620 sta = mesh->plink_sta; |
621 622 if (sta->sdata->local->quiescing) 623 return; 624 625 spin_lock_bh(&sta->mesh->plink_lock); 626 627 /* If a timer fires just before a state transition on another CPU, 628 * we may have already extended the timeout and changed state by the --- 63 unchanged lines hidden (view full) --- 692 spin_unlock_bh(&sta->mesh->plink_lock); 693 if (action) 694 mesh_plink_frame_tx(sdata, sta, action, sta->sta.addr, 695 sta->mesh->llid, sta->mesh->plid, reason); 696} 697 698static inline void mesh_plink_timer_set(struct sta_info *sta, u32 timeout) 699{ | 621 622 if (sta->sdata->local->quiescing) 623 return; 624 625 spin_lock_bh(&sta->mesh->plink_lock); 626 627 /* If a timer fires just before a state transition on another CPU, 628 * we may have already extended the timeout and changed state by the --- 63 unchanged lines hidden (view full) --- 692 spin_unlock_bh(&sta->mesh->plink_lock); 693 if (action) 694 mesh_plink_frame_tx(sdata, sta, action, sta->sta.addr, 695 sta->mesh->llid, sta->mesh->plid, reason); 696} 697 698static inline void mesh_plink_timer_set(struct sta_info *sta, u32 timeout) 699{ |
700 sta->mesh->plink_timer.expires = jiffies + msecs_to_jiffies(timeout); 701 sta->mesh->plink_timer.data = (unsigned long) sta; 702 sta->mesh->plink_timer.function = mesh_plink_timer; | |
703 sta->mesh->plink_timeout = timeout; | 700 sta->mesh->plink_timeout = timeout; |
704 add_timer(&sta->mesh->plink_timer); | 701 mod_timer(&sta->mesh->plink_timer, jiffies + msecs_to_jiffies(timeout)); |
705} 706 707static bool llid_in_use(struct ieee80211_sub_if_data *sdata, 708 u16 llid) 709{ 710 struct ieee80211_local *local = sdata->local; 711 bool in_use = false; 712 struct sta_info *sta; --- 495 unchanged lines hidden --- | 702} 703 704static bool llid_in_use(struct ieee80211_sub_if_data *sdata, 705 u16 llid) 706{ 707 struct ieee80211_local *local = sdata->local; 708 bool in_use = false; 709 struct sta_info *sta; --- 495 unchanged lines hidden --- |