Skip to content

Commit

Permalink
Merge branch 'fixes-jgarzik' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/linville/wireless-2.6 into upstream
  • Loading branch information
Jeff Garzik committed Oct 20, 2007
2 parents c9b2ca7 + 1f06862 commit fe25200
Show file tree
Hide file tree
Showing 17 changed files with 137 additions and 86 deletions.
5 changes: 2 additions & 3 deletions drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include "pio.h"
#include "sysfs.h"
#include "xmit.h"
#include "sysfs.h"
#include "lo.h"
#include "pcmcia.h"

Expand Down Expand Up @@ -3495,7 +3494,7 @@ static int b43_start(struct ieee80211_hw *hw)
struct b43_wl *wl = hw_to_b43_wl(hw);
struct b43_wldev *dev = wl->current_dev;
int did_init = 0;
int err;
int err = 0;

mutex_lock(&wl->mutex);

Expand All @@ -3521,7 +3520,7 @@ static int b43_start(struct ieee80211_hw *hw)
return err;
}

void b43_stop(struct ieee80211_hw *hw)
static void b43_stop(struct ieee80211_hw *hw)
{
struct b43_wl *wl = hw_to_b43_wl(hw);
struct b43_wldev *dev = wl->current_dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/b43legacy/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3306,7 +3306,7 @@ static int b43legacy_start(struct ieee80211_hw *hw)
struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
struct b43legacy_wldev *dev = wl->current_dev;
int did_init = 0;
int err;
int err = 0;

mutex_lock(&wl->mutex);

Expand Down
39 changes: 39 additions & 0 deletions drivers/net/wireless/ipw2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -2105,12 +2105,46 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status)
queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
}

static void send_scan_event(void *data)
{
struct ipw2100_priv *priv = data;
union iwreq_data wrqu;

wrqu.data.length = 0;
wrqu.data.flags = 0;
wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL);
}

static void ipw2100_scan_event_later(struct work_struct *work)
{
send_scan_event(container_of(work, struct ipw2100_priv,
scan_event_later.work));
}

static void ipw2100_scan_event_now(struct work_struct *work)
{
send_scan_event(container_of(work, struct ipw2100_priv,
scan_event_now));
}

static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)
{
IPW_DEBUG_SCAN("scan complete\n");
/* Age the scan results... */
priv->ieee->scans++;
priv->status &= ~STATUS_SCANNING;

/* Only userspace-requested scan completion events go out immediately */
if (!priv->user_requested_scan) {
if (!delayed_work_pending(&priv->scan_event_later))
queue_delayed_work(priv->workqueue,
&priv->scan_event_later,
round_jiffies(msecs_to_jiffies(4000)));
} else {
priv->user_requested_scan = 0;
cancel_delayed_work(&priv->scan_event_later);
queue_work(priv->workqueue, &priv->scan_event_now);
}
}

#ifdef CONFIG_IPW2100_DEBUG
Expand Down Expand Up @@ -4378,6 +4412,7 @@ static void ipw2100_kill_workqueue(struct ipw2100_priv *priv)
cancel_delayed_work(&priv->wx_event_work);
cancel_delayed_work(&priv->hang_check);
cancel_delayed_work(&priv->rf_kill);
cancel_delayed_work(&priv->scan_event_later);
destroy_workqueue(priv->workqueue);
priv->workqueue = NULL;
}
Expand Down Expand Up @@ -6121,6 +6156,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work);
INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check);
INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
INIT_WORK(&priv->scan_event_now, ipw2100_scan_event_now);
INIT_DELAYED_WORK(&priv->scan_event_later, ipw2100_scan_event_later);

tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
ipw2100_irq_tasklet, (unsigned long)priv);
Expand Down Expand Up @@ -7425,6 +7462,8 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
}

IPW_DEBUG_WX("Initiating scan...\n");

