#include <net/rtnetlink.h>
#include "ieee80211_i.h"
-#include "ieee80211_rate.h"
-#ifdef CONFIG_MAC80211_MESH
+#include "rate.h"
#include "mesh.h"
-#endif
#include "wme.h"
/* privid for wiphys to determine whether they belong to us or not */
/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
-const unsigned char rfc1042_header[] =
+const unsigned char rfc1042_header[] __aligned(2) =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
-const unsigned char bridge_tunnel_header[] =
+const unsigned char bridge_tunnel_header[] __aligned(2) =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
}
EXPORT_SYMBOL(ieee80211_get_hdrlen_from_skb);
-#ifdef CONFIG_MAC80211_MESH
int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr)
{
int ae = meshhdr->flags & IEEE80211S_FLAGS_AE;
/* 7.1.3.5a.2 */
switch (ae) {
case 0:
- return 5;
+ return 6;
case 1:
- return 11;
+ return 12;
case 2:
- return 17;
+ return 18;
case 3:
- return 23;
+ return 24;
default:
- return 5;
+ return 6;
}
}
-#endif
-void ieee80211_tx_set_iswep(struct ieee80211_txrx_data *tx)
+void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx->skb->data;
hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
- if (tx->u.tx.extra_frag) {
+ if (tx->extra_frag) {
struct ieee80211_hdr *fhdr;
int i;
- for (i = 0; i < tx->u.tx.num_extra_frag; i++) {
+ for (i = 0; i < tx->num_extra_frag; i++) {
fhdr = (struct ieee80211_hdr *)
- tx->u.tx.extra_frag[i]->data;
+ tx->extra_frag[i]->data;
fhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
}
}
struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_sub_if_data *sdata;
- rcu_read_lock();
+ rtnl_lock();
- list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+ list_for_each_entry(sdata, &local->interfaces, list) {
switch (sdata->vif.type) {
case IEEE80211_IF_TYPE_INVALID:
case IEEE80211_IF_TYPE_MNTR:
&sdata->vif);
}
- rcu_read_unlock();
+ rtnl_unlock();
}
EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);
-#ifdef CONFIG_MAC80211_MESH
-/**
- * ieee80211_new_mesh_header - create a new mesh header
- * @meshhdr: uninitialized mesh header
- * @sdata: mesh interface to be used
- *
- * Return the header length.
- */
-int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr,
- struct ieee80211_sub_if_data *sdata)
+void ieee80211_iterate_active_interfaces_atomic(
+ struct ieee80211_hw *hw,
+ void (*iterator)(void *data, u8 *mac,
+ struct ieee80211_vif *vif),
+ void *data)
{
- meshhdr->flags = 0;
- meshhdr->ttl = sdata->u.sta.mshcfg.dot11MeshTTL;
+ struct ieee80211_local *local = hw_to_local(hw);
+ struct ieee80211_sub_if_data *sdata;
- meshhdr->seqnum[0] = sdata->u.sta.mesh_seqnum[0]++;
- meshhdr->seqnum[1] = sdata->u.sta.mesh_seqnum[1];
- meshhdr->seqnum[2] = sdata->u.sta.mesh_seqnum[2];
+ rcu_read_lock();
- if (sdata->u.sta.mesh_seqnum[0] == 0) {
- sdata->u.sta.mesh_seqnum[1]++;
- if (sdata->u.sta.mesh_seqnum[1] == 0)
- sdata->u.sta.mesh_seqnum[2]++;
+ list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+ switch (sdata->vif.type) {
+ case IEEE80211_IF_TYPE_INVALID:
+ case IEEE80211_IF_TYPE_MNTR:
+ case IEEE80211_IF_TYPE_VLAN:
+ continue;
+ case IEEE80211_IF_TYPE_AP:
+ case IEEE80211_IF_TYPE_STA:
+ case IEEE80211_IF_TYPE_IBSS:
+ case IEEE80211_IF_TYPE_WDS:
+ case IEEE80211_IF_TYPE_MESH_POINT:
+ break;
+ }
+ if (sdata->dev == local->mdev)
+ continue;
+ if (netif_running(sdata->dev))
+ iterator(data, sdata->dev->dev_addr,
+ &sdata->vif);
}
- return 5;
+ rcu_read_unlock();
}
-#endif
+EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);