diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-28 09:44:56 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-28 09:44:56 -0700 |
commit | e4c5bf8e3dca827a1b3a6fac494eae8c74b7e1e7 (patch) | |
tree | ea51b391f7d74ca695dcb9f5e46eb02688a92ed9 /drivers/staging/otus/80211core/cwm.c | |
parent | 81280572ca6f54009edfa4deee563e8678784218 (diff) | |
parent | a4ac0d847af9dd34d5953a5e264400326144b6b2 (diff) | |
download | op-kernel-dev-e4c5bf8e3dca827a1b3a6fac494eae8c74b7e1e7.zip op-kernel-dev-e4c5bf8e3dca827a1b3a6fac494eae8c74b7e1e7.tar.gz |
Merge 'staging-next' to Linus's tree
This merges the staging-next tree to Linus's tree and resolves
some conflicts that were present due to changes in other trees that were
affected by files here.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/otus/80211core/cwm.c')
-rw-r--r-- | drivers/staging/otus/80211core/cwm.c | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/drivers/staging/otus/80211core/cwm.c b/drivers/staging/otus/80211core/cwm.c deleted file mode 100644 index 1bd0b1f..0000000 --- a/drivers/staging/otus/80211core/cwm.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2007-2008 Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/* */ -/* Module Name : cwm.c */ -/* */ -/* Abstract */ -/* This module contains channel width related functions. */ -/* */ -/* NOTES */ -/* None */ -/* */ -/************************************************************************/ - -#include "cprecomp.h" - - - -void zfCwmInit(zdev_t* dev) { - //u16_t i; - zmw_get_wlan_dev(dev); - - switch (wd->wlanMode) { - case ZM_MODE_AP: - wd->cwm.cw_mode = CWM_MODE2040; - wd->cwm.cw_width = CWM_WIDTH40; - wd->cwm.cw_enable = 1; - break; - case ZM_MODE_INFRASTRUCTURE: - case ZM_MODE_PSEUDO: - case ZM_MODE_IBSS: - default: - wd->cwm.cw_mode = CWM_MODE2040; - wd->cwm.cw_width = CWM_WIDTH20; - wd->cwm.cw_enable = 1; - break; - } -} - - -void zfCoreCwmBusy(zdev_t* dev, u16_t busy) -{ - - zmw_get_wlan_dev(dev); - - zm_msg1_mm(ZM_LV_0, "CwmBusy=", busy); - - if(wd->cwm.cw_mode == CWM_MODE20) { - wd->cwm.cw_width = CWM_WIDTH20; - return; - } - - if(wd->cwm.cw_mode == CWM_MODE40) { - wd->cwm.cw_width = CWM_WIDTH40; - return; - } - - if (busy) { - wd->cwm.cw_width = CWM_WIDTH20; - return; - } - - - if((wd->wlanMode == ZM_MODE_INFRASTRUCTURE || wd->wlanMode == ZM_MODE_PSEUDO || - wd->wlanMode == ZM_MODE_IBSS)) { - if ((wd->sta.ie.HtCap.HtCapInfo & HTCAP_SupChannelWidthSet) && - (wd->sta.ie.HtInfo.ChannelInfo & ExtHtCap_RecomTxWidthSet) && - (wd->sta.ie.HtInfo.ChannelInfo & ExtHtCap_ExtChannelOffsetAbove)) { - - wd->cwm.cw_width = CWM_WIDTH40; - } - else { - wd->cwm.cw_width = CWM_WIDTH20; - } - - return; - } - - if(wd->wlanMode == ZM_MODE_AP) { - wd->cwm.cw_width = CWM_WIDTH40; - } - -} - - - - -u16_t zfCwmIsExtChanBusy(u32_t ctlBusy, u32_t extBusy) -{ - u32_t busy; /* percentage */ - u32_t cycleTime, ctlClear; - - cycleTime = 1280000; //1.28 seconds - - if (cycleTime > ctlBusy) { - ctlClear = cycleTime - ctlBusy; - } - else - { - ctlClear = 0; - } - - /* Compute ratio of extension channel busy to control channel clear - * as an approximation to extension channel cleanliness. - * - * According to the hardware folks, ext rxclear is undefined - * if the ctrl rxclear is de-asserted (i.e. busy) - */ - if (ctlClear) { - busy = (extBusy * 100) / ctlClear; - } else { - busy = 0; - } - if (busy > ATH_CWM_EXTCH_BUSY_THRESHOLD) { - return TRUE; - } - - return FALSE; -} |