OLD | NEW |
1 //------------------------------------------------------------------------------ | 1 //------------------------------------------------------------------------------ |
2 // <copyright file="ar3kconfig.c" company="Atheros"> | 2 // Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. |
3 // Copyright (c) 2009 Atheros Corporation. All rights reserved. | |
4 // | 3 // |
5 // This program is free software; you can redistribute it and/or modify | |
6 // it under the terms of the GNU General Public License version 2 as | |
7 // published by the Free Software Foundation; | |
8 // | 4 // |
9 // Software distributed under the License is distributed on an "AS | 5 // Permission to use, copy, modify, and/or distribute this software for any |
10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 6 // purpose with or without fee is hereby granted, provided that the above |
11 // implied. See the License for the specific language governing | 7 // copyright notice and this permission notice appear in all copies. |
12 // rights and limitations under the License. | 8 // |
| 9 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
13 // | 16 // |
14 // | 17 // |
15 //------------------------------------------------------------------------------ | 18 //------------------------------------------------------------------------------ |
16 //============================================================================== | 19 //============================================================================== |
17 // AR3K configuration implementation | 20 // AR3K configuration implementation |
18 // | 21 // |
19 // Author(s): ="Atheros" | 22 // Author(s): ="Atheros" |
20 //============================================================================== | 23 //============================================================================== |
21 | 24 |
22 #include "a_config.h" | 25 #include "a_config.h" |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 break; | 472 break; |
470 } | 473 } |
471 | 474 |
472 if (pConfig->Flags & AR3K_CONFIG_FLAG_FORCE_MINBOOT_EXIT) { | 475 if (pConfig->Flags & AR3K_CONFIG_FLAG_FORCE_MINBOOT_EXIT) { |
473 status = AR3KExitMinBoot(pConfig); | 476 status = AR3KExitMinBoot(pConfig); |
474 if (A_FAILED(status)) { | 477 if (A_FAILED(status)) { |
475 break; | 478 break; |
476 } | 479 } |
477 } | 480 } |
478 | 481 |
479 if (pConfig->Flags & | 482 |
480 (AR3K_CONFIG_FLAG_SET_AR3K_BAUD | AR3K_CONFIG_FLAG_SET_AR6K_SCAL
E_STEP)) { | |
481 status = AR3KConfigureHCIBaud(pConfig); | |
482 if (A_FAILED(status)) { | |
483 break; | |
484 } | |
485 } | |
486 | |
487 /* Load patching and PST file if available*/ | 483 /* Load patching and PST file if available*/ |
488 if (A_OK != AthPSInitialize(pConfig)) { | 484 if (A_OK != AthPSInitialize(pConfig)) { |
489 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Patch Download Failed!\n")); | 485 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Patch Download Failed!\n")); |
490 } | 486 } |
491 | 487 |
492 /* Send HCI reset to make PS tags take effect*/ | 488 /* Send HCI reset to make PS tags take effect*/ |
493 AR3KConfigureSendHCIReset(pConfig); | 489 AR3KConfigureSendHCIReset(pConfig); |
494 | 490 |
| 491 if (pConfig->Flags & |
| 492 (AR3K_CONFIG_FLAG_SET_AR3K_BAUD | AR3K_CONFIG_FLAG_SET_AR6K_SCAL
E_STEP)) { |
| 493 status = AR3KConfigureHCIBaud(pConfig); |
| 494 if (A_FAILED(status)) { |
| 495 break; |
| 496 } |
| 497 } |
| 498 |
| 499 |
| 500 |
495 if (pConfig->PwrMgmtEnabled) { | 501 if (pConfig->PwrMgmtEnabled) { |
496 /* the delay is required after the previous HCI reset before further | 502 /* the delay is required after the previous HCI reset before further |
497 * HCI commands can be issued | 503 * HCI commands can be issued |
498 */ | 504 */ |
499 A_MDELAY(200); | 505 A_MDELAY(200); |
500 AR3KEnableTLPM(pConfig); | 506 AR3KEnableTLPM(pConfig); |
501 } | 507 } |
502 | 508 |
503 /* re-enable asynchronous recv */ | 509 /* re-enable asynchronous recv */ |
504 status = HCI_TransportEnableDisableAsyncRecv(pConfig->pHCIDev,TRUE); | 510 status = HCI_TransportEnableDisableAsyncRecv(pConfig->pHCIDev,TRUE); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 557 |
552 | 558 |
553 } while (FALSE); | 559 } while (FALSE); |
554 | 560 |
555 | 561 |
556 AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR3K Config: Cleanup Complete (status = %d)
\n",status)); | 562 AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR3K Config: Cleanup Complete (status = %d)
\n",status)); |
557 | 563 |
558 return status; | 564 return status; |
559 } | 565 } |
560 | 566 |
OLD | NEW |