Commit Graph

281 Commits

Author SHA1 Message Date
scottr
3f948507e7 Fix compilation when fast frames are disabled.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3747 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-30 05:27:52 +00:00
scottr
57f22bcbda Register sysctl before doing pci registration.
This fixes a bug when renaming multiple wireless cards on slow devices.
The pci registration causes udev to rename the device but the sysctl is
not registered yet so the device renames but the corresponding sysctl
entries are not renamed.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3746 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-26 08:23:41 +00:00
mentor
7a04e2c8e8 Add an error message if a unique BSSID is requested but the hardware does not support the BSSID mask
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3745 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-24 03:09:25 +00:00
mentor
70e6e83fc8 Add an informational message when debug flags are changed.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3744 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-22 05:32:29 +00:00
mentor
78cbb40469 Convert various _debug style char *func and int line passing to use dump_stack. This may possibly be a tad noisy still.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3743 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-22 02:12:53 +00:00
mentor
03dbd3568d Make module loading and unloading much less noisy. I don't believe any of this ifnromation is particularly useful for dbeugging, and definitely not for operational use.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3742 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-21 14:40:43 +00:00
mentor
7eedc3e565 Remove mystery mode define, and tidy also
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3741 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-21 14:28:07 +00:00
mtaylor
3d91ef2071 Revert portion of commit 3265 which introduced some poor
use of strncat (my bad) and needlessly complicated the debug 
output with prefixes.

Thanks, Pavel!  :-)



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3738 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-20 07:32:16 +00:00
proski
941d62b043 KASSERT should add newline at the end to match FreeBSD behavior
Fix KASSERT calls that add their own newline.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3734 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-19 16:58:07 +00:00
benoit
2b8d9ef1c9 Only display configured TXQ
Use the HAL to query the status of a TX descriptor


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3721 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-12 14:50:36 +00:00
mentor
cc4fba0582 Diversity and Antenna code cleanup:
* Tidy, including refactoring and variable rename for clarity and consistency
 * Move some variable initialisation out of sysctl register where it does not belong.
 * Only change antenna based on RX traffic if both diversity and an RX antenna is not set
 * Set HW/HAL diversity setting on HW/HAL reset


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3717 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-10 15:32:45 +00:00
mentor
b5b0838767 Yay. More whitespace changes
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3716 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-10 11:35:40 +00:00
mentor
fa195d07b8 Remove now extraneous ath_capture()
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3714 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-08 01:52:48 +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
785ca93999 In the RX path, the SKB needs to be copied if padding needs to be removed. Doing so causes correct operation of monitor mode interfaces to be restored, but is somewhat inefficient. Will tidy up the code in following revisions.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3711 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-07 03:24:30 +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
benoit
4b8b3f3960 Revert part of previous change. Was too board. Merge -dfs r3691
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3692 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-01 17:36:03 +00:00
benoit
ec82a6dabd Avoid soft lockup with calibration timer. Merge from -dfs r3689
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3690 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-01 16:44:12 +00:00
benoit
c04bc3e394 Merge -dfs r3410 and r3687 for proper multicast key search operation (disable
at this point since it does not work as expected).


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3688 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-06-01 09:34:30 +00:00
mentor
7045e12375 Aid debugging by helpfully not dereferencing NULL pointers and oopsing when debugging messages are turned on.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3679 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-24 12:15:44 +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
c62ff62eaf Cast to remotely the right pointer type
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3675 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-22 16:15:28 +00:00
mentor
03b00b0e45 A few final bits of tidy
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3673 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-22 15:17:20 +00:00
mentor
2e5d81996e Slightly tidier way of managing SKBs
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3672 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-22 15:13: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
04084c023d Make sure to free the skb if it is not used. This is brute force programming; I blame gotos.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3665 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-22 12:48:52 +00:00
br1
f99b56ca39 fixing and cleanup of ath_announce
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3659 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-21 13:44:15 +00:00
br1
e6646f6f0a add chip name by SREV mapping from ath5k and print MAC and PHY
chip name on module load


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3658 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-21 13:44:09 +00:00
br1
8d0833e60d move all HAL extensions (everything including direct register read and writes
or reverse engineered information) to if_ath_hal_extensions.[ch]


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3657 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-21 13:44:03 +00:00
br1
fe5351a3e3 remove add_timer() call after mod_timer(). it causes a kernel bug and is not
necessary since mod_timer does all the work already. this fixes station mode.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3653 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-20 17:16:24 +00:00
br1
9ba85e9edf drop packets if a WME queue gets too long.
similar code was removed in r3503, but it was wrong before as well, because
the packet needs to be dropped instead of requeued to actually achieve
prioritization between different packet types (WME classes). if we allow
one queue to consume all TX buffers then there is no buffer left to service
packets on higher priority queues.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3648 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-20 13:46:02 +00:00
mentor
c4093cb5c8 Manually stomp the DMA size to 128B for AR5418 devices. This patch should probably be extended to do this for all PCIe devices.
The register defines were taken from ath5k.

