1 /* 2 * Copyright (c) 2013-2017 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 "cepci.h" 30 31 #define MISSING 0 32 #include "regtable_sdio.h" 33 #include "targaddrs.h" 34 #include "if_sdio.h" 35 #include "ar9888def.h" 36 #include "ar6320def.h" 37 #include "ar6320v2def.h" 38 39 void target_register_tbl_attach(struct hif_softc *scn, u32 target_type) 40 { 41 switch (target_type) { 42 case TARGET_TYPE_AR9888: 43 scn->targetdef = &ar9888_targetdef; 44 break; 45 case TARGET_TYPE_AR6320: 46 scn->targetdef = &ar6320_targetdef; 47 break; 48 case TARGET_TYPE_AR6320V2: 49 scn->targetdef = &ar6320v2_targetdef; 50 break; 51 default: 52 break; 53 } 54 } 55 56 void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type) 57 { 58 if (NULL == scn) { 59 QDF_TRACE(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_ERROR, 60 "%s: sc is NULL", __func__); 61 return; 62 } 63 64 switch (hif_type) { 65 case HIF_TYPE_AR9888: 66 scn->hostdef = &ar9888_hostdef; 67 break; 68 case HIF_TYPE_AR6320: 69 scn->hostdef = &ar6320_hostdef; 70 break; 71 case HIF_TYPE_AR6320V2: 72 scn->hostdef = &ar6320v2_hostdef; 73 break; 74 default: 75 break; 76 } 77 } 78