Changeset 3722
- Timestamp:
- 06/12/08 19:44:56 (1 week ago)
- Files:
-
- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath.c (modified) (129 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_ahb.c (modified) (5 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_hal_extensions.h (modified) (5 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_pci.c (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.c (modified) (7 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.h (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/ath/if_athvar.h (modified) (8 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/Makefile (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.c (modified) (14 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.h (modified) (4 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/amrr/amrr.c (modified) (3 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/minstrel/minstrel.c (modified) (4 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/onoe/onoe.c (modified) (2 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/sample/sample.c (modified) (2 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/include/compat.h (modified) (3 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/_ieee80211.h (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211.c (modified) (4 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_beacon.c (modified) (2 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.c (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.h (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_ccmp.c (modified) (4 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_tkip.c (modified) (12 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_wep.c (modified) (3 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_input.c (modified) (31 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.c (modified) (5 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.h (modified) (2 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_monitor.c (modified) (10 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.c (modified) (28 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.h (modified) (15 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_output.c (modified) (18 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_power.c (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.c (modified) (5 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.h (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan.c (modified) (4 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan_sta.c (modified) (2 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.c (modified) (21 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.h (modified) (8 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_var.h (modified) (6 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_wireless.c (modified) (53 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/net80211/if_media.c (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/regression/wep/test_wep.c (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/tools/80211debug.c (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/tools/80211stats.c (modified) (3 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/tools/athdebug.c (modified) (1 diff)
- madwifi/branches/madwifi-hal-0.10.5.6/tools/athstats.c (modified) (2 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/tools/wireless_copy.h (modified) (2 diffs)
- madwifi/branches/madwifi-hal-0.10.5.6/tools/wlanconfig.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
-
madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath.c
r3692 r3722 127 127 128 128 static struct ieee80211vap *ath_vap_create(struct ieee80211com *, 129 const char *, int, int, struct net_device *);129 const char *, int, int, struct net_device *); 130 130 static void ath_vap_delete(struct ieee80211vap *); 131 131 static int ath_init(struct net_device *); … … 167 167 #ifdef IEEE80211_DEBUG_REFCNT 168 168 static struct ieee80211_node *ath_node_alloc_debug(struct ieee80211vap *, 169 const char *func, int line);170 static void ath_node_cleanup_debug(struct ieee80211_node *, const char *func,169 const char func, int line); 170 static void ath_node_cleanup_debug(struct ieee80211_node *, const char func, 171 171 int line); 172 static void ath_node_free_debug(struct ieee80211_node *, const char *func,172 static void ath_node_free_debug(struct ieee80211_node *, const char func, 173 173 int line); 174 174 #else … … 244 244 static void ath_registers_mark(struct ieee80211com *ic); 245 245 static unsigned int ath_read_register(struct ieee80211com *ic, 246 unsigned int address, unsigned int *value);246 unsigned int address, unsigned int value); 247 247 static unsigned int ath_write_register(struct ieee80211com *ic, 248 248 unsigned int address, unsigned int value); … … 281 281 ath_return_txbuf_debug(_sc, _pbuf, __func__, __LINE__) 282 282 static void ath_return_txbuf_debug(struct ath_softc *sc, struct ath_buf **buf, 283 const char *func, int line);283 const char func, int line); 284 284 #else /* #ifdef IEEE80211_DEBUG_REFCNT */ 285 285 static void ath_return_txbuf(struct ath_softc *sc, struct ath_buf **buf); … … 290 290 ath_return_txbuf_locked_debug(_sc, _pbuf, __func__, __LINE__) 291 291 static void ath_return_txbuf_locked_debug(struct ath_softc *sc, struct ath_buf **buf, 292 const char *func, int line);292 const char func, int line); 293 293 #else /* #ifdef IEEE80211_DEBUG_REFCNT */ 294 294 static void ath_return_txbuf_locked(struct ath_softc *sc, struct ath_buf **buf); … … 299 299 ath_return_txbuf_list_debug(_sc, _head, __func__, __LINE__) 300 300 static void ath_return_txbuf_list_debug(struct ath_softc *sc, ath_bufhead *bfhead, 301 const char *func, int line);301 const char func, int line); 302 302 #else /* #ifdef IEEE80211_DEBUG_REFCNT */ 303 303 static void ath_return_txbuf_list(struct ath_softc *sc, ath_bufhead *bfhead); … … 308 308 ath_return_txbuf_list_locked_debug(_sc, _head, __func__, __LINE__) 309 309 static void ath_return_txbuf_list_locked_debug(struct ath_softc *sc, ath_bufhead *bfhead, 310 const char *func, int line);310 const char func, int line); 311 311 #else /* #ifdef IEEE80211_DEBUG_REFCNT */ 312 312 static void ath_return_txbuf_list_locked(struct ath_softc *sc, ath_bufhead *bfhead); … … 316 316 #define cleanup_ath_buf(_sc, _buf, _dir) \ 317 317 cleanup_ath_buf_debug(_sc, _buf, _dir, __func__, __LINE__) 318 static struct ath_buf *cleanup_ath_buf_debug(struct ath_softc *sc, struct ath_buf *buf,319 int direction, const char *func, int line);318 static struct ath_buf cleanup_ath_buf_debug(struct ath_softc *sc, struct ath_buf *buf, 319 int direction, const char func, int line); 320 320 #else /* #ifdef IEEE80211_DEBUG_REFCNT */ 321 static struct ath_buf *cleanup_ath_buf(struct ath_softc *sc, struct ath_buf *buf,321 static struct ath_buf cleanup_ath_buf(struct ath_softc *sc, struct ath_buf *buf, 322 322 int direction); 323 323 #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ … … 338 338 /* 802.11h DFS support functions */ 339 339 static void ath_dfs_cac_completed(unsigned long); 340 static void ath_interrupt_dfs_cac(struct ath_softc *sc, const char *reason);341 342 static inline int ath_chan_unavail(struct ath_softc *sc);340 static void ath_interrupt_dfs_cac(struct ath_softc *sc, const char reason); 341 342 static inline int ath_chan_unavail(struct ath_softc sc); 343 343 344 344 #define ath_cac_running_dbgmsg(_sc) \ … … 347 347 _ath_chan_unavail_dbgmsg((_sc), __func__) 348 348 static inline int _ath_cac_running_dbgmsg(struct ath_softc *sc, 349 const char *func);349 const char func); 350 350 static inline int _ath_chan_unavail_dbgmsg(struct ath_softc *sc, 351 const char *func);351 const char func); 352 352 353 353 /* 802.11h DFS testing functions */ … … 371 371 static void ath_scanbufs(struct ath_softc *sc); 372 372 static int ath_debug_iwpriv(struct ieee80211com *ic, 373 373 unsigned int param, unsigned int value); 374 374 375 375 static u_int32_t ath_get_real_maxtxpower(struct ath_softc *sc); … … 551 551 atomic_set(&sc->sc_txbuf_counter, 0); 552 552 553 ATH_INIT_TQUEUE(&sc->sc_rxtq, ath_rx_tasklet,dev);554 ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet,dev);555 ATH_INIT_TQUEUE(&sc->sc_bmisstq, 556 ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet, dev);557 ATH_INIT_TQUEUE(&sc->sc_rxorntq, 558 ATH_INIT_TQUEUE(&sc->sc_fataltq, 553 ATH_INIT_TQUEUE(&sc->sc_rxtq, dev); 554 ATH_INIT_TQUEUE(&sc->sc_txtq, dev); 555 ATH_INIT_TQUEUE(&sc->sc_bmisstq,ath_bmiss_tasklet, dev); 556 ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet, dev); 557 ATH_INIT_TQUEUE(&sc->sc_rxorntq,ath_rxorn_tasklet, dev); 558 ATH_INIT_TQUEUE(&sc->sc_fataltq,ath_fatal_tasklet, dev); 559 559 560 560 /* … … 885 885 atomic_set(&ic->ic_node_counter, 0); 886 886 ic->ic_debug = 0; 887 888 887 889 888 890 ic->ic_wme.wme_update = ath_wme_update; … … 1006 1008 ic->ic_flags |= IEEE80211_F_DATAPAD; 1007 1009 1008 /* 1009 * Query the HAL about antenna support 1010 * Enable rx fast diversity if HAL has support 1011 */ 1012 if (ath_hal_hasdiversity(ah)) { 1013 sc->sc_hasdiversity = 1; 1014 ath_hal_setdiversity(ah, AH_TRUE); 1015 sc->sc_diversity = 1; 1016 } else { 1017 sc->sc_hasdiversity = 0; 1018 sc->sc_diversity = 0; 1019 ath_hal_setdiversity(ah, AH_FALSE); 1020 } 1021 sc->sc_defant = ath_hal_getdefantenna(ah); 1010 /* Query the HAL about antenna support 1011 * Enable RX fast diversity if HAL has support. */ 1012 sc->sc_hasdiversity = sc->sc_diversity = !!ath_hal_hasdiversity(ah); 1013 ath_hal_setdiversity(ah, sc->sc_diversity); 1014 1015 sc->sc_rxantenna = ath_hal_getdefantenna(ah); 1016 sc->sc_txantenna = 0; /* default to auto-selection */ 1022 1017 1023 1018 /* … … 1027 1022 sc->sc_hasveol = ath_hal_hasveol(ah); 1028 1023 1024 1029 1025 1030 1026 /* get mac address from hardware */ … … 1064 1060 ic->ic_vap_delete = ath_vap_delete; 1065 1061 1066 ic->ic_test_radar 1067 ic->ic_dump_hal_map 1068 1069 ic->ic_set_dfs_testmode 1070 ic->ic_get_dfs_testmode 1071 1072 ic->ic_set_txcont 1073 ic->ic_get_txcont 1074 1075 ic->ic_set_txcont_power 1076 ic->ic_get_txcont_power 1077 1078 ic->ic_set_txcont_rate 1079 ic->ic_get_txcont_rate 1080 1081 ic->ic_scan_start = ath_scan_start;1082 ic->ic_scan_end = ath_scan_end;1083 ic->ic_set_channel = ath_set_channel;1062 ic->ic_test_radar = ath_test_radar; 1063 ic->ic_dump_hal_map = ath_dump_hal_map; 1064 1065 ic->ic_set_dfs_testmode = ath_set_dfs_testmode; 1066 ic->ic_get_dfs_testmode = ath_get_dfs_testmode; 1067 1068 ic->ic_set_txcont = ath_set_txcont; 1069 ic->ic_get_txcont = ath_get_txcont; 1070 1071 ic->ic_set_txcont_power = ath_set_txcont_power; 1072 ic->ic_get_txcont_power = ath_get_txcont_power; 1073 1074 ic->ic_set_txcont_rate= ath_set_txcont_rate; 1075 ic->ic_get_txcont_rate= ath_get_txcont_rate; 1076 1077 ic->ic_scan_start = ath_scan_start; 1078 ic->ic_scan_end = ath_scan_end; 1079 ic->ic_set_channel= ath_set_channel; 1084 1080 1085 1081 #ifdef ATH_REVERSE_ENGINEERING 1086 ic->ic_read_register 1087 ic->ic_write_register 1088 ic->ic_registers_dump 1089 ic->ic_registers_dump_delta = ath_registers_dump_delta;1090 ic->ic_registers_mark 1082 ic->ic_read_register= ath_read_register; 1083 ic->ic_write_register = ath_write_register; 1084 ic->ic_registers_dump = ath_registers_dump; 1085 ic->ic_registers_dump_delta = ath_registers_dump_delta; 1086 ic->ic_registers_mark = ath_registers_mark; 1091 1087 #endif /* #ifdef ATH_REVERSE_ENGINEERING */ 1092 ic->ic_debug_ath_iwpriv 1088 ic->ic_debug_ath_iwpriv = ath_debug_iwpriv; 1093 1089 1094 1090 ic->ic_set_coverageclass = ath_set_coverageclass; … … 1599 1595 ath_suspend(struct net_device *dev) 1600 1596 { 1601 DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags);1597 DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); 1602 1598 ath_stop(dev); 1603 1599 } … … 1606 1602 ath_resume(struct net_device *dev) 1607 1603 { 1608 DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags);1604 DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); 1609 1605 ath_init(dev); 1610 1606 } … … 1641 1637 } 1642 1638 1643 static HAL_BOOL ath_hw_reset(struct ath_softc *sc, HAL_OPMODE opmode,1644 1645 1639 static HAL_BOOL ath_hw_reset(struct ath_softc sc, HAL_OPMODE opmode, 1640 HAL_CHANNEL *channel, HAL_BOOL bChannelChange, 1641 HAL_STATUS *status) 1646 1642 { 1647 1643 HAL_BOOL ret; … … 1654 1650 * ath_tx_txqaddbuf() and ath_tx_processq() */ 1655 1651 1656 for (i =0; i<HAL_NUM_TX_QUEUES; i++) {1657 1658 1659 1660 1652 for (i HAL_NUM_TX_QUEUES; i++) { 1653 if (ATH_TXQ_SETUP(sc, i)) { 1654 txq = &sc->sc_txq[i]; 1655 spin_lock_irqsave(&txq->axq_lock, __axq_lockflags[i]); 1656 } 1661 1657 } 1662 1658 … … 1664 1660 /* Restore all TXDP pointers, if appropriate, and unlock in 1665 1661 * the reverse order we locked */ 1666 for (i=HAL_NUM_TX_QUEUES-1; i>=0; i--) { 1667 /* only take care of configured TXQ */ 1668 if (ATH_TXQ_SETUP(sc, i)) { 1669 struct ath_buf * bf; 1670 u_int32_t txdp; 1671 1672 txq = &sc->sc_txq[i]; 1673 1674 /* Check that TXDP is NULL */ 1675 txdp = ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum); 1676 if (txdp != 0) { 1677 DPRINTF(sc, ATH_DEBUG_WATCHDOG, 1678 "TXQ%d: BUG TXDP:%08x is not NULL\n", 1679 txq->axq_qnum, txdp); 1680 } 1681 1682 bf = STAILQ_FIRST(&txq->axq_q); 1683 if (bf != NULL) { 1684 DPRINTF(sc, ATH_DEBUG_WATCHDOG, 1685 "TXQ%d: restoring TXDP:%08llx\n", 1686 txq->axq_qnum, (u_int64_t)bf->bf_daddr); 1687 ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); 1688 txdp = ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum); 1689 if (txdp != bf->bf_daddr) { 1690 DPRINTF(sc, ATH_DEBUG_WATCHDOG, 1691 "TXQ%d: BUG failed to restore TXDP:%08llx (is %08x)\n", 1692 txq->axq_qnum, (u_int64_t)bf->bf_daddr, txdp); 1693 } 1694 ath_hal_txstart(sc->sc_ah, txq->axq_qnum); 1695 } 1696 spin_unlock_irqrestore(&txq->axq_lock, __axq_lockflags[i]); 1697 } 1662 for (i = HAL_NUM_TX_QUEUES - 1; i >= 0; i--) { 1663 /* only take care of configured TXQ */ 1664 if (ATH_TXQ_SETUP(sc, i)) { 1665 struct ath_buf *bf; 1666 u_int32_t txdp; 1667 1668 txq = &sc->sc_txq[i]; 1669 1670 /* Check that TXDP is NULL */ 1671 txdp = ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum); 1672 if (txdp != 0) { 1673 DPRINTF(sc, ATH_DEBUG_WATCHDOG, 1674 "TXQ%d: BUG TXDP:%08x is " 1675 "not NULL\n", 1676 txq->axq_qnum, txdp); 1677 } 1678 1679 bf = STAILQ_FIRST(&txq->axq_q); 1680 if (bf != NULL) { 1681 DPRINTF(sc, ATH_DEBUG_WATCHDOG, 1682 "TXQ%d: restoring " 1683 "TXDP:%08llx\n", 1684 txq->axq_qnum, 1685 (u_int64_t)bf->bf_daddr); 1686 ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, 1687 bf->bf_daddr); 1688 txdp = ath_hal_gettxbuf(sc->sc_ah, 1689 txq->axq_qnum); 1690 if (txdp != bf->bf_daddr) { 1691 DPRINTF(sc, ATH_DEBUG_WATCHDOG, 1692 "TXQ%d: BUG failed to " 1693 "restore TXDP:%08llx " 1694 "(is %08x)\n", 1695 txq->axq_qnum, 1696 (u_int64_t)bf->bf_daddr, 1697 txdp); 1698 } 1699 ath_hal_txstart(sc->sc_ah, txq->axq_qnum); 1700 } 1701 spin_unlock_irqrestore(&txq->axq_lock, 1702 __axq_lockflags[i]); 1703 } 1698 1704 } 1699 1705 1700 1706 #ifdef ATH_CAP_TPC 1701 1707 if (sc->sc_hastpc && (hal_tpc != ath_hal_gettpc(sc->sc_ah))) { 1702 EPRINTF(sc, "TPC HAL capability out of sync. Got %d!\n", ath_hal_gettpc(sc->sc_ah)); 1708 EPRINTF(sc, "TPC HAL capability out of sync. Got %d!\n", 1709 ath_hal_gettpc(sc->sc_ah)); 1703 1710 ath_hal_settpc(sc->sc_ah, hal_tpc); 1704 1711 } … … 1714 1721 ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin); 1715 1722 ath_update_txpow(sc); /* Update TX power state. */ 1716 ath_setdefantenna(sc, sc->sc_defant); 1723 ath_hal_setdiversity(sc->sc_ah, sc->sc_diversity); 1724 ath_setdefantenna(sc, sc->sc_rxantenna); 1717 1725 /* XXX: Any other clobbered features? */ 1718 1726 … … 1726 1734 * unavailable. */ 1727 1735 static int 1728 ath_chan_unavail(struct ath_softc *sc) {1736 ath_chan_unavail(struct ath_softc sc) { 1729 1737 return sc->sc_dfs_cac || 1730 1738 ((sc->sc_curchan.privFlags & CHANNEL_DFS) && … … 1733 1741 1734 1742 static inline int 1735 _ath_cac_running_dbgmsg(struct ath_softc *sc, const char *func) {1743 _ath_cac_running_dbgmsg(struct ath_softc *sc, const char func) { 1736 1744 int b = sc->sc_dfs_cac; 1737 1745 if (b) … … 1743 1751 1744 1752 static inline int 1745 _ath_chan_unavail_dbgmsg(struct ath_softc *sc, const char *func) {1753 _ath_chan_unavail_dbgmsg(struct ath_softc *sc, const char func) { 1746 1754 int b = ath_chan_unavail(sc); 1747 1755 if (b) … … 1795 1803 1796 1804 static void 1797 ath_intr_process_rx_descriptors(struct ath_softc *sc, int *pneedmark, u_int64_t hw_tsf)1805 ath_intr_process_rx_descriptors(struct ath_softc *sc, int pneedmark, u_int64_t hw_tsf) 1798 1806 { 1799 1807 struct ath_hal *ah = sc->sc_ah; … … 1941 1949 sizeof(struct ieee80211_qosframe), 1942 1950 BUS_DMA_FROMDEVICE); 1943 qwh = (struct ieee80211_qosframe *) skb->data;1951 qwh = (struct ieee80211_qosframe *)skb->data; 1944 1952 1945 1953 /* Find the node; it MUST be in the keycache. */ … … 2204 2212 "TSF error: bf_tsf=%10llx " 2205 2213 "sc_last_tsf=%10llx\n", 2206 2207 2214 bf->bf_tsf, 2215 sc->sc_last_tsf); 2208 2216 } 2209 2217 sc->sc_last_tsf = bf->bf_tsf; … … 2446 2454 * noticeable with Windows clients. */ 2447 2455 mod_timer(&sc->sc_dturbo_switch_mode, 2448 2449 2456 jiffies + 2457 msecs_to_jiffies(10)); 2450 2458 } 2451 2459 } … … 2476 2484 } 2477 2485 2478 /* Let the HAL handle the event. */2486 /* Let the HAL handle the event. */ 2479 2487 ath_hal_mibevent(ah, &sc->sc_halstats); 2480 2488 ath_override_intmit_if_disabled(sc); … … 2622 2630 /* Enable interrupts. */ 2623 2631 sc->sc_imask = HAL_INT_RX | HAL_INT_TX 2624 2625 2626 2632 | HAL_INT_RXEOL | HAL_INT_RXORN 2633 | HAL_INT_FATAL | HAL_INT_GLOBAL 2634 | (sc->sc_needmib ? HAL_INT_MIB : 0); 2627 2635 2628 2636 /* Push changes to sc_imask to hardware */ … … 2862 2870 j = 0; 2863 2871 STAILQ_FOREACH(bf, &txq->axq_q, bf_list) { 2872 2873 2874 2875 2864 2876 DPRINTF(sc, ATH_DEBUG_WATCHDOG, " [%3u] bf_daddr:%08llx " 2865 "ds_link:%08x ds_hw3:%08x\n",2866 2867 2868 bf->bf_desc->ds_hw[3]);2877 \n", 2878 j++, 2879 (u_int64_t)bf->bf_daddr, bf->bf_desc->ds_link, 2880 ); 2869 2881 } 2870 2882 } … … 2997 3009 HAL_PKT_TYPE atype; 2998 3010 u_int flags; 2999 u_int8_t antenna,txrate;3011 u_int8_t txrate; 3000 3012 struct ath_txq *txq = NULL; 3001 3013 struct ath_desc *ds = NULL; … … 3037 3049 3038 3050 flags |= HAL_TXDESC_INTREQ; 3039 antenna = sc->sc_txantenna;3040 3051 3041 3052 /* XXX check return value? */ … … 3047 3058 txrate, try0, /* series 0 rate/tries */ 3048 3059 HAL_TXKEYIX_INVALID, /* key cache index */ 3049 antenna,/* antenna mode */3060 /* antenna mode */ 3050 3061 flags, /* flags */ 3051 3062 0, /* rts/cts rate */ … … 3172 3183 3173 3184 static 3174 struct ath_buf *3185 struct ath_buf * 3175 3186 #ifdef IEEE80211_DEBUG_REFCNT 3176 3187 _take_txbuf_locked_debug(struct ath_softc *sc, int for_management, … … 3180 3191 #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ 3181 3192 { 3182 struct ath_buf *bf = NULL;3193 struct ath_buf bf = NULL; 3183 3194 ATH_TXBUF_LOCK_ASSERT(sc); 3184 3195 /* Reserve at least ATH_TXBUF_MGT_RESERVED buffers for management frames */ … … 3232 3243 3233 3244 static 3234 struct ath_buf *3245 struct ath_buf * 3235 3246 #ifdef IEEE80211_DEBUG_REFCNT 3236 3247 _take_txbuf_debug(struct ath_softc *sc, int for_management, 3237 3248 const char *func, int line) { 3238 3249 #else 3239 3250 _take_txbuf(struct ath_softc *sc, int for_management) { 3240 3251 #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ 3241 struct ath_buf *bf = NULL;3252 struct ath_buf bf = NULL; 3242 3253 ATH_TXBUF_LOCK_IRQ(sc); 3243 3254 #ifdef IEEE80211_DEBUG_REFCNT … … 3326 3337 struct ath_node *an; 3327 3338 struct ath_txq *txq = NULL; 3328 struct sk_buff *skb = NULL;3339 struct sk_buff skb = NULL; 3329 3340 /* NB: NEVER free __skb, leave it alone and use original_skb instead! 3330 3341 * IF original_skb is NULL it means the ownership was taken! 3331 3342 * *** ALWAYS *** free any skb != __skb when cleaning up - unless it was 3332 3343 * taken. */ 3333 struct sk_buff *original_skb = __skb; /* ALWAYS FREE THIS ONE!!! */3344 struct sk_buff original_skb = __skb; /* ALWAYS FREE THIS ONE!!! */ 3334 3345 int ff_flush; 3335 3346 #endif … … 4304 4315 ath_hal_setmcastfilter(ah, mfilt[0], mfilt[1]); 4305 4316 DPRINTF(sc, ATH_DEBUG_STATE, 4306 4307 4317 "Set RX filter: 0x%x, MC filter: %08x:%08x\n", 4318 rfilt, mfilt[0], mfilt[1]); 4308 4319 } 4309 4320 … … 4323 4334 return (slottime * 2) + 8; 4324 4335 } 4325 4336 4326 4337 /* constant for CCK mib processing time */ 4327 4338 return (slottime * 2) + 18; … … 4514 4525 */ 4515 4526 bss_traffic = (sc->sc_devstats.tx_bytes + sc->sc_devstats.rx_bytes) 4516 - sc->sc_dturbo_bytes;4527 - sc->sc_dturbo_bytes; 4517 4528 sc->sc_dturbo_bytes = sc->sc_devstats.tx_bytes 4518 + sc->sc_devstats.rx_bytes;4529 + sc->sc_devstats.rx_bytes; 4519 4530 if (ic->ic_ath_cap & IEEE80211_ATHC_BOOST) { 4520 4531 /* Before switching to base mode, make sure that the … … 4523 4534 if ((sc->sc_dturbo_tcount >= sc->sc_dturbo_turbo_tmin) && 4524 4535 (sc->sc_dturbo_hold == 0) && 4525 (bss_traffic < sc->sc_dturbo_bw_base || !sc->sc_rate_recn_state)) { 4536 (bss_traffic < sc->sc_dturbo_bw_base || 4537 !sc->sc_rate_recn_state)) { 4526 4538 sc->sc_dturbo_hold = 1; 4527 4539 } else { 4528 4540 if (sc->sc_dturbo_hold && 4529 bss_traffic >= sc->sc_dturbo_bw_turbo && sc->sc_rate_recn_state) { 4541 bss_traffic >= sc->sc_dturbo_bw_turbo && 4542 sc->sc_rate_recn_state) { 4530 4543 /* out of hold state */ 4531 4544 sc->sc_dturbo_hold = 0; … … 4854 4867 struct sk_buff *skb = bf->bf_skb; 4855 4868 struct ath_hal *ah = sc->sc_ah; 4856 struct ath_desc *ds ;4869 struct ath_desc *ds ; 4857 4870 unsigned int flags; 4858 4871 int antenna = sc->sc_txantenna; … … 4864 4877 skb, skb->len); 4865 4878 4866 /* setup descriptors */4867 ds = bf->bf_desc;4868 4869 4879 flags = HAL_TXDESC_NOACK; 4870 4880 #ifdef ATH_SUPERG_DYNTURBO … … 4872 4882 flags |= HAL_TXDESC_INTREQ; 4873 4883 #endif 4874 4875 ds->ds_link = 0; 4876 /* 4877 * Switch antenna every beacon if txantenna is not set 4884 4885 /* Switch antenna every beacon if txantenna is not set 4878 4886 * Should only switch every beacon period, not for all 4879 4887 * SWBAs 4880 * XXX: assumes two antennae 4881 */ 4888 * XXX: assumes two antennae */ 4882 4889 if (antenna == 0) { 4883 4890 if (sc->sc_stagbeacons) … … 4888 4895 } 4889 4896 4890 ds->ds_data = bf->bf_skbaddr;4891 4897 /* 4892 4898 * Calculate rate code. … … 4915 4921 } 4916 4922 #endif 4923 4924 4917 4925 ath_hal_setuptxdesc(ah, ds, 4918 4926 skb->len + IEEE80211_CRC_LEN, /* frame length */ … … 5279 5287 ath_setslottime(sc); /* commit change to hardware */ 5280 5288 5281 if ((!sc->sc_stagbeacons || slot == 0) && (!sc->sc_diversity)) { 5289 /* If HW fast diversity is not enabled and there is not default RX 5290 * antenna set, check recent per-antenna transmit statistics and flip 5291 * the default RX antenna if noticeably more frames went out on the 5292 * non-default antenna. */ 5293 if ((!sc->sc_stagbeacons || slot == 0) && 5294 !sc->sc_diversity && !sc->sc_rxantenna) { 5282 5295 unsigned int otherant; 5283 /* 5284 * Check recent per-antenna transmit statistics and flip 5285 * the default rx antenna if noticeably more frames went out 5286 * on the non-default antenna. Only do this if rx diversity 5287 * is off. 5288 * XXX assumes 2 antennae 5289 */ 5290 otherant = sc->sc_defant & 1 ? 2 : 1; 5291 if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + 5296 /* XXX: assumes 2 antennae. */ 5297 otherant = sc->sc_rxantenna & 1 ? 2 : 1; 5298 if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_rxantenna] + 5292 5299 ATH_ANTENNA_DIFF) { 5293 5300 DPRINTF(sc, ATH_DEBUG_BEACON, 5294 "Flip default antenna to %u, %u > %u\n",5301 "Flip default antenna to %u, %u > %u\n", 5295 5302 otherant, sc->sc_ant_tx[otherant], 5296 sc->sc_ant_tx[sc->sc_ defant]);5303 sc->sc_ant_tx[sc->sc_]); 5297 5304 ath_setdefantenna(sc, otherant); 5298 5305 } … … 5763 5770 static struct ieee80211_node * 5764 5771 #ifdef IEEE80211_DEBUG_REFCNT 5765 ath_node_alloc_debug(struct ieee80211vap *vap, const char *func, int line)5772 ath_node_alloc_debug(struct ieee80211vap *vap, const char func, int line) 5766 5773 #else 5767 5774 ath_node_alloc(struct ieee80211vap *vap) … … 5794 5801 static void 5795 5802 #ifdef IEEE80211_DEBUG_REFCNT 5796 ath_node_cleanup_debug(struct ieee80211_node *ni, const char *func, int line)5803 ath_node_cleanup_debug(struct ieee80211_node *ni, const char func, int line) 5797 5804 #else 5798 5805 ath_node_cleanup(struct ieee80211_node *ni) … … 5852 5859 static void 5853 5860 #ifdef IEEE80211_DEBUG_REFCNT 5854 ath_node_free_debug(struct ieee80211_node *ni, const char *func, int line)5861 ath_node_free_debug(struct ieee80211_node *ni, const char func, int line) 5855 5862 #else 5856 5863 ath_node_free(struct ieee80211_node *ni) … … 6208 6215 #define ath_alloc_skb(_size, _align) \ 6209 6216 ath_alloc_skb_debug(_size, _align, __func__, __LINE__) 6210 ath_alloc_skb_debug(u_int size, u_int align, const char *func, int line)6217 ath_alloc_skb_debug(u_int size, u_int align, const char func, int line) 6211 6218 #else 6212 6219 ath_alloc_skb(u_int size, u_int align) … … 6321 6328 /* This function calculates the presence of, and then removes any padding 6322 6329 * bytes between the frame header and frame body, and returns a modified 6323 * SKB. If padding is removed and copy_skb is specified, then a new SKB is 6324 * created, otherwise the same SKB is used. 6325 * 6326 * NB: MAY ALLOCATE */ 6327 static struct sk_buff * 6328 ath_skb_removepad(struct sk_buff *skb, unsigned int copy_skb) 6329 { 6330 struct sk_buff *tskb = skb; 6330 * SKB. */ 6331 static void 6332 ath_skb_removepad(struct ieee80211com *ic, struct sk_buff *skb) 6333 { 6331 6334 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data; 6332 6335 unsigned int padbytes = 0, headersize = 0; 6336 6337 6338 6333 6339 6334 6340 /* Only non-control frames have bodies, and hence padding. */ … … 6337 6343 padbytes = roundup(headersize, 4) - headersize; 6338 6344 if (padbytes > 0) { 6339 if (copy_skb) { 6340 /* Copy skb and remove HW pad bytes */ 6341 tskb = skb_copy(skb, GFP_ATOMIC); 6342 if (tskb == NULL) 6343 return NULL; 6344 ieee80211_skb_copy_noderef(skb, tskb); 6345 } 6346 memmove(tskb->data + padbytes, tskb->data, headersize); 6347 skb_pull(tskb, padbytes); 6345 memmove(skb->data + padbytes, skb->data, headersize); 6346 skb_pull(skb, padbytes); 6348 6347 } 6349 6348 } 6350 return tskb;6351 }6352 6353 /*6354 * Add a prism2 header to a received frame and6355 * dispatch it to capture tools like kismet.6356 */6357 static void6358 ath_capture(struct net_device *dev, const struct ath_buf *bf,6359 struct sk_buff *skb, u_int64_t tsf, unsigned int tx)6360 {6361 struct ath_softc *sc = dev->priv;6362 struct ieee80211com *ic = &sc->sc_ic;6363 struct sk_buff *tskb = NULL;6364 6365 KASSERT(ic->ic_flags & IEEE80211_F_DATAPAD,6366 ("data padding not enabled?"));6367 6368 if (sc->sc_nmonvaps <= 0)6369 return;6370 6371 /* Never copy the SKB, as it is ours on the RX side, and this is the6372 * last process on the TX side and we only modify our own headers. */6373 tskb = ath_skb_removepad(skb, 0 /* Copy SKB */);6374 if (tskb == NULL) {6375 DPRINTF(sc, ATH_DEBUG_ANY,6376 "Dropping; ath_skb_removepad failed!\n");6377 return;6378 }6379 6380 ieee80211_input_monitor(ic, tskb, bf, tx, tsf, sc);6381 6349 } 6382 6350 … … 6410 6378 /* Lookup the new node if any (this grabs a reference to it). */ 6411 6379 ni = ieee80211_find_rxnode(vap->iv_ic, 6412 6380 (const struct ieee80211_frame_min *)skb->data); 6413 6381 if (ni == NULL) { 6414 6382 DPRINTF(sc, ATH_DEBUG_BEACON, "Dropping; node unknown.\n"); … … 6421 6389 * AND only for our AP's beacons */ 6422 6390 if (vap->iv_opmode == IEEE80211_M_STA && 6423 sc->sc_ic.ic_opmode == IEEE80211_M_STA &&6424 ni == vap->iv_bss)6391 sc->sc_ic.ic_opmode == IEEE80211_M_STA && 6392 ni == vap->iv_bss) 6425 6393 ATH_RSSI_LPF(sc->sc_halstats.ns_avgbrssi, rssi); 6426 6394 if ((sc->sc_syncbeacon || … … 6497 6465 struct ath_hal *ah = sc->sc_ah; 6498 6466 6499 /* XXX block beacon interrupts */6467 /* XXX block beacon interrupts */ 6500 6468 ath_hal_setdefantenna(ah, antenna); 6501 if (sc->sc_ defant!= antenna)6469 if (sc->sc_ != antenna) 6502 6470 sc->sc_stats.ast_ant_defswitch++; 6503 sc->sc_ defant= antenna;6504 sc->sc_ rxotherant = 0;6471 sc->sc_ = antenna; 6472 sc->sc_rxotherant = 0; 6505 6473 } 6506 6474 … … 6639 6607 skb->protocol = __constant_htons(ETH_P_CONTROL); 6640 6608 6641 ath_capture(dev, bf, skb, bf->bf_tsf, 0 /* RX */); 6609 ath_skb_removepad(ic, skb); 6610 ieee80211_input_monitor(ic, skb, bf, 0 /* RX */, bf->bf_tsf, sc); 6642 6611 6643 6612 /* Finished monitor mode handling, now reject error frames … … 6682 6651 if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) 6683 6652 ieee80211_dump_pkt(ic, skb->data, skb->len, 6684 6685 rs->rs_rssi);6653 sc->sc_hwmap[rs->rs_rate].ieeerate, 6654 ); 6686 6655 6687 6656 { … … 6747 6716 skb = NULL; /* SKB is no longer ours. */ 6748 6717 6718 6749 6719 if (sc->sc_diversity) { 6750 /* When using hardware fast diversity, change the default RX6751 * antenna if RX diversity chooses the other antenna 36752 * times in a row. */6753 if (sc->sc_ defant!= rs->rs_antenna) {6754 if (++sc->sc_ rxotherant >= 3)6720 /* When using hardware fast diversity, change the 6721 * 6722 * times in a row. */ 6723 if (sc->sc_ != rs->rs_antenna) { 6724 if (++sc->sc_rxotherant >= 3) 6755 6725 ath_setdefantenna(sc, rs->rs_antenna); 6756 6726 } else 6757 sc->sc_ rxotherant = 0;6727 sc->sc_rxotherant = 0; 6758 6728 } 6759 6729 … … 6792 6762 DPRINTF(sc, ATH_DEBUG_RX_PROC, 6793 6763 "Warning: %s got scheduled when no receive " 6794 6764 "buffers were ready. Were they cleared?\n", 6795 6765 __func__); 6796 6766 DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: cycle completed. " … … 6844 6814 */ 6845 6815 interval = XR_DEFAULT_POLL_INTERVAL - 6846 6847 6816 ((XR_DEFAULT_POLL_INTERVAL - XR_MIN_POLL_INTERVAL) * xrsta) / 6817 (normalsta * XR_GRPPOLL_PERIOD_FACTOR); 6848 6818 if (interval < XR_MIN_POLL_INTERVAL) 6849 6819 interval = XR_MIN_POLL_INTERVAL; … … 6916 6886 EPRINTF(sc, "HAL hardware queue number, %u, is out of range." 6917 6887 " The highest queue number is %u!\n", 6918 qnum,6919 (unsigned)ARRAY_SIZE(sc->sc_txq));6888 qnum, 6889 (unsigned)ARRAY_SIZE(sc->sc_txq)); 6920 6890 ath_hal_releasetxqueue(ah, qnum); 6921 6891 return; … … 7221 7191 #ifdef ATH_SUPERG_COMP 7222 7192 /* allocate compression scratch buffer for data queues */ 7223 if (((qtype == HAL_TX_QUEUE_DATA)|| (qtype == HAL_TX_QUEUE_UAPSD)) 7224 &&ath_hal_compressionsupported(ah)) {7193 if (((qtype == HAL_TX_QUEUE_DATA)|| (qtype == HAL_TX_QUEUE_UAPSD)) 7194 ath_hal_compressionsupported(ah)) { 7225 7195 compbufsz = roundup(HAL_COMP_BUF_MAX_SIZE, 7226 7196 HAL_COMP_BUF_ALIGN_SIZE) + HAL_COMP_BUF_ALIGN_SIZE; … … 7270 7240 EPRINTF(sc, "HAL hardware queue number, %u, is out of range." 7271 7241 " The highest queue number is %u!\n", 7272 qnum,7273 (unsigned)ARRAY_SIZE(sc->sc_txq));7242 qnum, 7243 (unsigned)ARRAY_SIZE(sc->sc_txq)); 7274 7244 #ifdef ATH_SUPERG_COMP 7275 7245 if (compbuf) { … … 7315 7285 if (ac >= ARRAY_SIZE(sc->sc_ac2q)) { 7316 7286 EPRINTF(sc, "AC, %u, is out of range. " 7317 "The maximum AC is %u!\n",7318 ac, (unsigned)ARRAY_SIZE(sc->sc_ac2q));7287 "The maximum AC is %u!\n", 7288 ac, (unsigned)ARRAY_SIZE(sc->sc_ac2q)); 7319 7289 return 0; 7320 7290 } … … 7371 7341 7372 7342 return !ath_txq_update(sc, sc->sc_ac2q[WME_AC_BE], WME_AC_BE) || 7373 7374 7375 7343 !ath_txq_update(sc, sc->sc_ac2q[WME_AC_BK], WME_AC_BK) || 7344 !ath_txq_update(sc, sc->sc_ac2q[WME_AC_VI], WME_AC_VI) || 7345 !ath_txq_update(sc, sc->sc_ac2q[WME_AC_VO], WME_AC_VO) ? EIO : 0; 7376 7346 } 7377 7347 … … 7972 7942 /* FFXXX: need multi-skb version to dump entire FF */ 7973 7943 ieee80211_dump_pkt(ic, skb->data, skb->len, 7974 sc->sc_hwmap[txrate].ieeerate, -1 );7944 sc->sc_hwmap[txrate].ieeerate, -1); 7975 7945 7976 7946 /* … … 8007 7977 #endif 8008 7978 8009 /* 8010 * sc_txantenna == 0 means transmit diversity mode. 7979 /* sc_txantenna == 0 means transmit diversity mode. 8011 7980 * sc_txantenna == 1 or sc_txantenna == 2 means the user has selected 8012 7981 * the first or second antenna port. 8013 * If the user has set the txantenna, use it for multicast frames too. 8014 */ 7982 * If the user has set the txantenna, use it for multicast frames too. */ 8015 7983 if (ismcast && !sc->sc_txantenna) { 8016 7984 antenna = sc->sc_mcastantenna + 1; … … 8034 8002 comp); 8035 8003 8036 /* 8037 * Formulate first tx descriptor with tx controls. 8038 */ 8004 /* Formulate first tx descriptor with tx controls. */ 8039 8005 /* XXX check return value? */ 8040 8006 ath_hal_setuptxdesc(ah, ds, … … 8099 8065 8100 8066 DPRINTF(sc, ATH_DEBUG_XMIT, "Q%d: %08x %08x %08x %08x %08x %08x\n", 8101 M_FLAG_GET(skb, M_UAPSD) ? 0 : txq->axq_qnum, ds->ds_link, ds->ds_data, 8102 ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); 8067 M_FLAG_GET(skb, M_UAPSD) ? 0 : txq->axq_qnum, 8068 ds->ds_link, ds->ds_data, 8069 ds->ds_ctl0, ds->ds_ctl1, 8070 ds->ds_hw[0], ds->ds_hw[1]); 8103 8071 #else /* ATH_SUPERG_FF */ 8104 8072 { … … 8320 8288 "Updating frame's sequence number " 8321 8289 "from %d to %d\n", 8322 8290 ((le16toh(*(__le16 *)&wh->i_seq[0]) & 8323 8291 IEEE80211_SEQ_SEQ_MASK)) >> 8324 8292 IEEE80211_SEQ_SEQ_SHIFT, 8325 8293 ts->ts_seqnum); 8326 8294 8327 8295 *(__le16 *)&wh->i_seq[0] = htole16( … … 8351 8319 #endif 8352 8320 8353 /* ath_capture modifies skb data; must be last process8354 * in TX path. */8355 tskb = skb->next;8321 /* 8322 * . */ 8323 ; 8356 8324 DPRINTF(sc, ATH_DEBUG_TX_PROC, "capture skb %p\n", 8357 8325 bf->bf_skb); 8358 ath_capture(sc->sc_dev, bf, skb, bf->bf_tsf, 1 /* TX */); 8326 tskb = skb->next; 8327 ieee80211_input_monitor(&sc->sc_ic, skb, bf, 8328 1 /* TX */, bf->bf_tsf, sc); 8359 8329 skb = tskb; 8360 8330 … … 8363 8333 * extra buffers */ 8364 8334 for (i = 0; i < bf->bf_numdescff; i++) { 8365 tskb = skb->next;8335 8366 8336 DPRINTF(sc, ATH_DEBUG_TX_PROC, "capture skb %p\n", 8367 8337 skb); 8368 ath_capture(sc->sc_dev, bf, skb, bf->bf_tsf, 1 /* TX */); 8338 tskb = skb->next; 8339 ieee80211_input_monitor(&sc->sc_ic, skb, bf, 8340 1 /* TX */, bf->bf_tsf, sc); 8369 8341 skb = tskb; 8370 8342 } … … 8430 8402 if (txqactive(sc->sc_ah, 3)) 8431 8403 ath_tx_processq(sc, &sc->sc_txq[3]); 8432 if (ATH_TXQ_SETUP(sc, sc->sc_cabq->axq_qnum) 8433 &&STAILQ_FIRST(&sc->sc_cabq->axq_q)) {8404 if (ATH_TXQ_SETUP(sc, sc->sc_cabq->axq_qnum) 8405 STAILQ_FIRST(&sc->sc_cabq->axq_q)) { 8434 8406 DPRINTF(sc, ATH_DEBUG_BEACON, 8435 8407 "Processing CABQ... it is active in HAL.\n"); … … 8468 8440 for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { 8469 8441 if (ATH_TXQ_SETUP(sc, i) && (txqactive(sc->sc_ah, i) || 8470 8442 (sc->sc_cabq->axq_qnum == i))) { 8471 8443 if (sc->sc_cabq->axq_qnum == i) 8472 8444 DPRINTF(sc, ATH_DEBUG_BEACON, … … 8500 8472 8501 8473 for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { 8502 ath_txq_check(sc, &sc->sc_txq[i], __func__); 8503 ath_txq_dump(sc, &sc->sc_txq[i]); 8474 if (ATH_TXQ_SETUP(sc, i)) { 8475 ath_txq_check(sc, &sc->sc_txq[i], __func__); 8476 ath_txq_dump(sc, &sc->sc_txq[i]); 8477 } 8504 8478 } 8505 8479 … … 8935 8909 8936 8910 /* Update calibration interval based on whether I gain and Q 8937 * gain adjustments completed. */8911 * gain adjustments completed. */ 8938 8912 sc->sc_calinterval_sec = (isIQdone == AH_TRUE) ? 8939 8913 ATH_LONG_CALINTERVAL_SECS : … … 9670 9644 KASSERT(ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE, 9671 9645 ("new node with a ucast key already setup (keyix %u)", 9672 ni->ni_ucastkey.wk_keyix));9646 ni->ni_ucastkey.wk_keyix)); 9673 9647 /* NB: 5210 has no passthru/clr key support */ 9674 9648 if (sc->sc_hasclrkey) … … 10062 10036 DPRINTF(sc, ATH_DEBUG_ANY, 10063 10037 "The rate table is too small (%u > %u)\n", 10064 10038 rt->rateCount, IEEE80211_RATE_MAXSIZE); 10065 10039 maxrates = IEEE80211_RATE_MAXSIZE; 10066 10040 } else … … 10078 10052 DPRINTF(sc, ATH_DEBUG_ANY, 10079 10053 "The rate table is too small (%u > %u)\n", 10080 10054 rt->rateCount, IEEE80211_RATE_MAXSIZE); 10081 10055 maxrates = IEEE80211_RATE_MAXSIZE; 10082 10056 } else … … 10261 10235 return AH_FALSE; 10262 10236 if (!(ic->ic_opmode == IEEE80211_M_STA || 10263 10237 ic->ic_opmode == IEEE80211_M_HOSTAP)) 10264 10238 return AH_FALSE; 10265 10239 if ((ic->ic_opmode == IEEE80211_M_HOSTAP) && 10266 10240 ETHER_IS_MULTICAST(eh->ether_dhost)) 10267 10241 return AH_FALSE; 10268 10242 … … 10302 10276 u_int8_t status = done ? rs->rs_status : 0; 10303 10277 printk("R (%p %08llx) %08x %08x %08x %08x %08x %08x%s%s%s%s%s%s%s%s%s\n", 10304 10305 10306 10307 10308 status ? "": " OK",10309 status & HAL_RXERR_CRC ? " ERR_CRC": "",10310 status & HAL_RXERR_PHY ? " ERR_PHY": "",10311 status & HAL_RXERR_FIFO? " ERR_FIFO" : "",10312 status & HAL_RXERR_DECRYPT? " ERR_DECRYPT" : "",10313 status & HAL_RXERR_MIC? " ERR_MIC" : "",10314 status & 0x20? " (1<<5)" : "",10315 status & 0x40? " (1<<6)" : "",10316 status & 0x80? " (1<<7)" : "");10278 ds, (u_int64_t)bf->bf_daddr, 10279 ds->ds_link, ds->ds_data, 10280 ds->ds_ctl0, ds->ds_ctl1, 10281 ds->ds_hw[0], ds->ds_hw[1], 10282 : " OK", 10283 : "", 10284 : "", 10285 ? " ERR_FIFO" : "", 10286 ? " ERR_DECRYPT" : "", 10287 ? " ERR_MIC" : "", 10288 ? " (1<<5)" : "", 10289 ? " (1<<6)" : "", 10290 ? " (1<<7)" : ""); 10317 10291 } 10318 10292 … … 10326 10300 10327 10301 DPRINTF(sc, ATH_DEBUG_ANY, 10328 10329 10330 10331 10332 10333 status ? "": " OK",10334 status & HAL_TXERR_XRETRY ? " ERR_XRETRY": "",10335 status & HAL_TXERR_FILT ? " ERR_FILT": "",10336 status & HAL_TXERR_FIFO ? " ERR_FIFO": "",10337 status & HAL_TXERR_XTXOP? " ERR_XTXOP" : "",10338 status & HAL_TXERR_DESC_CFG_ERR? " ERR_DESC_CFG_ERR" : "",10339 status & HAL_TXERR_DATA_UNDERRUN ? " ERR_DATA_UNDERRUN": "",10340 status & HAL_TXERR_DELIM_UNDERRUN ? " ERR_DELIM_UNDERRUN": "",10341 status & 0x80 ? " (1<<7)": "");10302 "T (%p %08llx) %08x %08x %08x %08x %08x %08x %08x %08x%s%s%s%s%s%s%s%s%s\n", 10303 ds, (u_int64_t)bf->bf_daddr, 10304 ds->ds_link, ds->ds_data, 10305 ds->ds_ctl0, ds->ds_ctl1, 10306 ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3], 10307 : " OK", 10308 : "", 10309 : "", 10310 : "", 10311 ? " ERR_XTXOP" : "", 10312 ? " ERR_DESC_CFG_ERR" : "", 10313 : "", 10314 : "", 10315 : ""); 10342 10316 } 10343 10317 #endif /* AR_DEBUG */ … … 10794 10768 /* Don't enable diversity if XR is enabled */ 10795 10769 if (((!sc->sc_hasdiversity) || 10796 (sc->sc_xrtxq != NULL)) &&10770 (sc->sc_xrtxq != NULL)) && 10797 10771 val) { 10798 10772 ret = -EINVAL; … … 10970 10944 val = sc->sc_useintmit; 10971 10945 break; 10972 10946 default: 10973 10947 ret = -EINVAL; 10974 10948 break; … … 11214 11188 sc->sc_sysctls = NULL; 11215 11189 } 11216 11217 /* initialize values */11218 ath_debug_global = (ath_debug & ATH_DEBUG_GLOBAL);11219 sc->sc_debug = (ath_debug & ~ATH_DEBUG_GLOBAL);11220 sc->sc_default_ieee80211_debug = ieee80211_debug;11221 sc->sc_txantenna = 0; /* default to auto-selection */11222 sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD;11223 11190 } 11224 11191 … … 11390 11357 } 11391 11358 11392 static const char *11359 static const char * 11393 11360 ath_get_hal_status_desc(HAL_STATUS status) 11394 11361 { … … 11491 11458 vap->iv_des_ssid[0].len = 0; 11492 11459 vap->iv_des_nssid = 1; 11493 sc->sc_txantenna = sc->sc_defant = sc->sc_mcastantenna = sc->sc_rxotherant = 1; 11460 sc->sc_txantenna = sc->sc_rxantenna = sc->sc_mcastantenna = 1; 11461 sc->sc_numrxotherant = 0; 11494 11462 sc->sc_diversity = 0; 11495 11463 memset(vap->iv_des_ssid[0].ssid, 0, IEEE80211_ADDR_LEN); … … 11607 11575 #define AR5K_AR5212_DCU_CHAN_TIME_DUR 0x000fffff 11608 11576 #define AR5K_AR5212_DCU_CHAN_TIME_ENABLE 0x00100000 11609 #define AR5K_AR5212_QCU(_n, _a) 11610 #define AR5K_AR5212_DCU(_n, _a) 11577 #define AR5K_AR5212_QCU(_n, _a) (((_n) << 2) + _a) 11578 #define AR5K_AR5212_DCU(_n, _a) AR5K_AR5212_QCU(_n, _a) 11611 11579 #define AR5K_AR5212_DCU_MISC(_n) AR5K_AR5212_DCU(_n, 0x1100) 11612 11580 #define AR5K_AR5212_DCU_CHAN_TIME(_n) AR5K_AR5212_DCU(_n, 0x10c0) … … 11647 11615 ~AR5K_AR5212_DCU_GBL_IFS_SLOT_M) | 1); 11648 11616 OS_REG_WRITE(ah, AR5K_AR5212_DCU_GBL_IFS_MISC, 11649 11650 11651 11652 11653 11617 OS_REG_READ(ah, AR5K_AR5212_DCU_GBL_IFS_MISC) & 11618 ~AR5K_AR5212_DCU_GBL_IFS_MISC_SIFS_DUR_USEC & 11619 ~AR5K_AR5212_DCU_GBL_IFS_MISC_USEC_DUR & 11620 ~AR5K_AR5212_DCU_GBL_IFS_MISC_DCU_ARB_DELAY & 11621 ~AR5K_AR5212_DCU_GBL_IFS_MISC_LFSR_SLICE); 11654 11622 11655 11623 /* Disable queue backoff (default was like 256 or 0x100) */ … … 11709 11677 /* Queue a self-looped packet for the specified hardware queue. */ 11710 11678 static void 11711 txcont_queue_packet(struct ieee80211com *ic, struct ath_txq *txq)11679 txcont_queue_packet(struct ieee80211com *ic, struct ath_txq txq) 11712 11680 { 11713 11681 struct net_device *dev = ic->ic_dev; … … 11719 11687 /* maximum supported size, subtracting headers and required slack */ 11720 11688 unsigned int datasz = 4028; 11721 struct ieee80211_frame *wh = NULL;11689 struct ieee80211_frame wh = NULL; 11722 11690 unsigned char *data = NULL; 11723 11691 unsigned char *crc = NULL; … … 11739 11707 BUG(); 11740 11708 } 11741 wh = (struct ieee80211_frame *)skb_put(skb,11709 wh = (struct ieee80211_frame *)skb_put(skb, 11742 11710 sizeof(struct ieee80211_frame)); 11743 11711 if (NULL == bf) { … … 11800 11768 ath_hal_settpc(ah, 0); 11801 11769 ath_hal_setuptxdesc(ah, 11802 11803 skb->len,/* packet length */11804 11805 HAL_PKT_TYPE_NORMAL,/* Atheros packet type */11806 sc->sc_txcont_power,/* txpower in 0.5dBm11770 bf->bf_desc, /* the descriptor */ 11771 /* packet length */ 11772 sizeof(struct ieee80211_frame), /* header length */ 11773 /* Atheros packet type */ 11774 /* txpower in 0.5dBm 11807 11775 * increments, range 0-n 11808 11776 * depending upon card 11809 11777 * typically 60-100 max */ 11810 ath_get_txcont_adj_ratecode(sc),/* series 0 rate */11811 0,/* series 0 retries */11812 11813 sc->sc_txantenna,/* antenna mode */11814 11815 0,/* rts/cts rate */11816 0,/* rts/cts duration */11817 0,/* comp icv len */11818 0,/* comp iv len */11819 11820 11778 /* series 0 rate */ 11779 /* series 0 retries */ 11780 HAL_TXKEYIX_INVALID, /* key cache index */ 11781 /* antenna mode */ 11782 bf->bf_flags, /* flags */ 11783 /* rts/cts rate */ 11784 /* rts/cts duration */ 11785 /* comp icv len */ 11786 /* comp iv len */ 11787 ATH_COMP_PROC_NO_COMP_NO_CCS /* comp scheme */ 11788 ); 11821 11789 11822 11790 ath_hal_filltxdesc(ah, 11823 11824 skb->len,/* buffer length */11825 AH_TRUE,/* is first segment */11826 AH_TRUE,/* is last segment */11827 bf->bf_desc/* first descriptor */11828 11791 bf->bf_desc, /* Descriptor to fill */ 11792 /* buffer length */ 11793 /* is first segment */ 11794 /* is last segment */ 11795 /* first descriptor */ 11796 ); 11829 11797 11830 11798 /* Byteswap (as necessary) */ … … 11832 11800 /* queue the self-linked frame */ 11833 11801 ath_tx_txqaddbuf(sc, NULL, /* node */ 11834 txq,/* hardware queue */11835 bf,/* atheros buffer */11836 bf->bf_skb->len/* frame length */11837 11802 /* hardware queue */ 11803 /* atheros buffer */ 11804 /* frame length */ 11805 ); 11838 11806 ath_hal_txstart(ah, txq->axq_qnum); 11839 11807 } … … 12066 12034 * necessary actions (such as a DFS reaction to radar). */ 12067 12035 static void 12068 ath_interrupt_dfs_cac(struct ath_softc *sc, const char *reason)12036 ath_interrupt_dfs_cac(struct ath_softc *sc, const char reason) 12069 12037 { 12070 12038 struct timeval tv; … … 12098 12066 12099 12067 void 12100 ath_radar_detected(struct ath_softc *sc, const char *cause) {12101 struct ath_hal *ah = sc->sc_ah;12102 struct ieee80211com *ic = &sc->sc_ic;12068 ath_radar_detected(struct ath_softc *sc, const char cause) { 12069 struct ath_halah = sc->sc_ah; 12070 struct ieee80211comic = &sc->sc_ic; 12103 12071 struct ieee80211_channel ichan; 12104 12072 struct timeval tv; … … 12233 12201 value = ath_reg_read(sc, address); 12234 12202 ath_hal_print_decoded_register(sc->sc_ah, SC_DEV_NAME(sc), 12235 12236 12203 address, value, value, 12204 AH_FALSE); 12237 12205 } while ((address += 4) < MAX_REGISTER_ADDRESS); 12238 12206 } … … 12253 12221 continue; 12254 12222 value = ath_reg_read(sc, address); 12255 p_old = (unsigned int *)&sc->register_snapshot[address];12223 p_old = (unsigned int *)&sc->register_snapshot[address]; 12256 12224 if (*p_old != value) { 12257 12225 ath_hal_print_decoded_register(sc->sc_ah, SC_DEV_NAME(sc), 12258 12226 address, *p_old, value, AH_FALSE); 12259 12227 } 12260 12228 } while ((address += 4) < MAX_REGISTER_ADDRESS); … … 12272 12240 12273 12241 do { 12274 *((unsigned int *)&sc->register_snapshot[address]) =12242 *((unsigned int *)&sc->register_snapshot[address]) = 12275 12243 ath_regdump_filter(sc, address) ? 12276 12244 0x0 : ath_reg_read(sc, address); … … 12283 12251 static unsigned int 12284 12252 ath_read_register(struct ieee80211com *ic, unsigned int address, 12285 unsigned int *value)12253 unsigned int value) 12286 12254 { 12287 12255 struct ath_softc *sc = ic->ic_dev->priv; … … 12376 12344 #ifdef IEEE80211_DEBUG_REFCNT 12377 12345 ath_return_txbuf_locked_debug(struct ath_softc *sc, struct ath_buf **bf, 12378 const char *func, int line)12346 const char func, int line) 12379 12347 #else 12380 12348 ath_return_txbuf_locked(struct ath_softc *sc, struct ath_buf **bf) … … 12405 12373 (!ath_chan_unavail(sc))) { 12406 12374 DPRINTF(sc, ATH_DEBUG_TXBUF | ATH_DEBUG_RESET, 12407 12408 12375 "Waking device queue with %d available buffers.\n", 12376 ath_get_buffers_available(sc)); 12409 12377 netif_wake_queue(sc->sc_dev); 12410 12378 } … … 12412 12380 else if (ath_chan_unavail(sc)) { 12413 12381 DPRINTF(sc, (ATH_DEBUG_TXBUF | ATH_DEBUG_RESET | 12414 12415 12416 12382 ATH_DEBUG_DOTH), 12383 "Not waking device queue. Channel " 12384 "is not available.\n"); 12417 12385 } 12418 12386 #endif … … 12423 12391 #ifdef IEEE80211_DEBUG_REFCNT 12424 12392 ath_return_txbuf_debug(struct ath_softc *sc, struct ath_buf **bf, 12425 const char *func, int line)12393 const char func, int line) 12426 12394 #else 12427 12395 ath_return_txbuf(struct ath_softc *sc, struct ath_buf **bf) … … 12441 12409 #ifdef IEEE80211_DEBUG_REFCNT 12442 12410 ath_return_txbuf_list_debug(struct ath_softc *sc, ath_bufhead *bfhead, 12443 const char *func, int line)12411 const char func, int line) 12444 12412 #else 12445 12413 ath_return_txbuf_list(struct ath_softc *sc, ath_bufhead *bfhead) … … 12450 12418 ATH_TXBUF_LOCK_IRQ(sc); 12451 12419 if (!STAILQ_EMPTY(bfhead)) { 12452 struct ath_buf* tbf; 12453 struct ath_buf* tempbf; 12454 STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, tempbf) { 12420 struct ath_buf *tbf, *nextbf; 12421 STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, nextbf) { 12455 12422 #ifdef IEEE80211_DEBUG_REFCNT 12456 12423 ath_return_txbuf_locked_debug(sc, &tbf, func, line); … … 12467 12434 #ifdef IEEE80211_DEBUG_REFCNT 12468 12435 ath_return_txbuf_list_locked_debug(struct ath_softc *sc, ath_bufhead *bfhead, 12469 const char *func, int line)12436 const char func, int line) 12470 12437 #else 12471 12438 ath_return_txbuf_list_locked(struct ath_softc *sc, ath_bufhead *bfhead) … … 12477 12444 12478 12445 if (!STAILQ_EMPTY(bfhead)) { 12479 struct ath_buf* tbf; 12480 struct ath_buf* tempbf; 12481 STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, tempbf) { 12446 struct ath_buf *tbf, *nextbf; 12447 STAILQ_FOREACH_SAFE(tbf, bfhead, bf_list, nextbf) { 12482 12448 #ifdef IEEE80211_DEBUG_REFCNT 12483 12449 ath_return_txbuf_locked_debug(sc, &tbf, func, line); … … 12490 12456 } 12491 12457 12492 static struct ath_buf *12458 static struct ath_buf * 12493 12459 #ifdef IEEE80211_DEBUG_REFCNT 12494 12460 cleanup_ath_buf_debug(struct ath_softc *sc, struct ath_buf *bf, int direction, 12495 const char *func, int line)12461 const char func, int line) 12496 12462 #else /* #ifdef IEEE80211_DEBUG_REFCNT */ 12497 12463 cleanup_ath_buf(struct ath_softc *sc, struct ath_buf *bf, int direction) … … 12516 12482 { 12517 12483 unsigned int i = 0; 12518 struct sk_buff *next_ffskb = NULL;12484 struct sk_buff next_ffskb = NULL; 12519 12485 /* Start with the second skb for FF */ 12520 struct sk_buff *ffskb = bf->bf_skb ?12486 struct sk_buff ffskb = bf->bf_skb ? 12521 12487 bf->bf_skb->next : NULL; 12522 12488 while (ffskb) { … … 12556 12522 #define SCANTXBUF_NAMSIZ 64 12557 12523 static inline int 12558 descdma_contains_buffer(struct ath_descdma * dd, struct ath_buf*bf) {12524 descdma_contains_buffer(struct ath_descdma bf) { 12559 12525 return (bf >= (dd->dd_bufptr)) && 12560 12526 bf < (dd->dd_bufptr + dd->dd_nbuf); … … 12562 12528 12563 12529 static inline int 12564 descdma_index_of_buffer(struct ath_descdma * dd, struct ath_buf*bf) {12530 descdma_index_of_buffer(struct ath_descdma bf) { 12565 12531 if (!descdma_contains_buffer(dd, bf)) 12566 12532 return -1; … … 12568 12534 } 12569 12535 12570 static inline struct ath_buf *12571 descdma_get_buffer(struct ath_descdma *dd, int index)12536 static inline struct ath_buf * 12537 descdma_get_buffer(struct ath_descdma dd, int index) 12572 12538 { 12573 12539 KASSERT((index >= 0 && index < dd->dd_nbuf), … … 12577 12543 12578 12544 static int ath_debug_iwpriv(struct ieee80211com *ic, 12579 12545 unsigned int param, unsigned int value) 12580 12546 { 12581 12547 struct ath_softc *sc = ic->ic_dev->priv; … … 12634 12600 12635 12601 static void 12636 ath_scanbufs_found_buf_locked(struct ath_softc *sc, struct ath_descdma *dd,12637 unsigned long *dd_bufs_found, struct ath_buf *tbf,12638 const char *context)12602 ath_scanbufs_found_buf_locked(struct ath_softc *sc, struct ath_descdma dd, 12603 unsigned long dd_bufs_found, struct ath_buf *tbf, 12604 const char context) 12639 12605 { 12640 12606 int index = descdma_index_of_buffer(dd, tbf); … … 12658 12624 12659 12625 static void 12660 ath_scanbufs_in_buflist_locked(struct ath_softc *sc, struct ath_descdma *dd,12661 unsigned long *dd_bufs_found, ath_bufhead *bufs,12662 const char *context)12626 ath_scanbufs_in_buflist_locked(struct ath_softc *sc, struct ath_descdma dd, 12627 unsigned long dd_bufs_found, ath_bufhead *bufs, 12628 const char context) 12663 12629 { 12664 12630 struct ath_buf *tbf; … … 12670 12636 12671 12637 static void 12672 ath_scanbufs_in_txq_locked(struct ath_softc *sc, struct ath_descdma *dd,12673 unsigned long* dd_bufs_found, struct ath_txq*txq,12674 const char*context)12638 ath_scanbufs_in_txq_locked(struct ath_softc *sc, struct ath_descdma dd, 12639 txq, 12640 context) 12675 12641 { 12676 12642 struct ath_buf *tbf; … … 12690 12656 12691 12657 static void 12692 ath_scanbufs_in_vap_locked(struct ath_softc *sc, struct ath_descdma *dd,12693 unsigned long*dd_bufs_found, struct ath_vap *av)12658 ath_scanbufs_in_vap_locked(struct ath_softc *sc, struct ath_descdma dd, 12659 dd_bufs_found, struct ath_vap *av) 12694 12660 { 12695 12661 char context[SCANTXBUF_NAMSIZ]; … … 12726 12692 12727 12693 static void 12728 ath_scanbufs_in_all_vaps_locked(struct ath_softc *sc, struct ath_descdma *dd,12729 unsigned long*dd_bufs_found)12694 ath_scanbufs_in_all_vaps_locked(struct ath_softc *sc, struct ath_descdma dd, 12695 dd_bufs_found) 12730 12696 { 12731 12697 struct ieee80211vap *vap; … … 12736 12702 12737 12703 static void 12738 ath_scanbufs_in_all_nodetable_locked(struct ath_softc *sc, struct ath_descdma *dd,12739 unsigned long *dd_bufs_found,12704 ath_scanbufs_in_all_nodetable_locked(struct ath_softc *sc, struct ath_descdma dd, 12705 unsigned long dd_bufs_found, 12740 12706 struct ieee80211_node_table *nt) 12741 12707 { … … 12753 12719 MAC_ADDR(athnode->an_node.ni_bssid)); 12754 12720 ath_scanbufs_in_buflist_locked(sc, dd, dd_bufs_found, 12755 12721 &athnode->an_uapsd_q, context); 12756 12722 12757 12723 snprintf(context, sizeof(context), … … 12762 12728 MAC_ADDR(athnode->an_node.ni_bssid)); 12763 12729 ath_scanbufs_in_buflist_locked(sc, dd, dd_bufs_found, 12764 12730 &athnode->an_uapsd_overflowq, 12765 12731 context); 12766 12732 } … … 12769 12735 static void 12770 12736 ath_scanbufs_in_all_hwtxq_locked(struct ath_softc *sc, 12771 struct ath_descdma *dd,12772 unsigned long *dd_bufs_found)12737 struct ath_descdma dd, 12738 unsigned long dd_bufs_found) 12773 12739 { 12774 12740 int q = HAL_NUM_TX_QUEUES; … … 12783 12749 static void 12784 12750 ath_scanbufs_print_leaks(struct ath_softc *sc, 12785 struct ath_descdma*dd,12786 unsigned long*dd_bufs_found)12751 dd, 12752 dd_bufs_found) 12787 12753 { 12788 12754 int index; … … 12813 12779 * are all external to this, so they were specified above with the 12814 12780 * standard lock macros... */ 12815 struct ath_descdma *descdma[] = {12781 struct ath_descdma descdma[] = { 12816 12782 &sc->sc_txdma, 12817 12783 &sc->sc_rxdma, … … 12819 12785 &sc->sc_grppolldma 12820 12786 }; 12821 struct ath_descdma *dd;12787 struct ath_descdma dd; 12822 12788 unsigned long *dd_bufs_found; 12823 12789 -
madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_ahb.c
r3316 r3722 75 75 ((devid & AR5315_REV_MAJ_M) == AR5317_REV_MAJ)) { 76 76 u_int32_t reg; 77 u_int32_t *en = (u_int32_t *) AR5315_AHB_ARB_CTL;77 u_int32_t *en = (u_int32_t *)AR5315_AHB_ARB_CTL; 78 78 79 79 KASSERT(wlanNum == 0, ("invalid wlan # %d", wlanNum)); … … 136 136 if (((devid & AR5315_REV_MAJ_M) == AR5315_REV_MAJ) || 137 137 ((devid & AR5315_REV_MAJ_M) == AR5317_REV_MAJ)) { 138 u_int32_t *en = (u_int32_t *) AR5315_AHB_ARB_CTL;138 u_int32_t *en = (u_int32_t *)AR5315_AHB_ARB_CTL; 139 139 140 140 KASSERT(wlanNum == 0, ("invalid wlan # %d", wlanNum)); … … 230 230 } 231 231 dev->mem_end = dev->mem_start + AR531X_WLANX_LEN; 232 sc->aps_sc.sc_iobase = (void __iomem *) dev->mem_start;232 sc->aps_sc.sc_iobase = (void __iomem *)dev->mem_start; 233 233 sc->aps_sc.sc_bdev = NULL; 234 234 … … 265 265 struct ar531x_config *config; 266 266 267 config = (struct ar531x_config *) pdev->dev.platform_data;267 config = (struct ar531x_config *)pdev->dev.platform_data; 268 268 devid = (long) config->tag; 269 269 config->tag = NULL; … … 275 275 static int ahb_wmac_remove(struct platform_device *pdev) 276 276 { 277 exit_ath_wmac(pdev->id, (struct ar531x_config *) pdev->dev.platform_data);277 exit_ath_wmac(pdev->id, (struct ar531x_config *)pdev->dev.platform_data); 278 278 279 279 return 0; -
madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_hal_extensions.h
r3658 r3722 126 126 127 127 #define IS_CHAN_ANY(ah) \ 128 (((struct ieee80211com *)ah->ah_sc)->ic_bsschan == IEEE80211_CHAN_ANYC)128 (((struct ieee80211com *)ah->ah_sc)->ic_bsschan == IEEE80211_CHAN_ANYC) 129 129 130 130 #define IS_BG_OR_ANY(ah) \ 131 (IS_CHAN_ANY(ah) || (!(ieee80211_chan2mode(((struct ieee80211com *)ah->ah_sc)->ic_bsschan) & \131 (IS_CHAN_ANY(ah) || (!(ieee80211_chan2mode(((struct ieee80211com *)ah->ah_sc)->ic_bsschan) & \ 132 132 (IEEE80211_MODE_11A | IEEE80211_MODE_TURBO_A)))) 133 133 … … 168 168 #define AR5K_STA_ID1_NO_PSPOLL 0x00100000 /* No power save polling [5210] */ 169 169 #define AR5K_STA_ID1_PCF_5211 0x00100000 /* Enable PCF on [5211+] */ 170 #define AR5K_STA_ID1_PCF_5210 0x00200000 /* Enable PCF on [5210] */170 #define AR5K_STA_ID1_PCF_5210 0x00200000 /* Enable PCF on [5210] */ 171 171 #define AR5K_STA_ID1_PCF (ah->ah_version == AR5K_AR5210 ? \ 172 172 AR5K_STA_ID1_PCF_5210 : AR5K_STA_ID1_PCF_5211) … … 239 239 240 240 241 int ath_set_ack_bitrate(struct ath_softc *sc, int);241 int ath_set_ack_bitrate(struct ath_softc sc, int); 242 242 int ar_device(int devid); 243 243 const char * ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val); … … 281 281 } 282 282 283 static inline void override_warning(struct ath_hal *ah, const char *name,283 static inline void override_warning(struct ath_hal *ah, const char name, 284 284 u_int32_t reg, u_int32_t mask, 285 285 u_int32_t shift, u_int32_t expected, int is_signed) { … … 306 306 } 307 307 308 static inline void verification_warning(struct ath_hal *ah, const char *name,308 static inline void verification_warning(struct ath_hal *ah, const char name, 309 309 u_int32_t reg, u_int32_t mask, 310 310 u_int32_t shift, u_int32_t expected, int is_signed) { -
madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_pci.c
r3641 r3722 211 211 SET_NETDEV_DEV(dev, &pdev->dev); 212 212 213 sc->aps_sc.sc_bdev = (void *) pdev;213 sc->aps_sc.sc_bdev = (void *)pdev; 214 214 215 215 pci_set_drvdata(pdev, dev); -
madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.c
r3573 r3722 364 364 365 365 #ifdef AR_DEBUG 366 static const char *get_match_result_desc(u_int32_t code) {366 static const char get_match_result_desc(u_int32_t code) { 367 367 switch (code) { 368 368 case MR_MATCH: … … 535 535 u_int32_t *num_bursts, 536 536 size_t bursts_buflen, 537 struct lp_burst *bursts)537 struct lp_burst bursts) 538 538 { 539 539 int i = 0; … … 567 567 } 568 568 569 /* If we are in range for pulse, assume it is a pulse */569 /* If we are in range for pulse, assume it is a pulse */ 570 570 if ((tsf_delta >= LP_MIN_PRI) && (tsf_delta <= LP_MAX_PRI)) { 571 571 bursts[waveform_num_bursts].lpb_num_pulses++; … … 618 618 static HAL_BOOL rp_analyze_long_pulse( 619 619 struct ath_softc *sc, struct ath_rp *last_pulse, 620 u_int32_t *bc,621 u_int32_t * matched, u_int32_t*missed,622 u_int32_t * noise, u_int32_t*pulses)620 u_int32_t bc, 621 u_int32_t missed, 622 u_int32_t pulses) 623 623 { 624 624 int i; … … 825 825 * 826 826 * - on this timescale, we matched the number of hit/missed using T - 827 * PERIOD *n taking into account the 2% error margin (using827 * PERIOD n taking into account the 2% error margin (using 828 828 * min_rep_int, max_rep_int) 829 829 * … … 1227 1227 1228 1228 #ifdef ATH_RADAR_LONG_PULSE 1229 static const char *get_longpulse_desc(int lp) {1229 static const char get_longpulse_desc(int lp) { 1230 1230 switch (lp) { 1231 1231 case 8: return "FCC [5, 8 pulses]"; … … 1522 1522 static void ath_rp_tasklet(TQUEUE_ARG data) 1523 1523 { 1524 struct net_device *dev = (struct net_device *) data;1524 struct net_device *dev = (struct net_device *)data; 1525 1525 struct ath_softc *sc = dev->priv; 1526 1526 -
madwifi/branches/madwifi-hal-0.10.5.6/ath/if_ath_radar.h
r3268 r3722 158 158 int ath_radar_is_enabled(struct ath_softc *sc); 159 159 /* Read the radar pulse detection parameters. */ 160 void ath_radar_get_params(struct ath_softc *sc, RADAR_PARAM *rp);160 void ath_radar_get_params(struct ath_softc *sc, RADAR_PARAM rp); 161 161 /* Update the radar pulse detection parameters. 162 162 * If rp is NULL, defaults are used for all fields. 163 163 * If any member of rp is set to RADAR_PARAM_USE_DEFAULT, the default 164 164 * is used for that field. */ 165 void ath_radar_set_params(struct ath_softc *sc, RADAR_PARAM *rp);165 void ath_radar_set_params(struct ath_softc *sc, RADAR_PARAM rp); 166 166 /* Update channel's DFS flags based upon whether DFS is reqired */ 167 167 int ath_radar_correct_dfs_flags(struct ath_softc *sc, HAL_CHANNEL *hchan); -
madwifi/branches/madwifi-hal-0.10.5.6/ath/if_athvar.h
r3679 r3722 87 87 #define ATH_INIT_WORK(t, f) do { \ 88 88 memset((t), 0, sizeof(struct tq_struct)); \ 89 (t)->routine = (void (*)(void *)) (f); \90 (t)->data =(void *) (t);\89 (t)->routine = (void (*)(void *)) (f); \ 90 (t)->data \ 91 91 } while (0) 92 92 #else … … 147 147 148 148 if (sizeof_priv) 149 dev->priv = (void *) (((long)(dev + 1) + 31) & ~31);149 dev->priv = (void *)(((long)(dev + 1) + 31) & ~31); 150 150 151 151 setup(dev); … … 441 441 dma_addr_t bf_daddr; /* physical addr of desc */ 442 442 struct sk_buff *bf_skb; /* skbuff for buf */ 443 dma_addr_t bf_skbaddr; /* physical addr of skb data - always used by one desc */443 dma_addr_t bf_skbaddr; /* physical addr of skb data - always used by one desc */ 444 444 u_int32_t bf_status; /* status flags */ 445 445 u_int16_t bf_flags; /* tx descriptor flags */ … … 455 455 #endif 456 456 int bf_taken_at_line; /* XXX: Want full alloc backtrace */ 457 const char *bf_taken_at_func;457 const char bf_taken_at_func; 458 458 }; 459 459 … … 650 650 struct sk_buff *, int, int, u_int64_t); 651 651 #ifdef IEEE80211_DEBUG_REFCNT 652 void (*sc_node_cleanup_debug)(struct ieee80211_node *, const char *func, int line);653 void (*sc_node_free_debug)(struct ieee80211_node *, const char *func, int line);652 void (*sc_node_cleanup_debug)(struct ieee80211_node *, const char func, int line); 653 void (*sc_node_free_debug)(struct ieee80211_node *, const char func, int line); 654 654 #else /* #ifdef IEEE80211_DEBUG_REFCNT */ 655 655 void (*sc_node_cleanup)(struct ieee80211_node *); … … 727 727 u_int8_t sc_mcastantenna; /* Multicast antenna number */ 728 728 u_int8_t sc_txantenna; /* data tx antenna (fixed or auto) */ 729 730 729 731 u_int16_t sc_nvaps; /* # of active virtual APs */ 730 732 u_int8_t sc_nstavaps; /* # of active station VAPs */ … … 757 759 struct ATH_TQ_STRUCT sc_rxtq; /* rx intr tasklet */ 758 760 struct ATH_TQ_STRUCT sc_rxorntq; /* rxorn intr tasklet */ 759 u_int8_t sc_defant; /* current default antenna */760 u_int8_t sc_rxotherant; /* RXs on non-default antenna */761 761 u_int16_t sc_cachelsz; /* cache line size */ 762 762 … … 1019 1019 DEV_NAME(_v->iv_ic->ic_dev)) 1020 1020 1021 void ath_radar_detected(struct ath_softc *sc, const char *message);1021 void ath_radar_detected(struct ath_softc *sc, const char message); 1022 1022 1023 1023 #endif /* _DEV_ATH_ATHVAR_H */ -
madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/Makefile
r3704 r3722 86 86 $(call if_changed,uudecode) 87 87 endif 88 89 88 # Replace as many hashed names as possible with meaningful 89 # ones in the symbol table of the binary kernel module for HAL. 90 90 $(filter-out -O binary -S,$(OBJCOPY)) \ 91 91 `cat $(TOP)/scripts/hal_unmangle.objcopy` \ -
madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.c
r3664 r3722 118 118 #ifdef AH_ASSERT 119 119 void __ahdecl 120 ath_hal_assert_failed(const char *filename, int lineno, const char *msg)120 ath_hal_assert_failed(const char filename, int lineno, const char *msg) 121 121 { 122 122 printk(KERN_ERR "Atheros HAL assertion failure: %s: line %u: %s\n", … … 153 153 static u_int ath_hal_alq_lost; /* count of lost records */ 154 154 static const char *ath_hal_logfile = "/var/log/ath_hal.log"; 155 static u_int ath_hal_alq_qsize = 8 *1024;155 static u_int ath_hal_alq_qsize = 8 1024; 156 156 157 157 … … 210 210 211 211 static inline void 212 ath_hal_logvprintf(struct ath_hal *ah, const char *fmt, va_list ap)212 ath_hal_logvprintf(struct ath_hal *ah, const char fmt, va_list ap) 213 213 { 214 214 struct ale *ale; … … 242 242 243 243 static inline void 244 _hal_vprintf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char *fmt, va_list ap)244 _hal_vprintf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char fmt, va_list ap) 245 245 { 246 246 char buf[MSG_MAXLEN]; … … 256 256 257 257 void __ahdecl 258 ath_hal_printf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char *fmt, ...)258 ath_hal_printf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char fmt, ...) 259 259 { 260 260 va_list ap; … … 269 269 * name is a known ar5212 register, and AH_FALSE otherwise. */ 270 270 HAL_BOOL 271 ath_hal_lookup_register_name(struct ath_hal *ah, char *buf, int buflen,271 ath_hal_lookup_register_name(struct ath_hal *ah, char buf, int buflen, 272 272 u_int32_t address) { 273 const char *static_label = NULL;273 const char static_label = NULL; 274 274 memset(buf, 0, buflen); 275 275 #if 0 /* Enable once for each new board/magic type */ … … 460 460 int reg = ((address - 0x8800) % keytable_entry_size) / 461 461 sizeof(u_int32_t); 462 char *format = NULL;462 char format = NULL; 463 463 switch (reg) { 464 464 case 0: format = "KEY(%3d).KEYBITS[031:000]"; break; … … 573 573 574 574 static void 575 _print_decoded_register_delta(struct ath_hal *ah, const char *device_name,575 _print_decoded_register_delta(struct ath_hal *ah, const char device_name, 576 576 HAL_BOOL prefer_alq, int regop, 577 577 u_int32_t address, u_int32_t v_old, u_int32_t v_new, … … 656 656 * printed with the status in symbolic form. */ 657 657 static void 658 _print_decoded_register_bitfields(struct ath_hal *ah, const char *device_name,658 _print_decoded_register_bitfields(struct ath_hal *ah, const char device_name, 659 659 HAL_BOOL prefer_alq, int regop, 660 660 u_int32_t address, u_int32_t old_v, … … 825 825 /* Print out a single register name/address/value in hex and binary */ 826 826 static inline void 827 _print_decoded_register(struct ath_hal *ah, const char *device_name,827 _print_decoded_register(struct ath_hal *ah, const char device_name, 828 828 HAL_BOOL prefer_alq, int regop, 829 829 u_int32_t address, u_int32_t oldval, … … 838 838 /* Print out a single register name/address/value in hex and binary */ 839 839 static inline void 840 _print_undecoded_register(struct ath_hal *ah, const char *device_name,840 _print_undecoded_register(struct ath_hal *ah, const char device_name, 841 841 HAL_BOOL prefer_alq, int regop, 842 842 u_int32_t address, u_int32_t newval) … … 856 856 void 857 857 ath_hal_print_decoded_register(struct ath_hal *ah, 858 const char *device_name,858 const char device_name, 859 859 u_int32_t address, u_int32_t oldval, 860 860 u_int32_t newval, HAL_BOOL bitfields) … … 868 868 void 869 869 ath_hal_print_register(struct ath_hal *ah, 870 const char *device_name,870 const char device_name, 871 871 u_int32_t address, u_int32_t newval) 872 872 { … … 957 957 958 958 void __ahdecl 959 ath_hal_free(void *p)959 ath_hal_free(void p) 960 960 { 961 961 kfree(p); -
madwifi/branches/madwifi-hal-0.10.5.6/ath_hal/ah_os.h
r3704 r3722 152 152 153 153 /* 154 * Some big-endian architectures don't set CONFIG_GENERIC_IOMAP, but fail to 155 * implement iowrite32be and ioread32be. Provide compatibility macros when 156 * it's needed. 157 * 158 * As of Linux 2.6.24, only MIPS, PARISC and PowerPC implement iowrite32be and 159 * ioread32be as functions. 160 * 161 * The downside or the replacement macros it that we may be byte-swapping data 162 * for the second time, so the native implementations should be preferred. 154 * The HAL programs big-endian platforms to use byte-swapped hardware registers. 155 * This is done to avoid the byte swapping needed to access PCI devices. 156 * 157 * Many big-endian architectures provide I/O functions that avoid byte swapping. 158 * We use them when possible. Otherwise, we provide replacements. The downside 159 * or the replacements is that we may be byte-swapping data twice, so we try to 160 * avoid it. 161 * 162 * We use raw access for Linux prior to 2.6.12. For newer version, we need to 163 * use ioread32() and iowrite32(), which would take care of indirect access to 164 * the registers. 163 165 */ 164 166 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)) && \ 165 !defined(CONFIG_GENERIC_IOMAP) && (AH_BYTE_ORDER == AH_BIG_ENDIAN) && \ 166 !defined(__mips__) && !defined(__hppa__) && !defined(__powerpc__) 167 (AH_BYTE_ORDER == AH_BIG_ENDIAN) && \ 168 !defined(CONFIG_GENERIC_IOMAP) && \ 169 !defined(CONFIG_PARICS) && \ 170 !(defined(CONFIG_PPC64) && \ 171 (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))) && \ 172 !defined(CONFIG_PPC_MERGE) && \ 173 !(defined(CONFIG_MIPS) && \ 174 (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21))) 167 175 # ifndef iowrite32be 168 176 # define iowrite32be(_val, _addr) iowrite32(swab32((_val)), (_addr)) … … 178 186 * 179 187 * The hardware registers use little-endian byte order natively. Big-endian 180 * systems are configured by HAL to enable hardware byte-swap of register reads 181 * and writes at reset. This avoid the need to byte-swap the data in software. 182 * However, the registers in a certain area from 0x4000 to 0x4fff (PCI clock 183 * domain registers) are not byte swapped! 188 * systems are configured by HAL to byte-swap of register reads and writes. 189 * However, the registers in the areas 0x4000-0x4fff and 0x7000-0x7fff are not 190 * byte swapped! 184 191 * 185 192 * Since Linux I/O primitives default to little-endian operations, we only … … 188 195 */ 189 196 #if (AH_BYTE_ORDER == AH_BIG_ENDIAN) 190 # define is_reg_le(__reg) ((0x4000 <= (__reg) && (__reg) < 0x5000) || \191 (0x7000 <= (__reg) && (__reg) < 0x8000))192 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)193 # define _OS_REG_WRITE(_ah, _reg, _val) do { \197 # define is_reg_le(__reg) ((0x4000 <= (__reg) && (__reg) < 0x5000) || \ 198 (0x7000 <= (__reg) && (__reg) < 0x8000)) 199 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) 200 # define _OS_REG_WRITE(_ah, _reg, _val) do { \ 194 201 is_reg_le(_reg) ? \ 195 iowrite32((_val), (_ah)->ah_sh + (_reg)) : \196 iowrite32be((_val), (_ah)->ah_sh + (_reg)); \202 iowrite32((_val), (_ah)->ah_sh + (_reg)) : \ 203 iowrite32be((_val), (_ah)->ah_sh + (_reg)); \ 197 204 } while (0) 198 # define _OS_REG_READ(_ah, _reg)\205 # \ 199 206 (is_reg_le(_reg) ? \ 200 ioread32((_ah)->ah_sh + (_reg)) : \201 ioread32be((_ah)->ah_sh + (_reg)))202 # else203 # define _OS_REG_WRITE(_ah, _reg, _val) do { \204 writel(is_reg_le(_reg) ? \205 (_val) : cpu_to_le32(_val),\206 (_ah)->ah_sh + (_reg));\207 ioread32((_ah)->ah_sh + (_reg)) : \ 208 ioread32be((_ah)->ah_sh + (_reg))) 209 # 210 # define _OS_REG_WRITE(_ah, _reg, _val) do { \ 211 writel(is_reg_le(_reg) ? \ 212 \ 213 \ 207 214 } while (0) 208 # define _OS_REG_READ(_ah, _reg)\215 # \ 209 216 (is_reg_le(_reg) ? \ 210 readl((_ah)->ah_sh + (_reg)) :\211 cpu_to_le32(readl((_ah)->ah_sh + (_reg))))212 # endif /* KERNEL_VERSION(2,6,12)*/213 #else /* AH_BYTE_ORDER != AH_BIG_ENDIAN*/214 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)215 # define _OS_REG_WRITE(_ah, _reg, _val) do { \217 \ 218 cpu_to_le32(readl((_ah)->ah_sh + (_reg)))) 219 # */ 220 #else /* */ 221 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) 222 # define _OS_REG_WRITE(_ah, _reg, _val) do { \ 216 223 iowrite32((_val), (_ah)->ah_sh + (_reg)); \ 217 224 } while (0) 218 # define _OS_REG_READ(_ah, _reg)\225 # \ 219 226 ioread32((_ah)->ah_sh + (_reg)) 220 # else221 # define _OS_REG_WRITE(_ah, _reg, _val) do { \227 # 228 # define _OS_REG_WRITE(_ah, _reg, _val) do { \ 222 229 writel((_val), (_ah)->ah_sh + (_reg)); \ 223 230 } while (0) 224 # define _OS_REG_READ(_ah, _reg)\231 # \ 225 232 readl((_ah)->ah_sh + (_reg)) 226 # endif /* KERNEL_VERSION(2,6,12)*/227 #endif /* AH_BYTE_ORDER != AH_BIG_ENDIAN*/233 # */ 234 #endif /* */ 228 235 229 236 #define HAL_DEBUG_OFF 0 … … 290 297 void 291 298 ath_hal_print_decoded_register(struct ath_hal *ah, 292 const char *device_name,299 const char device_name, 293 300 u_int32_t address, u_int32_t oldval, 294 301 u_int32_t newval, HAL_BOOL bitfields); 295 302 void 296 303 ath_hal_print_register(struct ath_hal *ah, 297 const char *device_name,304 const char device_name, 298 305 u_int32_t address, u_int32_t value); 299 306 300 307 HAL_BOOL 301 ath_hal_lookup_register_name(struct ath_hal *ah, char *buf, int buflen,308 ath_hal_lookup_register_name(struct ath_hal *ah, char buf, int buflen, 302 309 u_int32_t address); 303 310 -
madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/amrr/amrr.c
r3677 r3722 318 318 struct ieee80211com *ic = vap->iv_ic; 319 319 struct ath_softc *sc = ic->ic_dev->priv; 320 struct amrr_softc *asc = (struct amrr_softc *) sc->sc_rc;320 struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc; 321 321 struct ieee80211_node *ni; 322 322 … … 474 474 ath_rate_detach(struct ath_ratectrl *arc) 475 475 { 476 struct amrr_softc *asc = (struct amrr_softc *) arc;476 struct amrr_softc *asc = (struct amrr_softc *)arc; 477 477 478 478 del_timer(&asc->timer); … … 521 521 static ctl_table ath_rate_table[] = { 522 522 { .ctl_name = CTL_AUTO, 523 .procname = "rate ",523 .procname = "rate", 524 524 .mode = 0555, 525 525 .child = ath_rate_static_sysctls -
madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/minstrel/minstrel.c
r3677 r3722 771 771 ath_timer_function(unsigned long data) 772 772 { 773 struct minstrel_softc *ssc = (struct minstrel_softc *) data;773 struct minstrel_softc *ssc = (struct minstrel_softc *)data; 774 774 struct ath_softc *sc = ssc->sc; 775 775 struct ieee80211com *ic; … … 816 816 ath_rate_statistics(void *arg, struct ieee80211_node *ni) 817 817 { 818 struct ath_node *an = (struct ath_node *) ni;818 struct ath_node *an = (struct ath_node *)ni; 819 819 struct ieee80211_rateset *rs = &ni->ni_rates; 820 820 struct minstrel_node *rn = ATH_NODE_MINSTREL(an); … … 934 934 ath_rate_detach(struct ath_ratectrl *arc) 935 935 { 936 struct minstrel_softc *osc = (struct minstrel_softc *) arc;936 struct minstrel_softc *osc = (struct minstrel_softc *)arc; 937 937 osc->close_timer_now = 1; 938 938 del_timer(&osc->timer); … … 949 949 struct minstrel_node *odst; 950 950 struct ieee80211_node_table *nt = 951 (struct ieee80211_node_table *) &vap->iv_ic->ic_sta;951 (struct ieee80211_node_table *)&vap->iv_ic->ic_sta; 952 952 unsigned int x = 0; 953 953 unsigned int this_tp, this_prob, this_eprob; -
madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/onoe/onoe.c
r3483 r3722 424 424 ath_rate_detach(struct ath_ratectrl *arc) 425 425 { 426 struct onoe_softc *osc = (struct onoe_softc *) arc;426 struct onoe_softc *osc = (struct onoe_softc *)arc; 427 427 428 428 kfree(osc); … … 468 468 static ctl_table ath_rate_table[] = { 469 469 { .ctl_name = CTL_AUTO, 470 .procname = "rate ",470 .procname = "rate", 471 471 .mode = 0555, 472 472 .child = ath_rate_static_sysctls -
madwifi/branches/madwifi-hal-0.10.5.6/ath_rate/sample/sample.c
r3677 r3722 984 984 ath_rate_detach(struct ath_ratectrl *arc) 985 985 { 986 struct sample_softc *osc = (struct sample_softc *) arc;986 struct sample_softc *osc = (struct sample_softc *)arc; 987 987 kfree(osc); 988 988 _MOD_DEC_USE(THIS_MODULE); … … 997 997 struct sample_node *sn; 998 998 struct ieee80211_node_table *nt = 999 (struct ieee80211_node_table *) &vap->iv_ic->ic_sta;999 (struct ieee80211_node_table *)&vap->iv_ic->ic_sta; 1000 1000 unsigned int ndx; 1001 1001 unsigned int size_bin; -
madwifi/branches/madwifi-hal-0.10.5.6/include/compat.h
r3627 r3722 59 59 #endif 60 60 61 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)62 typedef int gfp_t;63 #endif64 65 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3)66 static inline void *kzalloc(size_t size, gfp_t flags)67 {68 void *p = kmalloc(size, flags);69 if (likely(p != NULL))70 memset(p, 0, size);71 return p;72 }73 #endif74 75 61 #ifndef container_of 76 62 #define container_of(ptr, type, member) ({ \ … … 116 102 #define __offsetof(t,m) offsetof(t,m) 117 103 118 #ifndef ALIGNED_POINTER119 /*120 * ALIGNED_POINTER is a boolean macro that checks whether an address121 * is valid to fetch data elements of type t from on this architecture.122 * This does not reflect the optimal alignment, just the possibility123 * (within reasonable limits).124 *125 */126 #define ALIGNED_POINTER(p,t) 1127 #endif128 129 #ifdef __KERNEL__130 #define KASSERT(exp, msg) do { \131 if (unlikely(!(exp))) { \132 printk msg; \133 BUG(); \134 } \135 } while (0)136 #endif /* __KERNEL__ */137 138 104 /* 139 105 * NetBSD/FreeBSD defines for file version. … … 146 112 */ 147 113 #ifdef __KERNEL__ 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 148 135 149 136 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/_ieee80211.h
r3207 r3722 148 148 #define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */ 149 149 #define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ 150 #define IEEE80211_CHAN_ANYC ((struct ieee80211_channel *) IEEE80211_CHAN_ANY)150 #define IEEE80211_CHAN_ANYC ((struct ieee80211_channel *)IEEE80211_CHAN_ANY) 151 151 152 152 #define IEEE80211_RADAR_CHANCHANGE_TBTT_COUNT 0 -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211.c
r3492 r3722 65 65 EXPORT_SYMBOL(ieee80211_phymode_name); 66 66 67 const char *ieee80211_opmode_name[] = {67 const char ieee80211_opmode_name[] = { 68 68 "ibss", /* IEEE80211_M_IBSS = 0 - IBSS (adhoc) station */ 69 69 "station", /* IEEE80211_M_STA = 1 - infrastructure station */ … … 79 79 80 80 81 static void ieee80211com_media_status(struct net_device *, struct ifmediareq *);81 static void ieee80211com_media_status(struct net_device *, struct ifmediareq *); 82 82 static int ieee80211com_media_change(struct net_device *); 83 83 static struct net_device_stats *ieee80211_getstats(struct net_device *); … … 861 861 ieee80211_expire_excl_restrictions(struct ieee80211com *ic) 862 862 { 863 struct ieee80211_channel * c= NULL;863 struct ieee80211_channel = NULL; 864 864 struct net_device *dev = ic->ic_dev; 865 865 struct timeval tv_now; … … 940 940 ieee80211_expire_dfs_excl_timer(unsigned long data) 941 941 { 942 struct ieee80211com *ic = (struct ieee80211com *) data;942 struct ieee80211com *ic = (struct ieee80211com *)data; 943 943 struct ieee80211vap *vap; 944 944 -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_beacon.c
r3627 r3722 118 118 bo->bo_tim_len = 0; 119 119 } else { 120 struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) frm;120 struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *)frm; 121 121 122 122 tie->tim_ie = IEEE80211_ELEMID_TIM; … … 401 401 if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* NB: no IBSS support*/ 402 402 struct ieee80211_tim_ie *tie = 403 (struct ieee80211_tim_ie *) bo->bo_tim;403 (struct ieee80211_tim_ie *)bo->bo_tim; 404 404 if (vap->iv_flags & IEEE80211_F_TIMUPDATE) { 405 405 u_int timlen, timoff, i; -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.c
r3268 r3722 645 645 * the key id in the header is meaningless (typically 0). 646 646 */ 647 wh = (struct ieee80211_frame *) skb->data;647 wh = (struct ieee80211_frame *)skb->data; 648 648 ivp = skb->data + hdrlen; 649 649 keyid = ivp[IEEE80211_WEP_IVLEN]; -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto.h
r3334 r3722 152 152 void ieee80211_crypto_register(const struct ieee80211_cipher *); 153 153 void ieee80211_crypto_unregister(const struct ieee80211_cipher *); 154 int ieee80211_crypto_available(struct ieee80211vap *, u_int);154 int ieee80211_crypto_available(struct ieee80211vap *, u_int); 155 155 156 156 struct ieee80211_key *ieee80211_crypto_encap(struct ieee80211_node *, -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_ccmp.c
r3334 r3722 416 416 if (IS_QOS_DATA(wh)) { 417 417 struct ieee80211_qosframe_addr4 *qwh4 = 418 (struct ieee80211_qosframe_addr4 *) wh;418 (struct ieee80211_qosframe_addr4 *)wh; 419 419 aad[30] = qwh4->i_qos[0] & 0x0f;/* just priority bits */ 420 420 aad[31] = 0; … … 429 429 if (IS_QOS_DATA(wh)) { 430 430 struct ieee80211_qosframe *qwh = 431 (struct ieee80211_qosframe *)wh;431 (struct ieee80211_qosframe wh; 432 432 aad[24] = qwh->i_qos[0] & 0x0f; /* just priority bits */ 433 433 aad[25] = 0; … … 471 471 { 472 472 struct ccmp_ctx *ctx = key->wk_private; 473 struct ieee80211_frame *wh = (struct ieee80211_frame *) skb0->data;473 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb0->data; 474 474 struct sk_buff *skb; 475 475 int data_len, i; … … 584 584 { 585 585 struct ccmp_ctx *ctx = key->wk_private; 586 struct ieee80211_frame *wh = (struct ieee80211_frame *) skb0->data;586 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb0->data; 587 587 struct sk_buff *skb; 588 588 uint8_t aad[2 * AES_BLOCK_LEN]; -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_tkip.c
r3334 r3722 162 162 #ifdef IEEE80211_DEBUG 163 163 struct ieee80211_frame *wh = 164 (struct ieee80211_frame *) skb->data;164 (struct ieee80211_frame *)skb->data; 165 165 #endif 166 166 … … 211 211 if ((k->wk_flags & IEEE80211_KEY_SWMIC) || force_sw) { 212 212 struct ieee80211_frame *wh = 213 (struct ieee80211_frame *) skb0->data;213 (struct ieee80211_frame *)skb0->data; 214 214 struct ieee80211vap *vap = ctx->tc_vap; 215 215 struct ieee80211com *ic = ctx->tc_ic; … … 354 354 pktlen += skb->len; 355 355 } 356 wh = (struct ieee80211_frame *) skb0->data;356 wh = (struct ieee80211_frame *)skb0->data; 357 357 /* NB: skb left pointing at last in chain */ 358 358 if ((k->wk_flags & IEEE80211_KEY_SWMIC) || force_sw) { … … 577 577 /* Make temporary area overlap WEP seed so that the final copy can be 578 578 * avoided on little endian hosts. */ 579 u16 *PPK = (u16 *) &WEPSeed[4];579 u16 *PPK = (u16 *)&WEPSeed[4]; 580 580 581 581 /* Step 1 - make copy of TTAK and bring in TSC */ … … 588 588 589 589 /* Step 2 - 96-bit bijective mixing using S-box */ 590 PPK[0] += _S_(PPK[5] ^ Mk16_le((const __le16 *) &TK[0]));591 PPK[1] += _S_(PPK[0] ^ Mk16_le((const __le16 *) &TK[2]));592 PPK[2] += _S_(PPK[1] ^ Mk16_le((const __le16 *) &TK[4]));593 PPK[3] += _S_(PPK[2] ^ Mk16_le((const __le16 *) &TK[6]));594 PPK[4] += _S_(PPK[3] ^ Mk16_le((const __le16 *) &TK[8]));595 PPK[5] += _S_(PPK[4] ^ Mk16_le((const __le16 *) &TK[10]));596 597 PPK[0] += RotR1(PPK[5] ^ Mk16_le((const __le16 *) &TK[12]));598 PPK[1] += RotR1(PPK[0] ^ Mk16_le((const __le16 *) &TK[14]));590 PPK[0] += _S_(PPK[5] ^ Mk16_le((const __le16 *)&TK[0])); 591 PPK[1] += _S_(PPK[0] ^ Mk16_le((const __le16 *)&TK[2])); 592 PPK[2] += _S_(PPK[1] ^ Mk16_le((const __le16 *)&TK[4])); 593 PPK[3] += _S_(PPK[2] ^ Mk16_le((const __le16 *)&TK[6])); 594 PPK[4] += _S_(PPK[3] ^ Mk16_le((const __le16 *)&TK[8])); 595 PPK[5] += _S_(PPK[4] ^ Mk16_le((const __le16 *)&TK[10])); 596 597 PPK[0] += RotR1(PPK[5] ^ Mk16_le((const __le16 *)&TK[12])); 598 PPK[1] += RotR1(PPK[0] ^ Mk16_le((const __le16 *)&TK[14])); 599 599 PPK[2] += RotR1(PPK[1]); 600 600 PPK[3] += RotR1(PPK[2]); … … 607 607 WEPSeed[1] = (Hi8(IV16) | 0x20) & 0x7F; 608 608 WEPSeed[2] = Lo8(IV16); 609 WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((const __le16 *) &TK[0])) >> 1);609 WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((const __le16 *)&TK[0])) >> 1); 610 610 611 611 #if _BYTE_ORDER == _BIG_ENDIAN … … 810 810 { 811 811 const struct ieee80211_frame_addr4 *wh = 812 (const struct ieee80211_frame_addr4 *) wh0;812 (const struct ieee80211_frame_addr4 *)wh0; 813 813 814 814 switch (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) { … … 833 833 if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) { 834 834 const struct ieee80211_qosframe *qwh = 835 (const struct ieee80211_qosframe *) wh;835 (const struct ieee80211_qosframe *)wh; 836 836 hdr[12] = qwh->i_qos[0] & IEEE80211_QOS_TID; 837 837 } else … … 850 850 u_int space; 851 851 852 michael_mic_hdr((struct ieee80211_frame *) skb->data, hdr);852 michael_mic_hdr((struct ieee80211_frame *)skb->data, hdr); 853 853 854 854 l = get_le32(key); … … 953 953 struct sk_buff *skb0, int hdrlen) 954 954 { 955 struct ieee80211_frame *wh = (struct ieee80211_frame *) skb0->data;955 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb0->data; 956 956 struct ieee80211vap *vap = ctx->tc_vap; 957 957 struct sk_buff *skb; … … 997 997 struct sk_buff *skb0, int hdrlen) 998 998 { 999 struct ieee80211_frame *wh = (struct ieee80211_frame *) skb0->data;999 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb0->data; 1000 1000 struct ieee80211vap *vap = ctx->tc_vap; 1001 1001 struct sk_buff *skb; … … 1017 1017 iv32 = (u32) (ctx->rx_rsc >> 16); 1018 1018 1019 wh = (struct ieee80211_frame *) skb0->data;1019 wh = (struct ieee80211_frame *)skb0->data; 1020 1020 tid = 0; 1021 1021 if (IEEE80211_QOS_HAS_SEQ(wh)) -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_crypto_wep.c
r3334 r3722 359 359 #ifdef IEEE80211_DEBUG 360 360 const struct ieee80211_frame *wh = 361 (const struct ieee80211_frame *) skb0->data;361 (const struct ieee80211_frame *)skb0->data; 362 362 #endif 363 363 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, … … 378 378 #ifdef IEEE80211_DEBUG 379 379 const struct ieee80211_frame *wh = 380 (const struct ieee80211_frame *) skb0->data;380 (const struct ieee80211_frame *)skb0->data; 381 381 #endif 382 382 /* NB: should not happen */ … … 459 459 #ifdef IEEE80211_DEBUG 460 460 const struct ieee80211_frame *wh = 461 (const struct ieee80211_frame *) skb0->data;461 (const struct ieee80211_frame *)skb0->data; 462 462 #endif 463 463 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_input.c
r3677 r3722 171 171 set_quality(&thr.high, vap->iv_spy.thr_high, vap->iv_ic->ic_channoise); 172 172 wireless_send_event(vap->iv_dev, 173 SIOCGIWTHRSPY, &wrq, (char *)&thr);173 SIOCGIWTHRSPY, &wrq, (char &thr); 174 174 break; 175 175 } … … 208 208 struct llc *llc; 209 209 #endif 210 int hdr space;210 int hdr; 211 211 u_int8_t dir, type = -1, subtype; 212 212 u_int8_t *bssid; … … 432 432 switch (type) { 433 433 case IEEE80211_FC0_TYPE_DATA: 434 hdr space = ieee80211_hdrspace(ic,wh);435 if (skb->len < hdr space) {434 hdrwh); 435 if (skb->len < hdr) { 436 436 IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, 437 437 wh, "data", "too short: len %u, expecting %u", 438 skb->len, hdr space);438 skb->len, hdr); 439 439 vap->iv_stats.is_rx_tooshort++; 440 440 goto out; /* XXX */ … … 625 625 goto out; 626 626 } 627 key = ieee80211_crypto_decap(ni, skb, hdr space);627 key = ieee80211_crypto_decap(ni, skb, hdr); 628 628 if (key == NULL) { 629 629 /* NB: stats+msgs handled in crypto_decap */ … … 640 640 */ 641 641 if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { 642 skb = ieee80211_defrag(ni, skb, hdr space);642 skb = ieee80211_defrag(ni, skb, hdr); 643 643 if (skb == NULL) { 644 644 /* Fragment dropped or frame not complete yet */ … … 652 652 */ 653 653 if (key != NULL && 654 !ieee80211_crypto_demic(vap, key, skb, hdr space, 0)) {654 !ieee80211_crypto_demic(vap, key, skb, hdr, 0)) { 655 655 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, 656 656 ni->ni_macaddr, "data", "%s", "demic error"); … … 662 662 * Finally, strip the 802.11 header. 663 663 */ 664 skb = ieee80211_decap(vap, skb, hdr space);664 skb = ieee80211_decap(vap, skb, hdr); 665 665 if (skb == NULL) { 666 666 /* don't count Null data frames as errors */ … … 673 673 goto err; 674 674 } 675 eh = (struct ether_header *) skb->data;675 eh = (struct ether_header *)skb->data; 676 676 677 677 if (!accept_data_frame(vap, ni, key, skb, eh)) … … 686 686 #ifdef ATH_SUPERG_FF 687 687 /* check for FF */ 688 llc = (struct llc *) (skb->data + sizeof(struct ether_header));688 llc = (struct llc *)(skb->data + sizeof(struct ether_header)); 689 689 if (ntohs(llc->llc_snap.ether_type) == (u_int16_t)ATH_ETH_TYPE) { 690 690 struct sk_buff *skb1 = NULL; … … 813 813 goto out; 814 814 } 815 hdr space = ieee80211_hdrspace(ic,wh);816 key = ieee80211_crypto_decap(ni, skb, hdr space);815 hdrwh); 816 key = ieee80211_crypto_decap(ni, skb, hdr); 817 817 if (key == NULL) { 818 818 /* NB: stats+msgs handled in crypto_decap */ … … 971 971 ieee80211_defrag(struct ieee80211_node *ni, struct sk_buff *skb, int hdrlen) 972 972 { 973 struct ieee80211_frame *wh = (struct ieee80211_frame *) skb->data;973 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data; 974 974 u_int16_t rxseq, last_rxseq; 975 975 u_int8_t fragno, last_fragno; … … 1016 1016 struct ieee80211_frame *lwh; 1017 1017 1018 lwh = (struct ieee80211_frame *) ni->ni_rxfrag->data;1018 lwh = (struct ieee80211_frame *)ni->ni_rxfrag->data; 1019 1019 last_rxseq = le16_to_cpu(*(__le16 *)lwh->i_seq) >> 1020 1020 IEEE80211_SEQ_SEQ_SHIFT; … … 1082 1082 skb_put(ni->ni_rxfrag, skb->len - hdrlen); 1083 1083 /* Keep a copy of last sequence and fragno */ 1084 *(__le16 *) lwh->i_seq = *(__le16 *)wh->i_seq;1084 *(__le16 *)wh->i_seq; 1085 1085 } 1086 1086 /* we're done with the fragment */ … … 1104 1104 struct ieee80211vap *vap = ni->ni_vap; 1105 1105 struct net_device *dev = vap->iv_dev; 1106 struct ether_header *eh = (struct ether_header *) skb->data;1106 struct ether_header *eh = (struct ether_header *)skb->data; 1107 1107 struct ieee80211_node *tni; 1108 1108 int ret; … … 1150 1150 } 1151 1151 if (skb1 != NULL) { 1152 struct ieee80211_node *tni;1153 1152 skb1->dev = dev; 1154 1153 skb_reset_mac_header(skb1); … … 1156 1155 1157 1156 skb1->protocol = __constant_htons(ETH_P_802_2); 1157 1158 1159 1160 1161 1162 1163 1158 1164 /* XXX: Insert vlan tag before queuing it? */ 1159 tni = SKB_NI(skb1); /* Remember node so we can free it. */1160 1165 if (dev_queue_xmit(skb1) == NET_XMIT_DROP) { 1161 /* If queue dropped the packet because device1162 * was too busy */1163 1166 vap->iv_devstats.tx_dropped++; 1164 /* node reference was leaked */1165 1167 if (tni != NULL) 1166 1168 ieee80211_unref_node(&tni); … … 1185 1187 if ((ni->ni_vlan != 0) && (vap->iv_vlgrp != NULL)) 1186 1188 /* Attach VLAN tag. */ 1187 ret = vlan_hwaccel_r eceive_skb(skb,1189 ret = vlan_hwaccel_r(skb, 1188 1190 vap->iv_vlgrp, ni->ni_vlan); 1189 1191 else 1190 1192 ret = netif_rx(skb); 1191 if (ret == NET_RX_DROP) { 1192 /* Cleanup if passing SKB to ourselves failed. */ 1193 if (tni != NULL) 1194 ieee80211_unref_node(&tni); 1193 if (ret == NET_RX_DROP) 1195 1194 vap->iv_devstats.rx_dropped++; 1196 } 1195 if (tni != NULL) 1196 ieee80211_unref_node(&tni); 1197 1197 skb = NULL; /* SKB is no longer ours */ 1198 1198 } … … 1215 1215 memcpy(&wh, skb->data, hdrlen); /* Make a copy of the variably sized .11 header */ 1216 1216 1217 llc = (struct llc *) skb_pull(skb, hdrlen);1217 llc = (struct llc *)skb_pull(skb, hdrlen); 1218 1218 /* XXX: For some unknown reason some APs think they are from DEC and 1219 1219 * use an OUI of 00-00-f8. This should be killed as soon as sanity is … … 1227 1227 } 1228 1228 1229 eh = (struct ether_header *) skb_push(skb, sizeof(struct ether_header));1229 eh = (struct ether_header *)skb_push(skb, sizeof(struct ether_header)); 1230 1230 switch (wh.i_fc[1] & IEEE80211_FC1_DIR_MASK) { 1231 1231 case IEEE80211_FC1_DIR_NODS: … … 1252 1252 eh->ether_type = ether_type; 1253 1253 1254 if (!ALIGNED_POINTER(skb->data + sizeof(*eh), u_int32_t)) {1255 struct sk_buff *tskb;1256 1257 /* XXX: does this always work? */1258 tskb = skb_copy(skb, GFP_ATOMIC);1259 if (tskb)1260 ieee80211_skb_copy_noderef(skb, tskb);1261 ieee80211_dev_kfree_skb(&skb);1262 skb = tskb;1263 }1264 1254 return skb; 1265 1255 } … … 2210 2200 #endif /* ATH_SUPERG_DYNTURBO */ 2211 2201 struct ieee80211_ie_athAdvCap *athIe = 2212 (struct ieee80211_ie_athAdvCap *) ie;2202 (struct ieee80211_ie_athAdvCap *)ie; 2213 2203 2214 2204 ni->ni_ath_flags = athIe->athAdvCap_capability; … … 2282 2272 if (filter_type && ((vap->app_filter & filter_type) == filter_type)) { 2283 2273 struct sk_buff *skb1; 2284 struct ieee80211_node *tni;2285 2274 2286 2275 skb1 = skb_copy(skb, GFP_ATOMIC); … … 2296 2285 skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ 2297 2286 2298 tni = SKB_NI(skb1);2299 if (netif_rx(skb1) == NET_RX_DROP) {2300 /* If netif_rx dropped the packet because2301 * device was too busy */2302 if (tni != NULL) {2303 /* node reference was leaked */2304 ieee80211_unref_node(&tni);2305 }2306 vap->iv_devstats.rx_dropped++;2307 }2308 2287 vap->iv_devstats.rx_packets++; 2309 2288 vap->iv_devstats.rx_bytes += skb1->len; 2289 2290 2291 2292 2293 2310 2294 } 2311 2295 } … … 2315 2299 { 2316 2300 const struct ieee80211_ie_athAdvCap *athIe = 2317 (const struct ieee80211_ie_athAdvCap *) ie;2301 (const struct ieee80211_ie_athAdvCap *)ie; 2318 2302 2319 2303 ieee80211_saveie(&ni->ni_ath_ie, ie); … … 3046 3030 ni = vap->iv_bss; 3047 3031 3048 wh = (struct ieee80211_frame *) skb->data;3032 wh = (struct ieee80211_frame *)skb->data; 3049 3033 frm = (u_int8_t *)&wh[1]; 3050 3034 efrm = skb->data + skb->len; … … 3356 3340 */ 3357 3341 struct ieee80211_tim_ie *tim = 3358 (struct ieee80211_tim_ie *) scan.tim;3342 (struct ieee80211_tim_ie *)scan.tim; 3359 3343 int aid = IEEE80211_AID(ni->ni_associd); 3360 3344 int ix = aid / NBBY; … … 4148 4132 IEEE80211_DISCARD(vap, 4149 4133 IEEE80211_MSG_POWER | IEEE80211_MSG_DEBUG, 4150 (struct ieee80211_frame *) wh, "ps-poll",4134 (struct ieee80211_frame *)wh, "ps-poll", 4151 4135 "%s", "unassociated station"); 4152 4136 vap->iv_stats.is_ps_unassoc++; … … 4160 4144 IEEE80211_DISCARD(vap, 4161 4145 IEEE80211_MSG_POWER | IEEE80211_MSG_DEBUG, 4162 (struct ieee80211_frame *) wh, "ps-poll",4146 (struct ieee80211_frame *)wh, "ps-poll", 4163 4147 "aid mismatch: sta aid 0x%x poll aid 0x%x", 4164 4148 ni->ni_associd, aid); … … 4215 4199 4216 4200 memcpy(&eh_src, skb->data, sizeof(struct ether_header)); 4217 llc = (struct llc *) skb_pull(skb, sizeof(struct ether_header));4201 llc = (struct llc *)skb_pull(skb, sizeof(struct ether_header)); 4218 4202 eh_src.ether_type = llc->llc_un.type_snap.ether_type; 4219 4203 skb_pull(skb, LLC_SNAPFRAMELEN); 4220 4204 4221 eh_dst = (struct ether_header *) skb_push(skb, sizeof(struct ether_header));4205 eh_dst = (struct ether_header *)skb_push(skb, sizeof(struct ether_header)); 4222 4206 memcpy(eh_dst, &eh_src, sizeof(struct ether_header)); 4223 4207 … … 4262 4246 struct ieee80211_frame *wh; 4263 4247 struct ieee80211_key *key; 4264 int hdrspace; 4265 struct ieee80211com *ic = vap->iv_ic; 4248 int hdrlen; 4266 4249 4267 4250 if (skb->len < sizeof(struct ieee80211_frame_min)) { … … 4274 4257 4275 4258 wh = (struct ieee80211_frame *)skb->data; 4276 hdr space = ieee80211_hdrspace(ic,wh);4277 4278 key = ieee80211_crypto_decap(ni, skb, hdr space);4259 hdrwh); 4260 4261 key = ieee80211_crypto_decap(ni, skb, hdr); 4279 4262 if (key == NULL) { 4280 4263 /* NB: stats+msgs handled in crypto_decap */ 4281 4264 IEEE80211_NODE_STAT(ni, rx_wepfail); 4282 } else if (!ieee80211_crypto_demic(vap, key, skb, hdr space, 1)) {4265 } else if (!ieee80211_crypto_demic(vap, key, skb, hdr, 1)) { 4283 4266 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, 4284 4267 ni->ni_macaddr, "data", "%s", "demic error"); -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.c
r3617 r3722 137 137 #ifdef IEEE80211_DEBUG_REFCNT 138 138 ieee80211_getmgtframe_debug(u_int8_t **frm, u_int pktlen, 139 const char *func, int line)139 const char func, int line) 140 140 #else 141 141 ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen) … … 433 433 { 434 434 loff_t pos = *offset; 435 struct proc_ieee80211_priv *pv = (struct proc_ieee80211_priv *) file->private_data; 435 struct proc_ieee80211_priv *pv = 436 (struct proc_ieee80211_priv *)file->private_data; 436 437 437 438 if (!pv->rbuf) … … 486 487 loff_t pos = *offset; 487 488 struct proc_ieee80211_priv *pv = 488 (struct proc_ieee80211_priv *) file->private_data;489 (struct proc_ieee80211_priv *)file->private_data; 489 490 490 491 if (!pv->wbuf) … … 509 510 { 510 511 struct proc_ieee80211_priv *pv = 511 (struct proc_ieee80211_priv *) file->private_data;512 (struct proc_ieee80211_priv *)file->private_data; 512 513 if (pv->rbuf) 513 514 vfree(pv->rbuf); … … 959 960 void *ptr) 960 961 { 961 struct net_device *dev = (struct net_device *) ptr;962 struct net_device *dev = (struct net_device *)ptr; 962 963 if (!dev || dev->open != &ieee80211_open) 963 964 return 0; -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_linux.h
r3627 r3722 469 469 ieee80211_getmgtframe_debug(_ppfrm, _pktlen, __func__, __LINE__) 470 470 extern struct sk_buff * ieee80211_getmgtframe_debug(u_int8_t **frm, u_int pktlen, 471 const char *func, int line);471 const char func, int line); 472 472 #else 473 473 extern struct sk_buff * ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen); … … 613 613 #define IEEE80211_VLAN_TAG_USED 1 614 614 615 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)616 #define vlan_hwaccel_receive_skb(skb, grp, tag) vlan_hwaccel_rx(skb, grp, tag)617 #endif618 619 615 #ifndef VLAN_GROUP_ARRAY_PART_LEN 620 616 #define vlan_group_set_device(group, vid, dev) do { \ -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_monitor.c
r3666 r3722 130 130 struct ieee80211_phy_params *ph = &(SKB_CB(skb)->phy); 131 131 SKB_CB(skb)->flags = M_RAW; 132 SKB_NI(skb) = NULL;132 SKB_NI(skb) = ; 133 133 134 134 /* send at a static rate if it is configured */ … … 140 140 switch (skb->dev->type) { 141 141 case ARPHRD_IEEE80211: { 142 struct ieee80211_frame *wh = (struct ieee80211_frame *) skb->data;142 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data; 143 143 if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) 144 144 ph->try[0] = 1; … … 148 148 struct ieee80211_frame *wh = NULL; 149 149 struct wlan_ng_prism2_header *p2h = 150 (struct wlan_ng_prism2_header *) skb->data;150 (struct wlan_ng_prism2_header *)skb->data; 151 151 /* does it look like there is a prism header here? */ 152 152 if (skb->len > sizeof(struct wlan_ng_prism2_header) && … … 156 156 skb_pull(skb, sizeof(struct wlan_ng_prism2_header)); 157 157 } 158 wh = (struct ieee80211_frame *) skb->data;158 wh = (struct ieee80211_frame *)skb->data; 159 159 if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) 160 160 ph->try[0] = 1; … … 183 183 /* skip the chain of additional bitmaps following it_present */ 184 184 while (present_ext & (1 << IEEE80211_RADIOTAP_EXT)) { 185 if (p +4 > end) {185 if (p 4 > end) { 186 186 /* An extended bitmap would now follow, but there is 187 187 * no place for it. Stop parsing. */ … … 266 266 if (skb->len > ATHDESC_HEADER_SIZE) { 267 267 struct ar5212_openbsd_desc *desc = 268 (struct ar5212_openbsd_desc *) (skb->data + 8);268 (struct ar5212_openbsd_desc *)(skb->data + 8); 269 269 ph->power = desc->xmit_power; 270 270 ph->rate[0] = ratecode_to_dot11(desc->xmit_rate0); … … 303 303 u_int32_t rssi = 0; 304 304 u_int8_t pkttype = 0; 305 305 306 if (tx) { 306 307 rssi = bf->bf_dsstatus.ds_txstat.ts_rssi; … … 462 463 } 463 464 464 th = (struct ath_tx_radiotap_header *) skb_push(skb1,465 th = (struct ath_tx_radiotap_header *)skb_push(skb1, 465 466 sizeof(struct ath_tx_radiotap_header)); 466 467 memset(th, 0, sizeof(struct ath_tx_radiotap_header)); … … 491 492 } 492 493 493 th = (struct ath_rx_radiotap_header *) skb_push(skb1,494 th = (struct ath_rx_radiotap_header *)skb_push(skb1, 494 495 sizeof(struct ath_rx_radiotap_header)); 495 496 memset(th, 0, sizeof(struct ath_rx_radiotap_header)); … … 575 576 __constant_htons(0x0019); /* ETH_P_80211_RAW */ 576 577 577 if (netif_rx(skb1) == NET_RX_DROP) {578 /* If netif_rx dropped the packet because579 * device was too busy, reclaim the ref. in580 * the skb. */581 if (SKB_NI(skb1) != NULL)582 ieee80211_unref_node(&SKB_NI(skb1));583 vap->iv_devstats.rx_dropped++;584 }585 586 578 vap->iv_devstats.rx_packets++; 587 579 vap->iv_devstats.rx_bytes += skb1->len; 580 581 582 583 584 585 588 586 } 589 587 } -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.c
r3677 r3722 71 71 ieee80211_alloc_node_debug(_vap, _mac, __func__, __LINE__) 72 72 static struct ieee80211_node *ieee80211_alloc_node_debug(struct ieee80211vap *, 73 const u_int8_t *, const char *func, int line);73 const u_int8_t *, const char func, int line); 74 74 #else 75 75 static struct ieee80211_node *ieee80211_alloc_node(struct ieee80211vap *, … … 81 81 #ifdef IEEE80211_DEBUG_REFCNT 82 82 static struct ieee80211_node *node_alloc_debug(struct ieee80211vap *, 83 const char *func, int line);84 static void node_cleanup_debug(struct ieee80211_node *, const char *func,83 const char func, int line); 84 static void node_cleanup_debug(struct ieee80211_node *, const char func, 85 85 int line); 86 static void node_free_debug(struct ieee80211_node *, const char *func,86 static void node_free_debug(struct ieee80211_node *, const char func, 87 87 int line); 88 88 #else /* #ifdef IEEE80211_DEBUG_REFCNT */ … … 99 99 node_table_leave_locked_debug(_table, _node, __func__, __LINE__) 100 100 static void node_table_leave_locked_debug(struct ieee80211_node_table *, 101 struct ieee80211_node *, const char *func, int line);101 struct ieee80211_node *, const char func, int line); 102 102 #else 103 103 static void node_table_leave_locked(struct ieee80211_node_table *, … … 109 109 node_table_join_locked_debug(_table, _node, __func__, __LINE__) 110 110 static void node_table_join_locked_debug(struct ieee80211_node_table *, 111 struct ieee80211_node *, const char *func, int line);111 struct ieee80211_node *, const char func, int line); 112 112 #else 113 113 static void node_table_join_locked(struct ieee80211_node_table *, … … 297 297 298 298 void 299 ieee80211_create_ibss(struct ieee80211vap *vap, struct ieee80211_channel *chan)299 ieee80211_create_ibss(struct ieee80211vap vap, struct ieee80211_channel *chan) 300 300 { 301 301 struct ieee80211com *ic = vap->iv_ic; … … 672 672 ieee80211_sta_join1_tasklet(IEEE80211_TQUEUE_ARG data) 673 673 { 674 struct ieee80211vap *vap= (struct ieee80211vap *) data;674 struct ieee80211vap *vap= (struct ieee80211vap *)data; 675 675 int rc; 676 676 … … 785 785 #ifdef IEEE80211_DEBUG_REFCNT 786 786 node_table_join_locked_debug(struct ieee80211_node_table *nt, 787 struct ieee80211_node *ni, const char *func, int line)787 struct ieee80211_node *ni, const char func, int line) 788 788 #else 789 789 node_table_join_locked(struct ieee80211_node_table *nt, … … 811 811 #ifdef IEEE80211_DEBUG_REFCNT 812 812 node_table_leave_locked_debug(struct ieee80211_node_table *nt, 813 struct ieee80211_node *ni, const char *func, int line)813 struct ieee80211_node *ni, const char func, int line) 814 814 #else 815 815 node_table_leave_locked(struct ieee80211_node_table *nt, … … 839 839 static struct ieee80211_node * 840 840 #ifdef IEEE80211_DEBUG_REFCNT 841 node_alloc_debug(struct ieee80211vap *vap, const char *func, int line)841 node_alloc_debug(struct ieee80211vap *vap, const char func, int line) 842 842 #else 843 843 node_alloc(struct ieee80211vap *vap) … … 862 862 static void 863 863 #ifdef IEEE80211_DEBUG_REFCNT 864 node_cleanup_debug(struct ieee80211_node *ni, const char *func, int line)864 node_cleanup_debug(struct ieee80211_node *ni, const char func, int line) 865 865 #else 866 866 node_cleanup(struct ieee80211_node *ni) … … 928 928 const struct ieee80211_node *ni, 929 929 #ifdef IEEE80211_DEBUG_REFCNT 930 const char *func1, int line1,931 #endif 932 const char *func2, int line2,933 const char *message,930 const char func1, int line1, 931 #endif 932 const char func2, int line2, 933 const char message, 934 934 ...) 935 935 { … … 979 979 static void 980 980 #ifdef IEEE80211_DEBUG_REFCNT 981 node_free_debug(struct ieee80211_node *ni, const char *func, int line)981 node_free_debug(struct ieee80211_node *ni, const char func, int line) 982 982 #else 983 983 node_free(struct ieee80211_node *ni) … … 1028 1028 * specific purpose. 1029 1029 * Dont assume a BSS? 1030 * Allocates a new ieee80211_node*that has a reference1030 * Allocates a new that has a reference 1031 1031 * count of one, and adds it to the node table. 1032 1032 */ … … 1035 1035 ieee80211_alloc_node_table_debug(struct ieee80211vap *vap, 1036 1036 const u_int8_t *macaddr, 1037 const char *func, int line)1037 const char func, int line) 1038 1038 #else 1039 1039 ieee80211_alloc_node_table(struct ieee80211vap *vap, … … 1083 1083 static struct ieee80211_node * 1084 1084 #ifdef IEEE80211_DEBUG_REFCNT 1085 ieee80211_alloc_node_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, const char *func, int line)1085 ieee80211_alloc_node_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, const char func, int line) 1086 1086 #else 1087 1087 ieee80211_alloc_node(struct ieee80211vap *vap, const u_int8_t *macaddr) … … 1136 1136 ieee80211_add_wds_addr_debug(struct ieee80211_node_table *nt, 1137 1137 struct ieee80211_node *ni, const u_int8_t *macaddr, u_int8_t wds_static, 1138 const char *func, int line)1138 const char func, int line) 1139 1139 #else 1140 1140 ieee80211_add_wds_addr(struct ieee80211_node_table *nt, … … 1178 1178 #ifdef IEEE80211_DEBUG_REFCNT 1179 1179 ieee80211_remove_wds_addr_debug(struct ieee80211_node_table *nt, const u_int8_t *macaddr, 1180 const char *func, int line)1180 const char func, int line) 1181 1181 #else 1182 1182 ieee80211_remove_wds_addr(struct ieee80211_node_table *nt, const u_int8_t *macaddr) … … 1212 1212 #ifdef IEEE80211_DEBUG_REFCNT 1213 1213 ieee80211_del_wds_node_debug(struct ieee80211_node_table *nt, struct ieee80211_node *ni, 1214 const char *func, int line)1214 const char func, int line) 1215 1215 #else 1216 1216 ieee80211_del_wds_node(struct ieee80211_node_table *nt, struct ieee80211_node *ni) … … 1268 1268 1269 1269 /* Add the specified station to the station table. 1270 * Allocates a new ieee80211_node*that has a reference count of one1270 * Allocates a new that has a reference count of one 1271 1271 * If tmp is 0, it is added to the node table and the reference is used. 1272 1272 * If tmp is 1, then the caller gets to use the reference. */ … … 1274 1274 #ifdef IEEE80211_DEBUG_REFCNT 1275 1275 ieee80211_dup_bss_debug(struct ieee80211vap *vap, const u_int8_t *macaddr, 1276 unsigned char tmp, const char *func, int line)1276 unsigned char tmp, const char func, int line) 1277 1277 #else 1278 1278 ieee80211_dup_bss(struct ieee80211vap *vap, const u_int8_t *macaddr, … … 1315 1315 #ifdef IEEE80211_DEBUG_REFCNT 1316 1316 ieee80211_find_wds_node_locked_debug(struct ieee80211_node_table *nt, 1317 const u_int8_t *macaddr, const char *func, int line)1317 const u_int8_t *macaddr, const char func, int line) 1318 1318 #else 1319 1319 ieee80211_find_wds_node_locked(struct ieee80211_node_table *nt, … … 1390 1390 #ifdef IEEE80211_DEBUG_REFCNT 1391 1391 ieee80211_find_wds_node_debug(struct ieee80211_node_table *nt, const u_int8_t *macaddr, 1392 const char *func, int line)1392 const char func, int line) 1393 1393 #else 1394 1394 ieee80211_find_wds_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr) … … 1450 1450 ieee80211_fakeup_adhoc_node_debug(struct ieee80211vap *vap, 1451 1451 const u_int8_t macaddr[IEEE80211_ADDR_LEN], 1452 const char *func, int line)1452 const char func, int line) 1453 1453 #else 1454 1454 ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap, … … 1876 1876 ieee80211_node_timeout(unsigned long arg) 1877 1877 { 1878 struct ieee80211com *ic = (struct ieee80211com *) arg;1878 struct ieee80211com *ic = (struct ieee80211com *)arg; 1879 1879 1880 1880 ieee80211_scan_timeout(ic); … … 1955 1955 { 1956 1956 ieee80211_iterate_nodes(nt, 1957 (ieee80211_iter_func *) ieee80211_dump_node, nt);1957 (ieee80211_iter_func *)ieee80211_dump_node, nt); 1958 1958 } 1959 1959 … … 2170 2170 if (ni->ni_needed_chans != NULL) { 2171 2171 /* remove nodes which don't support one of ni->ni_needed_chans */ 2172 ieee80211_iterate_nodes(&ic->ic_sta, &remove_worse_nodes, (void *)ni);2172 ieee80211_iterate_nodes(&ic->ic_sta, &remove_worse_nodes, (void *)ni); 2173 2173 FREE(ni->ni_needed_chans, M_DEVBUF); 2174 2174 ni->ni_needed_chans = NULL; … … 2453 2453 struct ieee80211_node *ni = NULL; 2454 2454 if (pni == NULL) { 2455 printk(KERN_ERR "%s: NULL ieee80211_node **\n", __func__);2455 printk(KERN_ERR "%s: NULL ieee80211_node **\n", __func__); 2456 2456 dump_stack(); 2457 2457 return; … … 2459 2459 ni = *pni; 2460 2460 if (ni == NULL) { 2461 printk(KERN_ERR "%s: NULL ieee80211_node *\n", __func__);2461 printk(KERN_ERR "%s: NULL ieee80211_node *\n", __func__); 2462 2462 dump_stack(); 2463 2463 return; -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_node.h
r3677 r3722 135 135 u_int8_t ni_n_needed_chans; /* size of ni_needed_chans list */ 136 136 u_int16_t ni_txseqs[17]; /* tx seq per-tid */ 137 u_int16_t ni_rxseqs[17]; /* rx seq previous per-tid */137 u_int16_t ni_rxseqs[17]; /* rx seq previous per-tid */ 138 138 unsigned long ni_rxfragstamp; /* time stamp of last rx frag */ 139 139 struct sk_buff *ni_rxfrag; /* rx frag reassembly */ … … 256 256 }; 257 257 258 /* Allocates a new ieee80211_node * that has a reference count of one, and258 /* Allocates a new ieee80211_node * that has a reference count of one, and 259 259 * adds it to the node table. */ 260 260 #ifdef IEEE80211_DEBUG_REFCNT … … 262 262 ieee80211_alloc_node_table_debug(_vap, _mac, __func__, __LINE__) 263 263 struct ieee80211_node *ieee80211_alloc_node_table_debug(struct ieee80211vap *, 264 const u_int8_t *, const char *name, int line);264 const u_int8_t *, const char name, int line); 265 265 #else 266 266 struct ieee80211_node *ieee80211_alloc_node_table(struct ieee80211vap *, … … 268 268 #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ 269 269 270 /* Allocates a new ieee80211_node * that has a reference count.270 /* Allocates a new ieee80211_node * that has a reference count. 271 271 * If tmp is 0, it is added to the node table and the reference is used. 272 272 * If tmp is 1, then the caller gets to use the reference. */ … … 275 275 ieee80211_dup_bss_debug(_vap, _mac, _tmp, __func__, __LINE__) 276 276 struct ieee80211_node *ieee80211_dup_bss_debug(struct ieee80211vap *, 277 const u_int8_t *, unsigned char tmp, const char *, int);277 const u_int8_t *, unsigned char tmp, const char *, int); 278 278 #else 279 279 struct ieee80211_node *ieee80211_dup_bss(struct ieee80211vap *, … … 283 283 void ieee80211_node_reset(struct ieee80211_node *, struct ieee80211vap *); 284 284 285 /* Returns a ieee80211_node * with refcount incremented, if found */285 /* Returns a ieee80211_node * with refcount incremented, if found */ 286 286 #ifdef IEEE80211_DEBUG_REFCNT 287 287 #define ieee80211_find_node(_nt, _mac) \ … … 294 294 #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ 295 295 296 /* Returns a ieee80211_node * with refcount incremented, if found */296 /* Returns a ieee80211_node * with refcount incremented, if found */ 297 297 #ifdef IEEE80211_DEBUG_REFCNT 298 298 #define ieee80211_find_rxnode(_nt, _wh) \ … … 305 305 #endif /* #ifdef IEEE80211_DEBUG_REFCNT */ 306 306 307 /* Returns a ieee80211_node * with refcount incremented, if found */307 /* Returns a ieee80211_node * with refcount incremented, if found */ 308 308 #ifdef IEEE80211_DEBUG_REFCNT 309 309 #define ieee80211_find_txnode(_nt, _mac) \ … … 329 329 * which is locked seperately. Thus, we do not need to lock the follwoing 330 330 * functions. 331 * Increment the reference counter for ieee80211_node *331 * Increment the reference counter for ieee80211_node * 332 332 */ 333 333 #ifdef IEEE80211_DEBUG_REFCNT … … 351 351 } 352 352 353 /* Decrement ieee80211_node * refcount, and relinquish the pointer. */353 /* Decrement ieee80211_node * refcount, and relinquish the pointer. */ 354 354 #ifdef IEEE80211_DEBUG_REFCNT 355 355 #define ieee80211_unref_node(_pni) \ … … 367 367 ieee80211_add_wds_addr_debug(_table, _node, _mac, _static, __func__, __LINE__) 368 368 int ieee80211_add_wds_addr_debug(struct ieee80211_node_table *, struct ieee80211_node *, 369 const u_int8_t *, u_int8_t, const char *func, int line);369 const u_int8_t *, u_int8_t, const char func, int line); 370 370 #else 371 371 int ieee80211_add_wds_addr(struct ieee80211_node_table *, struct ieee80211_node *, … … 378 378 ieee80211_remove_wds_addr_debug(_table, _mac, __func__, __LINE__) 379 379 void ieee80211_remove_wds_addr_debug(struct ieee80211_node_table *, const u_int8_t *, 380 const char *func, int line);380 const char func, int line); 381 381 #else 382 382 void ieee80211_remove_wds_addr(struct ieee80211_node_table *, const u_int8_t *); … … 388 388 ieee80211_del_wds_node_debug(_table, _node, __func__, __LINE__) 389 389 void ieee80211_del_wds_node_debug(struct ieee80211_node_table *, struct ieee80211_node *, 390 const char *func, int line);390 const char func, int line); 391 391 #else 392 392 void ieee80211_del_wds_node(struct ieee80211_node_table *, struct ieee80211_node *); … … 398 398 ieee80211_find_wds_node_debug(_table, _mac, __func__, __LINE__) 399 399 struct ieee80211_node *ieee80211_find_wds_node_debug(struct ieee80211_node_table *, 400 const u_int8_t *, const char *func, int line);400 const u_int8_t *, const char func, int line); 401 401 #else 402 402 struct ieee80211_node *ieee80211_find_wds_node(struct ieee80211_node_table *, … … 416 416 ieee80211_fakeup_adhoc_node_debug(_vap, _mac, __func__, __LINE__) 417 417 struct ieee80211_node *ieee80211_fakeup_adhoc_node_debug(struct ieee80211vap *, 418 const u_int8_t macaddr[], const char *, int);418 const u_int8_t macaddr[], const char *, int); 419 419 #else 420 420 struct ieee80211_node *ieee80211_fakeup_adhoc_node(struct ieee80211vap *, -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_output.c
r3666 r3722 84 84 { 85 85 struct ieee80211vap *vap = ni->ni_vap; 86 struct ether_header *eh = (struct ether_header *) skb->data;86 struct ether_header *eh = (struct ether_header *)skb->data; 87 87 int v_wme_ac = 0, d_wme_ac = 0; 88 88 … … 899 899 */ 900 900 901 llc = (struct llc *) skb_push(skb, LLC_SNAPFRAMELEN);901 llc = (struct llc *)skb_push(skb, LLC_SNAPFRAMELEN); 902 902 llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; 903 903 llc->llc_control = LLC_UI; … … 907 907 llc->llc_snap.ether_type = eh.ether_type; 908 908 909 eh_inter = (struct ether_header *) skb_push(skb, sizeof(struct ether_header));909 eh_inter = (struct ether_header *)skb_push(skb, sizeof(struct ether_header)); 910 910 memcpy(eh_inter, &eh, sizeof(struct ether_header) - sizeof eh.ether_type); 911 911 eh_inter->ether_type = htons(payload); … … 915 915 * practically ever change. 916 916 */ 917 ffhdr = (struct athl2p_tunnel_hdr *) skb_push(skb, sizeof(struct athl2p_tunnel_hdr) + 2);917 ffhdr = (struct athl2p_tunnel_hdr *)skb_push(skb, sizeof(struct athl2p_tunnel_hdr) + 2); 918 918 memset(ffhdr, 0, sizeof(struct athl2p_tunnel_hdr) + 2); 919 919 … … 924 924 payload = skb2->len + LLC_SNAPFRAMELEN; 925 925 926 llc = (struct llc *) skb_push(skb2, LLC_SNAPFRAMELEN);926 llc = (struct llc *)skb_push(skb2, LLC_SNAPFRAMELEN); 927 927 if (llc == NULL) { 928 928 IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPG, … … 938 938 llc->llc_snap.ether_type = eh2.ether_type; 939 939 940 eh_inter = (struct ether_header *) skb_push(skb2, sizeof(struct ether_header));940 eh_inter = (struct ether_header *)skb_push(skb2, sizeof(struct ether_header)); 941 941 if (eh_inter == NULL) { 942 942 IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPG, … … 954 954 #endif 955 955 956 llc = (struct llc *) skb_push(skb, LLC_SNAPFRAMELEN);956 llc = (struct llc *)skb_push(skb, LLC_SNAPFRAMELEN); 957 957 llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; 958 958 llc->llc_control = LLC_UI; … … 977 977 datalen = skb->len; /* NB: w/o 802.11 header */ 978 978 979 wh = (struct ieee80211_frame *) skb_push(skb, hdrsize);979 wh = (struct ieee80211_frame *)skb_push(skb, hdrsize); 980 980 wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_DATA; 981 981 wh->i_dur = 0; … … 1032 1032 if (addqos) { 1033 1033 struct ieee80211_qosframe *qwh = 1034 (struct ieee80211_qosframe *) wh;1034 (struct ieee80211_qosframe *)wh; 1035 1035 u_int8_t *qos; 1036 1036 int tid; … … 1067 1067 1068 1068 if (key != NULL) { 1069 cip = (struct ieee80211_cipher *) key->wk_cipher;1069 cip = (struct ieee80211_cipher *)key->wk_cipher; 1070 1070 ciphdrsize = cip->ic_header; 1071 1071 tailsize += (cip->ic_trailer + cip->ic_miclen); … … 1128 1128 1129 1129 fragnum = 0; 1130 wh = twh = (struct ieee80211_frame *) skb->data;1130 wh = twh = (struct ieee80211_frame *)skb->data; 1131 1131 1132 1132 /* … … 1150 1150 * Copy WLAN header into each frag header skb 1151 1151 */ 1152 twh = (struct ieee80211_frame *) skb_put(tskb, hdrsize);1153 memcpy((void *) twh, (void *)wh, hdrsize);1152 twh = (struct ieee80211_frame *)skb_put(tskb, hdrsize); 1153 memcpy((void *)wh, hdrsize); 1154 1154 1155 1155 *(__le16 *)&twh->i_seq[0] |= … … 1171 1171 */ 1172 1172 pdu = skb_put(tskb, pdulen); 1173 memcpy(pdu, (void *) skb->data+offset, pdulen);1173 memcpy(pdu, (void *) offset, pdulen); 1174 1174 1175 1175 offset += pdusize; … … 1529 1529 { 1530 1530 static const u_int8_t oui[4] = { WME_OUI_BYTES, WME_OUI_TYPE }; 1531 struct ieee80211_ie_wme *ie = (struct ieee80211_ie_wme *) frm;1531 struct ieee80211_ie_wme *ie = (struct ieee80211_ie_wme *)frm; 1532 1532 struct ieee80211_wme_state *wme = &ni->ni_ic->ic_wme; 1533 1533 struct ieee80211vap *vap = ni->ni_vap; … … 1573 1573 } while (0) 1574 1574 static const u_int8_t oui[4] = { WME_OUI_BYTES, WME_OUI_TYPE }; 1575 struct ieee80211_wme_param *ie = (struct ieee80211_wme_param *) frm;1575 struct ieee80211_wme_param *ie = (struct ieee80211_wme_param *)frm; 1576 1576 int i; 1577 1577 … … 1614 1614 ((ATH_OUI >> 16) & 0xff), ATH_OUI_TYPE, 1615 1615 ATH_OUI_SUBTYPE, ATH_OUI_VERSION}; 1616 struct ieee80211_ie_athAdvCap *ie = (struct ieee80211_ie_athAdvCap *) frm;1616 struct ieee80211_ie_athAdvCap *ie = (struct ieee80211_ie_athAdvCap *)frm; 1617 1617 1618 1618 *frm++ = IEEE80211_ELEMID_VENDOR; … … 1640 1640 ((ATH_OUI >> 16) & 0xff), ATH_OUI_TYPE_XR, 1641 1641 ATH_OUI_SUBTYPE_XR, ATH_OUI_VER_XR}; 1642 struct ieee80211_xr_param *ie = (struct ieee80211_xr_param *) frm;1642 struct ieee80211_xr_param *ie = (struct ieee80211_xr_param *)frm; 1643 1643 1644 1644 *frm++ = IEEE80211_ELEMID_VENDOR; … … 2208 2208 skb->priority = WME_AC_VO; 2209 2209 2210 wh = (struct ieee80211_ctlframe_addr2 *) skb_put(skb, sizeof(struct ieee80211_ctlframe_addr2));2210 wh = (struct ieee80211_ctlframe_addr2 *)skb_put(skb, sizeof(struct ieee80211_ctlframe_addr2)); 2211 2211 2212 2212 wh->i_aidordur = htole16(0xc000 | IEEE80211_NODE_AID(ni)); -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_power.c
r3666 r3722 225 225 #ifdef IEEE80211_DEBUG 226 226 if (ieee80211_msg_dumppkts(vap)) 227 ieee80211_dump_pkt(ni->ni_ic, skb->data, skb->len, -1, -1); 227 ieee80211_dump_pkt(ni->ni_ic, skb->data, 228 skb->len, -1, -1, 1); 228 229 #endif 229 230 if (SKB_NI(skb) != NULL) -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.c
r3680 r3722 314 314 315 315 void 316 ieee80211_dump_pkt(struct ieee80211com *ic, 317 const u_int8_t *buf, int len, int rate, int rssi)316 ieee80211_dump_pkt(struct ieee80211com *ic, 317 ) 318 318 { 319 319 const struct ieee80211_frame *wh; … … 366 366 int off; 367 367 368 off = ieee80211_anyhdrspace(ic, wh); 368 if (tx) 369 off = ieee80211_anyhdrspace(ic, wh); 370 else 371 off = ieee80211_anyhdrsize(wh); 369 372 printk(" Prot. [IV %.02x %.02x %.02x", 370 373 buf[off + 0], buf[off + 1], buf[off + 2]); … … 1237 1240 ieee80211_sta_swbmiss(unsigned long arg) 1238 1241 { 1239 struct ieee80211vap *vap = (struct ieee80211vap *) arg;1242 struct ieee80211vap *vap = (struct ieee80211vap *)arg; 1240 1243 ieee80211_beacon_miss(vap->iv_ic); 1241 1244 } … … 1248 1251 ieee80211_tx_timeout(unsigned long arg) 1249 1252 { 1250 struct ieee80211vap *vap = (struct ieee80211vap *) arg;1253 struct ieee80211vap *vap = (struct ieee80211vap *)arg; 1251 1254 1252 1255 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, … … 1697 1700 1698 1701 static void 1699 dump_vap_states(struct ieee80211com *ic, struct ieee80211vap *highlighed)1702 dump_vap_states(struct ieee80211com *ic, struct ieee80211vap highlighed) 1700 1703 { 1701 1704 /* RE-count the number of VAPs in RUN, SCAN states */ -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_proto.h
r3634 r3722 253 253 void ieee80211_print_essid(const u_int8_t *, int); 254 254 #ifdef IEEE80211_DEBUG 255 void ieee80211_dump_pkt(struct ieee80211com *, const u_int8_t *, int, int, int); 255 void ieee80211_dump_pkt(struct ieee80211com *, const u_int8_t *, 256 int, int, int, int); 256 257 #else 257 258 #define ieee80211_dump_pkt(...) -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan.c
r3627 r3722 69 69 struct timer_list ss_scan_timer; /* scan timer */ 70 70 }; 71 #define SCAN_PRIVATE( ss) ((struct scan_state *) ss)71 #define SCAN_PRIVATE() 72 72 73 73 /* … … 91 91 #define ROAM_RSSI_11B_DEFAULT 9 /* rssi threshold for 11b bss */ 92 92 #define ROAM_RSSI_11BONLY_DEFAULT 9 /* rssi threshold for 11b-only bss */ 93 #define ROAM_RATE_11A_DEFAULT 2 *24 /* tx rate threshold for 11a bss */94 #define ROAM_RATE_11B_DEFAULT 2 *9 /* tx rate threshold for 11b bss */95 #define ROAM_RATE_11BONLY_DEFAULT 2 *5 /* tx rate threshold for 11b-only bss */93 #define ROAM_RATE_11A_DEFAULT 2 24 /* tx rate threshold for 11a bss */ 94 #define ROAM_RATE_11B_DEFAULT 2 9 /* tx rate threshold for 11b bss */ 95 #define ROAM_RATE_11BONLY_DEFAULT 2 5 /* tx rate threshold for 11b-only bss */ 96 96 97 97 static void scan_restart_pwrsav(unsigned long); … … 287 287 scan_restart_pwrsav(unsigned long arg) 288 288 { 289 struct scan_state *ss = (struct scan_state *) arg;289 struct scan_state *ss = (struct scan_state *)arg; 290 290 struct ieee80211vap *vap = ss->base.ss_vap; 291 291 struct ieee80211com *ic = vap->iv_ic; … … 631 631 { 632 632 #define ISCAN_REP (ISCAN_MINDWELL | ISCAN_START | ISCAN_DISCARD) 633 struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg;633 struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *)arg; 634 634 struct ieee80211vap *vap = ss->ss_vap; 635 635 struct ieee80211com *ic = vap->iv_ic; -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_scan_sta.c
r3520 r3722 285 285 if (sp->tim != NULL) { 286 286 const struct ieee80211_tim_ie *tim = 287 (const struct ieee80211_tim_ie *)sp->tim;287 sp->tim; 288 288 ise->se_dtimperiod = tim->tim_period; 289 289 } … … 951 951 */ 952 952 static struct sta_entry * 953 sta_lookup(struct sta_table *st, const u_int8_t macaddr[IEEE80211_ADDR_LEN], struct ieee80211_scan_ssid* essid) 953 sta_lookup(struct sta_table *st, const u_int8_t macaddr[IEEE80211_ADDR_LEN], 954 struct ieee80211_scan_ssid *essid) 954 955 { 955 956 struct sta_entry *se; -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.c
r3666 r3722 83 83 #undef skb_share_check 84 84 #undef skb_unshare 85 #undef vlan_hwaccel_r eceive_skb85 #undef vlan_hwaccel_r 86 86 87 87 atomic_t skb_total_counter = ATOMIC_INIT(0); … … 101 101 const struct sk_buff *skb, 102 102 #ifdef IEEE80211_DEBUG_REFCNT 103 const char *func1, int line1,104 #endif 105 const char *func2, int line2,106 const char *message,103 const char func1, int line1, 104 #endif 105 const char func2, int line2, 106 const char message, 107 107 ...) 108 108 { … … 147 147 print_skb_refchange_message( 148 148 const struct sk_buff *skb, int users_adjustment, 149 const char *func1, int line1,150 const char *func2, int line2);149 const char func1, int line1, 150 const char func2, int line2); 151 151 static void 152 152 print_skb_trackchange_message( 153 153 const struct sk_buff *skb, int users_adjustment, 154 const char *func1, int line1,155 const char *func2, int line2,156 char *message);154 const char func1, int line1, 155 const char func2, int line2, 156 char message); 157 157 158 158 /* Called automatically when an SKB reaches zero users, 159 159 * reporting any leaked node references. */ 160 160 #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST 161 static void skb_destructor(struct sk_buff *skb);162 #endif 163 static void get_skb_description(char *dst, int dst_size, const char *label, const struct sk_buff *skb, int users_adjustment);161 static void skb_destructor(struct sk_buff skb); 162 #endif 163 static void get_skb_description(char *dst, int dst_size, const char label, const struct sk_buff *skb, int users_adjustment); 164 164 165 165 static struct sk_buff * … … 168 168 static struct sk_buff * 169 169 track_skb(struct sk_buff *skb, int users_adjustment, 170 const char *func1, int line1,171 const char *func2, int line2);170 const char func1, int line1, 171 const char func2, int line2); 172 172 173 173 static struct sk_buff * 174 174 untrack_skb(struct sk_buff *skb, int users_adjustment, 175 const char *func1, int line1,176 const char *func2, int line2);175 const char func1, int line1, 176 const char func2, int line2); 177 177 178 178 #define UNREF_USE_KFREE_SKB 0 … … 184 184 * count as (users - 1). */ 185 185 static void unref_skb(struct sk_buff *skb, int type, 186 const char *func1, int line1,187 const char *func2, int line2);186 const char func1, int line1, 187 const char func2, int line2); 188 188 189 189 /* Assumes SKB reference counter has already been updated and reports count as … … 191 191 static struct sk_buff * 192 192 ref_skb(struct sk_buff *skb, 193 const char *func1, int line1,194 const char *func2, int line2);193 const char func1, int line1, 194 const char func2, int line2); 195 195 196 196 197 197 #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST 198 198 /* Destructor for reporting node reference leaks */ 199 static void skb_destructor(struct sk_buff *skb) {199 static void skb_destructor(struct sk_buff skb) { 200 200 /* Report any node reference leaks - caused by kernel net device queue 201 201 * dropping buffer, rather than passing it to the driver. */ … … 214 214 #endif /* #ifdef IEEE80211_DEBUG_REFCNT_SKBDEST */ 215 215 216 static void get_skb_description(char *dst, int dst_size, const char *label, const struct sk_buff *skb, int users_adjustment) {216 static void get_skb_description(char *dst, int dst_size, const char label, const struct sk_buff *skb, int users_adjustment) { 217 217 dst[0] = '\0'; 218 218 if (NULL != skb) { … … 249 249 static void print_skb_refchange_message( 250 250 const struct sk_buff *skb, int users_adjustment, 251 const char *func1, int line1,252 const char *func2, int line2)251 const char func1, int line1, 252 const char func2, int line2) 253 253 { 254 254 char skb_desc[128] = { '\0' }; … … 264 264 static void print_skb_trackchange_message( 265 265 const struct sk_buff *skb, int users_adjustment, 266 const char *func1, int line1,267 const char *func2, int line2,268 char *message)266 const char func1, int line1, 267 const char func2, int line2, 268 char message) 269 269 { 270 270 char skb_desc[128] = { '\0' }; … … 287 287 static struct sk_buff * 288 288 track_skb(struct sk_buff *skb, int users_adjustment, 289 const char *func1, int line1,290 const char *func2, int line2)289 const char func1, int line1, 290 const char func2, int line2) 291 291 { 292 292 if (NULL == skb) { … … 327 327 static struct sk_buff * 328 328 untrack_skb(struct sk_buff *skb, int users_adjustment, 329 const char *func1, int line1,330 const char *func2, int line2)329 const char func1, int line1, 330 const char func2, int line2) 331 331 { 332 332 if (NULL == skb) { … … 374 374 static void 375 375 unref_skb(struct sk_buff *skb, int type, 376 const char *func1, int line1,377 const char *func2, int line2)376 const char func1, int line1, 377 const char func2, int line2) 378 378 { 379 379 if (NULL == skb) { … … 454 454 static struct sk_buff * 455 455 ref_skb(struct sk_buff *skb, 456 const char *func1, int line1,457 const char *func2, int line2)456 const char func1, int line1, 457 const char func2, int line2) 458 458 { 459 459 if (NULL == skb) { … … 487 487 * - Break the linked list, clearing next skb's prev pointer if possible. */ 488 488 #ifdef IEEE80211_DEBUG_REFCNT 489 void ieee80211_dev_kfree_skb_debug(struct sk_buff ** pskb, const char*func, int line)490 #else 491 void ieee80211_dev_kfree_skb(struct sk_buff **pskb)489 void ieee80211_dev_kfree_skb_debug(struct sk_buff func, int line) 490 #else 491 void ieee80211_dev_kfree_skb(struct sk_buff pskb) 492 492 #endif 493 493 { … … 528 528 #ifdef IEEE80211_DEBUG_REFCNT 529 529 void 530 ieee80211_dev_kfree_skb_list_debug(struct sk_buff ** pskb, const char*func, int line)530 ieee80211_dev_kfree_skb_list_debug(struct sk_buff func, int line) 531 531 #else 532 532 void 533 ieee80211_dev_kfree_skb_list(struct sk_buff **pskb)533 ieee80211_dev_kfree_skb_list(struct sk_buff pskb) 534 534 #endif 535 535 { … … 555 555 556 556 #ifdef IEEE80211_DEBUG_REFCNT 557 struct sk_buff *558 ieee80211_dev_alloc_skb_debug(int size, const char *func, int line)559 #else 560 struct sk_buff *557 struct sk_buff * 558 ieee80211_dev_alloc_skb_debug(int size, const char func, int line) 559 #else 560 struct sk_buff * 561 561 ieee80211_dev_alloc_skb(int size) 562 562 #endif … … 585 585 #ifdef IEEE80211_DEBUG_REFCNT 586 586 void 587 ieee80211_skb_track_debug(struct sk_buff *skb, const char *func, int line) {587 ieee80211_skb_track_debug(struct sk_buff *skb, const char func, int line) { 588 588 track_skb(skb, 0 /* users_adjustment */, 589 589 func, line, __func__, __LINE__); … … 599 599 #ifdef IEEE80211_DEBUG_REFCNT 600 600 void 601 ieee80211_skb_untrack_debug(struct sk_buff *skb, const char *func, int line) {601 ieee80211_skb_untrack_debug(struct sk_buff *skb, const char func, int line) { 602 602 untrack_skb(skb, 0 /* users_adjustment */, 603 603 func, line, __func__, __LINE__); … … 631 631 #ifdef IEEE80211_DEBUG_REFCNT 632 632 633 int vlan_hwaccel_r eceive_skb_debug(struct sk_buff *skb,633 int vlan_hwaccel_r_debug(struct sk_buff *skb, 634 634 struct vlan_group *grp, unsigned short vlan_tag, 635 const char *func, int line) {636 return vlan_hwaccel_r eceive_skb(635 const char func, int line) { 636 return vlan_hwaccel_r( 637 637 untrack_skb(skb, 0, func, line, __func__, __LINE__), 638 638 grp, vlan_tag); 639 639 } 640 640 641 int netif_rx_debug(struct sk_buff *skb, const char *func, int line) {641 int netif_rx_debug(struct sk_buff *skb, const char func, int line) { 642 642 return netif_rx(untrack_skb(skb, 0, func, line, __func__, __LINE__)); 643 643 } … … 726 726 727 727 void kfree_skb_fast_debug(struct sk_buff *skb, 728 const char *func, int line)728 const char func, int line) 729 729 { 730 730 /* NOT so fast... */ … … 760 760 } 761 761 762 EXPORT_SYMBOL(vlan_hwaccel_r eceive_skb_debug);762 EXPORT_SYMBOL(vlan_hwaccel_r_debug); 763 763 EXPORT_SYMBOL(netif_rx_debug); 764 764 EXPORT_SYMBOL(alloc_skb_debug); -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_skb.h
r3666 r3722 67 67 * timed out. We reuse the hardware checksum field in the 68 68 * mbuf packet header to store this data. 69 * XXX: use private cbarea. */69 * XXX: use private area. */ 70 70 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 71 71 #define skb_age csum_offset … … 85 85 #define ieee80211_dev_kfree_skb(_pskb) \ 86 86 ieee80211_dev_kfree_skb_debug(_pskb, __func__, __LINE__) 87 void ieee80211_dev_kfree_skb_debug(struct sk_buff ** pskb, const char*func, int line);88 #else 89 void ieee80211_dev_kfree_skb(struct sk_buff **pskb);87 void ieee80211_dev_kfree_skb_debug(struct sk_buff func, int line); 88 #else 89 void ieee80211_dev_kfree_skb(struct sk_buff pskb); 90 90 #endif 91 91 … … 97 97 } 98 98 99 /* 100 * ieee80211_dev_kfree_skb_list will invoke ieee80211_dev_kfree_skb on each node in 101 * a list of skbs, starting with the first. 102 */ 99 /* ieee80211_dev_kfree_skb_list will invoke ieee80211_dev_kfree_skb on each node in 100 * a list of skbs, starting with the first. */ 103 101 #ifdef IEEE80211_DEBUG_REFCNT 104 102 #define ieee80211_dev_kfree_skb_list(_pskb) \ 105 103 ieee80211_dev_kfree_skb_list_debug(_pskb, __func__, __LINE__) 106 void ieee80211_dev_kfree_skb_list_debug(struct sk_buff ** pskb, const char*func, int line);107 #else 108 void ieee80211_dev_kfree_skb_list(struct sk_buff **pskb);104 void ieee80211_dev_kfree_skb_list_debug(struct sk_buff func, int line); 105 #else 106 void ieee80211_dev_kfree_skb_list(struct sk_buff pskb); 109 107 #endif 110 108 … … 112 110 #define ieee80211_dev_alloc_skb(_size) \ 113 111 ieee80211_dev_alloc_skb_debug(_size, __func__, __LINE__) 114 struct sk_buff * ieee80211_dev_alloc_skb_debug(int size, const char*func, int line);115 #else 116 struct sk_buff *ieee80211_dev_alloc_skb(int size);112 struct sk_buff func, int line); 113 #else 114 struct sk_buff ieee80211_dev_alloc_skb(int size); 117 115 #endif 118 116 … … 123 121 ieee80211_skb_untrack_debug(_skb, __func__, __LINE__) 124 122 void ieee80211_skb_track_debug(struct sk_buff *skb, 125 const char *func, int line);123 const char func, int line); 126 124 void ieee80211_skb_untrack_debug(struct sk_buff *skb, 127 const char *func, int line);125 const char func, int line); 128 126 #else 129 127 void ieee80211_skb_track(struct sk_buff *skb); … … 145 143 #ifdef IEEE80211_DEBUG_REFCNT 146 144 147 int vlan_hwaccel_receive_skb_debug(struct sk_buff *skb, 148 struct vlan_group *grp, unsigned short vlan_tag, 149 const char* func, int line); 150 int netif_rx_debug(struct sk_buff *skb, const char* func, int line); 151 struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask, 152 const char *func, int line); 153 struct sk_buff * dev_alloc_skb_debug(unsigned int length, 154 const char *func, int line); 155 struct sk_buff * skb_clone_debug(struct sk_buff *skb, gfp_t pri, 156 const char *func, int line); 157 struct sk_buff * skb_copy_debug(struct sk_buff *skb, gfp_t pri, 158 const char *func, int line); 159 struct sk_buff * skb_get_debug(struct sk_buff *skb, 160 const char *func, int line); 161 struct sk_buff * skb_realloc_headroom_debug(struct sk_buff *skb, unsigned int headroom, 162 const char *func, int line); 163 struct sk_buff * pskb_copy_debug(struct sk_buff *skb, gfp_t pri, 164 const char *func, int line); 145 int vlan_hwaccel_rx_debug(struct sk_buff *skb, struct vlan_group *grp, 146 unsigned short vlan_tag, const char *func, int line); 147 int netif_rx_debug(struct sk_buff *skb, const char *func, int line); 148 struct sk_buff *alloc_skb_debug(unsigned int length, gfp_t gfp_mask, 149 const char *func, int line); 150 struct sk_buff *dev_alloc_skb_debug(unsigned int length, 151 const char *func, int line); 152 struct sk_buff *skb_clone_debug(struct sk_buff *skb, gfp_t pri, 153 const char *func, int line); 154 struct sk_buff *skb_copy_debug(struct sk_buff *skb, gfp_t pri, 155 const char *func, int line); 156 struct sk_buff *skb_get_debug(struct sk_buff *skb, 157 const char *func, int line); 158 struct sk_buff *skb_realloc_headroom_debug(struct sk_buff *skb, unsigned int headroom, 159 const char *func, int line); 160 struct sk_buff *pskb_copy_debug(struct sk_buff *skb, gfp_t pri, 161 const char *func, int line); 165 162 int dev_queue_xmit_debug(struct sk_buff *skb, 166 167 struct sk_buff * skb_share_check_debug(struct sk_buff *skb, gfp_t pri,168 169 void kfree_skb_fast_debug(struct sk_buff *skb,170 const char*func, int line);171 struct sk_buff * skb_unshare_debug(struct sk_buff *skb, gfp_t pri,172 173 struct sk_buff * skb_copy_expand_debug(const struct sk_buff *skb, int newheadroom,174 175 163 const char *func, int line); 164 struct sk_buff *skb_share_check_debug(struct sk_buff *skb, gfp_t pri, 165 const char *func, int line); 166 void kfree_skb_fast_debug(struct sk_buff *skb, 167 func, int line); 168 struct sk_buff *skb_unshare_debug(struct sk_buff *skb, gfp_t pri, 169 const char *func, int line); 170 struct sk_buff *skb_copy_expand_debug(const struct sk_buff *skb, int newheadroom, 171 int newtailroom, gfp_t gfp_mask, 172 const char *func, int line); 176 173 177 174 #undef alloc_skb … … 192 189 #undef skb_share_check 193 190 #undef skb_unshare 194 #undef vlan_hwaccel_r eceive_skb191 #undef vlan_hwaccel_r 195 192 196 193 #define skb_unshare(_skb, _pri) \ … … 198 195 #define skb_copy_expand(_skb, _newheadroom, _newtailroom, _gfp_mask) \ 199 196 skb_copy_expand_debug(_skb, _newheadroom, _newtailroom, _gfp_mask, __func__, __LINE__) 200 #define vlan_hwaccel_r eceive_skb(_skb, _grp, _tag) \201 vlan_hwaccel_r eceive_skb_debug(_skb, _grp, _tag, __func__, __LINE__)197 #define vlan_hwaccel_r(_skb, _grp, _tag) \ 198 vlan_hwaccel_r_debug(_skb, _grp, _tag, __func__, __LINE__) 202 199 #define netif_rx(_skb) \ 203 200 netif_rx_debug(_skb, __func__, __LINE__) -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_var.h
r3677 r3722 88 88 89 89 #define IEEE80211_BGSCAN_INTVAL_MIN 15 /* min bg scan intvl (secs) */ 90 #define IEEE80211_BGSCAN_INTVAL_DEFAULT (5 *60) /* default bg scan intvl*/90 #define IEEE80211_BGSCAN_INTVAL_DEFAULT (5 */ 91 91 92 92 #define IEEE80211_BGSCAN_IDLE_MIN 100 /* min idle time (ms) */ … … 240 240 u_int16_t iv_ps_sta; /* stations in power save */ 241 241 u_int16_t iv_ps_pending; /* PS STAs w/ pending frames */ 242 u_int8_t *iv_tim_bitmap; /* power-save stations w/ data */242 u_int8_t *iv_tim_bitmap; /* power-save stations w/ data */ 243 243 u_int16_t iv_tim_len; /* ic_tim_bitmap size (bytes) */ 244 244 u_int8_t iv_dtim_period; /* DTIM period */ … … 318 318 u_int8_t ic_ath_cap; /* Atheros adv. capabilities */ 319 319 u_int8_t ic_promisc; /* VAPs needing promisc mode */ 320 u_int8_t ic_allmulti; /* VAPs needing all multicast */320 u_int8_t ic_allmulti; /* VAPs needing all multicast */ 321 321 u_int8_t ic_nopened; /* VAPs been opened */ 322 322 struct ieee80211_rateset ic_sup_rates[IEEE80211_MODE_MAX]; … … 377 377 * y associated STAs in total), the number of common channel 378 378 * increases by z, then such an action is performed if 379 * 1000 *x/y < z*ic_sc_slcg379 * 1000 ic_sc_slcg 380 380 * ic_sc_sldg is the permil of Stations Lost per rssi Db Gained, the 381 381 * parameter used by SC_LOOSE algorithm. If due to the switch, … … 383 383 * decrease by z decibels and x stations from the set of y stations 384 384 * would be lost, then such a switch will be performed if 385 * 1000 *x/y < z*ic_sc_sldg385 * 1000 ic_sc_sldg 386 386 * ic_sc_ie is the Supported Channels IE that is about to be sent along 387 387 * with (re)assoc requests (STA mode) … … 467 467 #ifdef IEEE80211_DEBUG_REFCNT 468 468 struct ieee80211_node *(*ic_node_alloc_debug)(struct ieee80211vap *, 469 const char *func, int line);469 const char func, int line); 470 470 void (*ic_node_cleanup_debug)(struct ieee80211_node *, 471 const char *func, int line);471 const char func, int line); 472 472 void (*ic_node_free_debug)(struct ieee80211_node *, 473 const char *func, int line);473 const char func, int line); 474 474 #else 475 475 struct ieee80211_node *(*ic_node_alloc)(struct ieee80211vap *); -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/ieee80211_wireless.c
r3525 r3722 167 167 */ 168 168 static int 169 getiwkeyix(struct ieee80211vap *vap, const struct iw_point *erq, ieee80211_keyix_t *rkix)169 getiwkeyix(struct ieee80211vap *vap, const struct iw_point erq, ieee80211_keyix_t *rkix) 170 170 { 171 171 ieee80211_keyix_t kix; … … 913 913 struct ieee80211com *ic = vap->iv_ic; 914 914 struct ieee80211_node *ni = vap->iv_bss; 915 struct iw_range *range = (struct iw_range *) extra;915 struct iw_range *range = (struct iw_range *)extra; 916 916 struct ieee80211_rateset *rs; 917 917 u_int8_t reported[IEEE80211_CHAN_BYTES]; /* XXX stack usage? */ … … 1101 1101 int i; 1102 1102 1103 address = (struct sockaddr *) extra;1104 spy_stat = (struct iw_quality *) (extra + number * sizeof(struct sockaddr));1103 address = (struct sockaddr *)extra; 1104 spy_stat = (struct iw_quality *)(extra + number * sizeof(struct sockaddr)); 1105 1105 1106 1106 for (i = 0; i < number; i++) { … … 1185 1185 struct iw_thrspy *threshold; 1186 1186 1187 threshold = (struct iw_thrspy *) extra;1187 threshold = (struct iw_thrspy *)extra; 1188 1188 1189 1189 /* set threshold values */ … … 1432 1432 struct iw_request_info *info, void *w, char *extra) 1433 1433 { 1434 int *params = (int *)extra;1434 int *params = (int extra; 1435 1435 struct ieee80211vap *vap = dev->priv; 1436 1436 struct ieee80211com *ic = vap->iv_ic; … … 1443 1443 struct iw_request_info *info, void *w, char *extra) 1444 1444 { 1445 int *params = (int *)extra;1445 int *params = (int extra; 1446 1446 struct ieee80211vap *vap = dev->priv; 1447 1447 struct ieee80211com *ic = vap->iv_ic; … … 1454 1454 struct iw_request_info *info, void *w, char *extra) 1455 1455 { 1456 int *params = (int *)extra;1456 int *params = (int extra; 1457 1457 struct ieee80211vap *vap = dev->priv; 1458 1458 struct ieee80211com *ic = vap->iv_ic; … … 1464 1464 struct iw_request_info *info, void *w, char *extra) 1465 1465 { 1466 int *params = (int *)extra;1466 int *params = (int extra; 1467 1467 struct ieee80211vap *vap = dev->priv; 1468 1468 struct ieee80211com *ic = vap->iv_ic; … … 1474 1474 struct iw_request_info *info, void *w, char *extra) 1475 1475 { 1476 int *params = (int *)extra;1476 int *params = (int extra; 1477 1477 struct ieee80211vap *vap = dev->priv; 1478 1478 struct ieee80211com *ic = vap->iv_ic; … … 1485 1485 struct iw_request_info *info, void *w, char *extra) 1486 1486 { 1487 int *params = (int *)extra;1487 int *params = (int extra; 1488 1488 struct ieee80211vap *vap = dev->priv; 1489 1489 struct ieee80211com *ic = vap->iv_ic; … … 1496 1496 struct iw_request_info *info, void *w, char *extra) 1497 1497 { 1498 int *params = (int *)extra;1498 int *params = (int extra; 1499 1499 struct ieee80211vap *vap = dev->priv; 1500 1500 struct ieee80211com *ic = vap->iv_ic; … … 1507 1507 void *w, char *extra) 1508 1508 { 1509 int *params = (int *)extra;1509 int *params = (int extra; 1510 1510 struct ieee80211vap *vap = dev->priv; 1511 1511 struct ieee80211com *ic = vap->iv_ic; … … 1518 1518 struct iw_request_info *info, void *w, char *extra) 1519 1519 { 1520 int *params = (int *)extra;1520 int *params = (int extra; 1521 1521 struct ieee80211vap *vap = dev->priv; 1522 1522 struct ieee80211com *ic = vap->iv_ic; … … 1529 1529 struct iw_request_info *info, void *w, char *extra) 1530 1530 { 1531 int *params = (int *)extra;1531 int *params = (int extra; 1532 1532 struct ieee80211vap *vap = dev->priv; 1533 1533 struct ieee80211com *ic = vap->iv_ic; … … 1540 1540 struct iw_request_info *info, void *w, char *extra) 1541 1541 { 1542 int *params = (int *)extra;1542 int *params = (int extra; 1543 1543 struct ieee80211vap *vap = dev->priv; 1544 1544 struct ieee80211com *ic = vap->iv_ic; … … 1551 1551 struct iw_request_info *info, void *w, char *extra) 1552 1552 { 1553 int *params = (int *)extra;1553 int *params = (int extra; 1554 1554 struct ieee80211vap *vap = dev->priv; 1555 1555 struct ieee80211com *ic = vap->iv_ic; … … 1562 1562 void *w, char *extra) 1563 1563 { 1564 int *params = (int *)extra;1564 int *params = (int extra; 1565 1565 struct ieee80211vap *vap = dev->priv; 1566 1566 struct ieee80211com *ic = vap->iv_ic; … … 1574 1574 void *w, char *extra) 1575 1575 { 1576 int *params = (int *)extra;1576 int *params = (int extra; 1577 1577 struct ieee80211vap *vap = dev->priv; 1578 1578 struct ieee80211com *ic = vap->iv_ic; … … 1601 1601 ieee80211_dump_registers(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) 1602 1602 { 1603 unsigned int *params = (unsigned int *)extra;1603 unsigned int *params = (unsigned int extra; 1604 1604 struct ieee80211vap *vap = dev->priv; 1605 1605 struct ieee80211com *ic = vap->iv_ic; … … 1624 1624 ieee80211_ioctl_writereg(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) 1625 1625 { 1626 unsigned int *params = (unsigned int *)extra;1626 unsigned int *params = (unsigned int extra; 1627 1627 struct ieee80211vap *vap = dev->priv; 1628 1628 struct ieee80211com *ic = vap->iv_ic; … … 1635 1635 ieee80211_ioctl_readreg(struct net_device *dev, struct iw_request_info *info, void *w, char *extra) 1636 1636 { 1637 unsigned int *params = (unsigned int *)extra;1637 unsigned int *params = (unsigned int extra; 1638 1638 struct ieee80211vap *vap = dev->priv; 1639 1639 struct ieee80211com *ic = vap->iv_ic; … … 1820 1820 iwe.u.data.length = se->se_ssid[1]; 1821 1821 current_ev = iwe_stream_add_point(current_ev, 1822 end_buf, &iwe, (char *) se->se_ssid+2);1822 end_buf, &iwe, (char *) 2); 1823 1823 1824 1824 /* We ran out of space in the buffer. */ … … 2270 2270 struct ieee80211com *ic = vap->iv_ic; 2271 2271 struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn; 2272 unsigned int *i = (unsigned int *) extra;2272 unsigned int *i = (unsigned int *)extra; 2273 2273 unsigned int param = i[0]; /* parameter id is 1st */ 2274 2274 unsigned int value = i[1]; /* NB: most values are TYPE_INT */ … … 2953 2953 struct ieee80211com *ic = vap->iv_ic; 2954 2954 struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn; 2955 unsigned int *param = (unsigned int *) extra;2955 unsigned int *param = (unsigned int *)extra; 2956 2956 2957 2957 switch (param[0]) { … … 4010 4010 { 4011 4011 struct ieee80211vap *vap = dev->priv; 4012 unsigned int *param = (unsigned int *) extra;4012 unsigned int *param = (unsigned int *)extra; 4013 4013 unsigned int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; 4014 4014 unsigned int bss = param[2]; … … 4098 4098 { 4099 4099 struct ieee80211vap *vap = dev->priv; 4100 unsigned int *param = (unsigned int *) extra;4100 unsigned int *param = (unsigned int *)extra; 4101 4101 unsigned int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; 4102 4102 struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme; … … 4491 4491 struct ieee80211vap *vap = dev->priv; 4492 4492 struct ieee80211com *ic = vap->iv_ic; 4493 unsigned int *param = (unsigned int *) extra;4493 unsigned int *param = (unsigned int *)extra; 4494 4494 4495 4495 if (!(ic->ic_flags & IEEE80211_F_DOTH)) … … 4526 4526 memcpy(mlme.im_macaddr, wextmlme->addr.sa_data, IEEE80211_ADDR_LEN); 4527 4527 4528 return ieee80211_ioctl_setmlme(dev, NULL, NULL, (char *)&mlme);4528 return ieee80211_ioctl_setmlme(dev, NULL, NULL, (char *)&mlme); 4529 4529 } 4530 4530 … … 4568 4568 args[1] = 0; 4569 4569 4570 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4570 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4571 4571 } 4572 4572 … … 4619 4619 return -EINVAL; 4620 4620 } 4621 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4621 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4622 4622 } 4623 4623 … … 4637 4637 return -EINVAL; 4638 4638 } 4639 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4639 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4640 4640 } 4641 4641 … … 4654 4654 args[1] |= WPA_ASE_8021X_PSK; 4655 4655 4656 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4656 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4657 4657 } 4658 4658 … … 4664 4664 args[0] = IEEE80211_PARAM_COUNTERMEASURES; 4665 4665 args[1] = erq->value; 4666 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4666 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4667 4667 } 4668 4668 … … 4674 4674 args[0] = IEEE80211_PARAM_DROPUNENCRYPTED; 4675 4675 args[1] = erq->value; 4676 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4676 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4677 4677 } 4678 4678 … … 4701 4701 args[1] = IEEE80211_AUTH_OPEN; 4702 4702 } 4703 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4703 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4704 4704 } 4705 4705 … … 4717 4717 args[1] = 0; /* disable WPA1 and WPA2 */ 4718 4718 4719 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4719 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4720 4720 } 4721 4721 … … 4733 4733 args[1] = 0; 4734 4734 4735 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4735 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4736 4736 } 4737 4737 … … 4754 4754 return -EINVAL; 4755 4755 } 4756 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4756 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4757 4757 } 4758 4758 … … 4764 4764 args[0] = IEEE80211_PARAM_PRIVACY; 4765 4765 args[1] = erq->value; 4766 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args);4766 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char *)args); 4767 4767 } 4768 4768 … … 4834 4834 int arg = IEEE80211_PARAM_WPA; 4835 4835 4836 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);4836 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 4837 4837 if (rc) 4838 4838 return rc; … … 4864 4864 int arg = IEEE80211_PARAM_UCASTCIPHER; 4865 4865 4866 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);4866 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 4867 4867 if (rc) 4868 4868 return rc; … … 4882 4882 int arg = IEEE80211_PARAM_MCASTCIPHER; 4883 4883 4884 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);4884 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 4885 4885 if (rc) 4886 4886 return rc; … … 4900 4900 4901 4901 arg = IEEE80211_PARAM_KEYMGTALGS; 4902 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);4902 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 4903 4903 if (rc) 4904 4904 return rc; … … 4919 4919 4920 4920 arg = IEEE80211_PARAM_COUNTERMEASURES; 4921 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);4921 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 4922 4922 if (rc) 4923 4923 return rc; … … 4933 4933 int rc; 4934 4934 arg = IEEE80211_PARAM_DROPUNENCRYPTED; 4935 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);4935 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 4936 4936 if (rc) 4937 4937 return rc; … … 4954 4954 int arg = IEEE80211_PARAM_WPA; 4955 4955 4956 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);4956 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 4957 4957 if (rc) 4958 4958 return rc; … … 4978 4978 4979 4979 arg = IEEE80211_PARAM_ROAMING; 4980 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);4980 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 4981 4981 if (rc) 4982 4982 return rc; … … 5002 5002 int arg; 5003 5003 arg = IEEE80211_PARAM_PRIVACY; 5004 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg);5004 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char *)&arg); 5005 5005 if (rc) 5006 5006 return rc; … … 5148 5148 memcpy(&dk.idk_macaddr, ext->addr.sa_data, IEEE80211_ADDR_LEN); 5149 5149 5150 return ieee80211_ioctl_delkey(dev, NULL, NULL, (char *)&dk);5150 return ieee80211_ioctl_delkey(dev, NULL, NULL, (char *)&dk); 5151 5151 } 5152 5152 … … 5225 5225 } 5226 5226 5227 return ieee80211_ioctl_setkey(dev, NULL, NULL, (char *)&kr);5227 return ieee80211_ioctl_setkey(dev, NULL, NULL, (char *)&kr); 5228 5228 } 5229 5229 #endif /* WIRELESS_EXT >= 18 */ … … 5753 5753 5754 5754 static struct iw_handler_def ieee80211_iw_handler_def = { 5755 .standard = (iw_handler *) ieee80211_handlers,5755 .standard = (iw_handler *)ieee80211_handlers, 5756 5756 .num_standard = ARRAY_SIZE(ieee80211_handlers), 5757 .private = (iw_handler *) ieee80211_priv_handlers,5757 .private = (iw_handler *)ieee80211_priv_handlers, 5758 5758 .num_private = ARRAY_SIZE(ieee80211_priv_handlers), 5759 .private_args = (struct iw_priv_args *) ieee80211_priv_args,5759 .private_args = (struct iw_priv_args *)ieee80211_priv_args, 5760 5760 .num_private_args = ARRAY_SIZE(ieee80211_priv_args), 5761 5761 #if IW_HANDLER_VERSION >= 7 … … 5783 5783 return 0; 5784 5784 case IEEE80211_IOCTL_GETKEY: 5785 return ieee80211_ioctl_getkey(dev, (struct iwreq *) ifr);5785 return ieee80211_ioctl_getkey(dev, (struct iwreq *)ifr); 5786 5786 case IEEE80211_IOCTL_GETWPAIE: 5787 return ieee80211_ioctl_getwpaie(dev, (struct iwreq *) ifr);5787 return ieee80211_ioctl_getwpaie(dev, (struct iwreq *)ifr); 5788 5788 case IEEE80211_IOCTL_STA_STATS: 5789 return ieee80211_ioctl_getstastats(dev, (struct iwreq *) ifr);5789 return ieee80211_ioctl_getstastats(dev, (struct iwreq *)ifr); 5790 5790 case IEEE80211_IOCTL_STA_INFO: 5791 return ieee80211_ioctl_getstainfo(dev, (struct iwreq *) ifr);5791 return ieee80211_ioctl_getstainfo(dev, (struct iwreq *)ifr); 5792 5792 case IEEE80211_IOCTL_SCAN_RESULTS: 5793 5793 return ieee80211_ioctl_getscanresults(dev, (struct iwreq *)ifr); … … 5829 5829 * Must be called with rtnl_lock held 5830 5830 */ 5831 struct ieee80211vap *5831 struct ieee80211vap * 5832 5832 ieee80211_create_vap(struct ieee80211com *ic, char *name, 5833 5833 struct net_device *mdev, int opmode, int opflags) -
madwifi/branches/madwifi-hal-0.10.5.6/net80211/if_media.c
r3477 r3722 193 193 { 194 194 struct ifmedia_entry *match; 195 struct ifmediareq *ifmr = (struct ifmediareq *) ifr;195 struct ifmediareq *ifmr = (struct ifmediareq *)ifr; 196 196 int error = 0, sticky; 197 197 -
madwifi/branches/madwifi-hal-0.10.5.6/regression/wep/test_wep.c
r2988 r3722 258 258 * Encrypt frame. 259 259 */ 260 ctx = (struct wep_ctx_hw *) key->wk_private;260 ctx = (struct wep_ctx_hw *)key->wk_private; 261 261 memcpy(&ctx->wc_iv, t->iv, sizeof(t->iv)); /* for encap/encrypt */ 262 262 if (!(*cip->ic_encap)(key, skb, t->keyix << 6)) { -
madwifi/branches/madwifi-hal-0.10.5.6/tools/80211debug.c
r2988 r3722 169 169 return -1; 170 170 /* XXX: only handle ints */ 171 if (fscanf(fd, "%u", (int *) oldp) != 1) {171 if (fscanf(fd, "%u", (int *)oldp) != 1) { 172 172 fclose(fd); 173 173 return -1; -
madwifi/branches/madwifi-hal-0.10.5.6/tools/80211stats.c
r3334 r3722 175 175 (void) memset(&iwr, 0, sizeof(iwr)); 176 176 (void) strncpy(iwr.ifr_name, ifr.ifr_name, sizeof(iwr.ifr_name)); 177 iwr.u.data.pointer = (void *) &stats;177 iwr.u.data.pointer = (void *)&stats; 178 178 iwr.u.data.length = sizeof(stats); 179 179 memcpy(stats.is_u.macaddr, macaddr, IEEE80211_ADDR_LEN); 180 180 if (ioctl(s, IEEE80211_IOCTL_STA_STATS, &iwr) < 0) 181 181 err(1, "unable to get station stats for %s", 182 ether_ntoa((const struct ether_addr*) macaddr));183 184 fprintf(fd, "%s:\n", ether_ntoa((const struct ether_addr *)macaddr));182 ether_ntoa((const struct ether_addr*)macaddr)); 183 184 fprintf(fd, "%s:\n", ether_ntoa((const struct ether_addr macaddr)); 185 185 186 186 sep = "\t"; … … 295 295 (void) memset(&iwr, 0, sizeof(iwr)); 296 296 (void) strncpy(iwr.ifr_name, ifr.ifr_name, sizeof(iwr.ifr_name)); 297 iwr.u.data.pointer = (void *) buf;297 iwr.u.data.pointer = (void *)buf; 298 298 iwr.u.data.length = sizeof(buf); 299 299 if (ioctl(s, IEEE80211_IOCTL_STA_INFO, &iwr) < 0) … … 303 303 cp = buf; 304 304 do { 305 si = (struct ieee80211req_sta_info *) cp;305 si = (struct ieee80211req_sta_info *)cp; 306 306 print_sta_stats(stdout, si->isi_macaddr); 307 307 cp += si->isi_len, len -= si->isi_len; -
madwifi/branches/madwifi-hal-0.10.5.6/tools/athdebug.c
r3008 r3722 178 178 return -1; 179 179 /* XXX: only handle ints */ 180 if (fscanf(fd, "%u", (int *) oldp) != 1) {180 if (fscanf(fd, "%u", (int *)oldp) != 1) { 181 181 fclose(fd); 182 182 return -1; -
madwifi/branches/madwifi-hal-0.10.5.6/tools/athstats.c
r2988 r3722 69 69 static const struct { 70 70 u_int phyerr; 71 const char *desc;71 const chardesc; 72 72 } phyerrdescriptions[] = { 73 73 { HAL_PHYERR_UNDERRUN, "transmit underrun" }, … … 178 178 179 179 static u_int 180 getifrate(int s, const char *ifname)180 getifrate(int s, const char ifname) 181 181 { 182 182 struct iwreq wrq; -
madwifi/branches/madwifi-hal-0.10.5.6/tools/wireless_copy.h
r2394 r3722 520 520 #define IW_RETRY_ON 0x0000 /* No details... */ 521 521 #define IW_RETRY_TYPE 0xF000 /* Type of parameter */ 522 #define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries */522 #define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries */ 523 523 #define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */ 524 524 #define IW_RETRY_MODIFIER 0x000F /* Modify a parameter */ … … 1084 1084 * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second, 1085 1085 * we omit the pointer, so start at an offset. */ 1086 #define IW_EV_POINT_OFF (((char *) &(((struct iw_point *)NULL)->length)) - \1087 (char *) NULL)1086 #define IW_EV_POINT_OFF (((char *)NULL)->length)) - \ 1087 (char *)NULL) 1088 1088 #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ 1089 1089 IW_EV_POINT_OFF) -
madwifi/branches/madwifi-hal-0.10.5.6/tools/wlanconfig.c
r3476 r3722 174 174 if_base = NULL; 175 175 176 ifr.ifr_data = (void *) &cp;176 ifr.ifr_data = (void *)&cp; 177 177 vap_create(&ifr); 178 178 printf("%s\n", ifr.ifr_name); … … 435 435 436 436 static void 437 printie(const char *tag, const uint8_t *ie, size_t ielen, int maxlen)437 printie(const char tag, const uint8_t *ie, size_t ielen, int maxlen) 438 438 { 439 439 printf("%s", tag); 440 440 if (verbose) { 441 maxlen -= strlen(tag) +2;442 if (2 *ielen > maxlen)441 maxlen -= strlen(tag) 2; 442 if (2 ielen > maxlen) 443 443 maxlen--; 444 444 printf("<"); … … 566 566 list_stations(const char *ifname) 567 567 { 568 uint8_t buf[24 *1024];568 uint8_t buf[24 1024]; 569 569 struct iwreq iwr; 570 570 uint8_t *cp; … … 577 577 (void) memset(&iwr, 0, sizeof(iwr)); 578 578 (void) strncpy(iwr.ifr_name, ifname, sizeof(iwr.ifr_name)); 579 iwr.u.data.pointer = (void *) buf;579 iwr.u.data.pointer = (void *)buf; 580 580 iwr.u.data.length = sizeof(buf); 581 581 if (ioctl(s, IEEE80211_IOCTL_STA_INFO, &iwr) < 0) … … 608 608 uint8_t *vp; 609 609 610 si = (struct ieee80211req_sta_info *) cp;610 si = (struct ieee80211req_sta_info *)cp; 611 611 vp = (u_int8_t *)(si+1); 612 612 printf("%s %4u %4d %3dM %4d %4d %5d %6d %7d %6d %7d %-4.4s %-5.5s %3x %8x %8s", … … 684 684 uint8_t *vp; 685 685 686 sr = (struct ieee80211req_scan_result *) cp;687 vp = (u_int8_t *)(sr +1);686 sr = (struct ieee80211req_scan_result *)cp; 687 vp = (u_int8_t *)(sr 1); 688 688 printf("%-14.*s %s %3d %3dM %2d:%-2d %3d %-4.4s", 689 689 copy_essid(ssid, sizeof(ssid), vp, sr->isr_ssid_len),