Skip to content

Commit

Permalink
rt2x00: Move link tuning into seperate file
Browse files Browse the repository at this point in the history
Move link and antenna tuning into a seperate file named rt2x00link.c,
this makes the interface to the link tuner a lot cleaner.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Ivo van Doorn authored and John W. Linville committed Jan 29, 2009
1 parent 7d7f19c commit 84e3196
Show file tree
Hide file tree
Showing 7 changed files with 494 additions and 331 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/rt2x00/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ rt2x00lib-y += rt2x00dev.o
rt2x00lib-y += rt2x00mac.o
rt2x00lib-y += rt2x00config.o
rt2x00lib-y += rt2x00queue.o
rt2x00lib-y += rt2x00link.o
rt2x00lib-$(CONFIG_RT2X00_LIB_DEBUGFS) += rt2x00debug.o
rt2x00lib-$(CONFIG_RT2X00_LIB_CRYPTO) += rt2x00crypto.o
rt2x00lib-$(CONFIG_RT2X00_LIB_RFKILL) += rt2x00rfkill.o
Expand Down
29 changes: 1 addition & 28 deletions drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ struct link_qual {
* (WEIGHT_TX * tx_percentage) +
* (WEIGHT_RX * rx_percentage)) / 100
*
* This value should then be checked to not be greated then 100.
* This value should then be checked to not be greater then 100.
*/
int rx_percentage;
int rx_success;
Expand Down Expand Up @@ -318,33 +318,6 @@ static inline int rt2x00_get_link_rssi(struct link *link)
return DEFAULT_RSSI;
}

static inline int rt2x00_get_link_ant_rssi(struct link *link)
{
if (link->ant.rssi_ant && link->qual.rx_success)
return link->ant.rssi_ant;
return DEFAULT_RSSI;
}

static inline void rt2x00_reset_link_ant_rssi(struct link *link)
{
link->ant.rssi_ant = 0;
}

static inline int rt2x00_get_link_ant_rssi_history(struct link *link,
enum antenna ant)
{
if (link->ant.rssi_history[ant - ANTENNA_A])
return link->ant.rssi_history[ant - ANTENNA_A];
return DEFAULT_RSSI;
}

static inline int rt2x00_update_ant_rssi(struct link *link, int rssi)
{
int old_rssi = link->ant.rssi_history[link->ant.active.rx - ANTENNA_A];
link->ant.rssi_history[link->ant.active.rx - ANTENNA_A] = rssi;
return old_rssi;
}

/*
* Interface structure
* Per interface configuration details, this structure
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/wireless/rt2x00/rt2x00config.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
*/
rt2x00dev->ops->lib->config_ant(rt2x00dev, ant);

rt2x00lib_reset_link_tuner(rt2x00dev);
rt2x00_reset_link_ant_rssi(&rt2x00dev->link);
rt2x00link_reset_tuner(rt2x00dev, true);

memcpy(active, ant, sizeof(*ant));

Expand Down Expand Up @@ -191,7 +190,7 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
* which means we need to reset the link tuner.
*/
if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL)
rt2x00lib_reset_link_tuner(rt2x00dev);
rt2x00link_reset_tuner(rt2x00dev, false);

rt2x00dev->curr_band = conf->channel->band;
rt2x00dev->tx_power = conf->power_level;
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/rt2x00/rt2x00debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ struct rt2x00debug_intf {
};

void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
enum cipher cipher, enum rx_crypto status)
struct rxdone_entry_desc *rxdesc)
{
struct rt2x00debug_intf *intf = rt2x00dev->debugfs_intf;
enum cipher cipher = rxdesc->cipher;
enum rx_crypto status = rxdesc->cipher_status;

if (cipher == CIPHER_TKIP_NO_MIC)
cipher = CIPHER_TKIP;
Expand Down
Loading

0 comments on commit 84e3196

Please sign in to comment.