| Index: chromeos/drivers/ath6kl/htc2/htc.c
|
| diff --git a/chromeos/drivers/ath6kl/htc2/htc.c b/chromeos/drivers/ath6kl/htc2/htc.c
|
| index 0068685972a98714e541b574b86960489015ac65..7df62a20d4826814dca92b6d3131864cc955ee03 100644
|
| --- a/chromeos/drivers/ath6kl/htc2/htc.c
|
| +++ b/chromeos/drivers/ath6kl/htc2/htc.c
|
| @@ -1,15 +1,19 @@
|
| //------------------------------------------------------------------------------
|
| // <copyright file="htc.c" company="Atheros">
|
| -// Copyright (c) 2007-2008 Atheros Corporation. All rights reserved.
|
| +// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved.
|
| //
|
| -// This program is free software; you can redistribute it and/or modify
|
| -// it under the terms of the GNU General Public License version 2 as
|
| -// published by the Free Software Foundation;
|
| //
|
| -// Software distributed under the License is distributed on an "AS
|
| -// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
| -// implied. See the License for the specific language governing
|
| -// rights and limitations under the License.
|
| +// 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.
|
| //
|
| //
|
| //------------------------------------------------------------------------------
|
| @@ -18,7 +22,7 @@
|
| //==============================================================================
|
| #include "htc_internal.h"
|
|
|
| -#ifdef DEBUG
|
| +#ifdef ATH_DEBUG_MODULE
|
| static ATH_DEBUG_MASK_DESCRIPTION g_HTCDebugDescription[] = {
|
| { ATH_DEBUG_SEND , "Send"},
|
| { ATH_DEBUG_RECV , "Recv"},
|
| @@ -203,7 +207,7 @@ HTC_HANDLE HTCCreate(void *hif_handle, HTC_INIT_INFO *pInfo)
|
| void HTCDestroy(HTC_HANDLE HTCHandle)
|
| {
|
| HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
| - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCDestroy .. Destroying :0x%X \n",(A_UINT32)target));
|
| + AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCDestroy .. Destroying :0x%lX \n",(unsigned long)target));
|
| HTCCleanup(target);
|
| AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCDestroy \n"));
|
| }
|
| @@ -224,10 +228,11 @@ A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle)
|
| A_STATUS status;
|
| HTC_PACKET *pPacket = NULL;
|
| HTC_READY_EX_MSG *pRdyMsg;
|
| +
|
| HTC_SERVICE_CONNECT_REQ connect;
|
| HTC_SERVICE_CONNECT_RESP resp;
|
|
|
| - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCWaitTarget - Enter (target:0x%X) \n", (A_UINT32)target));
|
| + AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCWaitTarget - Enter (target:0x%lX) \n", (unsigned long)target));
|
|
|
| do {
|
|
|
| @@ -312,9 +317,15 @@ A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle)
|
|
|
| if (target->MaxMsgPerBundle > 0) {
|
| AR_DEBUG_PRINTF(ATH_DEBUG_TRC,
|
| - (" HTC bundling allowed. Max Msg Per HTC Bundle: %d\n", target->MaxMsgPerBundle));
|
| - target->SendBundlingEnabled = TRUE;
|
| - target->RecvBundlingEnabled = TRUE;
|
| + (" HTC bundling allowed. Max Msg Per HTC Bundle: %d\n", target->MaxMsgPerBundle));
|
| +
|
| + if (DEV_GET_MAX_BUNDLE_SEND_LENGTH(&target->Device) != 0) {
|
| + target->SendBundlingEnabled = TRUE;
|
| + }
|
| + if (DEV_GET_MAX_BUNDLE_RECV_LENGTH(&target->Device) != 0) {
|
| + target->RecvBundlingEnabled = TRUE;
|
| + }
|
| +
|
| if (!DEV_IS_LEN_BLOCK_ALIGNED(&target->Device,target->TargetCreditSize)) {
|
| AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("*** Credit size: %d is not block aligned! Disabling send bundling \n",
|
| target->TargetCreditSize));
|
| @@ -397,9 +408,12 @@ A_STATUS HTCStart(HTC_HANDLE HTCHandle)
|
| target->EpCreditDistributionListHead->pNext,
|
| target->TargetCredits);
|
|
|
| +#ifdef ATH_DEBUG_MODULE
|
| +
|
| if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_TRC)) {
|
| DumpCreditDistStates(target);
|
| }
|
| +#endif
|
|
|
| /* the caller is done connecting to services, so we can indicate to the
|
| * target that the setup phase is complete */
|
| @@ -461,6 +475,12 @@ void HTCStop(HTC_HANDLE HTCHandle)
|
| * all pending HIF I/O has completed, we can safely flush the queues */
|
| DevMaskInterrupts(&target->Device);
|
|
|
| +#ifdef THREAD_X
|
| + //
|
| + // Is this delay required
|
| + //
|
| + A_MDELAY(200); // wait for IRQ process done
|
| +#endif
|
| /* flush all send packets */
|
| HTCFlushSendPkts(target);
|
| /* flush all recv buffers */
|
| @@ -471,6 +491,7 @@ void HTCStop(HTC_HANDLE HTCHandle)
|
| AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCStop \n"));
|
| }
|
|
|
| +#ifdef ATH_DEBUG_MODULE
|
| void HTCDumpCreditStates(HTC_HANDLE HTCHandle)
|
| {
|
| HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
| @@ -483,7 +504,7 @@ void HTCDumpCreditStates(HTC_HANDLE HTCHandle)
|
|
|
| DumpAR6KDevState(&target->Device);
|
| }
|
| -
|
| +#endif
|
| /* report a target failure from the device, this is a callback from the device layer
|
| * which uses a mechanism to report errors from the target (i.e. special interrupts) */
|
| static void HTCReportFailure(void *Context)
|
|
|