public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] mac80211: assign needed_headroom/tailroom for netdevs
@ 2008-05-04 21:24 Johannes Berg
  2008-05-04 21:31 ` Johannes Berg
  2008-05-04 21:32 ` [RFC v2] " Johannes Berg
  0 siblings, 2 replies; 38+ messages in thread
From: Johannes Berg @ 2008-05-04 21:24 UTC (permalink / raw)
  To: John Linville; +Cc: David S. Miller, netdev, linux-wireless

This assigns the netdev's needed_headroom/tailroom members
to take advantage of pre-allocated space for 802.11 headers.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Builds on my other patch to add those fields, of course!

 net/mac80211/iface.c |    8 ++++++++
 net/mac80211/tx.c    |   14 +++++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

--- everything.orig/net/mac80211/iface.c	2008-05-04 15:40:53.000000000 +0200
+++ everything/net/mac80211/iface.c	2008-05-04 16:08:45.000000000 +0200
@@ -53,6 +53,14 @@ int ieee80211_if_add(struct net_device *
 	if (!ndev)
 		return -ENOMEM;
 
+	ndev->needed_headroom = local->tx_headroom +
+				4*6 /* four MAC addresses */
+				+ 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
+				+ 6 /* mesh */
+				- ETH_HLEN /* ethernet hard_header_len */
+				+ IEEE80211_ENCRYPT_HEADROOM;
+	ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
+
 	ret = dev_alloc_name(ndev, ndev->name);
 	if (ret < 0)
 		goto fail;



^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2008-05-13 10:07 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-04 21:24 [RFC] mac80211: assign needed_headroom/tailroom for netdevs Johannes Berg
2008-05-04 21:31 ` Johannes Berg
2008-05-04 21:32 ` [RFC v2] " Johannes Berg
2008-05-05  0:30   ` David Miller
2008-05-05  7:22     ` Johannes Berg
2008-05-05 14:27       ` Tomas Winkler
2008-05-05 15:22         ` Johannes Berg
2008-05-05 17:15           ` Tomas Winkler
2008-05-05 17:57             ` Johannes Berg
2008-05-05 18:58               ` David Miller
2008-05-05 19:05                 ` Johannes Berg
2008-05-05 19:50                   ` David Miller
2008-05-05 19:57                     ` Johannes Berg
2008-05-05 20:02                       ` David Miller
2008-05-05 20:10                         ` Johannes Berg
2008-05-05 20:44                           ` David Miller
2008-05-05 20:57                             ` Johannes Berg
2008-05-05 21:01                               ` David Miller
2008-05-05 22:37                               ` David Miller
2008-05-05 22:44                                 ` Johannes Berg
2008-05-05 23:14                                   ` David Miller
2008-05-05 23:23                                     ` Johannes Berg
2008-05-05 23:39                                       ` David Miller
2008-05-06  0:01                                         ` Johannes Berg
2008-05-06  0:08                                           ` David Miller
2008-05-06 11:13                                             ` Johannes Berg
2008-05-06  1:32                                         ` Herbert Xu
2008-05-13  5:01                                 ` David Miller
2008-05-05 23:03           ` David Miller
2008-05-05 23:17             ` Johannes Berg
2008-05-05 23:24               ` David Miller
2008-05-05 23:30                 ` Johannes Berg
2008-05-05 23:36             ` Johannes Berg
2008-05-05 23:40               ` David Miller
2008-05-13  3:52   ` David Miller
2008-05-13  9:01     ` Johannes Berg
2008-05-13  9:45       ` David Miller
2008-05-13 10:07         ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox