[bwn] break out the LP PHY code into a separate file.

This (and eventually migrating the other PHY code out) is in preparation
for adding the 11n PHY.  No, the 11ac PHY (for the BCM4260 softmac part) isn't
yet open source, so we can't grow that.  Yet.

This trims ~3,700 lines of code from if_bwn.c, bringing it down to a slightly
less crazy sounding 10,446 lines of code.
This commit is contained in:
Adrian Chadd 2016-05-02 21:06:02 +00:00
parent 96546b75e7
commit b976830308
6 changed files with 3825 additions and 3648 deletions

View File

@ -1132,6 +1132,8 @@ dev/bwi/if_bwi_pci.c optional bwi pci
# XXX Work around clang warning, until maintainer approves fix.
dev/bwn/if_bwn.c optional bwn siba_bwn \
compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}"
dev/bwn/if_bwn_phy_lp.c optional bwn siba_bwn \
compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}"
dev/cardbus/cardbus.c optional cardbus
dev/cardbus/cardbus_cis.c optional cardbus
dev/cardbus/cardbus_device.c optional cardbus

File diff suppressed because it is too large Load Diff

49
sys/dev/bwn/if_bwn_misc.h Normal file
View File

@ -0,0 +1,49 @@
/*-
* Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
* redistribution must be conditioned upon including a substantially
* similar Disclaimer requirement for further binary redistribution.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGES.
*
* $FreeBSD$
*/
#ifndef __IF_BWN_MISC_H__
#define __IF_BWN_MISC_H__
/*
* These are the functions used by the PHY code.
*
* They currently live in the driver itself; at least until they
* are broken out into smaller pieces.
*/
struct bwn_mac;
extern uint64_t bwn_hf_read(struct bwn_mac *);
extern void bwn_hf_write(struct bwn_mac *, uint64_t);
extern void bwn_mac_suspend(struct bwn_mac *);
extern void bwn_mac_enable(struct bwn_mac *);
#endif

3716
sys/dev/bwn/if_bwn_phy_lp.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
/*-
* Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
* redistribution must be conditioned upon including a substantially
* similar Disclaimer requirement for further binary redistribution.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGES.
*
* $FreeBSD$
*/
#ifndef __IF_BWN_PHY_LP_H__
#define __IF_BWN_PHY_LP_H__
extern void bwn_phy_lp_init_pre(struct bwn_mac *);
extern int bwn_phy_lp_init(struct bwn_mac *);
extern uint16_t bwn_phy_lp_read(struct bwn_mac *, uint16_t);
extern void bwn_phy_lp_write(struct bwn_mac *, uint16_t, uint16_t);
extern void bwn_phy_lp_maskset(struct bwn_mac *, uint16_t, uint16_t,
uint16_t);
extern uint16_t bwn_phy_lp_rf_read(struct bwn_mac *, uint16_t);
extern void bwn_phy_lp_rf_write(struct bwn_mac *, uint16_t, uint16_t);
extern void bwn_phy_lp_rf_onoff(struct bwn_mac *, int);
extern int bwn_phy_lp_switch_channel(struct bwn_mac *, uint32_t);
extern void bwn_phy_lp_switch_analog(struct bwn_mac *, int);
extern uint32_t bwn_phy_lp_get_default_chan(struct bwn_mac *);
extern void bwn_phy_lp_set_antenna(struct bwn_mac *, int);
extern void bwn_phy_lp_task_60s(struct bwn_mac *);
#endif /* __IF_BWN_PHY_LP_H__ */

View File

@ -4,6 +4,7 @@
KMOD= if_bwn
SRCS= if_bwn.c if_bwnreg.h if_bwnvar.h
SRCS+= if_bwn_phy_lp.c
SRCS+= device_if.h bus_if.h pci_if.h
.include <bsd.kmod.mk>