mac80211: use put_unaligned_le16 for precedence value in mesh
use put_unaligned_le16 for precedence value in mesh channel switch support Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
3751c4edc6
commit
ca91dc97b8
@ -674,8 +674,6 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)
|
|||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
csa = rcu_dereference(ifmsh->csa);
|
csa = rcu_dereference(ifmsh->csa);
|
||||||
if (csa) {
|
if (csa) {
|
||||||
__le16 pre_value;
|
|
||||||
|
|
||||||
pos = skb_put(skb, 13);
|
pos = skb_put(skb, 13);
|
||||||
memset(pos, 0, 13);
|
memset(pos, 0, 13);
|
||||||
*pos++ = WLAN_EID_CHANNEL_SWITCH;
|
*pos++ = WLAN_EID_CHANNEL_SWITCH;
|
||||||
@ -697,8 +695,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)
|
|||||||
WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT : 0x00;
|
WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT : 0x00;
|
||||||
put_unaligned_le16(WLAN_REASON_MESH_CHAN, pos);
|
put_unaligned_le16(WLAN_REASON_MESH_CHAN, pos);
|
||||||
pos += 2;
|
pos += 2;
|
||||||
pre_value = cpu_to_le16(ifmsh->pre_value);
|
put_unaligned_le16(ifmsh->pre_value, pos);
|
||||||
memcpy(pos, &pre_value, 2);
|
|
||||||
pos += 2;
|
pos += 2;
|
||||||
}
|
}
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
@ -2450,7 +2450,6 @@ int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata,
|
|||||||
|
|
||||||
if (ieee80211_vif_is_mesh(&sdata->vif)) {
|
if (ieee80211_vif_is_mesh(&sdata->vif)) {
|
||||||
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
||||||
__le16 pre_value;
|
|
||||||
|
|
||||||
skb_put(skb, 8);
|
skb_put(skb, 8);
|
||||||
*pos++ = WLAN_EID_CHAN_SWITCH_PARAM; /* EID */
|
*pos++ = WLAN_EID_CHAN_SWITCH_PARAM; /* EID */
|
||||||
@ -2466,8 +2465,7 @@ int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata,
|
|||||||
ifmsh->pre_value = 1;
|
ifmsh->pre_value = 1;
|
||||||
else
|
else
|
||||||
ifmsh->pre_value++;
|
ifmsh->pre_value++;
|
||||||
pre_value = cpu_to_le16(ifmsh->pre_value);
|
put_unaligned_le16(ifmsh->pre_value, pos);/* Precedence Value */
|
||||||
memcpy(pos, &pre_value, 2); /* Precedence Value */
|
|
||||||
pos += 2;
|
pos += 2;
|
||||||
ifmsh->chsw_init = true;
|
ifmsh->chsw_init = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user