diff options
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 34cd1a4a297f..4bcea5a9d70b 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -200,7 +200,7 @@ static int ath5k_pci_resume(struct pci_dev *pdev); | |||
200 | #endif /* CONFIG_PM */ | 200 | #endif /* CONFIG_PM */ |
201 | 201 | ||
202 | static struct pci_driver ath5k_pci_driver = { | 202 | static struct pci_driver ath5k_pci_driver = { |
203 | .name = "ath5k_pci", | 203 | .name = KBUILD_MODNAME, |
204 | .id_table = ath5k_pci_id_table, | 204 | .id_table = ath5k_pci_id_table, |
205 | .probe = ath5k_pci_probe, | 205 | .probe = ath5k_pci_probe, |
206 | .remove = __devexit_p(ath5k_pci_remove), | 206 | .remove = __devexit_p(ath5k_pci_remove), |
@@ -707,7 +707,7 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) | |||
707 | { | 707 | { |
708 | struct ath5k_softc *sc = hw->priv; | 708 | struct ath5k_softc *sc = hw->priv; |
709 | struct ath5k_hw *ah = sc->ah; | 709 | struct ath5k_hw *ah = sc->ah; |
710 | u8 mac[ETH_ALEN]; | 710 | u8 mac[ETH_ALEN] = {}; |
711 | int ret; | 711 | int ret; |
712 | 712 | ||
713 | ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device); | 713 | ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device); |
@@ -777,7 +777,13 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) | |||
777 | tasklet_init(&sc->restq, ath5k_tasklet_reset, (unsigned long)sc); | 777 | tasklet_init(&sc->restq, ath5k_tasklet_reset, (unsigned long)sc); |
778 | setup_timer(&sc->calib_tim, ath5k_calibrate, (unsigned long)sc); | 778 | setup_timer(&sc->calib_tim, ath5k_calibrate, (unsigned long)sc); |
779 | 779 | ||
780 | ath5k_hw_get_lladdr(ah, mac); | 780 | ret = ath5k_eeprom_read_mac(ah, mac); |
781 | if (ret) { | ||
782 | ATH5K_ERR(sc, "unable to read address from EEPROM: 0x%04x\n", | ||
783 | sc->pdev->device); | ||
784 | goto err_queues; | ||
785 | } | ||
786 | |||
781 | SET_IEEE80211_PERM_ADDR(hw, mac); | 787 | SET_IEEE80211_PERM_ADDR(hw, mac); |
782 | /* All MAC address bits matter for ACKs */ | 788 | /* All MAC address bits matter for ACKs */ |
783 | memset(sc->bssidmask, 0xff, ETH_ALEN); | 789 | memset(sc->bssidmask, 0xff, ETH_ALEN); |
@@ -2765,6 +2771,7 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, | |||
2765 | /* Set to a reasonable value. Note that this will | 2771 | /* Set to a reasonable value. Note that this will |
2766 | * be set to mac80211's value at ath5k_config(). */ | 2772 | * be set to mac80211's value at ath5k_config(). */ |
2767 | sc->bintval = 1000; | 2773 | sc->bintval = 1000; |
2774 | ath5k_hw_set_lladdr(sc->ah, conf->mac_addr); | ||
2768 | 2775 | ||
2769 | ret = 0; | 2776 | ret = 0; |
2770 | end: | 2777 | end: |
@@ -2777,11 +2784,13 @@ ath5k_remove_interface(struct ieee80211_hw *hw, | |||
2777 | struct ieee80211_if_init_conf *conf) | 2784 | struct ieee80211_if_init_conf *conf) |
2778 | { | 2785 | { |
2779 | struct ath5k_softc *sc = hw->priv; | 2786 | struct ath5k_softc *sc = hw->priv; |
2787 | u8 mac[ETH_ALEN] = {}; | ||
2780 | 2788 | ||
2781 | mutex_lock(&sc->lock); | 2789 | mutex_lock(&sc->lock); |
2782 | if (sc->vif != conf->vif) | 2790 | if (sc->vif != conf->vif) |
2783 | goto end; | 2791 | goto end; |
2784 | 2792 | ||
2793 | ath5k_hw_set_lladdr(sc->ah, mac); | ||
2785 | sc->vif = NULL; | 2794 | sc->vif = NULL; |
2786 | end: | 2795 | end: |
2787 | mutex_unlock(&sc->lock); | 2796 | mutex_unlock(&sc->lock); |