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