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