This patch has been only lightly tested, I'm afraid - trying for more coverage.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3641 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-17 04:53:35 +00:00
mentor
0d37af2c27 Interference mitigation control code changes:
* More pedanting of comments
 * Update sysctl to return early if no change is made and OPNOTSUPP if !sc_hasintmit
 * Tidy call to set HAL int. mit. status. Remove chatty printf as it is known that this does not work.
 * Preprocessor out HAL call as the int. mit. status is unconditionally set manually.
 * Misc. churn.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3639 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-17 04:41:01 +00:00
br1
3b9f5d1b89 add IEEE80211_TSF_TO_TU macro again and explain it once there instead of
open coding >> 10 and putting notes all over the place.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3635 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-16 16:09:36 +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
1866fef7c5 Pedant spelling/punctuation
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3630 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-14 19:21:38 +00:00
mentor
7d8156565c Downgrade Int. Mit. out of synchronisation message to a warning as we know it happens.
Also, remove extraneous message severity indicators.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3629 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-14 19:19:30 +00:00
mentor
88959bf97f If hal_tpc is out of sync. with the actual HAL setting, set the HAL setting to hal_tpc rather than just to on.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3628 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-14 19:16:59 +00:00
mentor
6abd8285aa Whitespace for control statements
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3627 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-14 19:11:57 +00:00
proski
17ef384654 Remove inline forward declarations, it doesn't work this way
Besided, gcc 3.4.6 doesn't accept it.  Move ath_ds_link_swap() before
the code that uses it.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3626 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-12 02:01:57 +00:00
mentor
30aec0e604 Off by one error in accessing bf_skbaddrff
Signed-off-by: Przemyslaw Bruski <pbruski@op.pl>


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3623 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-10 06:58:20 +00:00
mentor
b9be39d736 Cleanup extraneous ieee80211_dev_kfree_skb checks
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3622 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-10 06:07:18 +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
dfdda8ca55 Remove axq_link, for benoit.
The last descriptor is now implicit in the structure and meta-data of the buffers; axq_link does not need to be maintained separately.
Add macros to to return the last buffer, descriptor, and link them as necessary.
Make the queue moving macro implicitly link descriptors, and remove the explicit descriptor linking in this case.

