commit ebfde874c8c9e895ee86e9c8a3e223bdfdfba5a6 Merge: e84295c... 17de304... Author: Jiri Slaby Date: Sat Jun 23 12:53:48 2007 +0200 Merge with git+ssh://xslaby@decibel/home/xslaby/public_html/git/madwifi-openhal2 commit e84295c46eb56b29f8abb6d07f27c53cc2a74a32 Author: Jiri Slaby Date: Fri Jun 22 14:53:57 2007 +0200 check for null rates diff --git a/ath/if_ath_pci.c b/ath/if_ath_pci.c index 6a65fe7..4c6bfcc 100644 --- a/ath/if_ath_pci.c +++ b/ath/if_ath_pci.c @@ -272,6 +272,9 @@ static inline unsigned int ath_copy_rates(struct ieee80211_rate *rates, { unsigned int i; + if (rt == NULL) + return 0; + for (i = 0; i < rt->rate_count; i++, rates++) { rates->rate = rt->rates[i].rate_kbps / 100; rates->val = rt->rates[i].rate_code; commit e868e1e53256928c50c67fa0331073a6f8f48eb1 Author: Jiri Slaby Date: Fri Jun 22 11:11:25 2007 +0200 several cleanups diff --git a/ath/if_ath.c b/ath/if_ath.c index 02518fe..ed978b0 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -2317,7 +2317,7 @@ ath_mode_init(struct net_device *dev) // ath5k_hw_set_rx_filter(ah, rfilt); /* configure operational mode */ - ath5k_hw_set_pcu_config(ah); + ath5k_hw_set_opmode(ah); /* * Handle any link-level address change. Note that we only diff --git a/openhal/ath5k.h b/openhal/ath5k.h index 731f5a8..6de3c16 100644 --- a/openhal/ath5k.h +++ b/openhal/ath5k.h @@ -1042,7 +1042,6 @@ typedef bool (ath5k_rfgain_t)(struct ath_hw *, struct ieee80211_channel *, /* General Functions */ u16 ath_hal_computetxtime(struct ath_hw *hal, const struct ath5k_rate_table *rates, u32 frame_length, u16 rate_index, bool short_preamble); -unsigned int ath_hal_getwirelessmodes(struct ath_hw *hal, enum ieee80211_countrycode country) ; /* Attach/Detach Functions */ struct ath_hw *ath5k_hw_attach(u16 device, u8 macversion, void *sc, void __iomem *sh); const struct ath5k_rate_table *ath5k_hw_get_rate_table(struct ath_hw *hal, unsigned int mode); @@ -1066,7 +1065,6 @@ bool ath5k_hw_update_tx_triglevel(struct ath_hw *hal, bool increase); /* Interrupt handling */ bool ath5k_hw_is_intr_pending(struct ath_hw *hal); bool ath5k_hw_get_isr(struct ath_hw *hal, u32 *interrupt_mask); -u32 ath5k_hw_get_intr(struct ath_hw *hal); enum ath5k_int ath5k_hw_set_intr(struct ath_hw *hal, enum ath5k_int new_mask); void ath5k_hw_radar_alert(struct ath_hw *hal, bool enable); /* EEPROM access functions */ @@ -1076,7 +1074,6 @@ int ath5k_eeprom_read_modes(struct ath_hw *hal, u32 *offset, unsigned int mode); int ath5k_hw_set_regdomain(struct ath_hw *hal, u16 regdomain); /* Protocol Control Unit Functions */ void ath5k_hw_set_opmode(struct ath_hw *hal); -void ath5k_hw_set_pcu_config(struct ath_hw *hal); /* BSSID Functions */ void ath5k_hw_get_lladdr(struct ath_hw *hal, u8 *mac); bool ath5k_hw_set_lladdr(struct ath_hw *hal, const u8 *mac); diff --git a/openhal/ath5k_hw.c b/openhal/ath5k_hw.c index 99e5982..4bf7c42 100644 --- a/openhal/ath5k_hw.c +++ b/openhal/ath5k_hw.c @@ -180,23 +180,6 @@ ath_hal_computetxtime(struct ath_hw *hal, const struct ath5k_rate_table *rates, } /* - * Return the supported 802.11 operation modes - * TODO:Left here for combatibility, change it in at5k - */ -unsigned int/*TODO:Fix this */ -ath_hal_getwirelessmodes(struct ath_hw *hal, enum ieee80211_countrycode country) -{ - switch(hal->ah_version){ - case AR5K_AR5212: - return AR5K_MODE_11A|AR5K_MODE_11B|AR5K_MODE_11G; - case AR5K_AR5211: - return AR5K_MODE_11A|AR5K_MODE_11B|AR5K_MODE_11G; - default : - return(AR5K_MODE_11A); - } -} - -/* * Functions used internaly */ @@ -213,14 +196,12 @@ ath5k_hw_bitswap(u32 val, unsigned int bits) return retval; } -inline unsigned int -ath5k_hw_htoclock(unsigned int usec, bool turbo) +static inline unsigned int ath5k_hw_htoclock(unsigned int usec, bool turbo) { return turbo == true ? (usec * 80) : (usec * 40); } -inline unsigned int -ath5k_hw_clocktoh(unsigned int clock, bool turbo) +static inline unsigned int ath5k_hw_clocktoh(unsigned int clock, bool turbo) { return turbo == true ? (clock / 80) : (clock / 40); } @@ -228,7 +209,7 @@ ath5k_hw_clocktoh(unsigned int clock, bool turbo) /* * Copy a rate table to a new one */ -inline void +static inline void ath5k_hw_rtcopy(struct ath5k_rate_table *dst, const struct ath5k_rate_table *src) { memset(dst, 0, sizeof(struct ath5k_rate_table)); @@ -1817,17 +1798,6 @@ ath5k_hw_get_isr(struct ath_hw *hal, u32 *interrupt_mask) } /* - * Return the interrupt mask stored previously - * TODO: Remove ? - */ -u32 -ath5k_hw_get_intr(struct ath_hw *hal) -{ - AR5K_TRACE; - return hal->ah_imr; -} - -/* * Set interrupt mask */ enum ath5k_int @@ -2606,13 +2576,6 @@ ath5k_hw_set_opmode(struct ath_hw *hal) AR5K_REG_WRITE(AR5K_BCR, beacon_reg); } -void /*TODO: Get rid of this, clean up the driver code, only set_opmode is needed*/ -ath5k_hw_set_pcu_config(struct ath_hw *hal) -{ - AR5K_TRACE; - ath5k_hw_set_opmode(hal); -} - /* * BSSID Functions */ commit 5c4375df170ac3e4fdd971bdac02a919881fea50 Author: Jiri Slaby Date: Fri Jun 22 11:02:46 2007 +0200 remove ath5k_known_products diff --git a/openhal/ath5k_hw.c b/openhal/ath5k_hw.c index d941be3..99e5982 100644 --- a/openhal/ath5k_hw.c +++ b/openhal/ath5k_hw.c @@ -30,46 +30,6 @@ #include "ath5k.h" #include "ath5kreg.h" -/* - * Known pci ids - */ - -static const struct { - u16 vendor; - u16 device; - u8 mac_version; -} ath5k_known_products[] = { - /* - * From pcidevs_data.h - */ - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5210, AR5K_AR5210}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5210_AP, AR5K_AR5210}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT, AR5K_AR5210}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5211, AR5K_AR5211}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT, AR5K_AR5211}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5311, AR5K_AR5211}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B, AR5K_AR5211}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY, AR5K_AR5211}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_DEFAULT, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_FPGA, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_IBM, AR5K_AR5212}, - { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3CRDAG675, AR5K_AR5212}, - { PCI_VENDOR_ID_3COM_2, PCI_DEVICE_ID_3COM_2_3CRPAG175, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_REV2, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_REV7, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_REV8, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_0014, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_0015, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_0016, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_0017, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_0018, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_0019, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR2413, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5413, AR5K_AR5212}, - { PCI_VENDOR_ID_ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5424, AR5K_AR5212}, -}; - /*Rate tables*/ static const struct ath5k_rate_table ath5k_rt_11a = AR5K_RATES_11A; static const struct ath5k_rate_table ath5k_rt_11b = AR5K_RATES_11B;