aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-08-11 04:35:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:24:01 -0400
commit98deeea0b3464955ec416c30cbd0c3d21cacfa9a (patch)
tree3cf039e52965164e6b3b4c74c4a06ac75f8ea808
parent7c56d24bc80112daadc7ef54247a5fc8397dbc5c (diff)
ath9k: Trim struct ath_softc
Add sc_rxflush and sc_noreset as bitfields to sc_flags. Remove a few variables and function prototypes that are unused. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath9k/beacon.c8
-rw-r--r--drivers/net/wireless/ath9k/core.c10
-rw-r--r--drivers/net/wireless/ath9k/core.h58
-rw-r--r--drivers/net/wireless/ath9k/recv.c8
-rw-r--r--drivers/net/wireless/ath9k/xmit.c8
5 files changed, 31 insertions, 61 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c
index f1c420141714..e0ca0172f8be 100644
--- a/drivers/net/wireless/ath9k/beacon.c
+++ b/drivers/net/wireless/ath9k/beacon.c
@@ -555,7 +555,7 @@ void ath9k_beacon_tasklet(unsigned long data)
555 u32 tsftu; 555 u32 tsftu;
556 u16 intval; 556 u16 intval;
557 557
558 if (sc->sc_noreset) { 558 if (sc->sc_flags & SC_OP_NO_RESET) {
559 show_cycles = ath9k_hw_GetMibCycleCountsPct(ah, 559 show_cycles = ath9k_hw_GetMibCycleCountsPct(ah,
560 &rx_clear, 560 &rx_clear,
561 &rx_frame, 561 &rx_frame,
@@ -577,7 +577,7 @@ void ath9k_beacon_tasklet(unsigned long data)
577 * (in that layer). 577 * (in that layer).
578 */ 578 */
579 if (sc->sc_bmisscount < BSTUCK_THRESH) { 579 if (sc->sc_bmisscount < BSTUCK_THRESH) {
580 if (sc->sc_noreset) { 580 if (sc->sc_flags & SC_OP_NO_RESET) {
581 DPRINTF(sc, ATH_DBG_BEACON, 581 DPRINTF(sc, ATH_DBG_BEACON,
582 "%s: missed %u consecutive beacons\n", 582 "%s: missed %u consecutive beacons\n",
583 __func__, sc->sc_bmisscount); 583 __func__, sc->sc_bmisscount);
@@ -605,7 +605,7 @@ void ath9k_beacon_tasklet(unsigned long data)
605 __func__, sc->sc_bmisscount); 605 __func__, sc->sc_bmisscount);
606 } 606 }
607 } else if (sc->sc_bmisscount >= BSTUCK_THRESH) { 607 } else if (sc->sc_bmisscount >= BSTUCK_THRESH) {
608 if (sc->sc_noreset) { 608 if (sc->sc_flags & SC_OP_NO_RESET) {
609 if (sc->sc_bmisscount == BSTUCK_THRESH) { 609 if (sc->sc_bmisscount == BSTUCK_THRESH) {
610 DPRINTF(sc, 610 DPRINTF(sc,
611 ATH_DBG_BEACON, 611 ATH_DBG_BEACON,
@@ -624,7 +624,7 @@ void ath9k_beacon_tasklet(unsigned long data)
624 return; 624 return;
625 } 625 }
626 if (sc->sc_bmisscount != 0) { 626 if (sc->sc_bmisscount != 0) {
627 if (sc->sc_noreset) { 627 if (sc->sc_flags & SC_OP_NO_RESET) {
628 DPRINTF(sc, 628 DPRINTF(sc,
629 ATH_DBG_BEACON, 629 ATH_DBG_BEACON,
630 "%s: resume beacon xmit after %u misses\n", 630 "%s: resume beacon xmit after %u misses\n",
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c
index 87b4ca525d25..0d953f9fdeeb 100644
--- a/drivers/net/wireless/ath9k/core.c
+++ b/drivers/net/wireless/ath9k/core.c
@@ -1055,9 +1055,6 @@ int ath_init(u16 devid, struct ath_softc *sc)
1055 } 1055 }
1056 sc->sc_ah = ah; 1056 sc->sc_ah = ah;
1057 1057
1058 /* Get the chipset-specific aggr limit. */
1059 sc->sc_rtsaggrlimit = ah->ah_caps.rts_aggr_limit;
1060
1061 /* Get the hardware key cache size. */ 1058 /* Get the hardware key cache size. */
1062 sc->sc_keymax = ah->ah_caps.keycache_size; 1059 sc->sc_keymax = ah->ah_caps.keycache_size;
1063 if (sc->sc_keymax > ATH_KEYMAX) { 1060 if (sc->sc_keymax > ATH_KEYMAX) {
@@ -1216,13 +1213,6 @@ int ath_init(u16 devid, struct ath_softc *sc)
1216 sc->sc_tx_chainmask = ah->ah_caps.tx_chainmask; 1213 sc->sc_tx_chainmask = ah->ah_caps.tx_chainmask;
1217 sc->sc_rx_chainmask = ah->ah_caps.rx_chainmask; 1214 sc->sc_rx_chainmask = ah->ah_caps.rx_chainmask;
1218 1215
1219 /* Configuration for rx chain detection */
1220 sc->sc_rxchaindetect_ref = 0;
1221 sc->sc_rxchaindetect_thresh5GHz = 35;
1222 sc->sc_rxchaindetect_thresh2GHz = 35;
1223 sc->sc_rxchaindetect_delta5GHz = 30;
1224 sc->sc_rxchaindetect_delta2GHz = 30;
1225
1226 ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); 1216 ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL);
1227 sc->sc_defant = ath9k_hw_getdefantenna(ah); 1217 sc->sc_defant = ath9k_hw_getdefantenna(ah);
1228 1218
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h
index 7f4bd15fa7ef..8243ff049b60 100644
--- a/drivers/net/wireless/ath9k/core.h
+++ b/drivers/net/wireless/ath9k/core.h
@@ -724,11 +724,8 @@ void ath_beacon_config(struct ath_softc *sc, int if_id);
724int ath_beaconq_setup(struct ath_hal *ah); 724int ath_beaconq_setup(struct ath_hal *ah);
725int ath_beacon_alloc(struct ath_softc *sc, int if_id); 725int ath_beacon_alloc(struct ath_softc *sc, int if_id);
726void ath_bstuck_process(struct ath_softc *sc); 726void ath_bstuck_process(struct ath_softc *sc);
727void ath_beacon_tasklet(struct ath_softc *sc, int *needmark);
728void ath_beacon_free(struct ath_softc *sc);
729void ath_beacon_return(struct ath_softc *sc, struct ath_vap *avp); 727void ath_beacon_return(struct ath_softc *sc, struct ath_vap *avp);
730void ath_beacon_sync(struct ath_softc *sc, int if_id); 728void ath_beacon_sync(struct ath_softc *sc, int if_id);
731void ath_update_beacon_info(struct ath_softc *sc, int avgbrssi);
732void ath_get_beaconconfig(struct ath_softc *sc, 729void ath_get_beaconconfig(struct ath_softc *sc,
733 int if_id, 730 int if_id,
734 struct ath_beacon_config *conf); 731 struct ath_beacon_config *conf);
@@ -896,8 +893,10 @@ struct ath_ht_info {
896#define SC_OP_TXAGGR BIT(3) 893#define SC_OP_TXAGGR BIT(3)
897#define SC_OP_CHAINMASK_UPDATE BIT(4) 894#define SC_OP_CHAINMASK_UPDATE BIT(4)
898#define SC_OP_FULL_RESET BIT(5) 895#define SC_OP_FULL_RESET BIT(5)
899#define SC_OP_PREAMBLE_SHORT BIT(6) 896#define SC_OP_NO_RESET BIT(6)
900#define SC_OP_PROTECT_ENABLE BIT(7) 897#define SC_OP_PREAMBLE_SHORT BIT(7)
898#define SC_OP_PROTECT_ENABLE BIT(8)
899#define SC_OP_RXFLUSH BIT(9)
901 900
902struct ath_softc { 901struct ath_softc {
903 struct ieee80211_hw *hw; 902 struct ieee80211_hw *hw;
@@ -909,44 +908,39 @@ struct ath_softc {
909 struct ath_rate_softc *sc_rc; 908 struct ath_rate_softc *sc_rc;
910 void __iomem *mem; 909 void __iomem *mem;
911 910
911 u8 sc_curbssid[ETH_ALEN];
912 u8 sc_myaddr[ETH_ALEN];
913 u8 sc_bssidmask[ETH_ALEN];
914
912 int sc_debug; 915 int sc_debug;
913 u32 sc_intrstatus; 916 u32 sc_intrstatus;
914 u32 sc_flags; /* SC_OP_* */ 917 u32 sc_flags; /* SC_OP_* */
915 unsigned int rx_filter; 918 unsigned int rx_filter;
916
917 enum wireless_mode sc_curmode; /* current phy mode */
918 u16 sc_curtxpow; 919 u16 sc_curtxpow;
919 u16 sc_curaid; 920 u16 sc_curaid;
920 u8 sc_curbssid[ETH_ALEN]; 921 u16 sc_cachelsz;
921 u8 sc_myaddr[ETH_ALEN]; 922 int sc_slotupdate; /* slot to next advance fsm */
923 int sc_slottime;
924 int sc_bslot[ATH_BCBUF];
925 u8 sc_tx_chainmask;
926 u8 sc_rx_chainmask;
927 enum ath9k_int sc_imask;
928 enum wireless_mode sc_curmode; /* current phy mode */
922 enum PROT_MODE sc_protmode; 929 enum PROT_MODE sc_protmode;
923 u8 sc_mcastantenna; 930
924 u8 sc_txantenna; /* data tx antenna (fixed or auto) */
925 u8 sc_nbcnvaps; /* # of vaps sending beacons */ 931 u8 sc_nbcnvaps; /* # of vaps sending beacons */
926 u16 sc_nvaps; /* # of active virtual ap's */ 932 u16 sc_nvaps; /* # of active virtual ap's */
927 struct ath_vap *sc_vaps[ATH_BCBUF]; 933 struct ath_vap *sc_vaps[ATH_BCBUF];
928 enum ath9k_int sc_imask; 934
929 u8 sc_bssidmask[ETH_ALEN]; 935 u8 sc_mcastantenna;
930 u8 sc_defant; /* current default antenna */ 936 u8 sc_defant; /* current default antenna */
931 u8 sc_rxotherant; /* rx's on non-default antenna */ 937 u8 sc_rxotherant; /* rx's on non-default antenna */
932 u16 sc_cachelsz; 938
933 int sc_slotupdate; /* slot to next advance fsm */
934 int sc_slottime;
935 u8 sc_noreset;
936 int sc_bslot[ATH_BCBUF];
937 struct ath9k_node_stats sc_halstats; /* station-mode rssi stats */ 939 struct ath9k_node_stats sc_halstats; /* station-mode rssi stats */
938 struct list_head node_list; 940 struct list_head node_list;
939 struct ath_ht_info sc_ht_info; 941 struct ath_ht_info sc_ht_info;
940 int16_t sc_noise_floor; /* signal noise floor in dBm */
941 enum ath9k_ht_extprotspacing sc_ht_extprotspacing; 942 enum ath9k_ht_extprotspacing sc_ht_extprotspacing;
942 u8 sc_tx_chainmask; 943
943 u8 sc_rx_chainmask;
944 u8 sc_rxchaindetect_ref;
945 u8 sc_rxchaindetect_thresh5GHz;
946 u8 sc_rxchaindetect_thresh2GHz;
947 u8 sc_rxchaindetect_delta5GHz;
948 u8 sc_rxchaindetect_delta2GHz;
949 u32 sc_rtsaggrlimit; /* Chipset specific aggr limit */
950#ifdef CONFIG_SLOW_ANT_DIV 944#ifdef CONFIG_SLOW_ANT_DIV
951 struct ath_antdiv sc_antdiv; 945 struct ath_antdiv sc_antdiv;
952#endif 946#endif
@@ -967,7 +961,6 @@ struct ath_softc {
967 struct ath_descdma sc_rxdma; 961 struct ath_descdma sc_rxdma;
968 int sc_rxbufsize; /* rx size based on mtu */ 962 int sc_rxbufsize; /* rx size based on mtu */
969 u32 *sc_rxlink; /* link ptr in last RX desc */ 963 u32 *sc_rxlink; /* link ptr in last RX desc */
970 u32 sc_rxflush; /* rx flush in progress */
971 u64 sc_lastrx; /* tsf of last rx'd frame */ 964 u64 sc_lastrx; /* tsf of last rx'd frame */
972 965
973 /* TX */ 966 /* TX */
@@ -977,7 +970,6 @@ struct ath_softc {
977 u32 sc_txqsetup; 970 u32 sc_txqsetup;
978 u32 sc_txintrperiod; /* tx interrupt batching */ 971 u32 sc_txintrperiod; /* tx interrupt batching */
979 int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */ 972 int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */
980 u32 sc_ant_tx[8]; /* recent tx frames/antenna */
981 973
982 /* Beacon */ 974 /* Beacon */
983 struct ath9k_tx_queue_info sc_beacon_qi; 975 struct ath9k_tx_queue_info sc_beacon_qi;
@@ -1016,13 +1008,7 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan);
1016int ath_suspend(struct ath_softc *sc); 1008int ath_suspend(struct ath_softc *sc);
1017irqreturn_t ath_isr(int irq, void *dev); 1009irqreturn_t ath_isr(int irq, void *dev);
1018int ath_reset(struct ath_softc *sc, bool retry_tx); 1010int ath_reset(struct ath_softc *sc, bool retry_tx);
1019void ath_scan_start(struct ath_softc *sc);
1020void ath_scan_end(struct ath_softc *sc);
1021int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan); 1011int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan);
1022void ath_setup_rate(struct ath_softc *sc,
1023 enum wireless_mode wMode,
1024 enum RATE_TYPE type,
1025 const struct ath9k_rate_table *rt);
1026 1012
1027/*********************/ 1013/*********************/
1028/* Utility Functions */ 1014/* Utility Functions */
@@ -1041,7 +1027,6 @@ int ath_cabq_update(struct ath_softc *);
1041void ath_get_currentCountry(struct ath_softc *sc, 1027void ath_get_currentCountry(struct ath_softc *sc,
1042 struct ath9k_country_entry *ctry); 1028 struct ath9k_country_entry *ctry);
1043u64 ath_extend_tsf(struct ath_softc *sc, u32 rstamp); 1029u64 ath_extend_tsf(struct ath_softc *sc, u32 rstamp);
1044u32 ath_chan2flags(struct ieee80211_channel *chan, struct ath_softc *sc);
1045dma_addr_t ath_skb_map_single(struct ath_softc *sc, 1030dma_addr_t ath_skb_map_single(struct ath_softc *sc,
1046 struct sk_buff *skb, 1031 struct sk_buff *skb,
1047 int direction, 1032 int direction,
@@ -1050,7 +1035,6 @@ void ath_skb_unmap_single(struct ath_softc *sc,
1050 struct sk_buff *skb, 1035 struct sk_buff *skb,
1051 int direction, 1036 int direction,
1052 dma_addr_t *pa); 1037 dma_addr_t *pa);
1053void ath_mcast_merge(struct ath_softc *sc, u32 mfilt[2]);
1054enum ath9k_ht_macmode ath_cwm_macmode(struct ath_softc *sc); 1038enum ath9k_ht_macmode ath_cwm_macmode(struct ath_softc *sc);
1055 1039
1056#endif /* CORE_H */ 1040#endif /* CORE_H */
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 9c7583210e36..af2011fb05a0 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -504,7 +504,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
504 504
505 do { 505 do {
506 spin_lock_init(&sc->sc_rxflushlock); 506 spin_lock_init(&sc->sc_rxflushlock);
507 sc->sc_rxflush = 0; 507 sc->sc_flags &= ~SC_OP_RXFLUSH;
508 spin_lock_init(&sc->sc_rxbuflock); 508 spin_lock_init(&sc->sc_rxbuflock);
509 509
510 /* 510 /*
@@ -707,11 +707,11 @@ void ath_flushrecv(struct ath_softc *sc)
707 * progress (see references to sc_rxflush) 707 * progress (see references to sc_rxflush)
708 */ 708 */
709 spin_lock_bh(&sc->sc_rxflushlock); 709 spin_lock_bh(&sc->sc_rxflushlock);
710 sc->sc_rxflush = 1; 710 sc->sc_flags |= SC_OP_RXFLUSH;
711 711
712 ath_rx_tasklet(sc, 1); 712 ath_rx_tasklet(sc, 1);
713 713
714 sc->sc_rxflush = 0; 714 sc->sc_flags &= ~SC_OP_RXFLUSH;
715 spin_unlock_bh(&sc->sc_rxflushlock); 715 spin_unlock_bh(&sc->sc_rxflushlock);
716} 716}
717 717
@@ -755,7 +755,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
755 755
756 do { 756 do {
757 /* If handling rx interrupt and flush is in progress => exit */ 757 /* If handling rx interrupt and flush is in progress => exit */
758 if (sc->sc_rxflush && (flush == 0)) 758 if ((sc->sc_flags & SC_OP_RXFLUSH) && (flush == 0))
759 break; 759 break;
760 760
761 spin_lock_bh(&sc->sc_rxbuflock); 761 spin_lock_bh(&sc->sc_rxbuflock);
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index 9ea5d9333305..e2ffa1cdb5e1 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -485,12 +485,8 @@ static int ath_tx_prepare(struct ath_softc *sc,
485 if (is_multicast_ether_addr(hdr->addr1)) { 485 if (is_multicast_ether_addr(hdr->addr1)) {
486 antenna = sc->sc_mcastantenna + 1; 486 antenna = sc->sc_mcastantenna + 1;
487 sc->sc_mcastantenna = (sc->sc_mcastantenna + 1) & 0x1; 487 sc->sc_mcastantenna = (sc->sc_mcastantenna + 1) & 0x1;
488 } else 488 }
489 antenna = sc->sc_txantenna;
490 489
491#ifdef USE_LEGACY_HAL
492 txctl->antenna = antenna;
493#endif
494 return 0; 490 return 0;
495} 491}
496 492
@@ -743,7 +739,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)
743 int i, flags, rtsctsena = 0, dynamic_mimops = 0; 739 int i, flags, rtsctsena = 0, dynamic_mimops = 0;
744 u32 ctsduration = 0; 740 u32 ctsduration = 0;
745 u8 rix = 0, cix, ctsrate = 0; 741 u8 rix = 0, cix, ctsrate = 0;
746 u32 aggr_limit_with_rts = sc->sc_rtsaggrlimit; 742 u32 aggr_limit_with_rts = ah->ah_caps.rts_aggr_limit;
747 struct ath_node *an = (struct ath_node *) bf->bf_node; 743 struct ath_node *an = (struct ath_node *) bf->bf_node;
748 744
749 /* 745 /*