common_drv.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //------------------------------------------------------------------------------
  2. // <copyright file="common_drv.h" company="Atheros">
  3. // Copyright (c) 2004-2008 Atheros Corporation. All rights reserved.
  4. //
  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. //
  9. // Software distributed under the License is distributed on an "AS
  10. // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  11. // implied. See the License for the specific language governing
  12. // rights and limitations under the License.
  13. //
  14. //
  15. //------------------------------------------------------------------------------
  16. //==============================================================================
  17. // Author(s): ="Atheros"
  18. //==============================================================================
  19. #ifndef COMMON_DRV_H_
  20. #define COMMON_DRV_H_
  21. #include "hif.h"
  22. #include "htc_packet.h"
  23. /* structure that is the state information for the default credit distribution callback
  24. * drivers should instantiate (zero-init as well) this structure in their driver instance
  25. * and pass it as a context to the HTC credit distribution functions */
  26. typedef struct _COMMON_CREDIT_STATE_INFO {
  27. int TotalAvailableCredits; /* total credits in the system at startup */
  28. int CurrentFreeCredits; /* credits available in the pool that have not been
  29. given out to endpoints */
  30. HTC_ENDPOINT_CREDIT_DIST *pLowestPriEpDist; /* pointer to the lowest priority endpoint dist struct */
  31. } COMMON_CREDIT_STATE_INFO;
  32. /* HTC TX packet tagging definitions */
  33. #define AR6K_CONTROL_PKT_TAG HTC_TX_PACKET_TAG_USER_DEFINED
  34. #define AR6K_DATA_PKT_TAG (AR6K_CONTROL_PKT_TAG + 1)
  35. #define AR6002_VERSION_REV1 0x20000086
  36. #define AR6002_VERSION_REV2 0x20000188
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. /* OS-independent APIs */
  41. A_STATUS ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, COMMON_CREDIT_STATE_INFO *pCredInfo);
  42. A_STATUS ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data);
  43. A_STATUS ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data);
  44. A_STATUS ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, A_UCHAR *data, A_UINT32 length);
  45. A_STATUS ar6000_reset_device(HIF_DEVICE *hifDevice, A_UINT32 TargetType, A_BOOL waitForCompletion);
  46. void ar6000_dump_target_assert_info(HIF_DEVICE *hifDevice, A_UINT32 TargetType);
  47. A_STATUS ar6000_reset_device_skipflash(HIF_DEVICE *hifDevice);
  48. A_STATUS ar6000_set_htc_params(HIF_DEVICE *hifDevice,
  49. A_UINT32 TargetType,
  50. A_UINT32 MboxIsrYieldValue,
  51. A_UINT8 HtcControlBuffers);
  52. A_STATUS ar6000_prepare_target(HIF_DEVICE *hifDevice,
  53. A_UINT32 TargetType,
  54. A_UINT32 TargetVersion);
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif /*COMMON_DRV_H_*/