Commit Graph

64 Commits

Author SHA1 Message Date
proski 5890429464 Fix typos found by codespell
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4166 0192ed92-7a03-0410-a25b-9323aeb14dbd
2011-08-26 15:31:01 +00:00
proski 2774fa543e Fix compilation on Linux 3.1 broken by VLAN API changes
Don't define IEEE80211_VLAN_TAG_USED on Linux 3.1 and newer.  Don't use
vlan_hwaccel_rx() if IEEE80211_VLAN_TAG_USED is not 1.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4163 0192ed92-7a03-0410-a25b-9323aeb14dbd
2011-08-15 18:59:22 +00:00
proski ea28c77afc Fix all instances of unused variables reported by gcc 4.6.0.
Change IEEE80211_NODE_SAVEQ_DEQUEUE to a compound statement returning a
value, which may or may not be ignored by the caller.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4137 0192ed92-7a03-0410-a25b-9323aeb14dbd
2011-05-03 21:56:02 +00:00
proski e408c071a2 Add support for the latest kernels that don't define AUTOCONF_INCLUDED
Use CONFIG_LOCALVERSION as an alternative to check that the
configuration settings have been included.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4134 0192ed92-7a03-0410-a25b-9323aeb14dbd
2011-02-02 21:10:53 +00:00
proski a5b3087ab0 Rewrite ieee80211_input_all()
The logic to prevent calling ieee80211_input() on inactive VAPs was
flawed.  The first VAP was exempt from the check for no reason.

Rewrite to avoid having nested loops.  Give the original skb to the
first VAP, not to the last one, as the first VAP is easier to find in a
loop.  Process the first VAP after others.

Only collect the result from the first VAP.  ieee80211_input() should
return the same value (frame type) for all VAPs except if we call it
incorrectly, e.g. on an inactive VAP.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4081 0192ed92-7a03-0410-a25b-9323aeb14dbd
2009-07-30 21:06:29 +00:00
proski 319a241c30 Don't unref node in ieee80211_input() if it wasn't referenced
Thanks to:
Daniel Wu <danwu@ucdavis.edu>
"Ilya A. Volynets-Evenbakh" <ilya@total-knowledge.com>


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4080 0192ed92-7a03-0410-a25b-9323aeb14dbd
2009-07-30 17:17:02 +00:00
benoit 1b019e9b0d Merge madwifi-dfs back to trunk: this change is only about DFS, excluding
DFS pulse analysis. Untested.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4076 0192ed92-7a03-0410-a25b-9323aeb14dbd
2009-07-11 17:20:58 +00:00
proski d8b9462077 Merge formatting change from DFS branch
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4047 0192ed92-7a03-0410-a25b-9323aeb14dbd
2009-06-25 00:24:34 +00:00
proski 02bac30645 More typo fixes
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3809 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-07-18 22:00:42 +00:00
mentor 9a2f6efd63 Correctly name Data type Null subtype frame.
Do not try to process Null and QoS Null frames as data.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3749 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-07-05 01:00:32 +00:00
mentor be5b0e727a Move responsibility for removing padding in the RX path entirely to the driver. This allows it to be done once, and thus avoids extra copying of SKBs.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3713 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-08 01:43:53 +00:00
mentor 76cade5dac Make pointer declarations and casting consistent. Some other formatting changes are made in passing
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3710 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-06 20:32:29 +00:00
mentor 1a24cb141a Use vlan_hwaccel_rx instead of vlan_hwaccel_receive_skb, as this is the non-polling (non-NAPI) version.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3709 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-06 19:42:24 +00:00
mentor f259deab93 In some parts of Madwifi, SKBs are dispatched from the VAP device to the physical device using Linux kernel queuing, which does not understand our node reference system, so node references are carefully cleaned up if the packet is dropped.
However, the netif_rx and vlan_hwaccel_receive_skb functions dispatch the SKB to the higher networking levels, out of our domain.

