Deleted Added
full compact
if_malo.c (289165) if_malo.c (293339)
1/*-
2 * Copyright (c) 2008 Weongyo Jeong <weongyo@freebsd.org>
3 * Copyright (c) 2007 Marvell Semiconductor, Inc.
4 * Copyright (c) 2007 Sam Leffler, Errno Consulting
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 17 unchanged lines hidden (view full) ---

26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
27 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29 * THE POSSIBILITY OF SUCH DAMAGES.
30 */
31
32#include <sys/cdefs.h>
33#ifdef __FreeBSD__
1/*-
2 * Copyright (c) 2008 Weongyo Jeong <weongyo@freebsd.org>
3 * Copyright (c) 2007 Marvell Semiconductor, Inc.
4 * Copyright (c) 2007 Sam Leffler, Errno Consulting
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 17 unchanged lines hidden (view full) ---

26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
27 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29 * THE POSSIBILITY OF SUCH DAMAGES.
30 */
31
32#include <sys/cdefs.h>
33#ifdef __FreeBSD__
34__FBSDID("$FreeBSD: head/sys/dev/malo/if_malo.c 289165 2015-10-12 04:55:20Z adrian $");
34__FBSDID("$FreeBSD: head/sys/dev/malo/if_malo.c 293339 2016-01-07 18:41:03Z avos $");
35#endif
36
37#include "opt_malo.h"
38
39#include <sys/param.h>
40#include <sys/endian.h>
41#include <sys/kernel.h>
42#include <sys/socket.h>

--- 125 unchanged lines hidden (view full) ---

168}
169
170int
171malo_attach(uint16_t devid, struct malo_softc *sc)
172{
173 struct ieee80211com *ic = &sc->malo_ic;
174 struct malo_hal *mh;
175 int error;
35#endif
36
37#include "opt_malo.h"
38
39#include <sys/param.h>
40#include <sys/endian.h>
41#include <sys/kernel.h>
42#include <sys/socket.h>

--- 125 unchanged lines hidden (view full) ---

168}
169
170int
171malo_attach(uint16_t devid, struct malo_softc *sc)
172{
173 struct ieee80211com *ic = &sc->malo_ic;
174 struct malo_hal *mh;
175 int error;
176 uint8_t bands;
176 uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
177
178 MALO_LOCK_INIT(sc);
179 callout_init_mtx(&sc->malo_watchdog_timer, &sc->malo_mtx, 0);
180 mbufq_init(&sc->malo_snd, ifqmaxlen);
181
182 mh = malo_hal_attach(sc->malo_dev, devid,
183 sc->malo_io1h, sc->malo_io1t, sc->malo_dmat);
184 if (mh == NULL) {

--- 32 unchanged lines hidden (view full) ---

217 sc->malo_hwspecs.regioncode, sc->malo_hwspecs.num_antenna,
218 sc->malo_hwspecs.fw_releasenum, sc->malo_hwspecs.wcbbase0,
219 sc->malo_hwspecs.rxdesc_read, sc->malo_hwspecs.rxdesc_write,
220 sc->malo_hwspecs.ul_fw_awakecookie,
221 sc->malo_hwspecs.wcbbase[0], sc->malo_hwspecs.wcbbase[1],
222 sc->malo_hwspecs.wcbbase[2], sc->malo_hwspecs.wcbbase[3]);
223
224 /* NB: firmware looks that it does not export regdomain info API. */
177
178 MALO_LOCK_INIT(sc);
179 callout_init_mtx(&sc->malo_watchdog_timer, &sc->malo_mtx, 0);
180 mbufq_init(&sc->malo_snd, ifqmaxlen);
181
182 mh = malo_hal_attach(sc->malo_dev, devid,
183 sc->malo_io1h, sc->malo_io1t, sc->malo_dmat);
184 if (mh == NULL) {

--- 32 unchanged lines hidden (view full) ---

217 sc->malo_hwspecs.regioncode, sc->malo_hwspecs.num_antenna,
218 sc->malo_hwspecs.fw_releasenum, sc->malo_hwspecs.wcbbase0,
219 sc->malo_hwspecs.rxdesc_read, sc->malo_hwspecs.rxdesc_write,
220 sc->malo_hwspecs.ul_fw_awakecookie,
221 sc->malo_hwspecs.wcbbase[0], sc->malo_hwspecs.wcbbase[1],
222 sc->malo_hwspecs.wcbbase[2], sc->malo_hwspecs.wcbbase[3]);
223
224 /* NB: firmware looks that it does not export regdomain info API. */
225 bands = 0;
226 setbit(&bands, IEEE80211_MODE_11B);
227 setbit(&bands, IEEE80211_MODE_11G);
228 ieee80211_init_channels(ic, NULL, &bands);
225 memset(bands, 0, sizeof(bands));
226 setbit(bands, IEEE80211_MODE_11B);
227 setbit(bands, IEEE80211_MODE_11G);
228 ieee80211_init_channels(ic, NULL, bands);
229
230 sc->malo_txantenna = 0x2; /* h/w default */
231 sc->malo_rxantenna = 0xffff; /* h/w default */
232
233 /*
234 * Allocate tx + rx descriptors and populate the lists.
235 * We immediately push the information to the firmware
236 * as otherwise it gets upset.

--- 1944 unchanged lines hidden ---
229
230 sc->malo_txantenna = 0x2; /* h/w default */
231 sc->malo_rxantenna = 0xffff; /* h/w default */
232
233 /*
234 * Allocate tx + rx descriptors and populate the lists.
235 * We immediately push the information to the firmware
236 * as otherwise it gets upset.

--- 1944 unchanged lines hidden ---