xref: /wlan-dirver/qca-wifi-host-cmn/hif/src/sdio/regtable_sdio.c (revision aa6cfd9f971c0e14f93481280e1f636954e47f0e)
1 /*
2  * Copyright (c) 2013-2018 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 /*
23  * This file was originally distributed by Qualcomm Atheros, Inc.
24  * under proprietary terms before Copyright ownership was assigned
25  * to the Linux Foundation.
26  */
27 
28 #include "bmi_msg.h"
29 #include "target_type.h"
30 #include "cepci.h"
31 
32 #define MISSING 0
33 #include "regtable_sdio.h"
34 #include "targaddrs.h"
35 #include "if_sdio.h"
36 #include "ar9888def.h"
37 #include "ar6320def.h"
38 #include "ar6320v2def.h"
39 
40 void target_register_tbl_attach(struct hif_softc *scn, u32 target_type)
41 {
42 	switch (target_type) {
43 	case TARGET_TYPE_AR9888:
44 		scn->targetdef = &ar9888_targetdef;
45 		break;
46 	case TARGET_TYPE_AR6320:
47 		scn->targetdef = &ar6320_targetdef;
48 		break;
49 	case TARGET_TYPE_AR6320V2:
50 		scn->targetdef = &ar6320v2_targetdef;
51 		break;
52 	default:
53 		break;
54 	}
55 }
56 
57 void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type)
58 {
59 	if (NULL == scn) {
60 		QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_ERROR,
61 			  "%s: sc is NULL", __func__);
62 		return;
63 	}
64 
65 	switch (hif_type) {
66 	case HIF_TYPE_AR9888:
67 		scn->hostdef = &ar9888_hostdef;
68 		break;
69 	case HIF_TYPE_AR6320:
70 		scn->hostdef = &ar6320_hostdef;
71 		break;
72 	case HIF_TYPE_AR6320V2:
73 		scn->hostdef = &ar6320v2_hostdef;
74 		break;
75 	default:
76 		break;
77 	}
78 }
79