1286441Srpaulo/* $FreeBSD: releng/11.0/sys/dev/iwm/if_iwm_pcie_trans.h 286441 2015-08-08 06:06:48Z rpaulo $ */ 2286441Srpaulo/* 3286441Srpaulo * Copyright (c) 2014 genua mbh <info@genua.de> 4286441Srpaulo * Copyright (c) 2014 Fixup Software Ltd. 5286441Srpaulo * 6286441Srpaulo * Permission to use, copy, modify, and distribute this software for any 7286441Srpaulo * purpose with or without fee is hereby granted, provided that the above 8286441Srpaulo * copyright notice and this permission notice appear in all copies. 9286441Srpaulo * 10286441Srpaulo * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11286441Srpaulo * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12286441Srpaulo * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13286441Srpaulo * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14286441Srpaulo * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15286441Srpaulo * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16286441Srpaulo * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17286441Srpaulo */ 18286441Srpaulo 19286441Srpaulo/*- 20286441Srpaulo * Based on BSD-licensed source modules in the Linux iwlwifi driver, 21286441Srpaulo * which were used as the reference documentation for this implementation. 22286441Srpaulo * 23286441Srpaulo * Driver version we are currently based off of is 24286441Srpaulo * Linux 3.14.3 (tag id a2df521e42b1d9a23f620ac79dbfe8655a8391dd) 25286441Srpaulo * 26286441Srpaulo *********************************************************************** 27286441Srpaulo * 28286441Srpaulo * This file is provided under a dual BSD/GPLv2 license. When using or 29286441Srpaulo * redistributing this file, you may do so under either license. 30286441Srpaulo * 31286441Srpaulo * GPL LICENSE SUMMARY 32286441Srpaulo * 33286441Srpaulo * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved. 34286441Srpaulo * 35286441Srpaulo * This program is free software; you can redistribute it and/or modify 36286441Srpaulo * it under the terms of version 2 of the GNU General Public License as 37286441Srpaulo * published by the Free Software Foundation. 38286441Srpaulo * 39286441Srpaulo * This program is distributed in the hope that it will be useful, but 40286441Srpaulo * WITHOUT ANY WARRANTY; without even the implied warranty of 41286441Srpaulo * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 42286441Srpaulo * General Public License for more details. 43286441Srpaulo * 44286441Srpaulo * You should have received a copy of the GNU General Public License 45286441Srpaulo * along with this program; if not, write to the Free Software 46286441Srpaulo * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 47286441Srpaulo * USA 48286441Srpaulo * 49286441Srpaulo * The full GNU General Public License is included in this distribution 50286441Srpaulo * in the file called COPYING. 51286441Srpaulo * 52286441Srpaulo * Contact Information: 53286441Srpaulo * Intel Linux Wireless <ilw@linux.intel.com> 54286441Srpaulo * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 55286441Srpaulo * 56286441Srpaulo * 57286441Srpaulo * BSD LICENSE 58286441Srpaulo * 59286441Srpaulo * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved. 60286441Srpaulo * All rights reserved. 61286441Srpaulo * 62286441Srpaulo * Redistribution and use in source and binary forms, with or without 63286441Srpaulo * modification, are permitted provided that the following conditions 64286441Srpaulo * are met: 65286441Srpaulo * 66286441Srpaulo * * Redistributions of source code must retain the above copyright 67286441Srpaulo * notice, this list of conditions and the following disclaimer. 68286441Srpaulo * * Redistributions in binary form must reproduce the above copyright 69286441Srpaulo * notice, this list of conditions and the following disclaimer in 70286441Srpaulo * the documentation and/or other materials provided with the 71286441Srpaulo * distribution. 72286441Srpaulo * * Neither the name Intel Corporation nor the names of its 73286441Srpaulo * contributors may be used to endorse or promote products derived 74286441Srpaulo * from this software without specific prior written permission. 75286441Srpaulo * 76286441Srpaulo * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 77286441Srpaulo * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 78286441Srpaulo * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 79286441Srpaulo * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 80286441Srpaulo * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 81286441Srpaulo * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 82286441Srpaulo * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 83286441Srpaulo * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 84286441Srpaulo * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 85286441Srpaulo * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 86286441Srpaulo * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 87286441Srpaulo */ 88286441Srpaulo 89286441Srpaulo/*- 90286441Srpaulo * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> 91286441Srpaulo * 92286441Srpaulo * Permission to use, copy, modify, and distribute this software for any 93286441Srpaulo * purpose with or without fee is hereby granted, provided that the above 94286441Srpaulo * copyright notice and this permission notice appear in all copies. 95286441Srpaulo * 96286441Srpaulo * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 97286441Srpaulo * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 98286441Srpaulo * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 99286441Srpaulo * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 100286441Srpaulo * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 101286441Srpaulo * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 102286441Srpaulo * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 103286441Srpaulo */ 104286441Srpaulo#ifndef __IWM_PCIE_TRANS_H__ 105286441Srpaulo#define __IWM_PCIE_TRANS_H__ 106286441Srpaulo 107286441Srpauloextern uint32_t iwm_read_prph(struct iwm_softc *sc, uint32_t addr); 108286441Srpauloextern void iwm_write_prph(struct iwm_softc *sc, uint32_t addr, uint32_t val); 109286441Srpauloextern int iwm_read_mem(struct iwm_softc *sc, uint32_t addr, void *buf, int dwords); 110286441Srpauloextern int iwm_write_mem(struct iwm_softc *sc, uint32_t addr, const void *buf, 111286441Srpaulo int dwords); 112286441Srpauloextern int iwm_write_mem32(struct iwm_softc *sc, uint32_t addr, uint32_t val); 113286441Srpauloextern int iwm_poll_bit(struct iwm_softc *sc, int reg, 114286441Srpaulo uint32_t bits, uint32_t mask, int timo); 115286441Srpauloextern int iwm_nic_lock(struct iwm_softc *sc); 116286441Srpauloextern void iwm_nic_unlock(struct iwm_softc *sc); 117286441Srpauloextern void iwm_set_bits_mask_prph(struct iwm_softc *sc, 118286441Srpaulo uint32_t reg, uint32_t bits, uint32_t mask); 119286441Srpauloextern void iwm_set_bits_prph(struct iwm_softc *sc, uint32_t reg, uint32_t bits); 120286441Srpauloextern void iwm_clear_bits_prph(struct iwm_softc *sc, uint32_t reg, uint32_t bits); 121286441Srpauloextern void iwm_enable_rfkill_int(struct iwm_softc *sc); 122286441Srpauloextern int iwm_check_rfkill(struct iwm_softc *sc); 123286441Srpauloextern int iwm_set_hw_ready(struct iwm_softc *sc); 124286441Srpauloextern int iwm_prepare_card_hw(struct iwm_softc *sc); 125286441Srpauloextern void iwm_apm_config(struct iwm_softc *sc); 126286441Srpauloextern int iwm_apm_init(struct iwm_softc *sc); 127286441Srpauloextern void iwm_apm_stop(struct iwm_softc *sc); 128286441Srpauloextern int iwm_start_hw(struct iwm_softc *sc); 129286441Srpauloextern void iwm_set_pwr(struct iwm_softc *sc); 130286441Srpauloextern int iwm_pcie_rx_stop(struct iwm_softc *sc); 131286441Srpaulo 132286441Srpaulo#endif 133