1b9768303SAdrian Chadd /*- 2b9768303SAdrian Chadd * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3b9768303SAdrian Chadd * All rights reserved. 4b9768303SAdrian Chadd * 5b9768303SAdrian Chadd * Redistribution and use in source and binary forms, with or without 6b9768303SAdrian Chadd * modification, are permitted provided that the following conditions 7b9768303SAdrian Chadd * are met: 8b9768303SAdrian Chadd * 1. Redistributions of source code must retain the above copyright 9b9768303SAdrian Chadd * notice, this list of conditions and the following disclaimer, 10b9768303SAdrian Chadd * without modification. 11b9768303SAdrian Chadd * 2. Redistributions in binary form must reproduce at minimum a disclaimer 12b9768303SAdrian Chadd * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 13b9768303SAdrian Chadd * redistribution must be conditioned upon including a substantially 14b9768303SAdrian Chadd * similar Disclaimer requirement for further binary redistribution. 15b9768303SAdrian Chadd * 16b9768303SAdrian Chadd * NO WARRANTY 17b9768303SAdrian Chadd * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18b9768303SAdrian Chadd * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19b9768303SAdrian Chadd * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 20b9768303SAdrian Chadd * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 21b9768303SAdrian Chadd * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 22b9768303SAdrian Chadd * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23b9768303SAdrian Chadd * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24b9768303SAdrian Chadd * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25b9768303SAdrian Chadd * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26b9768303SAdrian Chadd * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27b9768303SAdrian Chadd * THE POSSIBILITY OF SUCH DAMAGES. 28b9768303SAdrian Chadd */ 29b9768303SAdrian Chadd #ifndef __IF_BWN_MISC_H__ 30b9768303SAdrian Chadd #define __IF_BWN_MISC_H__ 31b9768303SAdrian Chadd 32b9768303SAdrian Chadd /* 33b9768303SAdrian Chadd * These are the functions used by the PHY code. 34b9768303SAdrian Chadd * 35b9768303SAdrian Chadd * They currently live in the driver itself; at least until they 36b9768303SAdrian Chadd * are broken out into smaller pieces. 37b9768303SAdrian Chadd */ 38b9768303SAdrian Chadd 39b9768303SAdrian Chadd struct bwn_mac; 40b9768303SAdrian Chadd 41*d177c199SLandon J. Fuller extern int bwn_gpio_control(struct bwn_mac *, uint32_t); 42*d177c199SLandon J. Fuller 43b9768303SAdrian Chadd extern uint64_t bwn_hf_read(struct bwn_mac *); 44b9768303SAdrian Chadd extern void bwn_hf_write(struct bwn_mac *, uint64_t); 45b9768303SAdrian Chadd 466dbb9b3cSAdrian Chadd extern void bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon); 476dbb9b3cSAdrian Chadd 48d546e47aSAdrian Chadd extern void bwn_ram_write(struct bwn_mac *, uint16_t, uint32_t); 49d546e47aSAdrian Chadd 50b9768303SAdrian Chadd extern void bwn_mac_suspend(struct bwn_mac *); 51b9768303SAdrian Chadd extern void bwn_mac_enable(struct bwn_mac *); 52b9768303SAdrian Chadd 53d546e47aSAdrian Chadd extern int bwn_switch_channel(struct bwn_mac *, int); 54d546e47aSAdrian Chadd 55d546e47aSAdrian Chadd extern uint16_t bwn_shm_read_2(struct bwn_mac *, uint16_t, uint16_t); 56d546e47aSAdrian Chadd extern void bwn_shm_write_2(struct bwn_mac *, uint16_t, uint16_t, 57d546e47aSAdrian Chadd uint16_t); 58d546e47aSAdrian Chadd extern uint32_t bwn_shm_read_4(struct bwn_mac *, uint16_t, uint16_t); 59d546e47aSAdrian Chadd extern void bwn_shm_write_4(struct bwn_mac *, uint16_t, uint16_t, 60d546e47aSAdrian Chadd uint32_t); 61d546e47aSAdrian Chadd 62*d177c199SLandon J. Fuller extern int bwn_reset_core(struct bwn_mac *, int g_mode); 6352bef765SAdrian Chadd 64d546e47aSAdrian Chadd extern void bwn_psctl(struct bwn_mac *, uint32_t); 65d546e47aSAdrian Chadd 66b9768303SAdrian Chadd #endif 67