ath_node_move_data is still desperately in need of a review; it is used in XR.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3620 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-07 18:33:15 +00:00
mentor
3dc12c74ec Fold descriptor link address byte-swapping for hardware into a common function
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3619 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-06 22:18:43 +00:00
mentor
f5f3adc423 Have ath_tx_txqaddbuf calculate and use the last descriptor for the buffer. This occurs in the FF case, where there may be two buffers.
This fixes problems with r3548 noted in #1922.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3616 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-06 00:18:09 +00:00
mentor
f577062ef7 Move the monitor physical parameter struct inside ieee80211_cb. Have same struct actually be an array. Add an evil struct definition that breaks if ieee80211_cb is bigger than 48 bytes; it serves no other purpose.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3615 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-05 23:51:16 +00:00
mentor
2a96a01877 Refactor some FF buffer descriptor setup code to be clearer and more consistent
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3613 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-05 16:09:13 +00:00
proski
7d7024184e Don't use "inline" in forward declarations - it doesn't work
Move txqactive() implementation before it's used.  Let the compiler
decide whether to inline that function.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3606 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-05 13:50:10 +00:00
mentor
380c55d9c9 Rename and move, into the right headers, the SKB and BF macros
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3596 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-04 17:48:59 +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
2ecfeab07e Move the maximum monitor headroom definition to a nice header file
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3593 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-05-01 13:49:09 +00:00
benoit
663f433fcd Merge madwifi-dfs r3574:3578 to trunk
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3579 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-28 10:23:24 +00:00
mentor
c29842a728 Initially set sc_lastcal to now. The previous code set it to INITIAL_JIFFIES which is the initial value at _boot_ time not module load time.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3574 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-25 13:40:31 +00:00
mentor
ef6d84125b Convert as many things as possible to use kzalloc
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3573 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-24 14:10:42 +00:00
mentor
d8c264b8f5 Remove unused header file include - bitmap.h
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3569 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-24 13:15:43 +00:00
benoit
96adde4c63 Remove ito64() macro. Use u_int64_t instead.
Convert all dma_addr_t to u_int64_t for printing.
Fixed ticket #1895


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3559 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-21 21:23:19 +00:00
mentor
129ddd7051 Errant brace from r3554
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3556 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-20 23:43:45 +00:00
mentor
1e1bf2cb6b Remove code superceded by r3551
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3555 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-20 22:27:45 +00:00
mentor
528a01e3d7 Formatting for r3552
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3554 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-20 22:25:54 +00:00
benoit
ae11ec5e49 Added debug in case the TX queue locked up (You need to do athdebug +watchdog
to see those debug message).
Fixed a bug where we removed TX descriptors too early. This should fix NETDEV
WATCHDOG error messages. Apparently, TX descriptor status is updated by the
hardware before TXDP.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3552 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-20 21:06:15 +00:00
mentor
2b06287f11 More cases of r3549. Further, add a reminder to check ath_node_move_data, which look shorribly broken, but is used for XR only.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3550 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-19 19:00:14 +00:00
mentor
a4078f91f2 Update TX queue properties, caused by removal of the last item, while the same lock is still held during removal of that item. Thanks to benoit for coming across this while investigating a TX queue stoppage.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3549 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-19 16:04:07 +00:00
mentor
361fac4be9 Remove the 'lastds' parameter to ath_tx_txqaddbuf as it is always bf->bf_desc, and, further, most buffer handling logic assumes that the the descriptor is held in bf_desc.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3548 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-19 14:57:50 +00:00
mtaylor
405b1f16af Fix regression in r3532
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3534 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 23:57:24 +00:00
mtaylor
dc1f1c8425 Fix non-debug compilation warnings about unused functions/variables
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3532 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 23:48:41 +00:00
mtaylor
28ecfa570d Get rid of extra mdelay(5) after hardware reset, which isnt necessary anymore and is even causing problems in some cases.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3524 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 09:01:08 +00:00
mtaylor
119e3f308b Bug fix for the ath_buf scan code that resulted in mismatched
lock/unlock calls on SMP systems.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3523 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 08:24:58 +00:00
mtaylor
9b8af6f68a ath_rx_tasklet improvements...
*  Only hold the RX queue lock while removing and while re-inserting a buffer -
   allowing pre-emption to work properly while the tasklet is reaping and 
   recycling rx buffers.

*  All skb and bus handling is managed in the ath_rxbuf_init function now.

*  Do not stop processing when ath_rxbuf_init fails, because that means low
   free skb but does NOT mean the queue is fully processed.  Since we also keep
   our skbuff except during a very brief period when we free one and reallocate
   one - unless pre-emption or SMP steals it, chances are very good we can keep
   processing the queue even under low memory conditions -- and avoid dreaded
   rx overruns.

*  Add missing locks around code blocks that iterate over rx buffer list in
   flush/drain/init/cleanup/etc helper functions.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3519 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 06:19:53 +00:00
mtaylor
fcb3fdbe90 ath_rxbuf_init fixes...
I've simplified the buffer initialization code so that it 
always allocates things as if there were one or more monitor VAPs.  This is 
defensive since monitor VAPs can are created and/or destroyed while the radio is
up. 

The old logic was basically changing the behavior of the initialization function
dynamically based on the presence of a monitor VAP but could lead to a mixed set
of buffers.

The revised code keeps all the buffers the same and make sure there is room for a radiotap
or prism header if necessary in advance.

