Index: translation.h =================================================================== --- translation.h (revision 2605) +++ translation.h (revision 2629) @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2006-2007 Nick Kossifidis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id$ - */ - -/* - * Init/Exit functions - */ -#define ah_getRateTable ah_get_rate_table -//detach - -/* - * Reset functions - */ -//reset -//set_opmode -#define ah_perCalibration ah_phy_calibrate -#define ah_phyDisable ah_phy_disable - -/* - * TX functions - */ -#define ah_updateTxTrigLevel ah_update_tx_triglevel -#define ah_setupTxQueue ah_setup_tx_queue -#define ah_setTxQueueProps ah_setup_tx_queueprops -#define ah_getTxQueueProps ah_get_tx_queueprops -#define ah_releaseTxQueue ah_release_tx_queue -#define ah_resetTxQueue ah_reset_tx_queue -#define ah_getTxDP ah_get_tx_buf -#define ah_setTxDP ah_put_tx_buf -#define ah_numTxPending ah_num_tx_pending -#define ah_startTxDma ah_tx_start -#define ah_stopTxDma ah_stop_tx_dma -#define ah_setupTxDesc ah_setup_tx_desc -#define ah_setupXTxDesc ah_setup_xtx_desc -#define ah_fillTxDesc ah_fill_tx_desc -#define ah_procTxDesc ah_proc_tx_desc -#define ah_getTxIntrQueue ah_get_tx_inter_queue -//has_veol - -/* - * RX functions - */ -#define ah_getRxDP ah_get_rx_buf -#define ah_setRxDP ah_put_rx_buf -#define ah_enableReceive ah_start_rx -#define ah_stopDmaReceive ah_stop_rx_dma -#define ah_startPcuReceive ah_start_rx_pcu -#define ah_stopPcuReceive ah_stop_pcu_recv -#define ah_setMulticastFilter ah_set_mcast_filter -#define ah_setMulticastFilterIndex ah_set_mcast_filterindex -#define ah_clrMulticastFilterIndex ah_clear_mcast_filter_idx -#define ah_getRxFilter ah_get_rx_filter -#define ah_setRxFilter ah_set_rx_filter -#define ah_setupRxDesc ah_setup_rx_desc -#define ah_procRxDesc ah_proc_rx_desc -#define ah_rxMonitor ah_set_rx_signal -#define ah_procMibEvent ah_proc_mib_event - -/* - * Misc functions - */ -#define ah_getCapability ah_get_capability -#define ah_setCapability ah_set_capability -//dump_state -#define ah_getDiagState ah_get_diag_state -#define ah_getMacAddress ah_get_lladdr -#define ah_setMacAddress ah_set_lladdr -#define ah_setBssIdMask ah_set_bssid_mask -//#define ah_getBssIdMask ah_get_bssid_mask -#define ah_setRegulatoryDomain ah_set_regdomain -#define ah_setLedState ah_set_ledstate -#define ah_writeAssocid ah_set_associd -#define ah_gpioCfgInput ah_set_gpio_input -#define ah_gpioCfgOutput ah_set_gpio_output -#define ah_gpioGet ah_get_gpio -#define ah_gpioSet ah_set_gpio -#define ah_gpioSetIntr ah_set_gpio_intr -#define ah_getTsf32 ah_get_tsf32 -#define ah_getTsf64 ah_get_tsf64 -#define ah_resetTsf ah_reset_tsf -//get_regdomain -#define ah_detectCardPresent ah_detect_card_present -#define ah_updateMibCounters ah_update_mib_counters -#define ah_getRfGain ah_get_rf_gain -#define ah_getDefAntenna ah_get_def_antenna -#define ah_setDefAntenna ah_set_def_antenna -#define ah_setSlotTime ah_set_slot_time -#define ah_getSlotTime ah_get_slot_time -#define ah_setAckTimeout ah_set_ack_timeout -#define ah_getAckTimeout ah_get_ack_timeout -#define ah_setCTSTimeout ah_set_cts_timeout -#define ah_getCTSTimeout ah_get_cts_timeout - -/* - * Key table (WEP) functions - */ -//is_cipher_supported -#define ah_getKeyCacheSize ah_get_keycache_size -#define ah_resetKeyCacheEntry ah_reset_key -#define ah_isKeyCacheEntryValid ah_is_key_valid -#define ah_setKeyCacheEntry ah_set_key -#define ah_setKeyCacheEntryMac ah_set_key_lladdr - -/* - * Power management functions - */ -#define ah_setPowerMode ah_set_power -#define ah_getPowerMode ah_get_power_mode -//query_pspoll_support -#define ah_initPSPoll ah_init_pspoll -#define ah_enablePSPoll ah_enable_pspoll -#define ah_disablePSPoll ah_disable_pspoll -#define ah_setTxPowerLimit ah_set_txpower_limit - -/* - * Beacon functions - */ -#define ah_beaconInit ah_init_beacon -#define ah_setStationBeaconTimers ah_set_beacon_timers -#define ah_resetStationBeaconTimers ah_reset_beacon -#define ah_waitForBeaconDone ah_wait_for_beacon - -/* - * Interrupt functions - */ -#define ah_isInterruptPending ah_is_intr_pending -#define ah_getPendingInterrupts ah_get_isr -#define ah_getInterrupts ah_get_intr -#define ah_setInterrupts ah_set_intr - -/* - * Chipset functions (ar5k-specific, non-HAL) - */ -//get_capabilities -#define ah_radarlert ah_radar_alert - -/* - * EEPROM access - */ -//eeprom_is_busy -//eeprom_read -//eeprom_write - -#define ah_setPCUConfig ah_set_pcu_config Index: ath5k_hw.c =================================================================== --- ath5k_hw.c (revision 2605) +++ ath5k_hw.c (revision 2629) @@ -509,8 +509,10 @@ */ hal->ah_version = mac_version; - /*Fill the hal struct with the needed functions*/ - ath5k_hw_fill(hal); + if (hal->ah_version == AR5K_AR5212) + hal->ah_magic = AR5K_EEPROM_MAGIC_5212; + else if (hal->ah_version == AR5K_AR5211) + hal->ah_magic = AR5K_EEPROM_MAGIC_5211; /* Bring device out of sleep and reset it's units */ if (ath5k_hw_nic_wakeup(hal, AR5K_INIT_MODE, TRUE) != TRUE) @@ -6238,7 +6240,7 @@ } void /*Added AR5K_NODE_STATS argument*/ -ath5k_hw_set_rx_signal(struct ath_hal *hal, const AR5K_NODE_STATS *stats) +ath5k_hw_set_rx_signal_monitor(struct ath_hal *hal, const AR5K_NODE_STATS *stats) { AR5K_TRACE; /* Signal state monitoring is not yet supported */ @@ -6441,168 +6443,3 @@ AR5K_PRINTF("Possible radar activity detected at %u MHz (tick %u)\n", hal->ah_radar.r_last_alert, hal->ah_current_channel.freq);*/ } - -/* - * Fill the hal struct, left here for combatibility - */ -void /*Functions added*/ -ath5k_hw_fill(struct ath_hal *hal) -{ - if (hal->ah_version == AR5K_AR5212) - hal->ah_magic = AR5K_EEPROM_MAGIC_5212; - else if (hal->ah_version == AR5K_AR5211) - hal->ah_magic = AR5K_EEPROM_MAGIC_5211; - - /* - * Init/Exit functions - */ - AR5K_HAL_FUNCTION(hal, hw, get_rate_table); - AR5K_HAL_FUNCTION(hal, hw, detach); - - /* - * Reset functions - */ - AR5K_HAL_FUNCTION(hal, hw, reset); - AR5K_HAL_FUNCTION(hal, hw, set_opmode); - AR5K_HAL_FUNCTION(hal, hw, phy_calibrate); - - /* - * TX functions - */ - AR5K_HAL_FUNCTION(hal, hw, update_tx_triglevel); - AR5K_HAL_FUNCTION(hal, hw, setup_tx_queue); - AR5K_HAL_FUNCTION(hal, hw, setup_tx_queueprops); - AR5K_HAL_FUNCTION(hal, hw, release_tx_queue); - AR5K_HAL_FUNCTION(hal, hw, reset_tx_queue); - AR5K_HAL_FUNCTION(hal, hw, get_tx_buf); - AR5K_HAL_FUNCTION(hal, hw, put_tx_buf); - AR5K_HAL_FUNCTION(hal, hw, tx_start); - AR5K_HAL_FUNCTION(hal, hw, stop_tx_dma); - if (hal->ah_version == AR5K_AR5212) { - hal->ah_setup_tx_desc = ath5k_hw_setup_4word_tx_desc; - hal->ah_setup_xtx_desc = ath5k_hw_setup_xr_tx_desc; - hal->ah_fill_tx_desc = ath5k_hw_fill_4word_tx_desc; - hal->ah_proc_tx_desc = ath5k_hw_proc_4word_tx_status; - } else if (hal->ah_version != AR5K_AR5212) { - hal->ah_setup_tx_desc = ath5k_hw_setup_2word_tx_desc; - hal->ah_setup_xtx_desc = ath5k_hw_setup_xr_tx_desc; - hal->ah_fill_tx_desc = ath5k_hw_fill_2word_tx_desc; - hal->ah_proc_tx_desc = ath5k_hw_proc_2word_tx_status; - } - AR5K_HAL_FUNCTION(hal, hw, has_veol); - - /* - * RX functions - */ - AR5K_HAL_FUNCTION(hal, hw, get_rx_buf); - AR5K_HAL_FUNCTION(hal, hw, put_rx_buf); - AR5K_HAL_FUNCTION(hal, hw, start_rx); - AR5K_HAL_FUNCTION(hal, hw, stop_rx_dma); - AR5K_HAL_FUNCTION(hal, hw, start_rx_pcu); - AR5K_HAL_FUNCTION(hal, hw, stop_pcu_recv); - AR5K_HAL_FUNCTION(hal, hw, set_mcast_filter); - AR5K_HAL_FUNCTION(hal, hw, set_mcast_filterindex); - AR5K_HAL_FUNCTION(hal, hw, clear_mcast_filter_idx); - AR5K_HAL_FUNCTION(hal, hw, get_rx_filter); - AR5K_HAL_FUNCTION(hal, hw, set_rx_filter); - AR5K_HAL_FUNCTION(hal, hw, setup_rx_desc); - if (hal->ah_version == AR5K_AR5212) - hal->ah_proc_rx_desc = ath5k_hw_proc_new_rx_status; - else if (hal->ah_version <= AR5K_AR5211) - hal->ah_proc_rx_desc = ath5k_hw_proc_old_rx_status; - AR5K_HAL_FUNCTION(hal, hw, set_rx_signal); - - /* - * Misc functions - */ - AR5K_HAL_FUNCTION(hal, hw, dump_state); - AR5K_HAL_FUNCTION(hal, hw, get_diag_state); - AR5K_HAL_FUNCTION(hal, hw, get_lladdr); - AR5K_HAL_FUNCTION(hal, hw, set_lladdr); - AR5K_HAL_FUNCTION(hal, hw, set_regdomain); - AR5K_HAL_FUNCTION(hal, hw, set_ledstate); - AR5K_HAL_FUNCTION(hal, hw, set_associd); - AR5K_HAL_FUNCTION(hal, hw, set_gpio_input); - AR5K_HAL_FUNCTION(hal, hw, set_gpio_output); - AR5K_HAL_FUNCTION(hal, hw, get_gpio); - AR5K_HAL_FUNCTION(hal, hw, set_gpio); - AR5K_HAL_FUNCTION(hal, hw, set_gpio_intr); - AR5K_HAL_FUNCTION(hal, hw, get_tsf32); - AR5K_HAL_FUNCTION(hal, hw, get_tsf64); - AR5K_HAL_FUNCTION(hal, hw, reset_tsf); - AR5K_HAL_FUNCTION(hal, hw, get_regdomain); - AR5K_HAL_FUNCTION(hal, hw, detect_card_present); - AR5K_HAL_FUNCTION(hal, hw, update_mib_counters); - AR5K_HAL_FUNCTION(hal, hw, get_rf_gain); - AR5K_HAL_FUNCTION(hal, hw, set_slot_time); - AR5K_HAL_FUNCTION(hal, hw, get_slot_time); - AR5K_HAL_FUNCTION(hal, hw, set_ack_timeout); - AR5K_HAL_FUNCTION(hal, hw, get_ack_timeout); - AR5K_HAL_FUNCTION(hal, hw, set_cts_timeout); - AR5K_HAL_FUNCTION(hal, hw, get_cts_timeout); - - /* - * Key table (WEP) functions - */ - AR5K_HAL_FUNCTION(hal, hw, is_cipher_supported); - AR5K_HAL_FUNCTION(hal, hw, get_keycache_size); - AR5K_HAL_FUNCTION(hal, hw, reset_key); - AR5K_HAL_FUNCTION(hal, hw, is_key_valid); - AR5K_HAL_FUNCTION(hal, hw, set_key); - AR5K_HAL_FUNCTION(hal, hw, set_key_lladdr); - - /* - * Power management functions - */ - AR5K_HAL_FUNCTION(hal, hw, set_power); - AR5K_HAL_FUNCTION(hal, hw, get_power_mode); - AR5K_HAL_FUNCTION(hal, hw, query_pspoll_support); - AR5K_HAL_FUNCTION(hal, hw, init_pspoll); - AR5K_HAL_FUNCTION(hal, hw, enable_pspoll); - AR5K_HAL_FUNCTION(hal, hw, disable_pspoll); - - /* - * Beacon functions - */ - AR5K_HAL_FUNCTION(hal, hw, init_beacon); - AR5K_HAL_FUNCTION(hal, hw, set_beacon_timers); - AR5K_HAL_FUNCTION(hal, hw, reset_beacon); - AR5K_HAL_FUNCTION(hal, hw, wait_for_beacon); - - /* - * Interrupt functions - */ - AR5K_HAL_FUNCTION(hal, hw, is_intr_pending); - AR5K_HAL_FUNCTION(hal, hw, get_isr); - AR5K_HAL_FUNCTION(hal, hw, get_intr); - AR5K_HAL_FUNCTION(hal, hw, set_intr); - - /* - * Chipset functions (ar5k-specific, non-HAL) - */ - AR5K_HAL_FUNCTION(hal, hw, get_capabilities); - AR5K_HAL_FUNCTION(hal, hw, radar_alert); - - /* - * EEPROM access - */ - AR5K_HAL_FUNCTION(hal, hw, eeprom_is_busy); - AR5K_HAL_FUNCTION(hal, hw, eeprom_read); - AR5K_HAL_FUNCTION(hal, hw, eeprom_write); - - /* Functions not found in OpenBSD */ - AR5K_HAL_FUNCTION(hal, hw, get_tx_queueprops); - AR5K_HAL_FUNCTION(hal, hw, get_capability); - AR5K_HAL_FUNCTION(hal, hw, num_tx_pending); - AR5K_HAL_FUNCTION(hal, hw, phy_disable); - AR5K_HAL_FUNCTION(hal, hw, set_pcu_config); - AR5K_HAL_FUNCTION(hal, hw, set_txpower_limit); - AR5K_HAL_FUNCTION(hal, hw, set_def_antenna); - AR5K_HAL_FUNCTION(hal, hw, get_def_antenna); - AR5K_HAL_FUNCTION(hal, hw, set_bssid_mask); - /*Totaly unimplemented*/ - AR5K_HAL_FUNCTION(hal, hw, set_capability); - AR5K_HAL_FUNCTION(hal, hw, proc_mib_event); - AR5K_HAL_FUNCTION(hal, hw, get_tx_inter_queue); - -} Index: Makefile.kernel =================================================================== --- Makefile.kernel (revision 2605) +++ Makefile.kernel (revision 2629) @@ -17,13 +17,11 @@ ifneq ($(VERSION).$(PATCHLEVEL),2.4) obj-$(CONFIG_ATHEROS) += ath_hal.o -ath_hal-objs := ah_osdep.o ar5xxx.o ar5212.o ar5211.o ar5210.o \ - ieee80211_regdomain.o +ath_hal-objs := ah_osdep.o ath5k_hw.o ieee80211_regdomain.o endif ifeq ($(VERSION).$(PATCHLEVEL),2.4) -obj-$(CONFIG_ATHEROS) := ah_osdep.o ar5xxx.o ar5212.o ar5211.o ar5210.o \ - ieee80211_regdomain.o +obj-$(CONFIG_ATHEROS) := ah_osdep.o ath5k_hw.o ieee80211_regdomain.o export-objs := ah_osdep.o list-multi := ath_hal.o O_TARGET := ath_hal.o Index: README =================================================================== --- README (revision 2605) +++ README (revision 2629) @@ -1,7 +1,7 @@ -Linux OpenHAL 20072703 +Linux OpenHAL 20070108 ====================== /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ - * This is a port of the ar5k hal for atheros device drivers that is * + * This is a port/fork of the ar5k hal for atheros device drivers that is * * source-compatible with the Madwifi driver for linux. * * * * Code ported, modified for combatibility and some bugs were fixed by * @@ -9,9 +9,9 @@ * and Pavel Roskin so ar5k can work propertly * * on Linux. * * * - * Currently only the 5212 code has been tested due to lack of hardware. * + * Currently 5210 code has not been tested due to lack of hardware. * * * - * Some code from John Bicket's port (roofnet project) was taken, you can * + * Some code from John Bicket's port (roofnet project) was used, you can * * can find his OpenHAL here -> http://pdos.csail.mit.edu/~jbicket/openhal/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -53,7 +53,7 @@ If you want to be legal you shouldn't disable regdomains, althow if you want to experiment etc there are 2 ways you can override regdomains: -a) Change SUPERCHANNEL to 1 (opt_ah.h) +a) Change CHAN_DEBUG to 1 (opt_ah.h) b) Change your card's regulatory domain (EEPROM) to 0x00 WARNING: Whatever you do with your hardware is YOUR resposibility, don't blame the developers @@ -79,21 +79,6 @@ The Athens Wireless Metropolitan Network http://www.awmn.net - -Building -======== -To build OpenHAL with MadWiFi, place the OpenHAL source directory in the -MadWiFi directory. Edit Makefile.inc and set the following: - -HAL=${DEPTH}/ -ATH_HAL=${DEPTH}/ - -After that, go to the top directory and build like you normally would. - -WARNING: Don't delete the empty files included (ah_desc.h etc) - -Note: Currenty works for MadWiFi-old - Use ===== You 'll have to set everything propertly for things to work @@ -113,5 +98,21 @@ TODO ==== * Lot's of tests and fixes. -* Make it combatible with newer versions of MadWiFi (after the merge). -* Test 5210/5211 code. +* Fix tx power setting. +* Test 5210 code. + + +What works +========== +Tested combinations: +AR5213 + RF5111 (Wistron CM6) +AR5213 + RF5112a (Wistron CM9) +AR5211 + RF5111 (Toshiba/Askey) +RF5413 (don't remember vendor but it was a mini-pci one) + +They all seem to work fine except 5211 which has trouble working as an AP +(probably during faulty tx power setting). Also 5413 had poor signal quality +in comparison to binary HAL. We also got reports of 5424 non-working (droping +packets etc) at all. + +Please we need your feedback ! Index: ath5k.h =================================================================== --- ath5k.h (revision 2605) +++ ath5k.h (revision 2629) @@ -43,12 +43,6 @@ /*Options*/ #include "opt_ah.h" -/* - *Translation for MadWiFi combatibility - *(damn this is changed AGAIN in if_ath.pci :P) - */ -#include "translation.h" - /*Use with MadWiFi/net80211*/ #include "stack_net80211.h" @@ -941,137 +935,6 @@ typedef AR5K_BOOL (ath5k_rfgain_t) (struct ath_hal *, AR5K_CHANNEL *, u_int); -/* - * HAL Functions that have different implementations for each chipset... - */ -#define AR5K_HAL_FUNCTION(_hal, _n, _f) (_hal)->ah_##_f = ath5k_##_n##_##_f -#define AR5K_HAL_FUNCTIONS(_t, _n, _a) \ - _t const AR5K_RATE_TABLE *(_a _n##_get_rate_table)(struct ath_hal *, u_int mode); \ - _t void (_a _n##_detach)(struct ath_hal *); \ - /* Reset functions */ \ - _t AR5K_BOOL (_a _n##_reset)(struct ath_hal *, AR5K_OPMODE, AR5K_CHANNEL *, \ - AR5K_BOOL change_channel, AR5K_STATUS *status); \ - _t void (_a _n##_set_opmode)(struct ath_hal *); \ - _t AR5K_BOOL (_a _n##_phy_calibrate)(struct ath_hal*, AR5K_CHANNEL *); \ - /* Transmit functions */ \ - _t AR5K_BOOL (_a _n##_update_tx_triglevel)(struct ath_hal*, AR5K_BOOL level); \ - _t int (_a _n##_setup_tx_queue)(struct ath_hal *, AR5K_TX_QUEUE, AR5K_TXQ_INFO *); \ - _t AR5K_BOOL (_a _n##_setup_tx_queueprops)(struct ath_hal *, int queue, \ - const AR5K_TXQ_INFO *); \ - _t AR5K_BOOL (_a _n##_release_tx_queue)(struct ath_hal *, u_int queue); \ - _t AR5K_BOOL (_a _n##_reset_tx_queue)(struct ath_hal *, u_int queue); \ - _t u_int32_t (_a _n##_get_tx_buf)(struct ath_hal *, u_int queue); \ - _t AR5K_BOOL (_a _n##_put_tx_buf)(struct ath_hal *, u_int, u_int32_t phys_addr); \ - _t AR5K_BOOL (_a _n##_tx_start)(struct ath_hal *, u_int queue); \ - _t AR5K_BOOL (_a _n##_stop_tx_dma)(struct ath_hal *, u_int queue); \ - _t AR5K_BOOL (_a _n##_setup_tx_desc)(struct ath_hal *, struct ath_desc *, \ - u_int packet_length, u_int header_length, AR5K_PKT_TYPE type, \ - u_int txPower, u_int tx_rate0, u_int tx_tries0, u_int key_index,\ - u_int antenna_mode, u_int flags, u_int rtscts_rate, \ - u_int rtscts_duration); \ - _t AR5K_BOOL (_a _n##_setup_xtx_desc)(struct ath_hal *, struct ath_desc *, \ - u_int tx_rate1, u_int tx_tries1, u_int tx_rate2, \ - u_int tx_tries2,u_int tx_rate3, u_int tx_tries3); \ - _t AR5K_BOOL (_a _n##_fill_tx_desc)(struct ath_hal *, struct ath_desc *, u_int segLen, \ - AR5K_BOOL firstSeg, AR5K_BOOL lastSeg, const struct ath_desc *);\ - _t AR5K_STATUS (_a _n##_proc_tx_desc)(struct ath_hal *, struct ath_desc *); \ - _t AR5K_BOOL (_a _n##_has_veol)(struct ath_hal *); \ - /* Receive Functions */ \ - _t u_int32_t (_a _n##_get_rx_buf)(struct ath_hal*); \ - _t void (_a _n##_put_rx_buf)(struct ath_hal*, u_int32_t rxdp); \ - _t void (_a _n##_start_rx)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_stop_rx_dma)(struct ath_hal*); \ - _t void (_a _n##_start_rx_pcu)(struct ath_hal*); \ - _t void (_a _n##_stop_pcu_recv)(struct ath_hal*); \ - _t void (_a _n##_set_mcast_filter)(struct ath_hal*, u_int32_t filter0, \ - u_int32_t filter1); \ - _t AR5K_BOOL (_a _n##_set_mcast_filterindex)(struct ath_hal*, u_int32_t index); \ - _t AR5K_BOOL (_a _n##_clear_mcast_filter_idx)(struct ath_hal*,u_int32_t index); \ - _t u_int32_t (_a _n##_get_rx_filter)(struct ath_hal*); \ - _t void (_a _n##_set_rx_filter)(struct ath_hal*, u_int32_t); \ - _t AR5K_BOOL (_a _n##_setup_rx_desc)(struct ath_hal *, struct ath_desc *, \ - u_int32_t size, u_int flags); \ - _t AR5K_STATUS (_a _n##_proc_rx_desc)(struct ath_hal *, struct ath_desc *, \ - u_int32_t phyAddr, struct ath_desc *next); \ - _t void (_a _n##_set_rx_signal)(struct ath_hal *, const AR5K_NODE_STATS *); \ - /* Misc Functions */ \ - _t void (_a _n##_dump_state)(struct ath_hal *); \ - _t AR5K_BOOL (_a _n##_get_diag_state)(struct ath_hal *, int request,const void *args, \ - u_int32_t argsize, void **result, u_int32_t *resultsize); \ - _t void (_a _n##_get_lladdr)(struct ath_hal *, u_int8_t *); \ - _t AR5K_BOOL (_a _n##_set_lladdr)(struct ath_hal *, const u_int8_t*); \ - _t AR5K_BOOL (_a _n##_set_regdomain)(struct ath_hal*, u_int16_t, AR5K_STATUS *); \ - _t void (_a _n##_set_ledstate)(struct ath_hal*, AR5K_LED_STATE); \ - _t void (_a _n##_set_associd)(struct ath_hal*, const u_int8_t *bssid, \ - u_int16_t assocId); \ - _t AR5K_BOOL (_a _n##_set_gpio_input)(struct ath_hal *, u_int32_t gpio); \ - _t AR5K_BOOL (_a _n##_set_gpio_output)(struct ath_hal *, u_int32_t gpio); \ - _t u_int32_t (_a _n##_get_gpio)(struct ath_hal *, u_int32_t gpio); \ - _t AR5K_BOOL (_a _n##_set_gpio)(struct ath_hal *, u_int32_t gpio, u_int32_t val); \ - _t void (_a _n##_set_gpio_intr)(struct ath_hal*, u_int, u_int32_t); \ - _t u_int32_t (_a _n##_get_tsf32)(struct ath_hal*); \ - _t u_int64_t (_a _n##_get_tsf64)(struct ath_hal*); \ - _t void (_a _n##_reset_tsf)(struct ath_hal*); \ - _t u_int16_t (_a _n##_get_regdomain)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_detect_card_present)(struct ath_hal*); \ - _t void (_a _n##_update_mib_counters)(struct ath_hal*, AR5K_MIB_STATS*); \ - _t AR5K_RFGAIN (_a _n##_get_rf_gain)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_set_slot_time)(struct ath_hal*, u_int); \ - _t u_int (_a _n##_get_slot_time)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_set_ack_timeout)(struct ath_hal *, u_int); \ - _t u_int (_a _n##_get_ack_timeout)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_set_cts_timeout)(struct ath_hal*, u_int); \ - _t u_int (_a _n##_get_cts_timeout)(struct ath_hal*); \ - /* Key Cache Functions */ \ - _t AR5K_BOOL (_a _n##_is_cipher_supported)(struct ath_hal*, AR5K_CIPHER); \ - _t u_int32_t (_a _n##_get_keycache_size)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_reset_key)(struct ath_hal*, u_int16_t); \ - _t AR5K_BOOL (_a _n##_is_key_valid)(struct ath_hal *, u_int16_t); \ - _t AR5K_BOOL (_a _n##_set_key)(struct ath_hal*, u_int16_t, const AR5K_KEYVAL *, \ - const u_int8_t *, int); \ - _t AR5K_BOOL (_a _n##_set_key_lladdr)(struct ath_hal*, u_int16_t, const u_int8_t *); \ - /* Power Management Functions */ \ - _t AR5K_BOOL (_a _n##_set_power)(struct ath_hal*, AR5K_POWER_MODE mode, \ - AR5K_BOOL set_chip, u_int16_t sleep_duration); \ - _t AR5K_POWER_MODE (_a _n##_get_power_mode)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_query_pspoll_support)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_init_pspoll)(struct ath_hal*); \ - _t AR5K_BOOL (_a _n##_enable_pspoll)(struct ath_hal *, u_int8_t *, u_int16_t); \ - _t AR5K_BOOL (_a _n##_disable_pspoll)(struct ath_hal *); \ - /* Beacon Management Functions */ \ - _t void (_a _n##_init_beacon)(struct ath_hal *, u_int32_t nexttbtt, u_int32_t intval); \ - _t void (_a _n##_set_beacon_timers)(struct ath_hal *, const AR5K_BEACON_STATE *); \ - _t void (_a _n##_reset_beacon)(struct ath_hal *); \ - _t AR5K_BOOL (_a _n##_wait_for_beacon)(struct ath_hal *, AR5K_BUS_ADDR); \ - /* Interrupt functions */ \ - _t AR5K_BOOL (_a _n##_is_intr_pending)(struct ath_hal *); \ - _t AR5K_BOOL (_a _n##_get_isr)(struct ath_hal *, u_int32_t *); \ - _t u_int32_t (_a _n##_get_intr)(struct ath_hal *); \ - _t AR5K_INT (_a _n##_set_intr)(struct ath_hal *, AR5K_INT); \ - /* Chipset functions (ar5k-specific, non-HAL) */ \ - _t AR5K_BOOL (_a _n##_get_capabilities)(struct ath_hal *); \ - _t void (_a _n##_radar_alert)(struct ath_hal *, AR5K_BOOL enable); \ - _t AR5K_BOOL (_a _n##_eeprom_is_busy)(struct ath_hal *); \ - _t int (_a _n##_eeprom_read)(struct ath_hal *, u_int32_t offset, u_int16_t *data); \ - _t int (_a _n##_eeprom_write)(struct ath_hal *, u_int32_t offset, u_int16_t data); \ - /* Functions not found in OpenBSD */ \ - _t AR5K_BOOL (_a _n##_get_tx_queueprops)(struct ath_hal *, int, AR5K_TXQ_INFO *); \ - _t AR5K_STATUS (_a _n##_get_capability)(struct ath_hal *, AR5K_CAPABILITY_TYPE, \ - u_int32_t, u_int32_t *); \ - _t u_int32_t (_a _n##_num_tx_pending)(struct ath_hal *, u_int); \ - _t AR5K_BOOL (_a _n##_phy_disable)(struct ath_hal *); \ - _t void (_a _n##_set_pcu_config)(struct ath_hal *); \ - _t AR5K_BOOL (_a _n##_set_txpower_limit)(struct ath_hal *, u_int); \ - _t void (_a _n##_set_def_antenna)(struct ath_hal *, u_int); \ - _t u_int (_a _n ##_get_def_antenna)(struct ath_hal *); \ - _t AR5K_BOOL (_a _n ##_set_bssid_mask)(struct ath_hal *, const u_int8_t*); \ - /*Totaly unimplemented*/ \ - _t AR5K_BOOL (_a _n##_set_capability)(struct ath_hal *, AR5K_CAPABILITY_TYPE, u_int32_t,\ - u_int32_t,AR5K_STATUS *) ; \ - _t void (_a _n##_proc_mib_event)(struct ath_hal *, const AR5K_NODE_STATS *) ; \ - _t void (_a _n##_get_tx_inter_queue)(struct ath_hal *, u_int32_t *); - - #define AR5K_MAX_GPIO 10 #define AR5K_MAX_RF_BANKS 8 @@ -1161,11 +1024,6 @@ AR5K_CHANNEL r_last_channel; } ah_radar; - /* - * Function pointers - */ - AR5K_HAL_FUNCTIONS(, ah, *) - }; @@ -1367,7 +1225,7 @@ extern void ath5k_hw_dump_state(struct ath_hal *); extern AR5K_BOOL ath5k_hw_has_veol(struct ath_hal *); extern void ath5k_hw_get_tx_inter_queue(struct ath_hal *, u_int32_t *); -extern void ath5k_hw_set_rx_signal(struct ath_hal *, const AR5K_NODE_STATS *); +extern void ath5k_hw_set_rx_signal_monitor(struct ath_hal *, const AR5K_NODE_STATS *); extern AR5K_BOOL ath5k_hw_get_diag_state(struct ath_hal *, int request,const void *args, u_int32_t argsize, void **result, u_int32_t *resultsize); extern AR5K_BOOL ath5k_hw_detect_card_present(struct ath_hal*); @@ -1381,7 +1239,6 @@ extern AR5K_BOOL ath5k_hw_disable_pspoll(struct ath_hal *); const char * ath5k_hw_get_part_name(enum ath5k_srev_type, u_int32_t); void ath5k_radar_alert(struct ath_hal *); -void ath5k_hw_fill(struct ath_hal *); Index: ah_osdep.c =================================================================== --- ah_osdep.c (revision 2605) +++ ah_osdep.c (revision 2629) @@ -61,7 +61,7 @@ void ath_hal_detach(struct ath_hal *ah) { - (*ah->ah_detach)(ah); + ath5k_hw_detach(ah); #ifndef __MOD_INC_USE_COUNT module_put(THIS_MODULE); #else @@ -78,6 +78,77 @@ EXPORT_SYMBOL(ath_hal_mhz2ieee); EXPORT_SYMBOL(ath_hal_ieee2mhz); +EXPORT_SYMBOL(ath5k_hw_setup_xr_tx_desc); +EXPORT_SYMBOL(ath5k_hw_proc_2word_tx_status); +EXPORT_SYMBOL(ath5k_hw_put_tx_buf); +EXPORT_SYMBOL(ath5k_hw_tx_start); +EXPORT_SYMBOL(ath5k_hw_get_lladdr); +EXPORT_SYMBOL(ath5k_hw_setup_tx_queueprops); +EXPORT_SYMBOL(ath5k_hw_put_rx_buf); +EXPORT_SYMBOL(ath5k_hw_setup_2word_tx_desc); +EXPORT_SYMBOL(ath5k_hw_init_beacon); +EXPORT_SYMBOL(ath5k_hw_set_cts_timeout); +EXPORT_SYMBOL(ath5k_hw_get_ack_timeout); +EXPORT_SYMBOL(ath5k_hw_get_tx_queueprops); +EXPORT_SYMBOL(ath5k_hw_set_key); +EXPORT_SYMBOL(ath5k_hw_set_gpio); +EXPORT_SYMBOL(ath5k_hw_get_slot_time); +EXPORT_SYMBOL(ath5k_hw_setup_4word_tx_desc); +EXPORT_SYMBOL(ath5k_hw_start_rx); +EXPORT_SYMBOL(ath5k_hw_phy_disable); +EXPORT_SYMBOL(ath5k_hw_set_beacon_timers); +EXPORT_SYMBOL(ath5k_hw_set_capability); +EXPORT_SYMBOL(ath5k_hw_release_tx_queue); +EXPORT_SYMBOL(ath5k_hw_get_rate_table); +EXPORT_SYMBOL(ath5k_hw_set_txpower_limit); +EXPORT_SYMBOL(ath5k_hw_get_capability); +EXPORT_SYMBOL(ath5k_hw_phy_calibrate); +EXPORT_SYMBOL(ath5k_hw_reset_tx_queue); +EXPORT_SYMBOL(ath5k_hw_setup_rx_desc); +EXPORT_SYMBOL(ath5k_hw_is_key_valid); +EXPORT_SYMBOL(ath5k_hw_get_rx_filter); +EXPORT_SYMBOL(ath5k_hw_proc_new_rx_status); +EXPORT_SYMBOL(ath5k_hw_set_slot_time); +EXPORT_SYMBOL(ath5k_hw_reset); +EXPORT_SYMBOL(ath5k_hw_set_ack_timeout); +EXPORT_SYMBOL(ath5k_hw_proc_old_rx_status); +EXPORT_SYMBOL(ath5k_hw_get_keycache_size); +EXPORT_SYMBOL(ath5k_hw_get_tx_buf); +EXPORT_SYMBOL(ath5k_hw_get_rf_gain); +EXPORT_SYMBOL(ath5k_hw_proc_mib_event); +EXPORT_SYMBOL(ath5k_hw_fill_4word_tx_desc); +EXPORT_SYMBOL(ath5k_hw_set_def_antenna); +EXPORT_SYMBOL(ath5k_hw_set_power); +EXPORT_SYMBOL(ath5k_hw_get_def_antenna); +EXPORT_SYMBOL(ath5k_hw_stop_pcu_recv); +EXPORT_SYMBOL(ath5k_hw_set_gpio_output); +EXPORT_SYMBOL(ath5k_hw_stop_tx_dma); +EXPORT_SYMBOL(ath5k_hw_get_cts_timeout); +EXPORT_SYMBOL(ath5k_hw_set_intr); +EXPORT_SYMBOL(ath5k_hw_start_rx_pcu); +EXPORT_SYMBOL(ath5k_hw_update_tx_triglevel); +EXPORT_SYMBOL(ath5k_hw_set_key_lladdr); +EXPORT_SYMBOL(ath5k_hw_set_ledstate); +EXPORT_SYMBOL(ath5k_hw_stop_rx_dma); +EXPORT_SYMBOL(ath5k_hw_get_diag_state); +EXPORT_SYMBOL(ath5k_hw_set_mcast_filter); +EXPORT_SYMBOL(ath5k_hw_setup_tx_queue); +EXPORT_SYMBOL(ath5k_hw_set_rx_signal_monitor); +EXPORT_SYMBOL(ath5k_hw_set_opmode); +EXPORT_SYMBOL(ath5k_hw_reset_key); +EXPORT_SYMBOL(ath5k_hw_is_intr_pending); +EXPORT_SYMBOL(ath5k_hw_set_associd); +EXPORT_SYMBOL(ath5k_hw_proc_4word_tx_status); +EXPORT_SYMBOL(ath5k_hw_get_isr); +EXPORT_SYMBOL(ath5k_hw_get_tsf32); +EXPORT_SYMBOL(ath5k_hw_fill_2word_tx_desc); +EXPORT_SYMBOL(ath5k_hw_num_tx_pending); +EXPORT_SYMBOL(ath5k_hw_get_tsf64); +EXPORT_SYMBOL(ath5k_hw_set_rx_filter); +EXPORT_SYMBOL(ath5k_hw_set_lladdr); +EXPORT_SYMBOL(ath5k_hw_get_rx_buf); + + static int __init init_ath_hal(void) {