ath9k_common.c File Reference
#include "common.h"

Go to the source code of this file.


void ath9k_cmn_update_ichannel (struct ath9k_channel *ichan, struct net80211_channel *chan)
struct ath9k_channelath9k_cmn_get_curchannel (struct net80211_device *dev, struct ath_hw *ah)
void ath9k_cmn_update_txpow (struct ath_hw *ah, u16 cur_txpow, u16 new_txpow, u16 *txpower)

Function Documentation

◆ ath9k_cmn_update_ichannel()

void ath9k_cmn_update_ichannel ( struct ath9k_channel ichan,
struct net80211_channel chan 

Definition at line 29 of file ath9k_common.c.

31 {
32  ichan->channel = chan->center_freq;
33  ichan->chan = chan;
35  if (chan->band == NET80211_BAND_2GHZ) {
36  ichan->chanmode = CHANNEL_G;
38  } else {
39  ichan->chanmode = CHANNEL_A;
41  }
42 }
u16 channel
Definition: hw.h:349
u32 chanmode
Definition: hw.h:351
struct net80211_channel * chan
Definition: hw.h:347
u32 channelFlags
Definition: hw.h:350
#define CHANNEL_A
Definition: ath5k.h:638
#define NET80211_BAND_2GHZ
The 2.4 GHz ISM band, unlicensed in most countries.
Definition: net80211.h:45
#define CHANNEL_G
Definition: ath5k.h:640
u16 center_freq
The center frequency for this channel.
Definition: net80211.h:411
u8 band
The band with which this channel is associated.
Definition: net80211.h:388
Definition: ath5k.h:631
#define CHANNEL_5GHZ
Definition: ath5k.h:633
#define CHANNEL_2GHZ
Definition: ath5k.h:632

References net80211_channel::band, net80211_channel::center_freq, ath9k_channel::chan, ath9k_channel::chanmode, ath9k_channel::channel, CHANNEL_2GHZ, CHANNEL_5GHZ, CHANNEL_A, CHANNEL_G, CHANNEL_OFDM, ath9k_channel::channelFlags, and NET80211_BAND_2GHZ.

Referenced by ath9k_cmn_get_curchannel(), and ath9k_config().

◆ ath9k_cmn_get_curchannel()

struct ath9k_channel* ath9k_cmn_get_curchannel ( struct net80211_device dev,
struct ath_hw ah 

Definition at line 47 of file ath9k_common.c.

49 {
50  struct net80211_channel *curchan = dev->channels + dev->channel;
51  struct ath9k_channel *channel;
52  u8 chan_idx;
54  chan_idx = curchan->hw_value;
55  channel = &ah->channels[chan_idx];
58  return channel;
59 }
u8 channel
The channel currently in use, as an index into the channels array.
Definition: net80211.h:812
u16 hw_value
Hardware channel value.
Definition: net80211.h:414
uint32_t channel
RNDIS channel.
Definition: netvsc.h:14
void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, struct net80211_channel *chan)
Definition: ath9k_common.c:29
An 802.11 RF channel.
Definition: net80211.h:385
struct net80211_channel channels[NET80211_MAX_CHANNELS]
A list of all possible channels we might use.
Definition: net80211.h:806
uint8_t ah
Definition: registers.h:85
uint8_t u8
Definition: stdint.h:19

References ah, ath9k_cmn_update_ichannel(), channel, net80211_device::channel, net80211_device::channels, and net80211_channel::hw_value.

Referenced by ath9k_start(), and ath_radio_disable().

◆ ath9k_cmn_update_txpow()

void ath9k_cmn_update_txpow ( struct ath_hw ah,
u16  cur_txpow,
u16  new_txpow,
u16 txpower 

Definition at line 61 of file ath9k_common.c.

63 {
64  if (cur_txpow != new_txpow) {
65  ath9k_hw_set_txpowerlimit(ah, new_txpow, 0);
66  /* read back in case value is clamped */
67  *txpower = ath9k_hw_regulatory(ah)->power_limit;
68  }
69 }
static struct ath_regulatory * ath9k_hw_regulatory(struct ath_hw *ah)
Definition: hw.h:874
int16_t power_limit
Definition: ath.h:143
void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, int test)
Definition: ath9k_hw.c:1937
uint8_t ah
Definition: registers.h:85

References ah, ath9k_hw_regulatory(), ath9k_hw_set_txpowerlimit(), and ath_regulatory::power_limit.

Referenced by ath9k_config(), ath9k_start(), ath_reset(), and ath_set_channel().