Without this change, even after adding a monitor VAP you are going to pull SKBs that are too small for a while.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3518 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 05:59:23 +00:00
mtaylor
25a3a9f3db ath_hardstart bug fixes...
*  Fix a bug where we would copy any cloned skb received in ath_hardstart, 
   and free the original... before returning the original to the queue!
   The result of this would be memory corruption at best, randomly placed panic 
   at worst.

*  In one case we returned -ENETDOWN from hard start, which in current kernels
   is NOT NETDEV_TX_OK so it would therefore requeue the packet which we just
   released.

*  Fixes the logic for both requeue and drop in hardstart fail so that we never
   leak, never double-free, and never leave the kernel with an invalid pointer
   to an SKB we just freed.




git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3517 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 05:45:59 +00:00
mtaylor
0438f82469 * Eliminate an_halstats as it is unused. The HAL doesn't know about nodes.
*  Replace an_halstats it with an_avgrssi (EWMA)
*  Only update stats in ath_softc* when we are on-channel and acting as a station,
   as there is no meaning to these stats as an AP.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3515 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 05:26:44 +00:00
mtaylor
735fc50dc2 * Rename ath_uapsd_processtriggers to ath_intr_process_rx_descriptors since
this is what it does.

*  Rename ATH_BUFSTATUS_DONE to ATH_BUFSTATUS_RXDESC_DONE since this is what
we mean - has the descriptor been processed.

*  Eliminate a case where we were processing each descriptor twice and 
double-counting the statistics.

*  Delegate decision on whether to schedule the rx queue to 
ath_intr_process_rx_descriptors so we do not schedule it when there is no work.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3514 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 05:11:35 +00:00
mtaylor
b1aeabad06 Calibration and noise reading fixes...
*  Beacon calibration interval needs to be per-radio, not global because
   each radio is going to have it's IQ gain calibration reached at different 
   times.  With multi-radio systems, you could have one radio calibrated and one
   in sorry shape and the calibration interval would be dropped back to the 
   longer intervals for both.  This also necessitated removal of the sysctl var
   for "calibrate" since it was the wrong thing.

*  Fix for jiffies rollover bugs - use macros and mod_timer calls rather than 
   hacking timer structures directly.

*  Always process noise floor before retrieving it.  That is to say, the process 
   noise floor call and the get channel noise call should always be one after the
   other, owing to things like channel changes and scanning.

	ath_hal_process_noisefloor(sc->sc_ah);
 	ic->ic_channoise = ath_hal_get_channel_noise(sc->sc_ah, &(sc->sc_curchan));

*  Calculate noise floor and read noise level at more opportune times/places.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3513 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 04:17:27 +00:00
mtaylor
98dc20d2e4 Deleted a dead block of code and fixed continuous transmit function incompatibility with HAL's TPC control. The continuous transmit function is used to test emissions at different power levels, so having the levels fixed in the HAL defeated the settings for the continous transmit power level.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3512 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:58:32 +00:00
mtaylor
1246a7c612 A couple of minor cleanups
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3511 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:54:50 +00:00
mtaylor
334f390f9c We need to update beacon configuration when the channel changes, the tswitch condition doesnt factor into the decision
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3510 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:53:25 +00:00
mtaylor
436eb24f42 Replace references to ath_hal_reset with a local wrapper, ath_hw_reset and remove cloned code that immdiately follows all the ath_hal_reset code.
This makes sure that the post-hw-reset stuff we do is done consistently in all cases for improved stability and predictability everywhere hardware reset is necessary.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3509 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:51:31 +00:00
mtaylor
afadc9b41d Move slot-time, CTS/RTS, and ACK timeout calculations into the driver. Corrected logic for the relationships between slot time and cts timeout and ack timeout have been added and the athctrl now delegates to the driver instead.
You can override:
- slottime
- ctstimeout
- acktimeout

acktimeout and ctstimeout will be selected from the first available of: 

1) the explicitly specified override value [if present]
2) a value derived from an explicitly specified slottime [if present]
3) the HALs default behavior / standard settings for the PHY mode

Setting the distance is shorthand for updating the slottime, and both cts and ack timeout values based upon the usual equations for air propagation, speed of light, etc..etc..



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3508 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:46:54 +00:00
mtaylor
cee1c3f7f9 Add init/destroy for locks to correct places, including the new beacon buffer and group poll buffer locks which will be used in a subsequent checkin.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3507 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:30:01 +00:00
mtaylor
449f6e1220 This commit updates the descriptions of the parameters to indicate default values, and makes those default values explicit in the global variables in the module.
Further, the tpc module parameter was based upon a misunderstanding of what the HAL really supports and has been re-characterized.

