if_iwi.c (179643) | if_iwi.c (190526) |
---|---|
1/*- 2 * Copyright (c) 2004, 2005 3 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved. 4 * Copyright (c) 2005-2006 Sam Leffler, Errno Consulting 5 * Copyright (c) 2007 Andrew Thompson <thompsa@FreeBSD.org> 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004, 2005 3 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved. 4 * Copyright (c) 2005-2006 Sam Leffler, Errno Consulting 5 * Copyright (c) 2007 Andrew Thompson <thompsa@FreeBSD.org> 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/iwi/if_iwi.c 179643 2008-06-07 18:38:02Z sam $"); | 31__FBSDID("$FreeBSD: head/sys/dev/iwi/if_iwi.c 190526 2009-03-29 17:59:14Z sam $"); |
32 33/*- 34 * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver 35 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm 36 */ 37 38#include <sys/param.h> 39#include <sys/sysctl.h> --- 235 unchanged lines hidden (view full) --- 275iwi_attach(device_t dev) 276{ 277 struct iwi_softc *sc = device_get_softc(dev); 278 struct ifnet *ifp; 279 struct ieee80211com *ic; 280 uint16_t val; 281 int i, error; 282 uint8_t bands; | 32 33/*- 34 * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver 35 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm 36 */ 37 38#include <sys/param.h> 39#include <sys/sysctl.h> --- 235 unchanged lines hidden (view full) --- 275iwi_attach(device_t dev) 276{ 277 struct iwi_softc *sc = device_get_softc(dev); 278 struct ifnet *ifp; 279 struct ieee80211com *ic; 280 uint16_t val; 281 int i, error; 282 uint8_t bands; |
283 uint8_t macaddr[IEEE80211_ADDR_LEN]; |
|
283 284 sc->sc_dev = dev; 285 286 ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); 287 if (ifp == NULL) { 288 device_printf(dev, "can not if_alloc()\n"); 289 return ENXIO; 290 } --- 107 unchanged lines hidden (view full) --- 398 | IEEE80211_C_WME /* 802.11e */ 399#if 0 400 | IEEE80211_C_BGSCAN /* capable of bg scanning */ 401#endif 402 ; 403 404 /* read MAC address from EEPROM */ 405 val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 0); | 284 285 sc->sc_dev = dev; 286 287 ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); 288 if (ifp == NULL) { 289 device_printf(dev, "can not if_alloc()\n"); 290 return ENXIO; 291 } --- 107 unchanged lines hidden (view full) --- 399 | IEEE80211_C_WME /* 802.11e */ 400#if 0 401 | IEEE80211_C_BGSCAN /* capable of bg scanning */ 402#endif 403 ; 404 405 /* read MAC address from EEPROM */ 406 val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 0); |
406 ic->ic_myaddr[0] = val & 0xff; 407 ic->ic_myaddr[1] = val >> 8; | 407 macaddr[0] = val & 0xff; 408 macaddr[1] = val >> 8; |
408 val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 1); | 409 val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 1); |
409 ic->ic_myaddr[2] = val & 0xff; 410 ic->ic_myaddr[3] = val >> 8; | 410 macaddr[2] = val & 0xff; 411 macaddr[3] = val >> 8; |
411 val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 2); | 412 val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 2); |
412 ic->ic_myaddr[4] = val & 0xff; 413 ic->ic_myaddr[5] = val >> 8; | 413 macaddr[4] = val & 0xff; 414 macaddr[5] = val >> 8; |
414 415 bands = 0; 416 setbit(&bands, IEEE80211_MODE_11B); 417 setbit(&bands, IEEE80211_MODE_11G); 418 if (pci_get_device(dev) >= 0x4223) 419 setbit(&bands, IEEE80211_MODE_11A); 420 ieee80211_init_channels(ic, NULL, &bands); 421 | 415 416 bands = 0; 417 setbit(&bands, IEEE80211_MODE_11B); 418 setbit(&bands, IEEE80211_MODE_11G); 419 if (pci_get_device(dev) >= 0x4223) 420 setbit(&bands, IEEE80211_MODE_11A); 421 ieee80211_init_channels(ic, NULL, &bands); 422 |
422 ieee80211_ifattach(ic); | 423 ieee80211_ifattach(ic, macaddr); |
423 /* override default methods */ 424 ic->ic_node_alloc = iwi_node_alloc; 425 sc->sc_node_free = ic->ic_node_free; 426 ic->ic_node_free = iwi_node_free; 427 ic->ic_raw_xmit = iwi_raw_xmit; 428 ic->ic_scan_start = iwi_scan_start; 429 ic->ic_scan_end = iwi_scan_end; 430 ic->ic_set_channel = iwi_set_channel; --- 2132 unchanged lines hidden (view full) --- 2563 struct iwi_configuration config; 2564 struct iwi_rateset rs; 2565 struct iwi_txpower power; 2566 uint32_t data; 2567 int error, i; 2568 2569 IWI_LOCK_ASSERT(sc); 2570 | 424 /* override default methods */ 425 ic->ic_node_alloc = iwi_node_alloc; 426 sc->sc_node_free = ic->ic_node_free; 427 ic->ic_node_free = iwi_node_free; 428 ic->ic_raw_xmit = iwi_raw_xmit; 429 ic->ic_scan_start = iwi_scan_start; 430 ic->ic_scan_end = iwi_scan_end; 431 ic->ic_set_channel = iwi_set_channel; --- 2132 unchanged lines hidden (view full) --- 2564 struct iwi_configuration config; 2565 struct iwi_rateset rs; 2566 struct iwi_txpower power; 2567 uint32_t data; 2568 int error, i; 2569 2570 IWI_LOCK_ASSERT(sc); 2571 |
2571 IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); 2572 DPRINTF(("Setting MAC address to %6D\n", ic->ic_myaddr, ":")); 2573 error = iwi_cmd(sc, IWI_CMD_SET_MAC_ADDRESS, ic->ic_myaddr, | 2572 DPRINTF(("Setting MAC address to %6D\n", IF_LLADDR(ifp), ":")); 2573 error = iwi_cmd(sc, IWI_CMD_SET_MAC_ADDRESS, IF_LLADDR(ifp), |
2574 IEEE80211_ADDR_LEN); 2575 if (error != 0) 2576 return error; 2577 2578 memset(&config, 0, sizeof config); 2579 config.bluetooth_coexistence = sc->bluetooth; 2580 config.silence_threshold = 0x1e; 2581 config.antenna = sc->antenna; --- 1115 unchanged lines hidden --- | 2574 IEEE80211_ADDR_LEN); 2575 if (error != 0) 2576 return error; 2577 2578 memset(&config, 0, sizeof config); 2579 config.bluetooth_coexistence = sc->bluetooth; 2580 config.silence_threshold = 0x1e; 2581 config.antenna = sc->antenna; --- 1115 unchanged lines hidden --- |