aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-02-03 07:43:34 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-03 07:43:34 -0500
commita80f509f4a4f41ea8693733124470ad63a12664a (patch)
treeb32c1412837a0041800b1dfdc0abd65685b0bc71 /net
parent246f19d194ec99ee8992106e129a133142dc6a10 (diff)
parent04a9e451fdbbfb84d6b87042b991f729f1c14249 (diff)
Merge branch 'fixes' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/Kconfig12
-rw-r--r--net/mac80211/ieee80211.c14
-rw-r--r--net/mac80211/rc80211_pid_algo.c2
-rw-r--r--net/mac80211/rc80211_simple.c2
-rw-r--r--net/mac80211/rx.c7
5 files changed, 28 insertions, 9 deletions
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index 09c255002e56..e77592d050ce 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -98,6 +98,18 @@ config MAC80211_DEBUGFS
98 98
99 Say N unless you know you need this. 99 Say N unless you know you need this.
100 100
101config MAC80211_DEBUG_PACKET_ALIGNMENT
102 bool "Enable packet alignment debugging"
103 depends on MAC80211
104 help
105 This option is recommended for driver authors and strongly
106 discouraged for everybody else, it will trigger a warning
107 when a driver hands mac80211 a buffer that is aligned in
108 a way that will cause problems with the IP stack on some
109 architectures.
110
111 Say N unless you're writing a mac80211 based driver.
112
101config MAC80211_DEBUG 113config MAC80211_DEBUG
102 bool "Enable debugging output" 114 bool "Enable debugging output"
103 depends on MAC80211 115 depends on MAC80211
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 5dcc2d61551f..67b7c75c430d 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -1344,17 +1344,17 @@ static int __init ieee80211_init(void)
1344 1344
1345 ret = rc80211_simple_init(); 1345 ret = rc80211_simple_init();
1346 if (ret) 1346 if (ret)
1347 goto fail; 1347 goto out;
1348 1348
1349 ret = rc80211_pid_init(); 1349 ret = rc80211_pid_init();
1350 if (ret) 1350 if (ret)
1351 goto fail_simple; 1351 goto out_cleanup_simple;
1352 1352
1353 ret = ieee80211_wme_register(); 1353 ret = ieee80211_wme_register();
1354 if (ret) { 1354 if (ret) {
1355 printk(KERN_DEBUG "ieee80211_init: failed to " 1355 printk(KERN_DEBUG "ieee80211_init: failed to "
1356 "initialize WME (err=%d)\n", ret); 1356 "initialize WME (err=%d)\n", ret);
1357 goto fail_pid; 1357 goto out_cleanup_pid;
1358 } 1358 }
1359 1359
1360 ieee80211_debugfs_netdev_init(); 1360 ieee80211_debugfs_netdev_init();
@@ -1362,11 +1362,11 @@ static int __init ieee80211_init(void)
1362 1362
1363 return 0; 1363 return 0;
1364 1364
1365 fail_pid: 1365 out_cleanup_pid:
1366 rc80211_simple_exit();
1367 fail_simple:
1368 rc80211_pid_exit(); 1366 rc80211_pid_exit();
1369 fail: 1367 out_cleanup_simple:
1368 rc80211_simple_exit();
1369 out:
1370 return ret; 1370 return ret;
1371} 1371}
1372 1372
diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c
index 554c4baed6fb..c339571632b2 100644
--- a/net/mac80211/rc80211_pid_algo.c
+++ b/net/mac80211/rc80211_pid_algo.c
@@ -538,7 +538,7 @@ int __init rc80211_pid_init(void)
538 return ieee80211_rate_control_register(&mac80211_rcpid); 538 return ieee80211_rate_control_register(&mac80211_rcpid);
539} 539}
540 540
541void __exit rc80211_pid_exit(void) 541void rc80211_pid_exit(void)
542{ 542{
543 ieee80211_rate_control_unregister(&mac80211_rcpid); 543 ieee80211_rate_control_unregister(&mac80211_rcpid);
544} 544}
diff --git a/net/mac80211/rc80211_simple.c b/net/mac80211/rc80211_simple.c
index 934676d687d6..9a78b116acff 100644
--- a/net/mac80211/rc80211_simple.c
+++ b/net/mac80211/rc80211_simple.c
@@ -389,7 +389,7 @@ int __init rc80211_simple_init(void)
389 return ieee80211_rate_control_register(&mac80211_rcsimple); 389 return ieee80211_rate_control_register(&mac80211_rcsimple);
390} 390}
391 391
392void __exit rc80211_simple_exit(void) 392void rc80211_simple_exit(void)
393{ 393{
394 ieee80211_rate_control_unregister(&mac80211_rcsimple); 394 ieee80211_rate_control_unregister(&mac80211_rcsimple);
395} 395}
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index d44c87269bcb..535407d07fa4 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -340,11 +340,15 @@ static u32 ieee80211_rx_load_stats(struct ieee80211_local *local,
340 return load; 340 return load;
341} 341}
342 342
343#ifdef CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT
343static ieee80211_txrx_result 344static ieee80211_txrx_result
344ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx) 345ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx)
345{ 346{
346 int hdrlen; 347 int hdrlen;
347 348
349 if (!WLAN_FC_DATA_PRESENT(rx->fc))
350 return TXRX_CONTINUE;
351
348 /* 352 /*
349 * Drivers are required to align the payload data in a way that 353 * Drivers are required to align the payload data in a way that
350 * guarantees that the contained IP header is aligned to a four- 354 * guarantees that the contained IP header is aligned to a four-
@@ -371,11 +375,14 @@ ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx)
371 375
372 return TXRX_CONTINUE; 376 return TXRX_CONTINUE;
373} 377}
378#endif
374 379
375ieee80211_rx_handler ieee80211_rx_pre_handlers[] = 380ieee80211_rx_handler ieee80211_rx_pre_handlers[] =
376{ 381{
377 ieee80211_rx_h_parse_qos, 382 ieee80211_rx_h_parse_qos,
383#ifdef CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT
378 ieee80211_rx_h_verify_ip_alignment, 384 ieee80211_rx_h_verify_ip_alignment,
385#endif
379 NULL 386 NULL
380}; 387};
381 388