Originally I believed that the HAL implemented per-node power level tuning but they apparently felt the specifications were too complicated and instead they implemented the minimum requirement for ETSI aggregate power limit compliance.

In short, "tpc" really uses a fixed power level for all packets of the regulatory maximum less 3dBm.  It also defeats the fine-grained control (per descriptor) we have over the power levels of transmitted packets.

Therefore, I have renamed this to "hal_tpc" and updated the comments to reflect that this really is ETSI-style TPC hack for aggregate power.  Since the user can set the power level to max -3dBm just as easily, I don't see the point of it after all, but it's still supported just in case someone finds value in it.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3506 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:28:20 +00:00
mtaylor
0d6c6d0c6c This update uses the recently added HAL extensions for controlling noise immunity settings in order to correctly re-implement disabling of interference mitigation.
A module parameter and sysctl parameter are provided for changing whether interference mitigation is enabled or disabled.  

When interference mitigation is disabled, we work around a HAL defect where the interference mitigation auto-tuning algorithm still starts and/or sets some initially high mitigation levels.  

With this fix, disabling interference mitigation with the current HAL behaves like it did in prior HALs.  

Far greater receive sensitivity and increased range is supported with this disabled.  This is especially useful for long distance point-to-point links.

As a part of this fix, a severe bug that was originally a workaround for the HAL issue has been corrected.  When interference mitigation is enabled, we NEVER want to eat or throttle the MIB interrupts as the hardware counter callbacks to the HAL are what drives the interference mitigation calibration state machine.  Conversely, if interferference mitigation is being blocked by our driver but the hAL may still be enabling the HAL_INT_MIB in the IMR, then we want to force the interrupt OFF in the mask and eat the interrupt.

The failure case was where the interrupt would fire continually and never get properly handled because the HAL wasn't configured to handle interfernece mitigation - now we mask the interrupt OFF.  With the 'throttling' hack, we didn't fix hte problem but made it worse - when interfernce mitigation was enabled we just blocked the necessary signals to get the counters updated and stop the interrupt from continuing to fire.  

The timer to re-enable the MIB interrupt after it fired was also wrong cause it would make sure the interrupt could never be disabled by the HAL or the driver.




git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3505 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 03:21:59 +00:00
mtaylor
2477d20c5e Eliminate ath_buf's bf_node pointer.
This pointer is entirely redundant with the pointer already in the SKB.  This eliminates an unnecessary source of possible node reference leaks.  In all cases this variable was being populated from the SKB's node pointer and was never referenced outside of the context of processing an skb, for obvious reasons.

Use BF_NI(bf) or SKB_NI(skb) macros to obtain the node of a buffer or skb.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3504 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-10 00:07:55 +00:00
mtaylor
3a132792ff Simplification of kernel queue start/stop logic.
We had a local flag that was being used inconsistently to mirror the queue state, but was really brain dead.  sc_devstopped could be off even when the queue was stopped and no matter how many buffers were freed, we would never restart the queue.  This could lead to liveness issues (mostly after a buffer leak caused excessive buffers to be used).  
The kernel has an easy call to find out if the queue is stopped or not, so this checkin uses that.  

We will re-awaken the queue if:

1) we have some buffers we are willing to use for data
2) the channel is available (as opposed to being in DFS CAC)
3) the queue is stopped

This is what we were originally going for with reap counters and sc_dev_stopped and all this other nonsense.  The new logic is much simpler and cleaner.

This also fixes a performance problem where the queue was being re-awakened when no buffers were available resulting in a constant ping-pong of buffers between the kernel and madwifi and a very very heavy CPU utilization at exactly the wrong time.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3503 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 23:58:06 +00:00
mtaylor
9148c7a79a The RX tasklet must process the CABQ when it is setup and non-empty, even if the HAL says it is not "active".
HAL will say the CABQ is not active if the trigger has fired and the CABQ has been serviced.  Therefore, the conditions under which we were skipping CABQ are EXACTLY when we need to check it.

This was leading to large numbers of rx buffers consumed in the CABQ (multicast, etc) and thus the RX queue would deteriorate over time until RX overruns would eventually start to be a big problem.

