regtable_usb.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #include "bmi_msg.h"
  27. #include "targaddrs.h"
  28. #include "regtable_usb.h"
  29. #include "ar9888def.h"
  30. #include "ar6320def.h"
  31. #include "ar6320v2def.h"
  32. #include "hif_debug.h"
  33. void target_register_tbl_attach(struct hif_softc *scn,
  34. uint32_t target_type)
  35. {
  36. switch (target_type) {
  37. case TARGET_TYPE_AR9888:
  38. scn->targetdef = &ar9888_targetdef;
  39. break;
  40. case TARGET_TYPE_AR6320:
  41. scn->targetdef = &ar6320_targetdef;
  42. break;
  43. case TARGET_TYPE_AR6320V2:
  44. scn->targetdef = &ar6320v2_targetdef;
  45. break;
  46. default:
  47. HIF_ERROR("%s: unknown target_type %u", __func__, target_type);
  48. break;
  49. }
  50. }
  51. void hif_register_tbl_attach(struct hif_softc *scn, uint32_t hif_type)
  52. {
  53. switch (hif_type) {
  54. case HIF_TYPE_AR9888:
  55. scn->hostdef = &ar9888_hostdef;
  56. break;
  57. case HIF_TYPE_AR6320:
  58. scn->hostdef = &ar6320_hostdef;
  59. break;
  60. case HIF_TYPE_AR6320V2:
  61. scn->hostdef = &ar6320v2_hostdef;
  62. break;
  63. default:
  64. HIF_ERROR("%s: unknown hif_type %u", __func__, hif_type);
  65. break;
  66. }
  67. }