Back to home page

OSCL-LXR

 
 

    


0001 /*-
0002  * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
0003  * All rights reserved.
0004  *
0005  * Redistribution and use in source and binary forms, with or without
0006  * modification, are permitted provided that the following conditions
0007  * are met:
0008  * 1. Redistributions of source code must retain the above copyright
0009  *    notice, this list of conditions and the following disclaimer,
0010  *    without modification.
0011  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
0012  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
0013  *    redistribution must be conditioned upon including a substantially
0014  *    similar Disclaimer requirement for further binary redistribution.
0015  * 3. Neither the names of the above-listed copyright holders nor the names
0016  *    of any contributors may be used to endorse or promote products derived
0017  *    from this software without specific prior written permission.
0018  *
0019  * Alternatively, this software may be distributed under the terms of the
0020  * GNU General Public License ("GPL") version 2 as published by the Free
0021  * Software Foundation.
0022  *
0023  * NO WARRANTY
0024  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0025  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0026  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
0027  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
0028  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
0029  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0030  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0031  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
0032  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0033  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
0034  * THE POSSIBILITY OF SUCH DAMAGES.
0035  *
0036  */
0037 
0038 /*
0039  * Definitions for the Atheros Wireless LAN controller driver.
0040  */
0041 #ifndef _DEV_ATH5K_BASE_H
0042 #define _DEV_ATH5K_BASE_H
0043 
0044 struct ieee80211_vif;
0045 struct ieee80211_hw;
0046 struct ath5k_hw;
0047 struct ath5k_txq;
0048 struct ieee80211_channel;
0049 struct ath_bus_ops;
0050 struct ieee80211_tx_control;
0051 enum nl80211_iftype;
0052 
0053 enum ath5k_srev_type {
0054     AR5K_VERSION_MAC,
0055     AR5K_VERSION_RAD,
0056 };
0057 
0058 struct ath5k_srev_name {
0059     const char      *sr_name;
0060     enum ath5k_srev_type    sr_type;
0061     u_int           sr_val;
0062 };
0063 
0064 struct ath5k_buf {
0065     struct list_head        list;
0066     struct ath5k_desc       *desc;      /* virtual addr of desc */
0067     dma_addr_t          daddr;      /* physical addr of desc */
0068     struct sk_buff          *skb;       /* skbuff for buf */
0069     dma_addr_t          skbaddr;    /* physical addr of skb data */
0070     struct ieee80211_tx_rate    rates[4];   /* number of multi-rate stages */
0071 };
0072 
0073 struct ath5k_vif {
0074     bool            assoc; /* are we associated or not */
0075     enum nl80211_iftype opmode;
0076     int         bslot;
0077     struct ath5k_buf    *bbuf; /* beacon buffer */
0078 };
0079 
0080 struct ath5k_vif_iter_data {
0081     const u8    *hw_macaddr;
0082     u8      mask[ETH_ALEN];
0083     u8      active_mac[ETH_ALEN]; /* first active MAC */
0084     bool        need_set_hw_addr;
0085     bool        found_active;
0086     bool        any_assoc;
0087     enum nl80211_iftype opmode;
0088     int n_stas;
0089 };
0090 
0091 void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif);
0092 bool ath5k_any_vif_assoc(struct ath5k_hw *ah);
0093 
0094 int ath5k_start(struct ieee80211_hw *hw);
0095 void ath5k_stop(struct ieee80211_hw *hw);
0096 
0097 void ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf);
0098 int ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
0099 void ath5k_beacon_config(struct ath5k_hw *ah);
0100 void ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable);
0101 
0102 void ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah,
0103                     struct ieee80211_vif *vif);
0104 int ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef);
0105 void ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
0106 void ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
0107 void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
0108             struct ath5k_txq *txq, struct ieee80211_tx_control *control);
0109 
0110 const char *ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val);
0111 
0112 int ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops);
0113 void ath5k_deinit_ah(struct ath5k_hw *ah);
0114 
0115 /* Check whether BSSID mask is supported */
0116 #define ath5k_hw_hasbssidmask(_ah) (ah->ah_version == AR5K_AR5212)
0117 
0118 /* Check whether virtual EOL is supported */
0119 #define ath5k_hw_hasveol(_ah) (ah->ah_version != AR5K_AR5210)
0120 
0121 #endif  /* _DEV_ATH5K_BASE_H */