Skip to content

Commit

Permalink
Merge branch 'for-linville' of git://github.com/lucacoelho/wl12xx
Browse files Browse the repository at this point in the history
  • Loading branch information
John W. Linville committed Sep 27, 2011
2 parents bb8f2cb + 6b66189 commit 85a8eef
Show file tree
Hide file tree
Showing 11 changed files with 274 additions and 106 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wireless/wl12xx/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
wl12xx-objs = main.o cmd.o io.o event.o tx.o rx.o ps.o acx.o \
boot.o init.o debugfs.o scan.o

wl12xx_spi-objs = spi.o
wl12xx_spi-objs = spi.o
wl12xx_sdio-objs = sdio.o
wl12xx_sdio_test-objs = sdio_test.o
wl12xx_sdio_test-objs = sdio_test.o

wl12xx-$(CONFIG_NL80211_TESTMODE) += testmode.o
obj-$(CONFIG_WL12XX) += wl12xx.o
obj-$(CONFIG_WL12XX_SPI) += wl12xx_spi.o
obj-$(CONFIG_WL12XX_SDIO) += wl12xx_sdio.o

obj-$(CONFIG_WL12XX_SDIO_TEST) += wl12xx_sdio_test.o
obj-$(CONFIG_WL12XX_SDIO_TEST) += wl12xx_sdio_test.o

# small builtin driver bit
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx_platform_data.o
43 changes: 25 additions & 18 deletions drivers/net/wireless/wl12xx/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,9 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl)

wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wl->role_id);

/*
* We currently do not support hidden SSID. The real SSID
* should be fetched from mac80211 first.
*/
if (wl->ssid_len == 0) {
wl1271_warning("Hidden SSID currently not supported for AP");
/* trying to use hidden SSID with an old hostapd version */
if (wl->ssid_len == 0 && !bss_conf->hidden_ssid) {
wl1271_error("got a null SSID from beacon/bss");
ret = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -695,9 +692,18 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl)
cmd->ap.dtim_interval = bss_conf->dtim_period;
cmd->ap.beacon_expiry = WL1271_AP_DEF_BEACON_EXP;
cmd->channel = wl->channel;
cmd->ap.ssid_len = wl->ssid_len;
cmd->ap.ssid_type = WL12XX_SSID_TYPE_PUBLIC;
memcpy(cmd->ap.ssid, wl->ssid, wl->ssid_len);

if (!bss_conf->hidden_ssid) {
/* take the SSID from the beacon for backward compatibility */
cmd->ap.ssid_type = WL12XX_SSID_TYPE_PUBLIC;
cmd->ap.ssid_len = wl->ssid_len;
memcpy(cmd->ap.ssid, wl->ssid, wl->ssid_len);
} else {
cmd->ap.ssid_type = WL12XX_SSID_TYPE_HIDDEN;
cmd->ap.ssid_len = bss_conf->ssid_len;
memcpy(cmd->ap.ssid, bss_conf->ssid, bss_conf->ssid_len);
}

cmd->ap.local_rates = cpu_to_le32(0xffffffff);

switch (wl->band) {
Expand Down Expand Up @@ -1106,6 +1112,7 @@ int wl1271_cmd_build_probe_req(struct wl1271 *wl,
{
struct sk_buff *skb;
int ret;
u32 rate;

skb = ieee80211_probereq_get(wl->hw, wl->vif, ssid, ssid_len,
ie, ie_len);
Expand All @@ -1116,14 +1123,13 @@ int wl1271_cmd_build_probe_req(struct wl1271 *wl,

wl1271_dump(DEBUG_SCAN, "PROBE REQ: ", skb->data, skb->len);

rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]);
if (band == IEEE80211_BAND_2GHZ)
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4,
skb->data, skb->len, 0,
wl->conf.tx.basic_rate);
skb->data, skb->len, 0, rate);
else
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
skb->data, skb->len, 0,
wl->conf.tx.basic_rate_5);
skb->data, skb->len, 0, rate);

out:
dev_kfree_skb(skb);
Expand All @@ -1134,6 +1140,7 @@ struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
struct sk_buff *skb)
{
int ret;
u32 rate;

if (!skb)
skb = ieee80211_ap_probereq_get(wl->hw, wl->vif);
Expand All @@ -1142,14 +1149,13 @@ struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,

wl1271_dump(DEBUG_SCAN, "AP PROBE REQ: ", skb->data, skb->len);

rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[wl->band]);
if (wl->band == IEEE80211_BAND_2GHZ)
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4,
skb->data, skb->len, 0,
wl->conf.tx.basic_rate);
skb->data, skb->len, 0, rate);
else
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
skb->data, skb->len, 0,
wl->conf.tx.basic_rate_5);
skb->data, skb->len, 0, rate);