I also include better diagnostics.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3502 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 23:41:07 +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
mtaylor
017c006628 Improved debug tracing and support for cleaning up stalled CABQ.
When CABQ transfer finishes, HAL reports the queue as inactive.  Thus, if
we switch modes or change state the CABQ can be left with some ath_buf 
referenced by it.  The changes in this patch cause the CABQ to be checked
at DTIM even when no multicast is pending for the VAP and if "stalled"
then the queue is drained.  

A subsequent patch will fix the tx tasklet logic for CABQ.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3499 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 23:17:18 +00:00
mtaylor
a388f3a80c if iwpriv turbo is set before first beacon update it will segfault because the update for dturbo comes
before the allocation and initial configuration.  Since there shouldn't be any dturbo switches at this point, some null checks prevent the problem.  I'm not sure where the code should be moved to, but probably further down in the function.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3498 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 23:10:05 +00:00
mtaylor
43de3ce1a0 Debugging updates:
*  Updated register dump based on ath5k database (refresh the list)
*  Added a generic debug iwpriv delegation method to if_ath
*  Added some functions to help diagnose lost ath_buf pointers
	[resultant fixes will be checked in subsequent commits]



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3497 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 22:25:51 +00:00
mtaylor
a78d83bb0d Debugging function cleanup:
1) Move all debug preprocessor flags out into make files
2) Add support for remaining preprocessor flags to be set by ENV variables
3) Add support for HAL tracing to include device name



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3481 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 19:55:49 +00:00
mtaylor
80c58504d7 This patch cleans up the VAP creation API.
The need to use software instead of hardware for beacon timers in AP+STA mode (aka nosbeacon) is now just determined in software, as we always knew whether or not to enable this.

The confusing bssid and -bssid parameters are now deprecated.

The "uniquebssid" flag is equivalent to "bssid" and can be used to force IEEE80211_CLONE_BSSID flag.  If this is not specified, then the BSSID used will be the next unused BSSID in the sequence, which could very well be the parent device's MAC address.

"uniquebssid" equates directly to IEEE80211_CLONE_BSSID" flag therefore.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3476 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-09 03:24:05 +00:00
mentor
4be10b5ba8 Some cleaning. Mostly cosmetic, but:
* Restructure one set of control blocks into a more readable form
 * Add some additional debug output


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3456 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-04-06 03:02:25 +00:00
mentor
ce589c7ae3 Add node and SKB pointers to ath_buf in ath_mgtstart, so they are managed by the ath_buf logic. Also, remove unnecessary(?) comment.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3401 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-20 03:27:24 +00:00
mentor
eec0d88182 Annoyingly pedantic updates
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3390 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-17 04:57:52 +00:00
mentor
b1a451321f The SIOCGATHDIAG ioctl tries to overlay a new struct defintion (struct ath_diag) onto the struct ifreq. Unfortunately, this structure appears to be too large on 64-bit platforms due to a larger pointer size; the technique may also suffer other problems.
Remove the old SIOCGATHDIAG ioctl (return -EOPNOTSUPP), and add a new ioctl (SIOCGATHHALDIAG) that passes the struct through ifr_data. Also, return -EOPNOTSUPP for unknown IOCTL numbers.

Incidently, I can't find anything that actually uses the old IOCTL.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3389 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-17 04:46:00 +00:00
mentor
d72a04fc2e Rewrite ath_ioctl_diag to handle cases where buffer sizes are zero.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3388 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-17 04:08:25 +00:00
mentor
3252f8852e Merge -dfs to trunk - r3366
This commit should have been in trunk all along. Also, make one codepath sligthly less verbose.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3367 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-03-01 07:59:04 +00:00
nbd
b99d972b64 revert an accidental change to the handling of errors at ath_tx_start from r3346, thx. bruno
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3362 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-23 14:13:09 +00:00
mentor
7d5824e65c In some situations have the hardware PHY calibrations synchronised with beacon sending. There is a greater chance that the mediuim will be quiet during this time, which appears to imporive calibration results.
This patch differs from the original in that beacon synchronised calibration is not condifured during CAC as no beacons are sent.
Thanks to nbd.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3358 0192ed92-7a03-0410-a25b-9323aeb14dbd
2008-02-14 06:34:28 +00:00