Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265807
b: refs/heads/master
c: 31cd3ae
h: refs/heads/master
i:
  265805: c9954c5
  265803: 596c8ff
  265799: 10e9910
  265791: a105d5a
v: v3
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Aug 22, 2011
1 parent f9ab042 commit 52f5ee2
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b42f068baab96a899bb5488ad9f0e72b14743ec5
refs/heads/master: 31cd3aed29ca7ebcdaa2570a891a3fab75fe35f6
62 changes: 62 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl)
return ret;
}

/* use this function to stop ibss as well */
int wl12xx_cmd_role_stop_sta(struct wl1271 *wl)
{
struct wl12xx_cmd_role_stop *cmd;
Expand Down Expand Up @@ -770,6 +771,67 @@ int wl12xx_cmd_role_stop_ap(struct wl1271 *wl)
return ret;
}

int wl12xx_cmd_role_start_ibss(struct wl1271 *wl)
{
struct wl12xx_cmd_role_start *cmd;
struct ieee80211_bss_conf *bss_conf = &wl->vif->bss_conf;
int ret;

cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd) {
ret = -ENOMEM;
goto out;
}

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

cmd->role_id = wl->role_id;
if (wl->band == IEEE80211_BAND_5GHZ)
cmd->band = WL12XX_BAND_5GHZ;
cmd->channel = wl->channel;
cmd->ibss.basic_rate_set = cpu_to_le32(wl->basic_rate_set);
cmd->ibss.beacon_interval = cpu_to_le16(wl->beacon_int);
cmd->ibss.dtim_interval = bss_conf->dtim_period;
cmd->ibss.ssid_type = WL12XX_SSID_TYPE_ANY;
cmd->ibss.ssid_len = wl->ssid_len;
memcpy(cmd->ibss.ssid, wl->ssid, wl->ssid_len);
memcpy(cmd->ibss.bssid, wl->bssid, ETH_ALEN);
cmd->sta.local_rates = cpu_to_le32(wl->rate_set);

if (wl->sta_hlid == WL12XX_INVALID_LINK_ID) {
ret = wl12xx_allocate_link(wl, &wl->sta_hlid);
if (ret)
goto out_free;
}
cmd->ibss.hlid = wl->sta_hlid;
cmd->ibss.remote_rates = cpu_to_le32(wl->rate_set);

wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d "
"basic_rate_set: 0x%x, remote_rates: 0x%x",
wl->role_id, cmd->sta.hlid, cmd->sta.session,
wl->basic_rate_set, wl->rate_set);

wl1271_debug(DEBUG_CMD, "wl->bssid = %pM", wl->bssid);

ret = wl1271_cmd_send(wl, CMD_ROLE_START, cmd, sizeof(*cmd), 0);
if (ret < 0) {
wl1271_error("failed to initiate cmd role enable");
goto err_hlid;
}

goto out_free;

err_hlid:
/* clear links on error. */
wl12xx_free_link(wl, &wl->sta_hlid);

out_free:
kfree(cmd);

out:
return ret;
}


/**
* send test command to firmware
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/wl12xx/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl);
int wl12xx_cmd_role_stop_sta(struct wl1271 *wl);
int wl12xx_cmd_role_start_ap(struct wl1271 *wl);
int wl12xx_cmd_role_stop_ap(struct wl1271 *wl);
int wl12xx_cmd_role_start_ibss(struct wl1271 *wl);
int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
Expand Down

0 comments on commit 52f5ee2

Please sign in to comment.