if (ret < 0)
wl1271_error("Unable to set ap probe request template.");
Expand Down Expand Up @@ -1442,7 +1448,8 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid)
sta_rates |= sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET;

cmd->supported_rates =
cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates));
cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates,
wl->band));

wl1271_debug(DEBUG_CMD, "new peer rates=0x%x queues=0x%x",
cmd->supported_rates, sta->uapsd_queues);
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/wireless/wl12xx/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,10 @@ struct conf_rx_settings {
#define CONF_TX_AP_DEFAULT_MGMT_RATES (CONF_HW_BIT_RATE_1MBPS | \
CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS)

/*
* Default rates for working as IBSS. use 11b rates
*/
/* default rates for working as IBSS (11b and OFDM) */
#define CONF_TX_IBSS_DEFAULT_RATES (CONF_HW_BIT_RATE_1MBPS | \
CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
CONF_HW_BIT_RATE_11MBPS);
CONF_HW_BIT_RATE_11MBPS | CONF_TX_OFDM_RATES);

struct conf_tx_rate_class {

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/wl12xx/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static void wl1271_stop_ba_event(struct wl1271 *wl)
} else {
int i;
struct wl1271_link *lnk;
for (i = WL1271_AP_STA_HLID_START; i < WL12XX_MAX_LINKS; i++) {
for (i = WL1271_AP_STA_HLID_START; i < AP_MAX_LINKS; i++) {
lnk = &wl->links[i];
if (!wl1271_is_active_sta(wl, i) || !lnk->ba_bitmap)
continue;
Expand Down
17 changes: 10 additions & 7 deletions drivers/net/wireless/wl12xx/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ static int wl1271_ap_init_deauth_template(struct wl1271 *wl)
{
struct wl12xx_disconn_template *tmpl;
int ret;
u32 rate;

tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL);
if (!tmpl) {
Expand All @@ -113,9 +114,9 @@ static int wl1271_ap_init_deauth_template(struct wl1271 *wl)
tmpl->header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_DEAUTH);

rate = wl1271_tx_min_rate_get(wl, wl->basic_rate_set);
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_DEAUTH_AP,
tmpl, sizeof(*tmpl), 0,
wl1271_tx_min_rate_get(wl));
tmpl, sizeof(*tmpl), 0, rate);

out:
kfree(tmpl);
Expand All @@ -126,6 +127,7 @@ static int wl1271_ap_init_null_template(struct wl1271 *wl)
{
struct ieee80211_hdr_3addr *nullfunc;
int ret;
u32 rate;

nullfunc = kzalloc(sizeof(*nullfunc), GFP_KERNEL);
if (!nullfunc) {
Expand All @@ -142,9 +144,9 @@ static int wl1271_ap_init_null_template(struct wl1271 *wl)
memcpy(nullfunc->addr2, wl->mac_addr, ETH_ALEN);
memcpy(nullfunc->addr3, wl->mac_addr, ETH_ALEN);

rate = wl1271_tx_min_rate_get(wl, wl->basic_rate_set);
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, nullfunc,
sizeof(*nullfunc), 0,
wl1271_tx_min_rate_get(wl));
sizeof(*nullfunc), 0, rate);

out:
kfree(nullfunc);
Expand All @@ -155,6 +157,7 @@ static int wl1271_ap_init_qos_null_template(struct wl1271 *wl)
{
struct ieee80211_qos_hdr *qosnull;
int ret;
u32 rate;

qosnull = kzalloc(sizeof(*qosnull), GFP_KERNEL);
if (!qosnull) {
Expand All @@ -171,9 +174,9 @@ static int wl1271_ap_init_qos_null_template(struct wl1271 *wl)
memcpy(qosnull->addr2, wl->mac_addr, ETH_ALEN);
memcpy(qosnull->addr3, wl->mac_addr, ETH_ALEN);

rate = wl1271_tx_min_rate_get(wl, wl->basic_rate_set);
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, qosnull,
sizeof(*qosnull), 0,
wl1271_tx_min_rate_get(wl));
sizeof(*qosnull), 0, rate);

out:
kfree(qosnull);
Expand Down Expand Up @@ -498,7 +501,7 @@ int wl1271_init_ap_rates(struct wl1271 *wl)
return ret;

/* use the min basic rate for AP broadcast/multicast */
rc.enabled_rates = wl1271_tx_min_rate_get(wl);
rc.enabled_rates = wl1271_tx_min_rate_get(wl, wl->basic_rate_set);
rc.short_retry_limit = 10;
rc.long_retry_limit = 10;
rc.aflags = 0;
Expand Down
Loading

0 comments on commit 85a8eef

Please sign in to comment.