Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/linville/wireless-2.6
  • Loading branch information
David S. Miller committed Apr 17, 2009
2 parents e18e37e + 957b051 commit 75a241f
Show file tree
Hide file tree
Showing 25 changed files with 207 additions and 78 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ps3_gelic_wireless.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,9 @@ static int gelic_wl_associate_bss(struct gelic_wl_info *wl,
if (ret) {
pr_debug("%s: WEP/WPA setup failed %d\n", __func__,
ret);
ret = -EPERM;
gelic_wl_send_iwap_event(wl, NULL);
goto out;
}

/* start association */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -6713,11 +6713,11 @@ static int airo_set_auth(struct net_device *dev,
local->config.authType = AUTH_ENCRYPT;
} else
return -EINVAL;
break;

/* Commit the changes to flags if needed */
if (local->config.authType != currentAuthType)
set_bit (FLAG_COMMIT, &local->flags);
break;
}

case IW_AUTH_WPA_ENABLED:
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/ar9170/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,24 +310,24 @@ struct ar9170_tx_control {

struct ar9170_rx_head {
u8 plcp[12];
};
} __packed;

struct ar9170_rx_tail {
union {
struct {
u8 rssi_ant0, rssi_ant1, rssi_ant2,
rssi_ant0x, rssi_ant1x, rssi_ant2x,
rssi_combined;
};
} __packed;
u8 rssi[7];
};
} __packed;

u8 evm_stream0[6], evm_stream1[6];
u8 phy_err;
u8 SAidx, DAidx;
u8 error;
u8 status;
};
} __packed;

#define AR9170_ENC_ALG_NONE 0x0
#define AR9170_ENC_ALG_WEP64 0x1
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/ar9170/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ static struct usb_device_id ar9170_usb_ids[] = {
{ USB_DEVICE(0x0cf3, 0x9170) },
/* Atheros TG121N */
{ USB_DEVICE(0x0cf3, 0x1001) },
/* Cace Airpcap NX */
{ USB_DEVICE(0xcace, 0x0300) },
/* D-Link DWA 160A */
{ USB_DEVICE(0x07d1, 0x3c10) },
/* Netgear WNDA3100 */
Expand All @@ -67,6 +69,8 @@ static struct usb_device_id ar9170_usb_ids[] = {
{ USB_DEVICE(0x0846, 0x9001) },
/* Zydas ZD1221 */
{ USB_DEVICE(0x0ace, 0x1221) },
/* ZyXEL NWD271N */
{ USB_DEVICE(0x0586, 0x3417) },
/* Z-Com UB81 BG */
{ USB_DEVICE(0x0cde, 0x0023) },
/* Z-Com UB82 ABG */
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/at76c50x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ static struct usb_device_id dev_table[] = {
{ USB_DEVICE(0x03eb, 0x7617), USB_DEVICE_DATA(BOARD_505A) },
/* Siemens Gigaset USB WLAN Adapter 11 */
{ USB_DEVICE(0x1690, 0x0701), USB_DEVICE_DATA(BOARD_505A) },
/* OQO Model 01+ Internal Wi-Fi */
{ USB_DEVICE(0x1557, 0x0002), USB_DEVICE_DATA(BOARD_505A) },
/*
* at76c505amx-rfmd
*/
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
int hdrlen, padsize, retval;
bool decrypt_error = false;
u8 keyix;
__le16 fc;

spin_lock_bh(&sc->rx.rxbuflock);

Expand Down Expand Up @@ -606,6 +607,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
/* see if any padding is done by the hw and remove it */
hdr = (struct ieee80211_hdr *)skb->data;
hdrlen = ieee80211_get_hdrlen_from_skb(skb);
fc = hdr->frame_control;

/* The MAC header is padded to have 32-bit boundary if the
* packet payload is non-zero. The general calculation for
Expand Down Expand Up @@ -690,7 +692,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
sc->rx.rxotherant = 0;
}

if (ieee80211_is_beacon(hdr->frame_control) &&
if (ieee80211_is_beacon(fc) &&
(sc->sc_flags & SC_OP_WAIT_FOR_BEACON)) {
sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON;
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
Expand Down
50 changes: 40 additions & 10 deletions drivers/net/wireless/b43/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,32 @@ static bool b43_dma_mapping_error(struct b43_dmaring *ring,
return 1;
}

static bool b43_rx_buffer_is_poisoned(struct b43_dmaring *ring, struct sk_buff *skb)
{
unsigned char *f = skb->data + ring->frameoffset;

return ((f[0] & f[1] & f[2] & f[3] & f[4] & f[5] & f[6] & f[7]) == 0xFF);
}

static void b43_poison_rx_buffer(struct b43_dmaring *ring, struct sk_buff *skb)
{
struct b43_rxhdr_fw4 *rxhdr;
unsigned char *frame;

/* This poisons the RX buffer to detect DMA failures. */

rxhdr = (struct b43_rxhdr_fw4 *)(skb->data);
rxhdr->frame_len = 0;

B43_WARN_ON(ring->rx_buffersize < ring->frameoffset + sizeof(struct b43_plcp_hdr6) + 2);
frame = skb->data + ring->frameoffset;
memset(frame, 0xFF, sizeof(struct b43_plcp_hdr6) + 2 /* padding */);
}

static int setup_rx_descbuffer(struct b43_dmaring *ring,
struct b43_dmadesc_generic *desc,
struct b43_dmadesc_meta *meta, gfp_t gfp_flags)
{
struct b43_rxhdr_fw4 *rxhdr;
dma_addr_t dmaaddr;
struct sk_buff *skb;

Expand All @@ -568,6 +589,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags);
if (unlikely(!skb))
return -ENOMEM;
b43_poison_rx_buffer(ring, skb);
dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0);
if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) {
/* ugh. try to realloc in zone_dma */
Expand All @@ -578,6 +600,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags);
if (unlikely(!skb))
return -ENOMEM;
b43_poison_rx_buffer(ring, skb);
dmaaddr = map_descbuffer(ring, skb->data,
ring->rx_buffersize, 0);
if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) {
Expand All @@ -592,9 +615,6 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
ring->ops->fill_descriptor(ring, desc, dmaaddr,
ring->rx_buffersize, 0, 0, 0);

rxhdr = (struct b43_rxhdr_fw4 *)(skb->data);
rxhdr->frame_len = 0;

return 0;
}

