aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-11-29 07:00:10 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-30 07:41:27 -0500
commitb9a9ada14aab17f08c1d9735601f1097cdcfc6de (patch)
tree47d823b696f262c53d5f52ef60bfb143b8444fa0 /net/mac80211/util.c
parentc604b9f219422e969fe371cc7259de34c3c5601d (diff)
mac80211: remove probe response temporary buffer allocation
Instead of allocating a temporary buffer to build IEs build them right into the SKB. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index f119b1b6c1a7..41c9841614b8 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1239,14 +1239,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1239 struct ieee80211_local *local = sdata->local; 1239 struct ieee80211_local *local = sdata->local;
1240 struct sk_buff *skb; 1240 struct sk_buff *skb;
1241 struct ieee80211_mgmt *mgmt; 1241 struct ieee80211_mgmt *mgmt;
1242 size_t buf_len;
1243 u8 *buf;
1244 u8 chan_no; 1242 u8 chan_no;
1245 1243 int ies_len;
1246 /* FIXME: come up with a proper value */
1247 buf = kmalloc(200 + ie_len, GFP_KERNEL);
1248 if (!buf)
1249 return NULL;
1250 1244
1251 /* 1245 /*
1252 * Do not send DS Channel parameter for directed probe requests 1246 * Do not send DS Channel parameter for directed probe requests
@@ -1258,15 +1252,16 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1258 else 1252 else
1259 chan_no = ieee80211_frequency_to_channel(chan->center_freq); 1253 chan_no = ieee80211_frequency_to_channel(chan->center_freq);
1260 1254
1261 buf_len = ieee80211_build_preq_ies(local, buf, 200 + ie_len,
1262 ie, ie_len, chan->band,
1263 ratemask, chan_no);
1264
1265 skb = ieee80211_probereq_get(&local->hw, &sdata->vif, 1255 skb = ieee80211_probereq_get(&local->hw, &sdata->vif,
1266 ssid, ssid_len, 1256 ssid, ssid_len, 100 + ie_len);
1267 buf, buf_len);
1268 if (!skb) 1257 if (!skb)
1269 goto out; 1258 return NULL;
1259
1260 ies_len = ieee80211_build_preq_ies(local, skb_tail_pointer(skb),
1261 skb_tailroom(skb),
1262 ie, ie_len, chan->band,
1263 ratemask, chan_no);
1264 skb_put(skb, ies_len);
1270 1265
1271 if (dst) { 1266 if (dst) {
1272 mgmt = (struct ieee80211_mgmt *) skb->data; 1267 mgmt = (struct ieee80211_mgmt *) skb->data;
@@ -1276,9 +1271,6 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1276 1271
1277 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 1272 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
1278 1273
1279 out:
1280 kfree(buf);
1281
1282 return skb; 1274 return skb;
1283} 1275}
1284 1276