Deleted Added
full compact
if_ipw.c (189575) if_ipw.c (190526)
1/* $FreeBSD: head/sys/dev/ipw/if_ipw.c 189575 2009-03-09 13:23:54Z imp $ */
1/* $FreeBSD: head/sys/dev/ipw/if_ipw.c 190526 2009-03-29 17:59:14Z sam $ */
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>
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 $");
33__FBSDID("$FreeBSD: head/sys/dev/ipw/if_ipw.c 190526 2009-03-29 17:59:14Z sam $");
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;
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 uint8_t macaddr[IEEE80211_ADDR_LEN];
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);
235
236 sc->sc_dev = dev;
237
238 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
239 MTX_DEF | MTX_RECURSE);
240
241 TASK_INIT(&sc->sc_init_task, 0, ipw_init_task, sc);
242 TASK_INIT(&sc->sc_scan_task, 0, ipw_scan_task, sc);

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

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

--- 2427 unchanged lines hidden ---