Deleted Added
sdiff udiff text old ( 189575 ) new ( 190526 )
full compact
1/* $FreeBSD: head/sys/dev/ipw/if_ipw.c 189575 2009-03-09 13:23:54Z imp $ */
2
3/*-
4 * Copyright (c) 2004-2006
5 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
6 * Copyright (c) 2006 Sam Leffler, Errno Consulting
7 * Copyright (c) 2007 Andrew Thompson <thompsa@FreeBSD.org>
8 *
9 * Redistribution and use in source and binary forms, with or without

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

25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/dev/ipw/if_ipw.c 189575 2009-03-09 13:23:54Z imp $");
34
35/*-
36 * Intel(R) PRO/Wireless 2100 MiniPCI driver
37 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm
38 */
39
40#include <sys/param.h>
41#include <sys/sysctl.h>

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

226ipw_attach(device_t dev)
227{
228 struct ipw_softc *sc = device_get_softc(dev);
229 struct ifnet *ifp;
230 struct ieee80211com *ic;
231 struct ieee80211_channel *c;
232 uint16_t val;
233 int error, i;
234
235 sc->sc_dev = dev;
236
237 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
238 MTX_DEF | MTX_RECURSE);
239
240 TASK_INIT(&sc->sc_init_task, 0, ipw_init_task, sc);
241 TASK_INIT(&sc->sc_scan_task, 0, ipw_scan_task, sc);

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

310 | IEEE80211_C_MONITOR /* monitor mode supported */
311 | IEEE80211_C_PMGT /* power save supported */
312 | IEEE80211_C_SHPREAMBLE /* short preamble supported */
313 | IEEE80211_C_WPA /* 802.11i supported */
314 ;
315
316 /* read MAC address from EEPROM */
317 val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 0);
318 ic->ic_myaddr[0] = val >> 8;
319 ic->ic_myaddr[1] = val & 0xff;
320 val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 1);
321 ic->ic_myaddr[2] = val >> 8;
322 ic->ic_myaddr[3] = val & 0xff;
323 val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 2);
324 ic->ic_myaddr[4] = val >> 8;
325 ic->ic_myaddr[5] = val & 0xff;
326
327 /* set supported .11b channels (read from EEPROM) */
328 if ((val = ipw_read_prom_word(sc, IPW_EEPROM_CHANNEL_LIST)) == 0)
329 val = 0x7ff; /* default to channels 1-11 */
330 val <<= 1;
331 for (i = 1; i < 16; i++) {
332 if (val & (1 << i)) {
333 c = &ic->ic_channels[ic->ic_nchans++];
334 c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_2GHZ);
335 c->ic_flags = IEEE80211_CHAN_B;
336 c->ic_ieee = i;
337 }
338 }
339
340 /* check support for radio transmitter switch in EEPROM */
341 if (!(ipw_read_prom_word(sc, IPW_EEPROM_RADIO) & 8))
342 sc->flags |= IPW_FLAG_HAS_RADIO_SWITCH;
343
344 ieee80211_ifattach(ic);
345 ic->ic_scan_start = ipw_scan_start;
346 ic->ic_scan_end = ipw_scan_end;
347 ic->ic_set_channel = ipw_set_channel;
348 ic->ic_scan_curchan = ipw_scan_curchan;
349 ic->ic_scan_mindwell = ipw_scan_mindwell;
350 ic->ic_raw_xmit = ipw_raw_xmit;
351
352 ic->ic_vap_create = ipw_vap_create;

--- 2427 unchanged lines hidden ---