ret = wl1251_cmd_configure(wl, ACX_FW_GEN_FRAME_RATES,
rates, sizeof(*rates)); if (ret < 0) {
wl1251_error("Failed to set FW rates and modulation"); goto out;
}
out:
kfree(rates); return ret;
}
int wl1251_acx_station_id(struct wl1251 *wl)
{ struct acx_dot11_station_id *mac; int ret, i;
wl1251_debug(DEBUG_ACX, "acx dot11_station_id");
mac = kzalloc(sizeof(*mac), GFP_KERNEL); if (!mac) return -ENOMEM;
for (i = 0; i < ETH_ALEN; i++)
mac->mac[i] = wl->mac_addr[ETH_ALEN - 1 - i];
ret = wl1251_cmd_configure(wl, DOT11_STATION_ID, mac, sizeof(*mac));
kfree(mac); return ret;
}
int wl1251_acx_default_key(struct wl1251 *wl, u8 key_id)
{ struct acx_dot11_default_key *default_key; int ret;
ret = wl1251_cmd_configure(wl, ACX_WAKE_UP_CONDITIONS,
wake_up, sizeof(*wake_up)); if (ret < 0) {
wl1251_warning("could not set wake up conditions: %d", ret); goto out;
}
out:
kfree(wake_up); return ret;
}
int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth)
{ struct acx_sleep_auth *auth; int ret;
wl1251_debug(DEBUG_ACX, "acx sleep auth");
auth = kzalloc(sizeof(*auth), GFP_KERNEL); if (!auth) return -ENOMEM;
auth->sleep_auth = sleep_auth;
ret = wl1251_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth));
kfree(auth); return ret;
}
int wl1251_acx_fw_version(struct wl1251 *wl, char *buf, size_t len)
{ struct acx_revision *rev; int ret;
wl1251_debug(DEBUG_ACX, "acx fw rev");
rev = kzalloc(sizeof(*rev), GFP_KERNEL); if (!rev) return -ENOMEM;
ret = wl1251_cmd_interrogate(wl, ACX_FW_REV, rev, sizeof(*rev)); if (ret < 0) {
wl1251_warning("ACX_FW_REV interrogate failed"); goto out;
}
/* be careful with the buffer sizes */
strncpy(buf, rev->fw_version, min(len, sizeof(rev->fw_version)));
/* * if the firmware version string is exactly * sizeof(rev->fw_version) long or fw_len is less than * sizeof(rev->fw_version) it won't be null terminated
*/
buf[min(len, sizeof(rev->fw_version)) - 1] = '\0';
out:
kfree(rev); return ret;
}
int wl1251_acx_tx_power(struct wl1251 *wl, int power)
{ struct acx_current_tx_power *acx; int ret;
wl1251_debug(DEBUG_ACX, "acx dot11_cur_tx_pwr");
if (power < 0 || power > 25) return -EINVAL;
acx = kzalloc(sizeof(*acx), GFP_KERNEL); if (!acx) return -ENOMEM;
acx->current_tx_power = power * 10;
ret = wl1251_cmd_configure(wl, DOT11_CUR_TX_PWR, acx, sizeof(*acx)); if (ret < 0) {
wl1251_warning("configure of tx power failed: %d", ret); goto out;
}
out:
kfree(acx); return ret;
}
int wl1251_acx_feature_cfg(struct wl1251 *wl, u32 data_flow_options)
{ struct acx_feature_config *feature; int ret;
wl1251_debug(DEBUG_ACX, "acx feature cfg");
feature = kzalloc(sizeof(*feature), GFP_KERNEL); if (!feature) return -ENOMEM;
/* DF_ENCRYPTION_DISABLE and DF_SNIFF_MODE_ENABLE can be set */
feature->data_flow_options = data_flow_options;
feature->options = 0;
ret = wl1251_cmd_configure(wl, ACX_FEATURE_CFG,
feature, sizeof(*feature)); if (ret < 0) {
wl1251_error("Couldn't set HW encryption"); goto out;
}
out:
kfree(feature); return ret;
}
int wl1251_acx_mem_map(struct wl1251 *wl, struct acx_header *mem_map,
size_t len)
{ int ret;
wl1251_debug(DEBUG_ACX, "acx mem map");
ret = wl1251_cmd_interrogate(wl, ACX_MEM_MAP, mem_map, len); if (ret < 0) return ret;
return 0;
}
int wl1251_acx_data_path_params(struct wl1251 *wl, struct acx_data_path_params_resp *resp)
{ struct acx_data_path_params *params; int ret;
wl1251_debug(DEBUG_ACX, "acx data path params");
params = kzalloc(sizeof(*params), GFP_KERNEL); if (!params) return -ENOMEM;
ret = wl1251_cmd_configure(wl, DOT11_GROUP_ADDRESS_TBL,
acx, sizeof(*acx)); if (ret < 0) {
wl1251_warning("failed to set group addr table: %d", ret); goto out;
}
out:
kfree(acx); return ret;
}
int wl1251_acx_service_period_timeout(struct wl1251 *wl)
{ struct acx_rx_timeout *rx_timeout; int ret;
rx_timeout = kzalloc(sizeof(*rx_timeout), GFP_KERNEL); if (!rx_timeout) return -ENOMEM;
wl1251_debug(DEBUG_ACX, "acx service period timeout");
ret = wl1251_cmd_configure(wl, ACX_SERVICE_PERIOD_TIMEOUT,
rx_timeout, sizeof(*rx_timeout)); if (ret < 0) {
wl1251_warning("failed to set service period timeout: %d",
ret); goto out;
}
out:
kfree(rx_timeout); return ret;
}
int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold)
{ struct acx_rts_threshold *rts; int ret;
wl1251_debug(DEBUG_ACX, "acx rts threshold");
rts = kzalloc(sizeof(*rts), GFP_KERNEL); if (!rts) return -ENOMEM;
rts->threshold = rts_threshold;
ret = wl1251_cmd_configure(wl, DOT11_RTS_THRESHOLD, rts, sizeof(*rts)); if (ret < 0) {
wl1251_warning("failed to set rts threshold: %d", ret); goto out;
}
out:
kfree(rts); return ret;
}
int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter)
{ struct acx_beacon_filter_option *beacon_filter; int ret;
wl1251_debug(DEBUG_ACX, "acx beacon filter opt");
beacon_filter = kzalloc(sizeof(*beacon_filter), GFP_KERNEL); if (!beacon_filter) return -ENOMEM;
ret = wl1251_cmd_configure(wl, ACX_BCN_DTIM_OPTIONS, bb, sizeof(*bb)); if (ret < 0) {
wl1251_warning("failed to set rx config: %d", ret); goto out;
}
out:
kfree(bb); return ret;
}
int wl1251_acx_aid(struct wl1251 *wl, u16 aid)
{ struct acx_aid *acx_aid; int ret;
wl1251_debug(DEBUG_ACX, "acx aid");
acx_aid = kzalloc(sizeof(*acx_aid), GFP_KERNEL); if (!acx_aid) return -ENOMEM;
acx_aid->aid = aid;
ret = wl1251_cmd_configure(wl, ACX_AID, acx_aid, sizeof(*acx_aid)); if (ret < 0) {
wl1251_warning("failed to set aid: %d", ret); goto out;
}
out:
kfree(acx_aid); return ret;
}
int wl1251_acx_event_mbox_mask(struct wl1251 *wl, u32 event_mask)
{ struct acx_event_mask *mask; int ret;
wl1251_debug(DEBUG_ACX, "acx event mbox mask");
mask = kzalloc(sizeof(*mask), GFP_KERNEL); if (!mask) return -ENOMEM;
/* high event mask is unused */
mask->high_event_mask = 0xffffffff;
mask->event_mask = event_mask;
ret = wl1251_cmd_configure(wl, ACX_EVENT_MBOX_MASK,
mask, sizeof(*mask)); if (ret < 0) {
wl1251_warning("failed to set acx_event_mbox_mask: %d", ret); goto out;
}
out:
kfree(mask); return ret;
}
int wl1251_acx_low_rssi(struct wl1251 *wl, s8 threshold, u8 weight,
u8 depth, enum wl1251_acx_low_rssi_type type)
{ struct acx_low_rssi *rssi; int ret;
wl1251_debug(DEBUG_ACX, "acx low rssi");
rssi = kzalloc(sizeof(*rssi), GFP_KERNEL); if (!rssi) return -ENOMEM;
/* TX queue config */ for (i = 0; i < MAX_TX_QUEUES; i++) {
mem_conf->tx_queue_config[i].num_descs = ACX_TX_DESC_DEF;
mem_conf->tx_queue_config[i].attributes = i;
}
ret = wl1251_cmd_configure(wl, ACX_MEM_CFG, mem_conf, sizeof(*mem_conf)); if (ret < 0) {
wl1251_warning("wl1251 mem config failed: %d", ret); goto out;
}
out:
kfree(mem_conf); return ret;
}
int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim)
{ struct wl1251_acx_wr_tbtt_and_dtim *acx; int ret;
wl1251_debug(DEBUG_ACX, "acx tbtt and dtim");
acx = kzalloc(sizeof(*acx), GFP_KERNEL); if (!acx) return -ENOMEM;
acx->tbtt = tbtt;
acx->dtim = dtim;
ret = wl1251_cmd_configure(wl, ACX_WR_TBTT_AND_DTIM,
acx, sizeof(*acx)); if (ret < 0) {
wl1251_warning("failed to set tbtt and dtim: %d", ret); goto out;
}
out:
kfree(acx); return ret;
}
int wl1251_acx_bet_enable(struct wl1251 *wl, enum wl1251_acx_bet_mode mode,
u8 max_consecutive)
{ struct wl1251_acx_bet_enable *acx; int ret;
wl1251_debug(DEBUG_ACX, "acx bet enable");
acx = kzalloc(sizeof(*acx), GFP_KERNEL); if (!acx) return -ENOMEM;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.