Therefore, handle node references as appropriate.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3708 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-06 19:21:33 +00:00
mentor a5680de2b6 Remove sead ALIGNED_POINTER code
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3705 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-06 01:40:25 +00:00
benoit 99ead2121d Merge madwifi-dfs r3676
Fixed type of all variables storing jiffies
Converted add_timer() to mod_timer()


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3677 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-22 20:25:48 +00:00
mentor c0466a75a6 Record stat's before dispatch, and generally don't try to access NULL pointers
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3674 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-22 16:09:19 +00:00
mentor 18682f3d29 SKB handling code cleanup:
* Convert last SKB_CB()->ni to SKB_NI
 * Lots of comments
 * Refactor various pieces of code for consistency, readability, and removal of goto


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3666 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-22 12:58:24 +00:00
mentor 547147362c Random whitespace
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3652 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-20 15:58:00 +00:00
mentor 15abd8d1f1 Formatting - r3634
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3640 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-17 04:44:05 +00:00
br1 86d8de1785 let ieee80211_recv_mgmt() return 0 if the frame is to be discarded and don't
process discarded frames in ath_recv_mgmt(). this reduces the number of times
we attempt to merge IBSS to invalid beacons.

this patch is based on the work of Derek Smithies


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3634 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-16 16:09:28 +00:00
mentor a192279dd6 Only deliver frames to VAPs that are running.
This includes the reinstatement of the ieee80211_input_all function as this functionality should live in the net80211 layer. Unfortunately the code for this is a tad on the ugly side.

Thanks to OpenWRT/nbd: https://dev.openwrt.org/log/trunk/package/madwifi/patches/334-input.patch


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3621 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-10 06:03:52 +00:00
mentor 9538bc8243 Remove the skb_copy call from ieee80211_input. However, create a copied SKB for each call to ieee80211_input when we are sending to all VAPs. Effectively, this means that we are using the SKB from the ath_buf except when ieee80211_input is called multiple times.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3595 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-03 03:49:05 +00:00
mentor 1b318d3853 Tidy RX queue processing code:
* Formatting
 * Add a function to remove SKB from ath_buf.
 * Call aforementioned function early if we are accepting a frame, so that there's not chance the data can get stomped on by DMA. We should probably do this for ignored frames as well, but I got fed up trying to sort out the stack of goto.
 * Remove some KASSERT for skb users, as the SKB are always copied.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3594 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-03 03:40:27 +00:00
mentor bbcacb393a Correct terminology in ieee80211_input skb_copy comment
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3585 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-30 22:04:38 +00:00
mtaylor 7c6997619e This commit fixes problems with skbuff cloning and reference counting in input handling. The biggest problem with this code was corruption of memory.
ieee80211_input can receive cloned skb from the bridge layer, and thus makes copies to modify and use.  The original was being freed immediately upon copying.  The problem is that when you issue ANY response other than NETDEV_TX_OK the skb is returned to the kernel queue.  So, basically there were wild pointers to skb in the skb queue, and these skb were being re-used by other applications and drivers - resulting in crashes all over the place.

With this new logic, we keep the original around until we know whether or not we will requeue it NETDEV_TX_BUSY or consume it NETDEV_TX_OK and we correctly free the skb only when appropriate.