Expand Down Expand Up @@ -1483,12 +1503,17 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
len = le16_to_cpu(rxhdr->frame_len);
} while (len == 0 && i++ < 5);
if (unlikely(len == 0)) {
/* recycle the descriptor buffer. */
sync_descbuffer_for_device(ring, meta->dmaaddr,
ring->rx_buffersize);
goto drop;
dmaaddr = meta->dmaaddr;
goto drop_recycle_buffer;
}
}
if (unlikely(b43_rx_buffer_is_poisoned(ring, skb))) {
/* Something went wrong with the DMA.
* The device did not touch the buffer and did not overwrite the poison. */
b43dbg(ring->dev->wl, "DMA RX: Dropping poisoned buffer.\n");
dmaaddr = meta->dmaaddr;
goto drop_recycle_buffer;
}
if (unlikely(len > ring->rx_buffersize)) {
/* The data did not fit into one descriptor buffer
* and is split over multiple buffers.
Expand All @@ -1501,6 +1526,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
while (1) {
desc = ops->idx2desc(ring, *slot, &meta);
/* recycle the descriptor buffer. */
b43_poison_rx_buffer(ring, meta->skb);
sync_descbuffer_for_device(ring, meta->dmaaddr,
ring->rx_buffersize);
*slot = next_slot(ring, *slot);
Expand All @@ -1519,8 +1545,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
err = setup_rx_descbuffer(ring, desc, meta, GFP_ATOMIC);
if (unlikely(err)) {
b43dbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n");
sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize);
goto drop;
goto drop_recycle_buffer;
}

unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0);
Expand All @@ -1530,6 +1555,11 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
b43_rx(ring->dev, skb, rxhdr);
drop:
return;

drop_recycle_buffer:
/* Poison and recycle the RX buffer. */
b43_poison_rx_buffer(ring, skb);
sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize);
}

void b43_dma_rx(struct b43_dmaring *ring)
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3974,6 +3974,11 @@ static void setup_struct_phy_for_init(struct b43_wldev *dev,
phy->next_txpwr_check_time = jiffies;
/* PHY TX errors counter. */
atomic_set(&phy->txerr_cnt, B43_PHY_TX_BADNESS_LIMIT);

#if B43_DEBUG
phy->phy_locked = 0;
phy->radio_locked = 0;
#endif
}

