11 #include <linux/slab.h>
12 #include <asm/unaligned.h>
16 #define TMR_RUNNING_HK 0
17 #define TMR_RUNNING_MP 1
18 #define TMR_RUNNING_MPR 2
23 #ifdef CONFIG_MAC80211_MESH
26 return (mgmt->
u.action.u.mesh_action.action_code ==
48 static void ieee80211_mesh_housekeeping_timer(
unsigned long data)
103 if (sdata->
vif.bss_conf.basic_rates != basic_rates)
116 sdata->
vif.bss_conf.channel_type != sta_channel_type)
153 free_plinks = mesh_plink_availables(sdata);
155 if (free_plinks != sdata->
u.
mesh.accepting_plinks) {
156 sdata->
u.
mesh.accepting_plinks = free_plinks;
168 if (!sdata->
u.
mesh.rmc)
172 INIT_LIST_HEAD(&sdata->
u.
mesh.rmc->bucket[i].list);
182 if (!sdata->
u.
mesh.rmc)
226 }
else if ((seqnum == p->
seqnum) &&
227 (ether_addr_equal(sa, p->
sa)))
249 if (skb_tailroom(skb) < 2 + meshconf_len)
252 pos =
skb_put(skb, 2 + meshconf_len);
254 *pos++ = meshconf_len;
269 neighbors = (neighbors > 15) ? 15 : neighbors;
270 *pos++ = neighbors << 1;
316 if (skb_tailroom(skb) < len)
345 if (skb_tailroom(skb) < len)
361 if (skb_tailroom(skb) < 3)
364 sband = local->
hw.wiphy->bands[chan->
band];
383 if (!sband->
ht_cap.ht_supported ||
402 sdata->
vif.bss_conf.channel_type;
404 local->
hw.wiphy->bands[channel->
band];
416 sdata->
vif.bss_conf.ht_operation_mode);
420 static void ieee80211_mesh_path_timer(
unsigned long data)
435 static void ieee80211_mesh_path_root_timer(
unsigned long data)
474 const u8 *meshda,
const u8 *meshsa)
476 if (is_multicast_ether_addr(meshda)) {
511 BUG_ON(!addr4or5 && addr6);
512 memset(meshhdr, 0,
sizeof(*meshhdr));
513 meshhdr->
ttl = sdata->
u.
mesh.mshcfg.dot11MeshTTL;
515 sdata->
u.
mesh.mesh_seqnum++;
516 if (addr4or5 && !addr6) {
520 }
else if (addr4or5 && addr6) {
552 interval = ifmsh->
mshcfg.dot11MeshHWMPRannInterval;
554 interval = ifmsh->
mshcfg.dot11MeshHWMProotInterval;
608 sdata->
vif.bss_conf.ht_operation_mode =
611 sdata->
vif.bss_conf.basic_rates =
613 sdata->
local->oper_channel->band);
654 sdata->
u.
mesh.timers_running = 0;
673 !ether_addr_equal(mgmt->
da, sdata->
vif.addr))
676 baselen = (
u8 *) mgmt->
u.probe_resp.variable - (
u8 *)
mgmt;
684 if (elems.rsn_len && sdata->
u.
mesh.security == IEEE80211_MESH_SEC_NONE)
687 if (elems.ds_params && elems.ds_params_len == 1)
690 freq = rx_status->
freq;
692 channel = ieee80211_get_channel(local->
hw.wiphy, freq);
697 if (elems.mesh_id && elems.mesh_config &&
702 ifmsh->
sync_ops->rx_bcn_presp(sdata,
703 stype, mgmt, &elems, rx_status);
711 switch (mgmt->
u.action.category) {
713 switch (mgmt->
u.action.u.self_prot.action_code) {
735 rx_status = IEEE80211_SKB_RXCB(skb);
742 ieee80211_mesh_rx_bcn_presp(sdata, stype, mgmt, skb->
len,
746 ieee80211_mesh_rx_mgmt_action(sdata, mgmt, skb->
len, rx_status);
767 ieee80211_mesh_housekeeping(sdata, ifmsh);
770 ieee80211_mesh_rootpath(sdata);
782 if (ieee80211_vif_is_mesh(&sdata->
vif))
792 ieee80211_mesh_housekeeping_timer,
793 (
unsigned long) sdata);
807 ieee80211_mesh_path_timer,
808 (
unsigned long) sdata);
810 ieee80211_mesh_path_root_timer,
811 (
unsigned long) sdata);