Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111415
b: refs/heads/master
c: e0a58ea
h: refs/heads/master
i:
  111413: 2f7be49
  111411: 7bc3ee4
  111407: 87b9dd2
v: v3
  • Loading branch information
Christian Lamparter authored and John W. Linville committed Sep 8, 2008
1 parent f169ca9 commit 36df81d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b7dcd9652c8d6b2a0dd04f3a3e6ca0574560042
refs/heads/master: e0a58eacf540c65763288c81caa74013f62d7234
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/p54/p54.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ struct p54_common {
struct mutex conf_mutex;
u8 mac_addr[ETH_ALEN];
u8 bssid[ETH_ALEN];
__le16 filter_type;
struct pda_iq_autocal_entry *iq_autocal;
unsigned int iq_autocal_len;
struct pda_channel_output_limit *output_limit;
unsigned int output_limit_len;
struct pda_pa_curve_data *curve_data;
u16 rxhw;
u8 version;
u8 rx_antenna;
unsigned int tx_hdr_len;
void *cached_vdcf;
unsigned int fw_var;
Expand Down
39 changes: 18 additions & 21 deletions trunk/drivers/net/wireless/p54/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
}

static int p54_set_filter(struct ieee80211_hw *dev, u16 filter_type,
const u8 *dst, const u8 *src, u8 antenna,
u32 magic3, u32 magic8, u32 magic9)
const u8 *bssid)
{
struct p54_common *priv = dev->priv;
struct p54_control_hdr *hdr;
Expand All @@ -806,19 +805,19 @@ static int p54_set_filter(struct ieee80211_hw *dev, u16 filter_type,
p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + sizeof(*filter));
hdr->type = cpu_to_le16(P54_CONTROL_TYPE_FILTER_SET);

filter->filter_type = cpu_to_le16(filter_type);
memcpy(filter->dst, dst, ETH_ALEN);
if (!src)
memset(filter->src, ~0, ETH_ALEN);
priv->filter_type = filter->filter_type = cpu_to_le16(filter_type);
memcpy(filter->mac_addr, priv->mac_addr, ETH_ALEN);
if (!bssid)
memset(filter->bssid, ~0, ETH_ALEN);
else
memcpy(filter->src, src, ETH_ALEN);
filter->antenna = antenna;
filter->magic3 = cpu_to_le32(magic3);
memcpy(filter->bssid, bssid, ETH_ALEN);

filter->rx_antenna = priv->rx_antenna;
filter->basic_rate_mask = cpu_to_le32(0x15F);
filter->rx_addr = cpu_to_le32(priv->rx_end);
filter->max_rx = cpu_to_le16(priv->rx_mtu);
filter->rxhw = cpu_to_le16(priv->rxhw);
filter->magic8 = cpu_to_le16(magic8);
filter->magic9 = cpu_to_le16(magic9);
filter->wakeup_timer = cpu_to_le16(500);

priv->tx(dev, hdr, sizeof(*hdr) + sizeof(*filter), 1);
return 0;
Expand Down Expand Up @@ -1044,12 +1043,11 @@ static int p54_add_interface(struct ieee80211_hw *dev,

memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);

p54_set_filter(dev, 0, priv->mac_addr, NULL, 0, 1, 0, 0xF642);
p54_set_filter(dev, 0, priv->mac_addr, NULL, 1, 0, 0, 0xF642);
p54_set_filter(dev, 0, NULL);

switch (conf->type) {
case IEEE80211_IF_TYPE_STA:
p54_set_filter(dev, 1, priv->mac_addr, NULL, 0, 0x15F, 0x1F4, 0);
p54_set_filter(dev, 1, NULL);
break;
default:
BUG(); /* impossible */
Expand All @@ -1067,7 +1065,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev,
struct p54_common *priv = dev->priv;
priv->mode = IEEE80211_IF_TYPE_MNTR;
memset(priv->mac_addr, 0, ETH_ALEN);
p54_set_filter(dev, 0, priv->mac_addr, NULL, 2, 0, 0, 0);
p54_set_filter(dev, 0, NULL);
}

static int p54_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
Expand All @@ -1076,6 +1074,8 @@ static int p54_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
struct p54_common *priv = dev->priv;

mutex_lock(&priv->conf_mutex);
priv->rx_antenna = (conf->antenna_sel_rx == 0) ?
2 : conf->antenna_sel_tx - 1;
ret = p54_set_freq(dev, cpu_to_le16(conf->channel->center_freq));
p54_set_vdcf(dev);
mutex_unlock(&priv->conf_mutex);
Expand All @@ -1089,8 +1089,7 @@ static int p54_config_interface(struct ieee80211_hw *dev,
struct p54_common *priv = dev->priv;

mutex_lock(&priv->conf_mutex);
p54_set_filter(dev, 0, priv->mac_addr, conf->bssid, 0, 1, 0, 0xF642);
p54_set_filter(dev, 0, priv->mac_addr, conf->bssid, 2, 0, 0, 0);
p54_set_filter(dev, 0, conf->bssid);
p54_set_leds(dev, 1, !is_multicast_ether_addr(conf->bssid), 0);
memcpy(priv->bssid, conf->bssid, ETH_ALEN);
mutex_unlock(&priv->conf_mutex);
Expand All @@ -1108,11 +1107,9 @@ static void p54_configure_filter(struct ieee80211_hw *dev,

if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
p54_set_filter(dev, 0, priv->mac_addr,
NULL, 2, 0, 0, 0);
p54_set_filter(dev, 0, NULL);
else
p54_set_filter(dev, 0, priv->mac_addr,
priv->bssid, 2, 0, 0, 0);
p54_set_filter(dev, 0, priv->bssid);
}
}

Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/net/wireless/p54/p54common.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,17 @@ struct p54_tx_control_allocdata {

struct p54_tx_control_filter {
__le16 filter_type;
u8 dst[ETH_ALEN];
u8 src[ETH_ALEN];
u8 antenna;
u8 debug;
__le32 magic3;
u8 rates[8]; // FIXME: what's this for?
u8 mac_addr[ETH_ALEN];
u8 bssid[ETH_ALEN];
u8 rx_antenna;
u8 rx_align;
__le32 basic_rate_mask;
u8 rts_rates[8];
__le32 rx_addr;
__le16 max_rx;
__le16 rxhw;
__le16 magic8;
__le16 magic9;
__le16 wakeup_timer;
__le16 unalloc;
} __attribute__ ((packed));

struct p54_tx_control_channel {
Expand Down

0 comments on commit 36df81d

Please sign in to comment.