priv->user_requested_scan = 1;
if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) {
IPW_DEBUG_WX("Start scan failed.\n");

Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/ipw2100.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,10 @@ struct ipw2100_priv {
struct delayed_work wx_event_work;
struct delayed_work hang_check;
struct delayed_work rf_kill;
struct work_struct scan_event_now;
struct delayed_work scan_event_later;

int user_requested_scan;

u32 interrupts;
int tx_interrupts;
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/wireless/iwlwifi/iwl-3945-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@

#include <linux/workqueue.h>

#include <net/mac80211.h>
#include <linux/wireless.h>

#define IWL 3945

#include "../net/mac80211/ieee80211_rate.h"
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <net/mac80211.h>

#include <linux/etherdevice.h>
#include <linux/delay.h>

#define IWL 3945

Expand Down
13 changes: 8 additions & 5 deletions drivers/net/wireless/iwlwifi/iwl-4965-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@

#include <linux/workqueue.h>

#include <net/mac80211.h>
#include <linux/wireless.h>

#define IWL 4965

#include "../net/mac80211/ieee80211_rate.h"
Expand Down Expand Up @@ -2024,12 +2021,18 @@ static int open_file_generic(struct inode *inode, struct file *file)
static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
struct iwl_rate *mcs, int index)
{
const u32 cck_rate = 0x820A;
u32 base_rate;

if (rs_priv->phymode == (u8) MODE_IEEE80211A)
base_rate = 0x800D;
else
base_rate = 0x820A;

if (rs_priv->dbg_fixed.rate_n_flags) {
if (index < 12)
mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags;
else
mcs->rate_n_flags = cck_rate;
mcs->rate_n_flags = base_rate;
IWL_DEBUG_RATE("Fixed rate ON\n");
return;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <net/mac80211.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>

#define IWL 4965

Expand Down
44 changes: 26 additions & 18 deletions drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <linux/firmware.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_arp.h>

Expand Down Expand Up @@ -1749,21 +1747,22 @@ static void iwl_unset_hw_setting(struct iwl_priv *priv)
* return : set the bit for each supported rate insert in ie
*/
static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
u16 basic_rate, int max_count)
u16 basic_rate, int *left)
{
u16 ret_rates = 0, bit;
int i;
u8 *rates;

rates = &(ie[1]);
u8 *cnt = ie;
u8 *rates = ie + 1;

for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
if (bit & supported_rate) {
ret_rates |= bit;
rates[*ie] = iwl_rates[i].ieee |
((bit & basic_rate) ? 0x80 : 0x00);
*ie = *ie + 1;
if (*ie >= max_count)
rates[*cnt] = iwl_rates[i].ieee |
((bit & basic_rate) ? 0x80 : 0x00);
(*cnt)++;
(*left)--;
if ((*left <= 0) ||
(*cnt >= IWL_SUPPORTED_RATES_IE_LEN))
break;
}
}
Expand All @@ -1780,7 +1779,7 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
{
int len = 0;
u8 *pos = NULL;
u16 ret_rates;
u16 active_rates, ret_rates, cck_rates;

/* Make sure there is enough space for the probe request,
* two mandatory IEs and the data */
Expand Down Expand Up @@ -1825,19 +1824,27 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
left -= 2;
if (left < 0)
return 0;

/* ... fill it in... */
*pos++ = WLAN_EID_SUPP_RATES;
*pos = 0;
ret_rates = priv->active_rate = priv->rates_mask;

priv->active_rate = priv->rates_mask;
active_rates = priv->active_rate;
priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;

iwl_supported_rate_to_ie(pos, priv->active_rate,
priv->active_rate_basic, left);
cck_rates = IWL_CCK_RATES_MASK & active_rates;
ret_rates = iwl_supported_rate_to_ie(pos, cck_rates,
priv->active_rate_basic, &left);
active_rates &= ~ret_rates;

ret_rates = iwl_supported_rate_to_ie(pos, active_rates,
priv->active_rate_basic, &left);
active_rates &= ~ret_rates;

len += 2 + *pos;
pos += (*pos) + 1;
ret_rates = ~ret_rates & priv->active_rate;

if (ret_rates == 0)
if (active_rates == 0)
goto fill_end;

/* fill in supported extended rate */
Expand All @@ -1848,7 +1855,8 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
/* ... fill it in... */
*pos++ = WLAN_EID_EXT_SUPP_RATES;
*pos = 0;
iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left);
iwl_supported_rate_to_ie(pos, active_rates,
priv->active_rate_basic, &left);
if (*pos > 0)
len += 2 + *pos;

Expand Down
52 changes: 30 additions & 22 deletions drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <linux/firmware.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_arp.h>

Expand Down Expand Up @@ -1802,21 +1800,22 @@ static void iwl_unset_hw_setting(struct iwl_priv *priv)
* return : set the bit for each supported rate insert in ie
*/
static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
u16 basic_rate, int max_count)
u16 basic_rate, int *left)
{
u16 ret_rates = 0, bit;
int i;
u8 *rates;

rates = &(ie[1]);
u8 *cnt = ie;
u8 *rates = ie + 1;

for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
if (bit & supported_rate) {
ret_rates |= bit;
rates[*ie] = iwl_rates[i].ieee |
((bit & basic_rate) ? 0x80 : 0x00);
*ie = *ie + 1;
if (*ie >= max_count)
rates[*cnt] = iwl_rates[i].ieee |
((bit & basic_rate) ? 0x80 : 0x00);
(*cnt)++;
(*left)--;
if ((*left <= 0) ||
(*cnt >= IWL_SUPPORTED_RATES_IE_LEN))
break;
}
}
Expand All @@ -1839,7 +1838,7 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
{
int len = 0;
u8 *pos = NULL;
u16 ret_rates;
u16 active_rates, ret_rates, cck_rates;

/* Make sure there is enough space for the probe request,
* two mandatory IEs and the data */
Expand Down Expand Up @@ -1884,19 +1883,27 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
left -= 2;
if (left < 0)
return 0;

/* ... fill it in... */
*pos++ = WLAN_EID_SUPP_RATES;
*pos = 0;
ret_rates = priv->active_rate = priv->rates_mask;

priv->active_rate = priv->rates_mask;
active_rates = priv->active_rate;
priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;

iwl_supported_rate_to_ie(pos, priv->active_rate,
priv->active_rate_basic, left);
cck_rates = IWL_CCK_RATES_MASK & active_rates;
ret_rates = iwl_supported_rate_to_ie(pos, cck_rates,
priv->active_rate_basic, &left);
active_rates &= ~ret_rates;

ret_rates = iwl_supported_rate_to_ie(pos, active_rates,
priv->active_rate_basic, &left);
active_rates &= ~ret_rates;

len += 2 + *pos;
pos += (*pos) + 1;
ret_rates = ~ret_rates & priv->active_rate;

if (ret_rates == 0)
if (active_rates == 0)
goto fill_end;

/* fill in supported extended rate */
Expand All @@ -1907,7 +1914,8 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
/* ... fill it in... */
*pos++ = WLAN_EID_EXT_SUPP_RATES;
*pos = 0;
iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left);
iwl_supported_rate_to_ie(pos, active_rates,
priv->active_rate_basic, &left);
if (*pos > 0)
len += 2 + *pos;

Expand Down Expand Up @@ -4494,13 +4502,13 @@ static u8 ratio2dB[100] = {
* Conversion assumes that levels are voltages (20*log), not powers (10*log). */
int iwl_calc_db_from_ratio(int sig_ratio)
{
/* Anything above 1000:1 just report as 60 dB */
if (sig_ratio > 1000)
/* 1000:1 or higher just report as 60 dB */
if (sig_ratio >= 1000)
return 60;

/* Above 100:1, divide by 10 and use table,
/* 100:1 or higher, divide by 10 and use table,
* add 20 dB to make up for divide by 10 */
if (sig_ratio > 100)
if (sig_ratio >= 100)
return (20 + (int)ratio2dB[sig_ratio/10]);

/* We shouldn't see this */
Expand Down
Loading

0 comments on commit fe25200

Please sign in to comment.