We also get rid of the net80211_input_all function which was doing a bunch of unnecessary (and broken) copies and noe updates.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3501 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 23:34:44 +00:00
mentor 101b902062 Arbitrary whitespace cleanups
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3365 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-25 15:51:38 +00:00
mentor ebc79fce38 Cleanup up de-MIC failure (in hardware) handling. Apparently, HW sometimes gets this wrong and spuriusly fails valid packets. In all cases, the packets are dropped, but we do extra processing to record statistics correctly.
This changeset adds a node statistic. If this is not liked, I encourage it to be fixed; I might learn something.
Thanks nbd.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3334 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-04 00:16:24 +00:00
mentor b0f92899f4 Formatting - calming...
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3304 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-29 11:18:15 +00:00
mtaylor dead14502d Fix a few more leaked node references when a
copy of the bss node is used to send a message
we need to make sure all code paths release
it when done.  This bug combined with repeated
auth failures would cause node references to 
grow with every failure.  Then, if you were 
taking down the interface and bringing it back
up you would leak one page (4kb) every time the
the node table was flushed on transition to UP.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3299 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-29 06:58:22 +00:00
mentor 8e8ba8882b Some extra SKB operation return code checks. This deviates from nbd's original patch, because I don't think that if the aligning operation fails that we should return the unaligned one.
Thanks nbd


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3297 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 23:49:26 +00:00
mtaylor f0a1f3d537 Null protection for skb1 in multicast node fix
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3285 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 20:05:31 +00:00
mtaylor 43f0aa1604 Undo regression from madwifi-dfs merge
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3282 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-28 19:34:03 +00:00
mentor 4a60ebccec 'Context:' is used to denote the kernel context that the process is running in (i.e., hard IRQ, soft IRQ, process, preemption disabled, etc.)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3276 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-27 19:50:09 +00:00
mentor cf6e609462 Formatting
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3274 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-27 05:48:23 +00:00
mentor 28cf53aa95 Fix merge failures - pass one
mdtaylor: bad merging like this really must not continue any longer


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3272 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-27 04:26:38 +00:00
mtaylor c2bce77197 Merge madwifi-dfs branch to trunk.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3268 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-26 20:48:11 +00:00
mentor d05f18eef2 Have internal bridged packets belong to the BSS node
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3259 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-26 02:30:35 +00:00
mtaylor e479155497 Eliminate ether_sprintf in favor of new MAC_FMT and MAC_ADDR macros (which are faster and thread safe).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3254 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-25 22:49:48 +00:00
mtaylor e04d68cce7 ieee80211_dev_kfree_skb will NULL ni_rxfrag.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3226 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-21 23:19:39 +00:00
mentor ac2124cce3 Another pass on r3156:r3200:
* Lots of coding style and formatting, tedious and annoying
 * Quite a few bad merges as far as I can tell; at least one of which was serious - reintroduced a leak


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3202 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-18 01:28:43 +00:00
mtaylor c55568ef0d DFS and FCC requirements pretty much make the madwifi-specific 'CSA PROTECTION PERIOD' violate compliance with the regulations. This is being commented out in preparation for merging the DFS compliant code into the trunk
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3166 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 20:11:27 +00:00
mentor 63ccd5bbe2 Remove unneccessary node unreference - it is handled in ieee80211_dev_kfree_skb
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3164 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 20:09:34 +00:00
mentor 5f4816e17e Add ieee80211_skb_copy_noderef, which hopefully does what it says on the tin (i.e., copies a node reference, not a pointer, from one skb to another).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3163 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 20:07:34 +00:00
proski d01fbe3c85 Annotate len in struct l2_update_frame as big-endian
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3156 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 04:08:40 +00:00
mtaylor 132f01bad9 Fix for bridging. We modify the packet's contents. Linux bridging code assumes it can clone the packet and send it to multiple interfaces without having it changed out from under it. Therefore, we need to clone each skb prior to modifying the copy. This fixes some very nasty bugs with bridged VAPs (esp with multiple VAPs in a bridge and multicast/broadcast traffic).
The symptom would be fragments of 802.11 header showing up in the ethernet header because of skb header offsets being corrupted by MadWifi devices on lower ports which then get forwarded as-is to wired ports.

Sorry for the lame explanation, but the short end of the story is that you have to copy the skb before you modify it if you are going to play nice with bridging.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3146 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:21:23 +00:00
mtaylor d246553128 Switch from clone to copy. Contents may be changed.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3144 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:16:07 +00:00
mtaylor e6a0fd9b49 This patch refactors the layer 2 update frame sending logic into two routines. Both RNR and XID frames are sent to update bridges. The RNR is probably not the best way to update L2 bridges. It's basically telling the bridges and switches that the MAC is not able to receive traffic (i.e. congested or down) and we never send any other L2 packets to counteract any side effects of this. I also found that it didn't seem to be updating every MAC table on every bridge. XID, however, is the correct way, according to my research and we send XID to inform the bridges of the new location of the MAC as dictated by the standards. I left the RNR in there for good measure, since it doesn't appear to have any ill effects for anyone. (Hostapd ALSO sends XID when you are using hostapd... the redundancy is harmless and allows madwifi to operate correctly when using open or WEP protected modes without hostapd).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3134 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-16 00:01:06 +00:00
mtaylor e7ccdf6be3 When IFF_MULTICAST was not enabled on the vap, we used to skip some filtering that prevents reception of your own multicast traffic. Then we would procede to ignore the fact that IFF_MULTICAST flag was disabled and send anyway.
I've fixed the logic so that multicast is dropped, with an error when disabled.  I don't think this is a valid configuration.  Also, we don't skip the filtering logic so that our own multicast traffic doesn't come back to us (looking like a bridging loop). 


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3132 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-15 23:54:34 +00:00
benoit 56f411f3c0 Fixed a kernel panic due to incorrect linux API use
hard_start_xmit() functions must either return NETDEV_TX_OK or 
NETDEV_TX_BUSY (they might also return negative errno values as well, 
like -ENETDOWN)
Correct a small missing static reported by sparse
This revert part of r3075


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3123 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-01-10 20:10:41 +00:00