On Fri, Feb 1, 2013 at 5:25 AM, Marco Porsch <[email protected]> wrote:
> On 02/01/2013 05:56 AM, Thomas Pedersen wrote:
>>
>> Previously, the entire mesh beacon would be generated each
>> time the beacon timer fired. Instead generate a beacon
>> head and tail
>
>
>> (so the TIM can easily be inserted when mesh
>> power save is on)
>
>
> Got the hint =)
> Btw, the TIM IE will always be present in mesh beacons (just 6 bytes when no
> data has been buffered).

OK.

>> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
>> index a2cb6a3..cb311e1 100644
>> --- a/net/mac80211/tx.c
>> +++ b/net/mac80211/tx.c
>> @@ -2424,66 +2424,27 @@ struct sk_buff *ieee80211_beacon_get_tim(struct
>> ieee80211_hw *hw,
>>                 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
>>                                                  IEEE80211_STYPE_BEACON);
>>         } else if (ieee80211_vif_is_mesh(&sdata->vif)) {
>> -               struct ieee80211_mgmt *mgmt;
>>                 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
>> -               u8 *pos;
>> -               int hdr_len = offsetof(struct ieee80211_mgmt, u.beacon) +
>> -                             sizeof(mgmt->u.beacon);
>> +               struct sk_buff *head = rcu_dereference(ifmsh->bcn_head);
>> +               struct sk_buff *tail = rcu_dereference(ifmsh->bcn_tail);
>>
>> -#ifdef CONFIG_MAC80211_MESH
>> -               if (!sdata->u.mesh.mesh_id_len)
>> +               if (!head || !tail)
>>                         goto out;
>> -#endif
>>
>>                 if (ifmsh->sync_ops)
>>                         ifmsh->sync_ops->adjust_tbtt(
>>                                                 sdata);
>>
>>                 skb = dev_alloc_skb(local->tx_headroom +
>> -                                   hdr_len +
>> -                                   2 + /* NULL SSID */
>> -                                   2 + 8 + /* supported rates */
>> -                                   2 + 3 + /* DS params */
>> -                                   2 + (IEEE80211_MAX_SUPP_RATES - 8) +
>> -                                   2 + sizeof(struct ieee80211_ht_cap) +
>> -                                   2 + sizeof(struct
>> ieee80211_ht_operation) +
>> -                                   2 + sdata->u.mesh.mesh_id_len +
>> -                                   2 + sizeof(struct
>> ieee80211_meshconf_ie) +
>> -                                   sdata->u.mesh.ie_len);
>> +                                   head->len +
>> +                                   256 + /* TIM IE */
>
>
> Any reason to already allocate the space? May as well add that with the TIM
> IE commit.

Good point, I'll pull that out for now.

Thanks!

-- 
Thomas
_______________________________________________
Devel mailing list
[email protected]
http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel

Reply via email to