static void setup_struct_wldev_for_init(struct b43_wldev *dev)
Expand Down
16 changes: 12 additions & 4 deletions drivers/net/wireless/b43/phy_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,16 @@ void b43_radio_lock(struct b43_wldev *dev)
{
u32 macctl;

#if B43_DEBUG
B43_WARN_ON(dev->phy.radio_locked);
dev->phy.radio_locked = 1;
#endif

macctl = b43_read32(dev, B43_MMIO_MACCTL);
B43_WARN_ON(macctl & B43_MACCTL_RADIOLOCK);
macctl |= B43_MACCTL_RADIOLOCK;
b43_write32(dev, B43_MMIO_MACCTL, macctl);
/* Commit the write and wait for the device
* to exit any radio register access. */
/* Commit the write and wait for the firmware
* to finish any radio register access. */
b43_read32(dev, B43_MMIO_MACCTL);
udelay(10);
}
Expand All @@ -145,11 +149,15 @@ void b43_radio_unlock(struct b43_wldev *dev)
{
u32 macctl;

#if B43_DEBUG
B43_WARN_ON(!dev->phy.radio_locked);
dev->phy.radio_locked = 0;
#endif

/* Commit any write */
b43_read16(dev, B43_MMIO_PHY_VER);
/* unlock */
macctl = b43_read32(dev, B43_MMIO_MACCTL);
B43_WARN_ON(!(macctl & B43_MACCTL_RADIOLOCK));
macctl &= ~B43_MACCTL_RADIOLOCK;
b43_write32(dev, B43_MMIO_MACCTL, macctl);
}
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/b43/phy_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ struct b43_phy {
atomic_t txerr_cnt;

#ifdef CONFIG_B43_DEBUG
/* PHY registers locked by b43_phy_lock()? */
/* PHY registers locked (w.r.t. firmware) */
bool phy_locked;
/* Radio registers locked (w.r.t. firmware) */
bool radio_locked;
#endif /* B43_DEBUG */
};

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -4913,6 +4913,8 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)

hw->wiphy->custom_regulatory = true;

hw->wiphy->max_scan_ssids = 1; /* WILL FIX */

/* Default value; 4 EDCA QOS priorities */
hw->queues = 4;

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/libertas/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
lbs_deb_rx("rx err: frame received with bad length\n");
dev->stats.rx_length_errors++;
ret = 0;
dev_kfree_skb(skb);
goto done;
}

Expand All @@ -181,6 +182,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
lbs_pr_alert("rxpd not ok\n");
dev->stats.rx_errors++;
ret = 0;
dev_kfree_skb(skb);
goto done;
}

Expand Down
8 changes: 3 additions & 5 deletions drivers/net/wireless/orinoco/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,13 @@ int __orinoco_hw_set_tkip_key(hermes_t *hw, int key_idx, int set_tx,
}

/* Wait upto 100ms for tx queue to empty */
k = 100;
do {
k--;
for (k = 100; k > 0; k--) {
udelay(1000);
ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY,
&xmitting);
if (ret)
if (ret || !xmitting)
break;
} while ((k > 0) && xmitting);
}

if (k == 0)
ret = -ETIMEDOUT;
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/wireless/p54/p54.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* published by the Free Software Foundation.
*/

#ifdef CONFIG_MAC80211_LEDS
#ifdef CONFIG_P54_LEDS
#include <linux/leds.h>
#endif /* CONFIG_MAC80211_LEDS */
#endif /* CONFIG_P54_LEDS */

enum p54_control_frame_types {
P54_CONTROL_TYPE_SETUP = 0,
Expand Down Expand Up @@ -116,7 +116,7 @@ enum fw_state {
FW_STATE_RESETTING,
};

#ifdef CONFIG_MAC80211_LEDS
#ifdef CONFIG_P54_LEDS

#define P54_LED_MAX_NAME_LEN 31

Expand All @@ -129,7 +129,7 @@ struct p54_led_dev {
unsigned int registered;
};

#endif /* CONFIG_MAC80211_LEDS */
#endif /* CONFIG_P54_LEDS */

struct p54_common {
struct ieee80211_hw *hw;
Expand Down Expand Up @@ -177,10 +177,10 @@ struct p54_common {
u8 privacy_caps;
u8 rx_keycache_size;
/* LED management */
#ifdef CONFIG_MAC80211_LEDS
#ifdef CONFIG_P54_LEDS
struct p54_led_dev assoc_led;
struct p54_led_dev tx_led;
#endif /* CONFIG_MAC80211_LEDS */
#endif /* CONFIG_P54_LEDS */
u16 softled_state; /* bit field of glowing LEDs */
};

Expand Down
Loading

0 comments on commit 75a241f

Please sign in to comment.