提交 0aef64d7 编写于 作者: D Dan Williams 提交者: David S. Miller

[PATCH] libertas: re-uppercase command defines and other constants

For readability.
Signed-off-by: NDan Williams <dcbw@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b44898eb
...@@ -422,13 +422,13 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* ...@@ -422,13 +422,13 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
u8 libertas_get_scan_type_11d(u8 chan, u8 libertas_get_scan_type_11d(u8 chan,
struct parsed_region_chan_11d * parsed_region_chan) struct parsed_region_chan_11d * parsed_region_chan)
{ {
u8 scan_type = cmd_scan_type_passive; u8 scan_type = CMD_SCAN_TYPE_PASSIVE;
lbs_deb_enter(LBS_DEB_11D); lbs_deb_enter(LBS_DEB_11D);
if (wlan_channel_known_11d(chan, parsed_region_chan)) { if (wlan_channel_known_11d(chan, parsed_region_chan)) {
lbs_deb_11d("11D: Found and do Active Scan\n"); lbs_deb_11d("11D: Found and do Active Scan\n");
scan_type = cmd_scan_type_active; scan_type = CMD_SCAN_TYPE_ACTIVE;
} else { } else {
lbs_deb_11d("11D: Not Find and do Passive Scan\n"); lbs_deb_11d("11D: Not Find and do Passive Scan\n");
} }
...@@ -454,9 +454,9 @@ static int wlan_enable_11d(wlan_private * priv, u8 flag) ...@@ -454,9 +454,9 @@ static int wlan_enable_11d(wlan_private * priv, u8 flag)
/* send cmd to FW to enable/disable 11D function in FW */ /* send cmd to FW to enable/disable 11D function in FW */
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_snmp_mib, CMD_802_11_SNMP_MIB,
cmd_act_set, CMD_ACT_SET,
cmd_option_waitforrsp, CMD_OPTION_WAITFORRSP,
OID_802_11D_ENABLE, OID_802_11D_ENABLE,
&priv->adapter->enable11d); &priv->adapter->enable11d);
if (ret) if (ret)
...@@ -479,9 +479,9 @@ static int set_domain_info_11d(wlan_private * priv) ...@@ -479,9 +479,9 @@ static int set_domain_info_11d(wlan_private * priv)
return 0; return 0;
} }
ret = libertas_prepare_and_send_command(priv, cmd_802_11d_domain_info, ret = libertas_prepare_and_send_command(priv, CMD_802_11D_DOMAIN_INFO,
cmd_act_set, CMD_ACT_SET,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
if (ret) if (ret)
lbs_deb_11d("11D: Fail to dnld domain Info\n"); lbs_deb_11d("11D: Fail to dnld domain Info\n");
...@@ -541,7 +541,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, ...@@ -541,7 +541,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
cmd->command = cpu_to_le16(cmdno); cmd->command = cpu_to_le16(cmdno);
pdomaininfo->action = cpu_to_le16(cmdoption); pdomaininfo->action = cpu_to_le16(cmdoption);
if (cmdoption == cmd_act_get) { if (cmdoption == CMD_ACT_GET) {
cmd->size = cmd->size =
cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN);
lbs_dbg_hex("11D: 802_11D_DOMAIN_INFO:", (u8 *) cmd, lbs_dbg_hex("11D: 802_11D_DOMAIN_INFO:", (u8 *) cmd,
...@@ -633,10 +633,10 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, ...@@ -633,10 +633,10 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv,
} }
switch (action) { switch (action) {
case cmd_act_set: /*Proc Set action */ case CMD_ACT_SET: /*Proc Set action */
break; break;
case cmd_act_get: case CMD_ACT_GET:
break; break;
default: default:
lbs_deb_11d("Invalid action:%d\n", domaininfo->action); lbs_deb_11d("Invalid action:%d\n", domaininfo->action);
......
...@@ -175,14 +175,14 @@ static int assoc_helper_mode(wlan_private *priv, ...@@ -175,14 +175,14 @@ static int assoc_helper_mode(wlan_private *priv,
if (assoc_req->mode == IW_MODE_INFRA) { if (assoc_req->mode == IW_MODE_INFRA) {
if (adapter->psstate != PS_STATE_FULL_POWER) if (adapter->psstate != PS_STATE_FULL_POWER)
libertas_ps_wakeup(priv, cmd_option_waitforrsp); libertas_ps_wakeup(priv, CMD_OPTION_WAITFORRSP);
adapter->psmode = wlan802_11powermodecam; adapter->psmode = WLAN802_11POWERMODECAM;
} }
adapter->mode = assoc_req->mode; adapter->mode = assoc_req->mode;
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_snmp_mib, CMD_802_11_SNMP_MIB,
0, cmd_option_waitforrsp, 0, CMD_OPTION_WAITFORRSP,
OID_802_11_INFRASTRUCTURE_MODE, OID_802_11_INFRASTRUCTURE_MODE,
/* Shoot me now */ (void *) (size_t) assoc_req->mode); /* Shoot me now */ (void *) (size_t) assoc_req->mode);
...@@ -195,9 +195,9 @@ static int assoc_helper_mode(wlan_private *priv, ...@@ -195,9 +195,9 @@ static int assoc_helper_mode(wlan_private *priv,
static int update_channel(wlan_private * priv) static int update_channel(wlan_private * priv)
{ {
/* the channel in f/w could be out of sync, get the current channel */ /* the channel in f/w could be out of sync, get the current channel */
return libertas_prepare_and_send_command(priv, cmd_802_11_rf_channel, return libertas_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL,
cmd_opt_802_11_rf_channel_get, CMD_OPT_802_11_RF_CHANNEL_GET,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
} }
void libertas_sync_channel(struct work_struct *work) void libertas_sync_channel(struct work_struct *work)
...@@ -227,9 +227,9 @@ static int assoc_helper_channel(wlan_private *priv, ...@@ -227,9 +227,9 @@ static int assoc_helper_channel(wlan_private *priv,
lbs_deb_assoc("ASSOC: channel: %d -> %d\n", lbs_deb_assoc("ASSOC: channel: %d -> %d\n",
adapter->curbssparams.channel, assoc_req->channel); adapter->curbssparams.channel, assoc_req->channel);
ret = libertas_prepare_and_send_command(priv, cmd_802_11_rf_channel, ret = libertas_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL,
cmd_opt_802_11_rf_channel_set, CMD_OPT_802_11_RF_CHANNEL_SET,
cmd_option_waitforrsp, 0, &assoc_req->channel); CMD_OPTION_WAITFORRSP, 0, &assoc_req->channel);
if (ret < 0) { if (ret < 0) {
lbs_deb_assoc("ASSOC: channel: error setting channel."); lbs_deb_assoc("ASSOC: channel: error setting channel.");
} }
...@@ -278,15 +278,15 @@ static int assoc_helper_wep_keys(wlan_private *priv, ...@@ -278,15 +278,15 @@ static int assoc_helper_wep_keys(wlan_private *priv,
|| assoc_req->wep_keys[2].len || assoc_req->wep_keys[2].len
|| assoc_req->wep_keys[3].len) { || assoc_req->wep_keys[3].len) {
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_set_wep, CMD_802_11_SET_WEP,
cmd_act_add, CMD_ACT_ADD,
cmd_option_waitforrsp, CMD_OPTION_WAITFORRSP,
0, assoc_req); 0, assoc_req);
} else { } else {
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_set_wep, CMD_802_11_SET_WEP,
cmd_act_remove, CMD_ACT_REMOVE,
cmd_option_waitforrsp, CMD_OPTION_WAITFORRSP,
0, NULL); 0, NULL);
} }
...@@ -295,9 +295,9 @@ static int assoc_helper_wep_keys(wlan_private *priv, ...@@ -295,9 +295,9 @@ static int assoc_helper_wep_keys(wlan_private *priv,
/* enable/disable the MAC's WEP packet filter */ /* enable/disable the MAC's WEP packet filter */
if (assoc_req->secinfo.wep_enabled) if (assoc_req->secinfo.wep_enabled)
adapter->currentpacketfilter |= cmd_act_mac_wep_enable; adapter->currentpacketfilter |= CMD_ACT_MAC_WEP_ENABLE;
else else
adapter->currentpacketfilter &= ~cmd_act_mac_wep_enable; adapter->currentpacketfilter &= ~CMD_ACT_MAC_WEP_ENABLE;
ret = libertas_set_mac_packet_filter(priv); ret = libertas_set_mac_packet_filter(priv);
if (ret) if (ret)
goto out; goto out;
...@@ -342,9 +342,9 @@ static int assoc_helper_secinfo(wlan_private *priv, ...@@ -342,9 +342,9 @@ static int assoc_helper_secinfo(wlan_private *priv,
/* Get RSN enabled/disabled */ /* Get RSN enabled/disabled */
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_enable_rsn, CMD_802_11_ENABLE_RSN,
cmd_act_set, CMD_ACT_GET,
cmd_option_waitforrsp, CMD_OPTION_WAITFORRSP,
0, &rsn); 0, &rsn);
if (ret) { if (ret) {
lbs_deb_assoc("Failed to get RSN status: %d", ret); lbs_deb_assoc("Failed to get RSN status: %d", ret);
...@@ -359,9 +359,9 @@ static int assoc_helper_secinfo(wlan_private *priv, ...@@ -359,9 +359,9 @@ static int assoc_helper_secinfo(wlan_private *priv,
/* Set RSN enabled/disabled */ /* Set RSN enabled/disabled */
rsn = do_wpa; rsn = do_wpa;
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_enable_rsn, CMD_802_11_ENABLE_RSN,
cmd_act_set, CMD_ACT_SET,
cmd_option_waitforrsp, CMD_OPTION_WAITFORRSP,
0, &rsn); 0, &rsn);
out: out:
...@@ -378,9 +378,9 @@ static int assoc_helper_wpa_keys(wlan_private *priv, ...@@ -378,9 +378,9 @@ static int assoc_helper_wpa_keys(wlan_private *priv,
lbs_deb_enter(LBS_DEB_ASSOC); lbs_deb_enter(LBS_DEB_ASSOC);
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_key_material, CMD_802_11_KEY_MATERIAL,
cmd_act_set, CMD_ACT_SET,
cmd_option_waitforrsp, CMD_OPTION_WAITFORRSP,
0, assoc_req); 0, assoc_req);
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
...@@ -412,7 +412,7 @@ static int assoc_helper_wpa_ie(wlan_private *priv, ...@@ -412,7 +412,7 @@ static int assoc_helper_wpa_ie(wlan_private *priv,
static int should_deauth_infrastructure(wlan_adapter *adapter, static int should_deauth_infrastructure(wlan_adapter *adapter,
struct assoc_request * assoc_req) struct assoc_request * assoc_req)
{ {
if (adapter->connect_status != libertas_connected) if (adapter->connect_status != LIBERTAS_CONNECTED)
return 0; return 0;
if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) {
...@@ -453,7 +453,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter, ...@@ -453,7 +453,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
static int should_stop_adhoc(wlan_adapter *adapter, static int should_stop_adhoc(wlan_adapter *adapter,
struct assoc_request * assoc_req) struct assoc_request * assoc_req)
{ {
if (adapter->connect_status != libertas_connected) if (adapter->connect_status != LIBERTAS_CONNECTED)
return 0; return 0;
if (libertas_ssid_cmp(adapter->curbssparams.ssid, if (libertas_ssid_cmp(adapter->curbssparams.ssid,
...@@ -623,7 +623,7 @@ void libertas_association_worker(struct work_struct *work) ...@@ -623,7 +623,7 @@ void libertas_association_worker(struct work_struct *work)
success = 0; success = 0;
} }
if (adapter->connect_status != libertas_connected) { if (adapter->connect_status != LIBERTAS_CONNECTED) {
lbs_deb_assoc("ASSOC: assoication attempt unsuccessful, " lbs_deb_assoc("ASSOC: assoication attempt unsuccessful, "
"not connected.\n"); "not connected.\n");
success = 0; success = 0;
...@@ -636,12 +636,12 @@ void libertas_association_worker(struct work_struct *work) ...@@ -636,12 +636,12 @@ void libertas_association_worker(struct work_struct *work)
adapter->curbssparams.ssid_len), adapter->curbssparams.ssid_len),
MAC_ARG(adapter->curbssparams.bssid)); MAC_ARG(adapter->curbssparams.bssid));
libertas_prepare_and_send_command(priv, libertas_prepare_and_send_command(priv,
cmd_802_11_rssi, CMD_802_11_RSSI,
0, cmd_option_waitforrsp, 0, NULL); 0, CMD_OPTION_WAITFORRSP, 0, NULL);
libertas_prepare_and_send_command(priv, libertas_prepare_and_send_command(priv,
cmd_802_11_get_log, CMD_802_11_GET_LOG,
0, cmd_option_waitforrsp, 0, NULL); 0, CMD_OPTION_WAITFORRSP, 0, NULL);
} else { } else {
ret = -1; ret = -1;
} }
......
此差异已折叠。
...@@ -28,7 +28,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) ...@@ -28,7 +28,7 @@ void libertas_mac_event_disconnected(wlan_private * priv)
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
union iwreq_data wrqu; union iwreq_data wrqu;
if (adapter->connect_status != libertas_connected) if (adapter->connect_status != LIBERTAS_CONNECTED)
return; return;
lbs_deb_cmd("Handles disconnect event.\n"); lbs_deb_cmd("Handles disconnect event.\n");
...@@ -69,7 +69,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) ...@@ -69,7 +69,7 @@ void libertas_mac_event_disconnected(wlan_private * priv)
escape_essid(adapter->prev_ssid, adapter->prev_ssid_len), escape_essid(adapter->prev_ssid, adapter->prev_ssid_len),
adapter->prev_ssid_len); adapter->prev_ssid_len);
adapter->connect_status = libertas_disconnected; adapter->connect_status = LIBERTAS_DISCONNECTED;
/* Save previous SSID and BSSID for possible reassociation */ /* Save previous SSID and BSSID for possible reassociation */
memcpy(&adapter->prev_ssid, &adapter->curbssparams.ssid, memcpy(&adapter->prev_ssid, &adapter->curbssparams.ssid,
...@@ -124,7 +124,7 @@ static int wlan_ret_reg_access(wlan_private * priv, ...@@ -124,7 +124,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
switch (type) { switch (type) {
case cmd_ret_mac_reg_access: case CMD_RET_MAC_REG_ACCESS:
{ {
struct cmd_ds_mac_reg_access *reg = &resp->params.macreg; struct cmd_ds_mac_reg_access *reg = &resp->params.macreg;
...@@ -133,7 +133,7 @@ static int wlan_ret_reg_access(wlan_private * priv, ...@@ -133,7 +133,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
break; break;
} }
case cmd_ret_bbp_reg_access: case CMD_RET_BBP_REG_ACCESS:
{ {
struct cmd_ds_bbp_reg_access *reg = &resp->params.bbpreg; struct cmd_ds_bbp_reg_access *reg = &resp->params.bbpreg;
...@@ -142,7 +142,7 @@ static int wlan_ret_reg_access(wlan_private * priv, ...@@ -142,7 +142,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
break; break;
} }
case cmd_ret_rf_reg_access: case CMD_RET_RF_REG_ACCESS:
{ {
struct cmd_ds_rf_reg_access *reg = &resp->params.rfreg; struct cmd_ds_rf_reg_access *reg = &resp->params.rfreg;
...@@ -274,21 +274,21 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, ...@@ -274,21 +274,21 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv,
querytype); querytype);
lbs_deb_cmd("SNMP_RESP: Buf size = %x\n", le16_to_cpu(smib->bufsize)); lbs_deb_cmd("SNMP_RESP: Buf size = %x\n", le16_to_cpu(smib->bufsize));
if (querytype == cmd_act_get) { if (querytype == CMD_ACT_GET) {
switch (oid) { switch (oid) {
case fragthresh_i: case FRAGTHRESH_I:
priv->adapter->fragthsd = priv->adapter->fragthsd =
le16_to_cpu(*((__le16 *)(smib->value))); le16_to_cpu(*((__le16 *)(smib->value)));
lbs_deb_cmd("SNMP_RESP: fragthsd =%u\n", lbs_deb_cmd("SNMP_RESP: fragthsd =%u\n",
priv->adapter->fragthsd); priv->adapter->fragthsd);
break; break;
case rtsthresh_i: case RTSTHRESH_I:
priv->adapter->rtsthsd = priv->adapter->rtsthsd =
le16_to_cpu(*((__le16 *)(smib->value))); le16_to_cpu(*((__le16 *)(smib->value)));
lbs_deb_cmd("SNMP_RESP: rtsthsd =%u\n", lbs_deb_cmd("SNMP_RESP: rtsthsd =%u\n",
priv->adapter->rtsthsd); priv->adapter->rtsthsd);
break; break;
case short_retrylim_i: case SHORT_RETRYLIM_I:
priv->adapter->txretrycount = priv->adapter->txretrycount =
le16_to_cpu(*((__le16 *)(smib->value))); le16_to_cpu(*((__le16 *)(smib->value)));
lbs_deb_cmd("SNMP_RESP: txretrycount =%u\n", lbs_deb_cmd("SNMP_RESP: txretrycount =%u\n",
...@@ -314,7 +314,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv, ...@@ -314,7 +314,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv,
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
/* Copy the returned key to driver private data */ /* Copy the returned key to driver private data */
if (action == cmd_act_get) { if (action == CMD_ACT_GET) {
u8 * buf_ptr = (u8 *) &pkeymaterial->keyParamSet; u8 * buf_ptr = (u8 *) &pkeymaterial->keyParamSet;
u8 * resp_end = (u8 *) (resp + le16_to_cpu(resp->size)); u8 * resp_end = (u8 *) (resp + le16_to_cpu(resp->size));
...@@ -396,10 +396,10 @@ static int wlan_ret_802_11_rf_antenna(wlan_private * priv, ...@@ -396,10 +396,10 @@ static int wlan_ret_802_11_rf_antenna(wlan_private * priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
u16 action = le16_to_cpu(pAntenna->action); u16 action = le16_to_cpu(pAntenna->action);
if (action == cmd_act_get_rx) if (action == CMD_ACT_GET_rx)
adapter->rxantennamode = le16_to_cpu(pAntenna->antennamode); adapter->rxantennamode = le16_to_cpu(pAntenna->antennamode);
if (action == cmd_act_get_tx) if (action == CMD_ACT_GET_tx)
adapter->txantennamode = le16_to_cpu(pAntenna->antennamode); adapter->txantennamode = le16_to_cpu(pAntenna->antennamode);
lbs_deb_cmd("RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n", lbs_deb_cmd("RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n",
...@@ -416,7 +416,7 @@ static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv, ...@@ -416,7 +416,7 @@ static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv,
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
if (rates->action == cmd_act_get) { if (rates->action == CMD_ACT_GET) {
adapter->enablehwauto = le16_to_cpu(rates->enablehwauto); adapter->enablehwauto = le16_to_cpu(rates->enablehwauto);
adapter->ratebitmap = le16_to_cpu(rates->bitmap); adapter->ratebitmap = le16_to_cpu(rates->bitmap);
} }
...@@ -438,7 +438,7 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, ...@@ -438,7 +438,7 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv,
(u8 *) pdatarate, sizeof(struct cmd_ds_802_11_data_rate)); (u8 *) pdatarate, sizeof(struct cmd_ds_802_11_data_rate));
dot11datarate = pdatarate->datarate[0]; dot11datarate = pdatarate->datarate[0];
if (pdatarate->action == cpu_to_le16(cmd_act_get_tx_rate)) { if (pdatarate->action == cpu_to_le16(CMD_ACT_GET_tx_rate)) {
memcpy(adapter->libertas_supported_rates, pdatarate->datarate, memcpy(adapter->libertas_supported_rates, pdatarate->datarate,
sizeof(adapter->libertas_supported_rates)); sizeof(adapter->libertas_supported_rates));
} }
...@@ -458,7 +458,7 @@ static int wlan_ret_802_11_rf_channel(wlan_private * priv, ...@@ -458,7 +458,7 @@ static int wlan_ret_802_11_rf_channel(wlan_private * priv,
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
if (action == cmd_opt_802_11_rf_channel_get if (action == CMD_OPT_802_11_RF_CHANNEL_GET
&& adapter->curbssparams.channel != newchannel) { && adapter->curbssparams.channel != newchannel) {
lbs_deb_cmd("channel Switch: %d to %d\n", lbs_deb_cmd("channel Switch: %d to %d\n",
adapter->curbssparams.channel, newchannel); adapter->curbssparams.channel, newchannel);
...@@ -547,7 +547,7 @@ static int libertas_ret_802_11_enable_rsn(wlan_private * priv, ...@@ -547,7 +547,7 @@ static int libertas_ret_802_11_enable_rsn(wlan_private * priv,
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
if (enable_rsn->action == cpu_to_le16(cmd_act_get)) { if (enable_rsn->action == cpu_to_le16(CMD_ACT_GET)) {
if (pdata_buf) if (pdata_buf)
*pdata_buf = (u32) le16_to_cpu(enable_rsn->enable); *pdata_buf = (u32) le16_to_cpu(enable_rsn->enable);
} }
...@@ -565,134 +565,134 @@ static inline int handle_cmd_response(u16 respcmd, ...@@ -565,134 +565,134 @@ static inline int handle_cmd_response(u16 respcmd,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
switch (respcmd) { switch (respcmd) {
case cmd_ret_mac_reg_access: case CMD_RET_MAC_REG_ACCESS:
case cmd_ret_bbp_reg_access: case CMD_RET_BBP_REG_ACCESS:
case cmd_ret_rf_reg_access: case CMD_RET_RF_REG_ACCESS:
ret = wlan_ret_reg_access(priv, respcmd, resp); ret = wlan_ret_reg_access(priv, respcmd, resp);
break; break;
case cmd_ret_hw_spec_info: case CMD_RET_HW_SPEC_INFO:
ret = wlan_ret_get_hw_spec(priv, resp); ret = wlan_ret_get_hw_spec(priv, resp);
break; break;
case cmd_ret_802_11_scan: case CMD_RET_802_11_SCAN:
ret = libertas_ret_80211_scan(priv, resp); ret = libertas_ret_80211_scan(priv, resp);
break; break;
case cmd_ret_802_11_get_log: case CMD_RET_802_11_GET_LOG:
ret = wlan_ret_get_log(priv, resp); ret = wlan_ret_get_log(priv, resp);
break; break;
case cmd_ret_802_11_associate: case CMD_RET_802_11_ASSOCIATE:
case cmd_ret_802_11_reassociate: case CMD_RET_802_11_REASSOCIATE:
ret = libertas_ret_80211_associate(priv, resp); ret = libertas_ret_80211_associate(priv, resp);
break; break;
case cmd_ret_802_11_disassociate: case CMD_RET_802_11_DISASSOCIATE:
case cmd_ret_802_11_deauthenticate: case CMD_RET_802_11_DEAUTHENTICATE:
ret = libertas_ret_80211_disassociate(priv, resp); ret = libertas_ret_80211_disassociate(priv, resp);
break; break;
case cmd_ret_802_11_ad_hoc_start: case CMD_RET_802_11_AD_HOC_START:
case cmd_ret_802_11_ad_hoc_join: case CMD_RET_802_11_AD_HOC_JOIN:
ret = libertas_ret_80211_ad_hoc_start(priv, resp); ret = libertas_ret_80211_ad_hoc_start(priv, resp);
break; break;
case cmd_ret_802_11_stat: case CMD_RET_802_11_STAT:
ret = wlan_ret_802_11_stat(priv, resp); ret = wlan_ret_802_11_stat(priv, resp);
break; break;
case cmd_ret_802_11_snmp_mib: case CMD_RET_802_11_SNMP_MIB:
ret = wlan_ret_802_11_snmp_mib(priv, resp); ret = wlan_ret_802_11_snmp_mib(priv, resp);
break; break;
case cmd_ret_802_11_rf_tx_power: case CMD_RET_802_11_RF_TX_POWER:
ret = wlan_ret_802_11_rf_tx_power(priv, resp); ret = wlan_ret_802_11_rf_tx_power(priv, resp);
break; break;
case cmd_ret_802_11_set_afc: case CMD_RET_802_11_SET_AFC:
case cmd_ret_802_11_get_afc: case CMD_RET_802_11_GET_AFC:
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
memmove(adapter->cur_cmd->pdata_buf, &resp->params.afc, memmove(adapter->cur_cmd->pdata_buf, &resp->params.afc,
sizeof(struct cmd_ds_802_11_afc)); sizeof(struct cmd_ds_802_11_afc));
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
break; break;
case cmd_ret_802_11_rf_antenna: case CMD_RET_802_11_RF_ANTENNA:
ret = wlan_ret_802_11_rf_antenna(priv, resp); ret = wlan_ret_802_11_rf_antenna(priv, resp);
break; break;
case cmd_ret_mac_multicast_adr: case CMD_RET_MAC_MULTICAST_ADR:
case cmd_ret_mac_control: case CMD_RET_MAC_CONTROL:
case cmd_ret_802_11_set_wep: case CMD_RET_802_11_SET_WEP:
case cmd_ret_802_11_reset: case CMD_RET_802_11_RESET:
case cmd_ret_802_11_authenticate: case CMD_RET_802_11_AUTHENTICATE:
case cmd_ret_802_11_radio_control: case CMD_RET_802_11_RADIO_CONTROL:
case cmd_ret_802_11_beacon_stop: case CMD_RET_802_11_BEACON_STOP:
break; break;
case cmd_ret_802_11_enable_rsn: case CMD_RET_802_11_ENABLE_RSN:
ret = libertas_ret_802_11_enable_rsn(priv, resp); ret = libertas_ret_802_11_enable_rsn(priv, resp);
break; break;
case cmd_ret_802_11_data_rate: case CMD_RET_802_11_DATA_RATE:
ret = wlan_ret_802_11_data_rate(priv, resp); ret = wlan_ret_802_11_data_rate(priv, resp);
break; break;
case cmd_ret_802_11_rate_adapt_rateset: case CMD_RET_802_11_RATE_ADAPT_RATESET:
ret = wlan_ret_802_11_rate_adapt_rateset(priv, resp); ret = wlan_ret_802_11_rate_adapt_rateset(priv, resp);
break; break;
case cmd_ret_802_11_rf_channel: case CMD_RET_802_11_RF_CHANNEL:
ret = wlan_ret_802_11_rf_channel(priv, resp); ret = wlan_ret_802_11_rf_channel(priv, resp);
break; break;
case cmd_ret_802_11_rssi: case CMD_RET_802_11_RSSI:
ret = wlan_ret_802_11_rssi(priv, resp); ret = wlan_ret_802_11_rssi(priv, resp);
break; break;
case cmd_ret_802_11_mac_address: case CMD_RET_802_11_MAC_ADDRESS:
ret = wlan_ret_802_11_mac_address(priv, resp); ret = wlan_ret_802_11_mac_address(priv, resp);
break; break;
case cmd_ret_802_11_ad_hoc_stop: case CMD_RET_802_11_AD_HOC_STOP:
ret = libertas_ret_80211_ad_hoc_stop(priv, resp); ret = libertas_ret_80211_ad_hoc_stop(priv, resp);
break; break;
case cmd_ret_802_11_key_material: case CMD_RET_802_11_KEY_MATERIAL:
lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n"); lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n");
ret = wlan_ret_802_11_key_material(priv, resp); ret = wlan_ret_802_11_key_material(priv, resp);
break; break;
case cmd_ret_802_11_eeprom_access: case CMD_RET_802_11_EEPROM_ACCESS:
ret = wlan_ret_802_11_eeprom_access(priv, resp); ret = wlan_ret_802_11_eeprom_access(priv, resp);
break; break;
case cmd_ret_802_11d_domain_info: case CMD_RET_802_11D_DOMAIN_INFO:
ret = libertas_ret_802_11d_domain_info(priv, resp); ret = libertas_ret_802_11d_domain_info(priv, resp);
break; break;
case cmd_ret_802_11_sleep_params: case CMD_RET_802_11_SLEEP_PARAMS:
ret = wlan_ret_802_11_sleep_params(priv, resp); ret = wlan_ret_802_11_sleep_params(priv, resp);
break; break;
case cmd_ret_802_11_inactivity_timeout: case CMD_RET_802_11_INACTIVITY_TIMEOUT:
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
*((u16 *) adapter->cur_cmd->pdata_buf) = *((u16 *) adapter->cur_cmd->pdata_buf) =
le16_to_cpu(resp->params.inactivity_timeout.timeout); le16_to_cpu(resp->params.inactivity_timeout.timeout);
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
break; break;
case cmd_ret_802_11_tpc_cfg: case CMD_RET_802_11_TPC_CFG:
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
memmove(adapter->cur_cmd->pdata_buf, &resp->params.tpccfg, memmove(adapter->cur_cmd->pdata_buf, &resp->params.tpccfg,
sizeof(struct cmd_ds_802_11_tpc_cfg)); sizeof(struct cmd_ds_802_11_tpc_cfg));
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
break; break;
case cmd_ret_802_11_led_gpio_ctrl: case CMD_RET_802_11_LED_GPIO_CTRL:
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
memmove(adapter->cur_cmd->pdata_buf, &resp->params.ledgpio, memmove(adapter->cur_cmd->pdata_buf, &resp->params.ledgpio,
sizeof(struct cmd_ds_802_11_led_ctrl)); sizeof(struct cmd_ds_802_11_led_ctrl));
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
break; break;
case cmd_ret_802_11_pwr_cfg: case CMD_RET_802_11_PWR_CFG:
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
memmove(adapter->cur_cmd->pdata_buf, &resp->params.pwrcfg, memmove(adapter->cur_cmd->pdata_buf, &resp->params.pwrcfg,
sizeof(struct cmd_ds_802_11_pwr_cfg)); sizeof(struct cmd_ds_802_11_pwr_cfg));
...@@ -700,32 +700,32 @@ static inline int handle_cmd_response(u16 respcmd, ...@@ -700,32 +700,32 @@ static inline int handle_cmd_response(u16 respcmd,
break; break;
case cmd_ret_get_tsf: case CMD_RET_GET_TSF:
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
memcpy(priv->adapter->cur_cmd->pdata_buf, memcpy(priv->adapter->cur_cmd->pdata_buf,
&resp->params.gettsf.tsfvalue, sizeof(u64)); &resp->params.gettsf.tsfvalue, sizeof(u64));
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
break; break;
case cmd_ret_bt_access: case CMD_RET_BT_ACCESS:
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
if (adapter->cur_cmd->pdata_buf) if (adapter->cur_cmd->pdata_buf)
memcpy(adapter->cur_cmd->pdata_buf, memcpy(adapter->cur_cmd->pdata_buf,
&resp->params.bt.addr1, 2 * ETH_ALEN); &resp->params.bt.addr1, 2 * ETH_ALEN);
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
break; break;
case cmd_ret_fwt_access: case CMD_RET_FWT_ACCESS:
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
if (adapter->cur_cmd->pdata_buf) if (adapter->cur_cmd->pdata_buf)
memcpy(adapter->cur_cmd->pdata_buf, &resp->params.fwt, memcpy(adapter->cur_cmd->pdata_buf, &resp->params.fwt,
sizeof(resp->params.fwt)); sizeof(resp->params.fwt));
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
break; break;
case cmd_ret_mesh_access: case CMD_RET_MESH_ACCESS:
if (adapter->cur_cmd->pdata_buf) if (adapter->cur_cmd->pdata_buf)
memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh, memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh,
sizeof(resp->params.mesh)); sizeof(resp->params.mesh));
break; break;
case cmd_rte_802_11_tx_rate_query: case CMD_RTE_802_11_TX_RATE_QUERY:
priv->adapter->txrate = resp->params.txrate.txrate; priv->adapter->txrate = resp->params.txrate.txrate;
break; break;
default: default:
...@@ -787,7 +787,7 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -787,7 +787,7 @@ int libertas_process_rx_command(wlan_private * priv)
/* Store the response code to cur_cmd_retcode. */ /* Store the response code to cur_cmd_retcode. */
adapter->cur_cmd_retcode = result;; adapter->cur_cmd_retcode = result;;
if (respcmd == cmd_ret_802_11_ps_mode) { if (respcmd == CMD_RET_802_11_PS_MODE) {
struct cmd_ds_802_11_ps_mode *psmode = &resp->params.psmode; struct cmd_ds_802_11_ps_mode *psmode = &resp->params.psmode;
u16 action = le16_to_cpu(psmode->action); u16 action = le16_to_cpu(psmode->action);
...@@ -804,14 +804,14 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -804,14 +804,14 @@ int libertas_process_rx_command(wlan_private * priv)
* libertas_execute_next_command(). * libertas_execute_next_command().
*/ */
if (adapter->mode == IW_MODE_ADHOC && if (adapter->mode == IW_MODE_ADHOC &&
action == cmd_subcmd_enter_ps) action == CMD_SUBCMD_ENTER_PS)
adapter->psmode = wlan802_11powermodecam; adapter->psmode = WLAN802_11POWERMODECAM;
} else if (action == cmd_subcmd_enter_ps) { } else if (action == CMD_SUBCMD_ENTER_PS) {
adapter->needtowakeup = 0; adapter->needtowakeup = 0;
adapter->psstate = PS_STATE_AWAKE; adapter->psstate = PS_STATE_AWAKE;
lbs_deb_cmd("CMD_RESP: Enter_PS command response\n"); lbs_deb_cmd("CMD_RESP: Enter_PS command response\n");
if (adapter->connect_status != libertas_connected) { if (adapter->connect_status != LIBERTAS_CONNECTED) {
/* /*
* When Deauth Event received before Enter_PS command * When Deauth Event received before Enter_PS command
* response, We need to wake up the firmware. * response, We need to wake up the firmware.
...@@ -825,7 +825,7 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -825,7 +825,7 @@ int libertas_process_rx_command(wlan_private * priv)
mutex_lock(&adapter->lock); mutex_lock(&adapter->lock);
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
} }
} else if (action == cmd_subcmd_exit_ps) { } else if (action == CMD_SUBCMD_EXIT_PS) {
adapter->needtowakeup = 0; adapter->needtowakeup = 0;
adapter->psstate = PS_STATE_FULL_POWER; adapter->psstate = PS_STATE_FULL_POWER;
lbs_deb_cmd("CMD_RESP: Exit_PS command response\n"); lbs_deb_cmd("CMD_RESP: Exit_PS command response\n");
...@@ -857,8 +857,8 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -857,8 +857,8 @@ int libertas_process_rx_command(wlan_private * priv)
* Handling errors here * Handling errors here
*/ */
switch (respcmd) { switch (respcmd) {
case cmd_ret_hw_spec_info: case CMD_RET_HW_SPEC_INFO:
case cmd_ret_802_11_reset: case CMD_RET_802_11_RESET:
lbs_deb_cmd("CMD_RESP: Reset command failed\n"); lbs_deb_cmd("CMD_RESP: Reset command failed\n");
break; break;
...@@ -1003,7 +1003,7 @@ int libertas_process_event(wlan_private * priv) ...@@ -1003,7 +1003,7 @@ int libertas_process_event(wlan_private * priv)
case MACREG_INT_CODE_MESH_AUTO_STARTED: case MACREG_INT_CODE_MESH_AUTO_STARTED:
lbs_pr_alert( "EVENT: MESH_AUTO_STARTED\n"); lbs_pr_alert( "EVENT: MESH_AUTO_STARTED\n");
adapter->connect_status = libertas_connected ; adapter->connect_status = LIBERTAS_CONNECTED ;
if (priv->mesh_open == 1) { if (priv->mesh_open == 1) {
netif_wake_queue(priv->mesh_dev) ; netif_wake_queue(priv->mesh_dev) ;
netif_carrier_on(priv->mesh_dev) ; netif_carrier_on(priv->mesh_dev) ;
......
...@@ -125,9 +125,9 @@ static ssize_t libertas_sleepparams_write(struct file *file, ...@@ -125,9 +125,9 @@ static ssize_t libertas_sleepparams_write(struct file *file,
priv->adapter->sp.sp_reserved = p6; priv->adapter->sp.sp_reserved = p6;
res = libertas_prepare_and_send_command(priv, res = libertas_prepare_and_send_command(priv,
cmd_802_11_sleep_params, CMD_802_11_SLEEP_PARAMS,
cmd_act_set, CMD_ACT_SET,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
if (!res) if (!res)
res = count; res = count;
...@@ -150,9 +150,9 @@ static ssize_t libertas_sleepparams_read(struct file *file, char __user *userbuf ...@@ -150,9 +150,9 @@ static ssize_t libertas_sleepparams_read(struct file *file, char __user *userbuf
char *buf = (char *)addr; char *buf = (char *)addr;
res = libertas_prepare_and_send_command(priv, res = libertas_prepare_and_send_command(priv,
cmd_802_11_sleep_params, CMD_802_11_SLEEP_PARAMS,
cmd_act_get, CMD_ACT_GET,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
if (res) { if (res) {
res = -EFAULT; res = -EFAULT;
goto out_unlock; goto out_unlock;
...@@ -386,7 +386,7 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf, ...@@ -386,7 +386,7 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf,
struct cmd_ctrl_node **cmdnode, struct cmd_ctrl_node **cmdnode,
struct cmd_ds_command **cmd) struct cmd_ds_command **cmd)
{ {
u16 wait_option = cmd_option_waitforrsp; u16 wait_option = CMD_OPTION_WAITFORRSP;
if (!(*cmdnode = libertas_get_free_cmd_ctrl_node(priv))) { if (!(*cmdnode = libertas_get_free_cmd_ctrl_node(priv))) {
lbs_deb_debugfs("failed libertas_get_free_cmd_ctrl_node\n"); lbs_deb_debugfs("failed libertas_get_free_cmd_ctrl_node\n");
...@@ -402,7 +402,7 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf, ...@@ -402,7 +402,7 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf,
(*cmdnode)->cmdflags |= CMD_F_HOSTCMD; (*cmdnode)->cmdflags |= CMD_F_HOSTCMD;
(*cmdnode)->cmdwaitqwoken = 0; (*cmdnode)->cmdwaitqwoken = 0;
*cmd = (struct cmd_ds_command *)(*cmdnode)->bufvirtualaddr; *cmd = (struct cmd_ds_command *)(*cmdnode)->bufvirtualaddr;
(*cmd)->command = cpu_to_le16(cmd_802_11_subscribe_event); (*cmd)->command = cpu_to_le16(CMD_802_11_SUBSCRIBE_EVENT);
(*cmd)->seqnum = cpu_to_le16(++priv->adapter->seqnum); (*cmd)->seqnum = cpu_to_le16(++priv->adapter->seqnum);
(*cmd)->result = 0; (*cmd)->result = 0;
return 0; return 0;
...@@ -429,7 +429,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf, ...@@ -429,7 +429,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf,
} }
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_get); event->action = cpu_to_le16(CMD_ACT_GET);
pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
libertas_queue_cmd(adapter, pcmdnode, 1); libertas_queue_cmd(adapter, pcmdnode, 1);
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
...@@ -447,7 +447,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf, ...@@ -447,7 +447,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -493,7 +493,7 @@ static u16 libertas_get_events_bitmap(wlan_private *priv) ...@@ -493,7 +493,7 @@ static u16 libertas_get_events_bitmap(wlan_private *priv)
return res; return res;
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_get); event->action = cpu_to_le16(CMD_ACT_GET);
pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
libertas_queue_cmd(adapter, pcmdnode, 1); libertas_queue_cmd(adapter, pcmdnode, 1);
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
...@@ -511,7 +511,7 @@ static u16 libertas_get_events_bitmap(wlan_private *priv) ...@@ -511,7 +511,7 @@ static u16 libertas_get_events_bitmap(wlan_private *priv)
return 0; return 0;
} }
if (pcmdptr->command != cmd_ret_802_11_subscribe_event) { if (pcmdptr->command != CMD_RET_802_11_SUBSCRIBE_EVENT) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
return 0; return 0;
...@@ -559,7 +559,7 @@ static ssize_t libertas_lowrssi_write(struct file *file, ...@@ -559,7 +559,7 @@ static ssize_t libertas_lowrssi_write(struct file *file,
goto out_unlock; goto out_unlock;
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_set); event->action = cpu_to_le16(CMD_ACT_SET);
pcmdptr->size = cpu_to_le16(S_DS_GEN + pcmdptr->size = cpu_to_le16(S_DS_GEN +
sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct cmd_ds_802_11_subscribe_event) +
sizeof(struct mrvlietypes_rssithreshold)); sizeof(struct mrvlietypes_rssithreshold));
...@@ -591,7 +591,7 @@ static ssize_t libertas_lowrssi_write(struct file *file, ...@@ -591,7 +591,7 @@ static ssize_t libertas_lowrssi_write(struct file *file,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -625,7 +625,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf, ...@@ -625,7 +625,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf,
} }
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_get); event->action = cpu_to_le16(CMD_ACT_GET);
pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
libertas_queue_cmd(adapter, pcmdnode, 1); libertas_queue_cmd(adapter, pcmdnode, 1);
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
...@@ -644,7 +644,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf, ...@@ -644,7 +644,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -712,7 +712,7 @@ static ssize_t libertas_lowsnr_write(struct file *file, ...@@ -712,7 +712,7 @@ static ssize_t libertas_lowsnr_write(struct file *file,
goto out_unlock; goto out_unlock;
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_set); event->action = cpu_to_le16(CMD_ACT_SET);
pcmdptr->size = cpu_to_le16(S_DS_GEN + pcmdptr->size = cpu_to_le16(S_DS_GEN +
sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct cmd_ds_802_11_subscribe_event) +
sizeof(struct mrvlietypes_snrthreshold)); sizeof(struct mrvlietypes_snrthreshold));
...@@ -743,7 +743,7 @@ static ssize_t libertas_lowsnr_write(struct file *file, ...@@ -743,7 +743,7 @@ static ssize_t libertas_lowsnr_write(struct file *file,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -778,7 +778,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf, ...@@ -778,7 +778,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf,
} }
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_get); event->action = cpu_to_le16(CMD_ACT_GET);
pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
libertas_queue_cmd(adapter, pcmdnode, 1); libertas_queue_cmd(adapter, pcmdnode, 1);
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
...@@ -797,7 +797,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf, ...@@ -797,7 +797,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -864,7 +864,7 @@ static ssize_t libertas_failcount_write(struct file *file, ...@@ -864,7 +864,7 @@ static ssize_t libertas_failcount_write(struct file *file,
goto out_unlock; goto out_unlock;
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_set); event->action = cpu_to_le16(CMD_ACT_SET);
pcmdptr->size = cpu_to_le16(S_DS_GEN + pcmdptr->size = cpu_to_le16(S_DS_GEN +
sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct cmd_ds_802_11_subscribe_event) +
sizeof(struct mrvlietypes_failurecount)); sizeof(struct mrvlietypes_failurecount));
...@@ -895,7 +895,7 @@ static ssize_t libertas_failcount_write(struct file *file, ...@@ -895,7 +895,7 @@ static ssize_t libertas_failcount_write(struct file *file,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -929,7 +929,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf, ...@@ -929,7 +929,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf,
} }
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_get); event->action = cpu_to_le16(CMD_ACT_GET);
pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
libertas_queue_cmd(adapter, pcmdnode, 1); libertas_queue_cmd(adapter, pcmdnode, 1);
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
...@@ -948,7 +948,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf, ...@@ -948,7 +948,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
free_page(addr); free_page(addr);
kfree(response_buf); kfree(response_buf);
...@@ -1015,7 +1015,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file, ...@@ -1015,7 +1015,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file,
goto out_unlock; goto out_unlock;
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_set); event->action = cpu_to_le16(CMD_ACT_SET);
pcmdptr->size = cpu_to_le16(S_DS_GEN + pcmdptr->size = cpu_to_le16(S_DS_GEN +
sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct cmd_ds_802_11_subscribe_event) +
sizeof(struct mrvlietypes_beaconsmissed)); sizeof(struct mrvlietypes_beaconsmissed));
...@@ -1045,7 +1045,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file, ...@@ -1045,7 +1045,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
free_page(addr); free_page(addr);
kfree(response_buf); kfree(response_buf);
...@@ -1079,7 +1079,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf, ...@@ -1079,7 +1079,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf,
} }
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_get); event->action = cpu_to_le16(CMD_ACT_GET);
pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
libertas_queue_cmd(adapter, pcmdnode, 1); libertas_queue_cmd(adapter, pcmdnode, 1);
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
...@@ -1098,7 +1098,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf, ...@@ -1098,7 +1098,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -1166,7 +1166,7 @@ static ssize_t libertas_highrssi_write(struct file *file, ...@@ -1166,7 +1166,7 @@ static ssize_t libertas_highrssi_write(struct file *file,
goto out_unlock; goto out_unlock;
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_set); event->action = cpu_to_le16(CMD_ACT_SET);
pcmdptr->size = cpu_to_le16(S_DS_GEN + pcmdptr->size = cpu_to_le16(S_DS_GEN +
sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct cmd_ds_802_11_subscribe_event) +
sizeof(struct mrvlietypes_rssithreshold)); sizeof(struct mrvlietypes_rssithreshold));
...@@ -1196,7 +1196,7 @@ static ssize_t libertas_highrssi_write(struct file *file, ...@@ -1196,7 +1196,7 @@ static ssize_t libertas_highrssi_write(struct file *file,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
return 0; return 0;
...@@ -1229,7 +1229,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf, ...@@ -1229,7 +1229,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf,
} }
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_get); event->action = cpu_to_le16(CMD_ACT_GET);
pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN); pcmdptr->size = cpu_to_le16(sizeof(*event) + S_DS_GEN);
libertas_queue_cmd(adapter, pcmdnode, 1); libertas_queue_cmd(adapter, pcmdnode, 1);
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
...@@ -1248,7 +1248,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf, ...@@ -1248,7 +1248,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -1316,7 +1316,7 @@ static ssize_t libertas_highsnr_write(struct file *file, ...@@ -1316,7 +1316,7 @@ static ssize_t libertas_highsnr_write(struct file *file,
goto out_unlock; goto out_unlock;
event = &pcmdptr->params.subscribe_event; event = &pcmdptr->params.subscribe_event;
event->action = cpu_to_le16(cmd_act_set); event->action = cpu_to_le16(CMD_ACT_SET);
pcmdptr->size = cpu_to_le16(S_DS_GEN + pcmdptr->size = cpu_to_le16(S_DS_GEN +
sizeof(struct cmd_ds_802_11_subscribe_event) + sizeof(struct cmd_ds_802_11_subscribe_event) +
sizeof(struct mrvlietypes_snrthreshold)); sizeof(struct mrvlietypes_snrthreshold));
...@@ -1347,7 +1347,7 @@ static ssize_t libertas_highsnr_write(struct file *file, ...@@ -1347,7 +1347,7 @@ static ssize_t libertas_highsnr_write(struct file *file,
return 0; return 0;
} }
if (pcmdptr->command != cpu_to_le16(cmd_ret_802_11_subscribe_event)) { if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n"); lbs_pr_err("command response incorrect!\n");
kfree(response_buf); kfree(response_buf);
free_page(addr); free_page(addr);
...@@ -1375,8 +1375,8 @@ static ssize_t libertas_rdmac_read(struct file *file, char __user *userbuf, ...@@ -1375,8 +1375,8 @@ static ssize_t libertas_rdmac_read(struct file *file, char __user *userbuf,
offval.value = 0; offval.value = 0;
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_mac_reg_access, 0, CMD_MAC_REG_ACCESS, 0,
cmd_option_waitforrsp, 0, &offval); CMD_OPTION_WAITFORRSP, 0, &offval);
mdelay(10); mdelay(10);
pos += snprintf(buf+pos, len-pos, "MAC[0x%x] = 0x%08x\n", pos += snprintf(buf+pos, len-pos, "MAC[0x%x] = 0x%08x\n",
priv->mac_offset, adapter->offsetvalue.value); priv->mac_offset, adapter->offsetvalue.value);
...@@ -1433,8 +1433,8 @@ static ssize_t libertas_wrmac_write(struct file *file, ...@@ -1433,8 +1433,8 @@ static ssize_t libertas_wrmac_write(struct file *file,
offval.offset = offset; offval.offset = offset;
offval.value = value; offval.value = value;
res = libertas_prepare_and_send_command(priv, res = libertas_prepare_and_send_command(priv,
cmd_mac_reg_access, 1, CMD_MAC_REG_ACCESS, 1,
cmd_option_waitforrsp, 0, &offval); CMD_OPTION_WAITFORRSP, 0, &offval);
mdelay(10); mdelay(10);
res = count; res = count;
...@@ -1458,8 +1458,8 @@ static ssize_t libertas_rdbbp_read(struct file *file, char __user *userbuf, ...@@ -1458,8 +1458,8 @@ static ssize_t libertas_rdbbp_read(struct file *file, char __user *userbuf,
offval.value = 0; offval.value = 0;
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_bbp_reg_access, 0, CMD_BBP_REG_ACCESS, 0,
cmd_option_waitforrsp, 0, &offval); CMD_OPTION_WAITFORRSP, 0, &offval);
mdelay(10); mdelay(10);
pos += snprintf(buf+pos, len-pos, "BBP[0x%x] = 0x%08x\n", pos += snprintf(buf+pos, len-pos, "BBP[0x%x] = 0x%08x\n",
priv->bbp_offset, adapter->offsetvalue.value); priv->bbp_offset, adapter->offsetvalue.value);
...@@ -1517,8 +1517,8 @@ static ssize_t libertas_wrbbp_write(struct file *file, ...@@ -1517,8 +1517,8 @@ static ssize_t libertas_wrbbp_write(struct file *file,
offval.offset = offset; offval.offset = offset;
offval.value = value; offval.value = value;
res = libertas_prepare_and_send_command(priv, res = libertas_prepare_and_send_command(priv,
cmd_bbp_reg_access, 1, CMD_BBP_REG_ACCESS, 1,
cmd_option_waitforrsp, 0, &offval); CMD_OPTION_WAITFORRSP, 0, &offval);
mdelay(10); mdelay(10);
res = count; res = count;
...@@ -1542,8 +1542,8 @@ static ssize_t libertas_rdrf_read(struct file *file, char __user *userbuf, ...@@ -1542,8 +1542,8 @@ static ssize_t libertas_rdrf_read(struct file *file, char __user *userbuf,
offval.value = 0; offval.value = 0;
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_rf_reg_access, 0, CMD_RF_REG_ACCESS, 0,
cmd_option_waitforrsp, 0, &offval); CMD_OPTION_WAITFORRSP, 0, &offval);
mdelay(10); mdelay(10);
pos += snprintf(buf+pos, len-pos, "RF[0x%x] = 0x%08x\n", pos += snprintf(buf+pos, len-pos, "RF[0x%x] = 0x%08x\n",
priv->rf_offset, adapter->offsetvalue.value); priv->rf_offset, adapter->offsetvalue.value);
...@@ -1601,8 +1601,8 @@ static ssize_t libertas_wrrf_write(struct file *file, ...@@ -1601,8 +1601,8 @@ static ssize_t libertas_wrrf_write(struct file *file,
offval.offset = offset; offval.offset = offset;
offval.value = value; offval.value = value;
res = libertas_prepare_and_send_command(priv, res = libertas_prepare_and_send_command(priv,
cmd_rf_reg_access, 1, CMD_RF_REG_ACCESS, 1,
cmd_option_waitforrsp, 0, &offval); CMD_OPTION_WAITFORRSP, 0, &offval);
mdelay(10); mdelay(10);
res = count; res = count;
......
...@@ -286,11 +286,11 @@ enum SNRNF_DATA { ...@@ -286,11 +286,11 @@ enum SNRNF_DATA {
/** WLAN_802_11_POWER_MODE */ /** WLAN_802_11_POWER_MODE */
enum WLAN_802_11_POWER_MODE { enum WLAN_802_11_POWER_MODE {
wlan802_11powermodecam, WLAN802_11POWERMODECAM,
wlan802_11powermodemax_psp, WLAN802_11POWERMODEMAX_PSP,
wlan802_11Powermodefast_psp, WLAN802_11POWERMODEFAST_PSP,
/*not a real mode, defined as an upper bound */ /*not a real mode, defined as an upper bound */
wlan802_11powemodemax WLAN802_11POWEMODEMAX
}; };
/** PS_STATE */ /** PS_STATE */
...@@ -310,14 +310,14 @@ enum DNLD_STATE { ...@@ -310,14 +310,14 @@ enum DNLD_STATE {
/** WLAN_MEDIA_STATE */ /** WLAN_MEDIA_STATE */
enum WLAN_MEDIA_STATE { enum WLAN_MEDIA_STATE {
libertas_connected, LIBERTAS_CONNECTED,
libertas_disconnected LIBERTAS_DISCONNECTED
}; };
/** WLAN_802_11_PRIVACY_FILTER */ /** WLAN_802_11_PRIVACY_FILTER */
enum WLAN_802_11_PRIVACY_FILTER { enum WLAN_802_11_PRIVACY_FILTER {
wlan802_11privfilteracceptall, WLAN802_11PRIVFILTERACCEPTALL,
wlan802_11privfilter8021xWEP WLAN802_11PRIVFILTER8021XWEP
}; };
/** mv_ms_type */ /** mv_ms_type */
...@@ -330,23 +330,23 @@ enum mv_ms_type { ...@@ -330,23 +330,23 @@ enum mv_ms_type {
/** SNMP_MIB_INDEX_e */ /** SNMP_MIB_INDEX_e */
enum SNMP_MIB_INDEX_e { enum SNMP_MIB_INDEX_e {
desired_bsstype_i = 0, DESIRED_BSSTYPE_I = 0,
op_rateset_i, OP_RATESET_I,
bcnperiod_i, BCNPERIOD_I,
dtimperiod_i, DTIMPERIOD_I,
assocrsp_timeout_i, ASSOCRSP_TIMEOUT_I,
rtsthresh_i, RTSTHRESH_I,
short_retrylim_i, SHORT_RETRYLIM_I,
long_retrylim_i, LONG_RETRYLIM_I,
fragthresh_i, FRAGTHRESH_I,
dot11d_i, DOT11D_I,
dot11h_i, DOT11H_I,
manufid_i, MANUFID_I,
prodID_i, PRODID_I,
manuf_oui_i, MANUF_OUI_I,
manuf_name_i, MANUF_NAME_I,
manuf_prodname_i, MANUF_PRODNAME_I,
manuf_prodver_i, MANUF_PRODVER_I,
}; };
/** KEY_TYPE_ID */ /** KEY_TYPE_ID */
......
...@@ -72,9 +72,9 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, ...@@ -72,9 +72,9 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev,
regctrl.action, regctrl.offset, regctrl.NOB); regctrl.action, regctrl.offset, regctrl.NOB);
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_eeprom_access, CMD_802_11_EEPROM_ACCESS,
regctrl.action, regctrl.action,
cmd_option_waitforrsp, 0, CMD_OPTION_WAITFORRSP, 0,
&regctrl); &regctrl);
if (ret) { if (ret) {
...@@ -138,8 +138,8 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev) ...@@ -138,8 +138,8 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev)
/* Get Mesh Statistics */ /* Get Mesh Statistics */
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_mesh_access, cmd_act_mesh_get_stats, CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
cmd_option_waitforrsp, 0, &mesh_access); CMD_OPTION_WAITFORRSP, 0, &mesh_access);
if (ret) { if (ret) {
ret = 0; ret = 0;
......
...@@ -99,8 +99,8 @@ static int wlan_setup_station_hw(wlan_private * priv, char *fw_name) ...@@ -99,8 +99,8 @@ static int wlan_setup_station_hw(wlan_private * priv, char *fw_name)
*/ */
memset(adapter->current_addr, 0xff, ETH_ALEN); memset(adapter->current_addr, 0xff, ETH_ALEN);
ret = libertas_prepare_and_send_command(priv, cmd_get_hw_spec, ret = libertas_prepare_and_send_command(priv, CMD_GET_HW_SPEC,
0, cmd_option_waitforrsp, 0, NULL); 0, CMD_OPTION_WAITFORRSP, 0, NULL);
if (ret) { if (ret) {
ret = -1; ret = -1;
...@@ -110,9 +110,9 @@ static int wlan_setup_station_hw(wlan_private * priv, char *fw_name) ...@@ -110,9 +110,9 @@ static int wlan_setup_station_hw(wlan_private * priv, char *fw_name)
libertas_set_mac_packet_filter(priv); libertas_set_mac_packet_filter(priv);
/* Get the supported Data rates */ /* Get the supported Data rates */
ret = libertas_prepare_and_send_command(priv, cmd_802_11_data_rate, ret = libertas_prepare_and_send_command(priv, CMD_802_11_DATA_RATE,
cmd_act_get_tx_rate, CMD_ACT_GET_tx_rate,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
if (ret) { if (ret) {
ret = -1; ret = -1;
...@@ -145,12 +145,12 @@ static int wlan_allocate_adapter(wlan_private * priv) ...@@ -145,12 +145,12 @@ static int wlan_allocate_adapter(wlan_private * priv)
memset(&adapter->libertas_ps_confirm_sleep, 0, sizeof(struct PS_CMD_ConfirmSleep)); memset(&adapter->libertas_ps_confirm_sleep, 0, sizeof(struct PS_CMD_ConfirmSleep));
adapter->libertas_ps_confirm_sleep.seqnum = cpu_to_le16(++adapter->seqnum); adapter->libertas_ps_confirm_sleep.seqnum = cpu_to_le16(++adapter->seqnum);
adapter->libertas_ps_confirm_sleep.command = adapter->libertas_ps_confirm_sleep.command =
cpu_to_le16(cmd_802_11_ps_mode); cpu_to_le16(CMD_802_11_PS_MODE);
adapter->libertas_ps_confirm_sleep.size = adapter->libertas_ps_confirm_sleep.size =
cpu_to_le16(sizeof(struct PS_CMD_ConfirmSleep)); cpu_to_le16(sizeof(struct PS_CMD_ConfirmSleep));
adapter->libertas_ps_confirm_sleep.result = 0; adapter->libertas_ps_confirm_sleep.result = 0;
adapter->libertas_ps_confirm_sleep.action = adapter->libertas_ps_confirm_sleep.action =
cpu_to_le16(cmd_subcmd_sleep_confirmed); cpu_to_le16(CMD_SUBCMD_SLEEP_CONFIRMED);
return 0; return 0;
} }
...@@ -168,14 +168,14 @@ static void wlan_init_adapter(wlan_private * priv) ...@@ -168,14 +168,14 @@ static void wlan_init_adapter(wlan_private * priv)
/* ATIM params */ /* ATIM params */
adapter->atimwindow = 0; adapter->atimwindow = 0;
adapter->connect_status = libertas_disconnected; adapter->connect_status = LIBERTAS_DISCONNECTED;
memset(adapter->current_addr, 0xff, ETH_ALEN); memset(adapter->current_addr, 0xff, ETH_ALEN);
/* scan type */ /* scan type */
adapter->scantype = cmd_scan_type_active; adapter->scantype = CMD_SCAN_TYPE_ACTIVE;
/* scan mode */ /* scan mode */
adapter->scanmode = cmd_bss_type_any; adapter->scanmode = CMD_BSS_TYPE_ANY;
/* 802.11 specific */ /* 802.11 specific */
adapter->secinfo.wep_enabled = 0; adapter->secinfo.wep_enabled = 0;
...@@ -208,7 +208,7 @@ static void wlan_init_adapter(wlan_private * priv) ...@@ -208,7 +208,7 @@ static void wlan_init_adapter(wlan_private * priv)
adapter->surpriseremoved = 0; adapter->surpriseremoved = 0;
adapter->currentpacketfilter = adapter->currentpacketfilter =
cmd_act_mac_rx_on | cmd_act_mac_tx_on; CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
adapter->radioon = RADIO_ON; adapter->radioon = RADIO_ON;
adapter->txantenna = RF_ANTENNA_2; adapter->txantenna = RF_ANTENNA_2;
...@@ -220,7 +220,7 @@ static void wlan_init_adapter(wlan_private * priv) ...@@ -220,7 +220,7 @@ static void wlan_init_adapter(wlan_private * priv)
// set default capabilities // set default capabilities
adapter->capability = WLAN_CAPABILITY_SHORT_PREAMBLE; adapter->capability = WLAN_CAPABILITY_SHORT_PREAMBLE;
adapter->psmode = wlan802_11powermodecam; adapter->psmode = WLAN802_11POWERMODECAM;
adapter->multipledtim = MRVDRV_DEFAULT_MULTIPLE_DTIM; adapter->multipledtim = MRVDRV_DEFAULT_MULTIPLE_DTIM;
adapter->listeninterval = MRVDRV_DEFAULT_LISTEN_INTERVAL; adapter->listeninterval = MRVDRV_DEFAULT_LISTEN_INTERVAL;
......
...@@ -108,7 +108,7 @@ struct cmd_ds_gen { ...@@ -108,7 +108,7 @@ struct cmd_ds_gen {
#define S_DS_GEN sizeof(struct cmd_ds_gen) #define S_DS_GEN sizeof(struct cmd_ds_gen)
/* /*
* Define data structure for cmd_get_hw_spec * Define data structure for CMD_GET_HW_SPEC
* This structure defines the response for the GET_HW_SPEC command * This structure defines the response for the GET_HW_SPEC command
*/ */
struct cmd_ds_get_hw_spec { struct cmd_ds_get_hw_spec {
...@@ -155,7 +155,7 @@ struct cmd_ds_802_11_subscribe_event { ...@@ -155,7 +155,7 @@ struct cmd_ds_802_11_subscribe_event {
/* /*
* This scan handle Country Information IE(802.11d compliant) * This scan handle Country Information IE(802.11d compliant)
* Define data structure for cmd_802_11_scan * Define data structure for CMD_802_11_SCAN
*/ */
struct cmd_ds_802_11_scan { struct cmd_ds_802_11_scan {
u8 bsstype; u8 bsstype;
......
...@@ -78,7 +78,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) ...@@ -78,7 +78,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
/* Wake main thread if commands are pending */ /* Wake main thread if commands are pending */
if (!adapter->cur_cmd) if (!adapter->cur_cmd)
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
if ((adapter->connect_status == libertas_connected)) { if ((adapter->connect_status == LIBERTAS_CONNECTED)) {
netif_wake_queue(dev); netif_wake_queue(dev);
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
} }
...@@ -758,8 +758,8 @@ static int if_usb_reset_device(wlan_private *priv) ...@@ -758,8 +758,8 @@ static int if_usb_reset_device(wlan_private *priv)
int ret; int ret;
lbs_deb_enter(LBS_DEB_USB); lbs_deb_enter(LBS_DEB_USB);
ret = libertas_prepare_and_send_command(priv, cmd_802_11_reset, ret = libertas_prepare_and_send_command(priv, CMD_802_11_RESET,
cmd_act_halt, 0, 0, NULL); CMD_ACT_HALT, 0, 0, NULL);
msleep_interruptible(10); msleep_interruptible(10);
lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret);
......
...@@ -88,7 +88,7 @@ int libertas_send_deauth(wlan_private * priv) ...@@ -88,7 +88,7 @@ int libertas_send_deauth(wlan_private * priv)
int ret = 0; int ret = 0;
if (adapter->mode == IW_MODE_INFRA && if (adapter->mode == IW_MODE_INFRA &&
adapter->connect_status == libertas_connected) adapter->connect_status == LIBERTAS_CONNECTED)
ret = libertas_send_deauthentication(priv); ret = libertas_send_deauthentication(priv);
else else
ret = -ENOTSUPP; ret = -ENOTSUPP;
...@@ -111,8 +111,8 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req) ...@@ -111,8 +111,8 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req)
lbs_deb_enter(LBS_DEB_JOIN); lbs_deb_enter(LBS_DEB_JOIN);
ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate, ret = libertas_prepare_and_send_command(priv, CMD_802_11_AUTHENTICATE,
0, cmd_option_waitforrsp, 0, CMD_OPTION_WAITFORRSP,
0, assoc_req->bss.bssid); 0, assoc_req->bss.bssid);
if (ret) if (ret)
...@@ -121,14 +121,14 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req) ...@@ -121,14 +121,14 @@ int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req)
/* set preamble to firmware */ /* set preamble to firmware */
if ( (adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) if ( (adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
&& (assoc_req->bss.capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) && (assoc_req->bss.capability & WLAN_CAPABILITY_SHORT_PREAMBLE))
adapter->preamble = cmd_type_short_preamble; adapter->preamble = CMD_TYPE_SHORT_PREAMBLE;
else else
adapter->preamble = cmd_type_long_preamble; adapter->preamble = CMD_TYPE_LONG_PREAMBLE;
libertas_set_radio_control(priv); libertas_set_radio_control(priv);
ret = libertas_prepare_and_send_command(priv, cmd_802_11_associate, ret = libertas_prepare_and_send_command(priv, CMD_802_11_ASSOCIATE,
0, cmd_option_waitforrsp, 0, assoc_req); 0, CMD_OPTION_WAITFORRSP, 0, assoc_req);
done: done:
lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
...@@ -151,10 +151,10 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass ...@@ -151,10 +151,10 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass
if (adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) { if (adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) {
lbs_deb_join("AdhocStart: Short preamble\n"); lbs_deb_join("AdhocStart: Short preamble\n");
adapter->preamble = cmd_type_short_preamble; adapter->preamble = CMD_TYPE_SHORT_PREAMBLE;
} else { } else {
lbs_deb_join("AdhocStart: Long preamble\n"); lbs_deb_join("AdhocStart: Long preamble\n");
adapter->preamble = cmd_type_long_preamble; adapter->preamble = CMD_TYPE_LONG_PREAMBLE;
} }
libertas_set_radio_control(priv); libertas_set_radio_control(priv);
...@@ -162,8 +162,8 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass ...@@ -162,8 +162,8 @@ int libertas_start_adhoc_network(wlan_private * priv, struct assoc_request * ass
lbs_deb_join("AdhocStart: channel = %d\n", assoc_req->channel); lbs_deb_join("AdhocStart: channel = %d\n", assoc_req->channel);
lbs_deb_join("AdhocStart: band = %d\n", assoc_req->band); lbs_deb_join("AdhocStart: band = %d\n", assoc_req->band);
ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_start, ret = libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_START,
0, cmd_option_waitforrsp, 0, assoc_req); 0, CMD_OPTION_WAITFORRSP, 0, assoc_req);
return ret; return ret;
} }
...@@ -209,10 +209,10 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso ...@@ -209,10 +209,10 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso
if ( !(bss->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) if ( !(bss->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
|| !(adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) { || !(adapter->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) {
lbs_deb_join("AdhocJoin: Long preamble\n"); lbs_deb_join("AdhocJoin: Long preamble\n");
adapter->preamble = cmd_type_long_preamble; adapter->preamble = CMD_TYPE_LONG_PREAMBLE;
} else { } else {
lbs_deb_join("AdhocJoin: Short preamble\n"); lbs_deb_join("AdhocJoin: Short preamble\n");
adapter->preamble = cmd_type_short_preamble; adapter->preamble = CMD_TYPE_SHORT_PREAMBLE;
} }
libertas_set_radio_control(priv); libertas_set_radio_control(priv);
...@@ -222,8 +222,8 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso ...@@ -222,8 +222,8 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso
adapter->adhoccreate = 0; adapter->adhoccreate = 0;
ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_join, ret = libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_JOIN,
0, cmd_option_waitforrsp, 0, CMD_OPTION_WAITFORRSP,
OID_802_11_SSID, assoc_req); OID_802_11_SSID, assoc_req);
return ret; return ret;
...@@ -231,8 +231,8 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso ...@@ -231,8 +231,8 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso
int libertas_stop_adhoc_network(wlan_private * priv) int libertas_stop_adhoc_network(wlan_private * priv)
{ {
return libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_stop, return libertas_prepare_and_send_command(priv, CMD_802_11_AD_HOC_STOP,
0, cmd_option_waitforrsp, 0, NULL); 0, CMD_OPTION_WAITFORRSP, 0, NULL);
} }
/** /**
...@@ -243,8 +243,8 @@ int libertas_stop_adhoc_network(wlan_private * priv) ...@@ -243,8 +243,8 @@ int libertas_stop_adhoc_network(wlan_private * priv)
*/ */
int libertas_send_deauthentication(wlan_private * priv) int libertas_send_deauthentication(wlan_private * priv)
{ {
return libertas_prepare_and_send_command(priv, cmd_802_11_deauthenticate, return libertas_prepare_and_send_command(priv, CMD_802_11_DEAUTHENTICATE,
0, cmd_option_waitforrsp, 0, NULL); 0, CMD_OPTION_WAITFORRSP, 0, NULL);
} }
/** /**
...@@ -267,7 +267,7 @@ int libertas_cmd_80211_authenticate(wlan_private * priv, ...@@ -267,7 +267,7 @@ int libertas_cmd_80211_authenticate(wlan_private * priv,
lbs_deb_enter(LBS_DEB_JOIN); lbs_deb_enter(LBS_DEB_JOIN);
cmd->command = cpu_to_le16(cmd_802_11_authenticate); cmd->command = cpu_to_le16(CMD_802_11_AUTHENTICATE);
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate) cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate)
+ S_DS_GEN); + S_DS_GEN);
...@@ -307,7 +307,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv, ...@@ -307,7 +307,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv,
lbs_deb_enter(LBS_DEB_JOIN); lbs_deb_enter(LBS_DEB_JOIN);
cmd->command = cpu_to_le16(cmd_802_11_deauthenticate); cmd->command = cpu_to_le16(CMD_802_11_DEAUTHENTICATE);
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_deauthenticate) + cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_deauthenticate) +
S_DS_GEN); S_DS_GEN);
...@@ -349,7 +349,7 @@ int libertas_cmd_80211_associate(wlan_private * priv, ...@@ -349,7 +349,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
goto done; goto done;
} }
cmd->command = cpu_to_le16(cmd_802_11_associate); cmd->command = cpu_to_le16(CMD_802_11_ASSOCIATE);
memcpy(passo->peerstaaddr, bss->bssid, sizeof(passo->peerstaaddr)); memcpy(passo->peerstaaddr, bss->bssid, sizeof(passo->peerstaaddr));
pos += sizeof(passo->peerstaaddr); pos += sizeof(passo->peerstaaddr);
...@@ -465,7 +465,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -465,7 +465,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
goto done; goto done;
} }
cmd->command = cpu_to_le16(cmd_802_11_ad_hoc_start); cmd->command = cpu_to_le16(CMD_802_11_AD_HOC_START);
/* /*
* Fill in the parameters for 2 data structures: * Fill in the parameters for 2 data structures:
...@@ -487,7 +487,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -487,7 +487,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
assoc_req->ssid_len); assoc_req->ssid_len);
/* set the BSS type */ /* set the BSS type */
adhs->bsstype = cmd_bss_type_ibss; adhs->bsstype = CMD_BSS_TYPE_IBSS;
adapter->mode = IW_MODE_ADHOC; adapter->mode = IW_MODE_ADHOC;
adhs->beaconperiod = cpu_to_le16(adapter->beaconperiod); adhs->beaconperiod = cpu_to_le16(adapter->beaconperiod);
...@@ -524,7 +524,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -524,7 +524,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
adhs->capability = cpu_to_le16(tmpcap); adhs->capability = cpu_to_le16(tmpcap);
/* probedelay */ /* probedelay */
adhs->probedelay = cpu_to_le16(cmd_scan_probe_delay_time); adhs->probedelay = cpu_to_le16(CMD_SCAN_PROBE_DELAY_TIME);
memset(adhs->datarate, 0, sizeof(adhs->datarate)); memset(adhs->datarate, 0, sizeof(adhs->datarate));
...@@ -569,7 +569,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -569,7 +569,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv, int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv,
struct cmd_ds_command *cmd) struct cmd_ds_command *cmd)
{ {
cmd->command = cpu_to_le16(cmd_802_11_ad_hoc_stop); cmd->command = cpu_to_le16(CMD_802_11_AD_HOC_STOP);
cmd->size = cpu_to_le16(S_DS_GEN); cmd->size = cpu_to_le16(S_DS_GEN);
return 0; return 0;
...@@ -590,9 +590,9 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, ...@@ -590,9 +590,9 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
lbs_deb_enter(LBS_DEB_JOIN); lbs_deb_enter(LBS_DEB_JOIN);
cmd->command = cpu_to_le16(cmd_802_11_ad_hoc_join); cmd->command = cpu_to_le16(CMD_802_11_AD_HOC_JOIN);
join_cmd->bss.type = cmd_bss_type_ibss; join_cmd->bss.type = CMD_BSS_TYPE_IBSS;
join_cmd->bss.beaconperiod = cpu_to_le16(bss->beaconperiod); join_cmd->bss.beaconperiod = cpu_to_le16(bss->beaconperiod);
memcpy(&join_cmd->bss.bssid, &bss->bssid, ETH_ALEN); memcpy(&join_cmd->bss.bssid, &bss->bssid, ETH_ALEN);
...@@ -617,7 +617,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, ...@@ -617,7 +617,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
join_cmd->failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT); join_cmd->failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT);
/* probedelay */ /* probedelay */
join_cmd->probedelay = cpu_to_le16(cmd_scan_probe_delay_time); join_cmd->probedelay = cpu_to_le16(CMD_SCAN_PROBE_DELAY_TIME);
/* Copy Data rates from the rates recorded in scan response */ /* Copy Data rates from the rates recorded in scan response */
memset(join_cmd->bss.datarates, 0, sizeof(join_cmd->bss.datarates)); memset(join_cmd->bss.datarates, 0, sizeof(join_cmd->bss.datarates));
...@@ -659,14 +659,14 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, ...@@ -659,14 +659,14 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
join_cmd->bss.capability = cpu_to_le16(tmp); join_cmd->bss.capability = cpu_to_le16(tmp);
} }
if (adapter->psmode == wlan802_11powermodemax_psp) { if (adapter->psmode == WLAN802_11POWERMODEMAX_PSP) {
/* wake up first */ /* wake up first */
__le32 Localpsmode; __le32 Localpsmode;
Localpsmode = cpu_to_le32(wlan802_11powermodecam); Localpsmode = cpu_to_le32(WLAN802_11POWERMODECAM);
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_ps_mode, CMD_802_11_PS_MODE,
cmd_act_set, CMD_ACT_SET,
0, 0, &Localpsmode); 0, 0, &Localpsmode);
if (ret) { if (ret) {
...@@ -722,7 +722,7 @@ int libertas_ret_80211_associate(wlan_private * priv, ...@@ -722,7 +722,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
le16_to_cpu(resp->size) - S_DS_GEN); le16_to_cpu(resp->size) - S_DS_GEN);
/* Send a Media Connected event, according to the Spec */ /* Send a Media Connected event, according to the Spec */
adapter->connect_status = libertas_connected; adapter->connect_status = LIBERTAS_CONNECTED;
lbs_deb_join("ASSOC_RESP: assocated to '%s'\n", lbs_deb_join("ASSOC_RESP: assocated to '%s'\n",
escape_essid(bss->ssid, bss->ssid_len)); escape_essid(bss->ssid, bss->ssid_len));
...@@ -802,7 +802,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, ...@@ -802,7 +802,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
*/ */
if (result) { if (result) {
lbs_deb_join("ADHOC_RESP: failed\n"); lbs_deb_join("ADHOC_RESP: failed\n");
if (adapter->connect_status == libertas_connected) { if (adapter->connect_status == LIBERTAS_CONNECTED) {
libertas_mac_event_disconnected(priv); libertas_mac_event_disconnected(priv);
} }
ret = -1; ret = -1;
...@@ -817,9 +817,9 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, ...@@ -817,9 +817,9 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
escape_essid(bss->ssid, bss->ssid_len)); escape_essid(bss->ssid, bss->ssid_len));
/* Send a Media Connected event, according to the Spec */ /* Send a Media Connected event, according to the Spec */
adapter->connect_status = libertas_connected; adapter->connect_status = LIBERTAS_CONNECTED;
if (command == cmd_ret_802_11_ad_hoc_start) { if (command == CMD_RET_802_11_AD_HOC_START) {
/* Update the created network descriptor with the new BSSID */ /* Update the created network descriptor with the new BSSID */
memcpy(bss->bssid, padhocresult->bssid, ETH_ALEN); memcpy(bss->bssid, padhocresult->bssid, ETH_ALEN);
} }
......
...@@ -187,9 +187,9 @@ static ssize_t libertas_anycast_get(struct device * dev, ...@@ -187,9 +187,9 @@ static ssize_t libertas_anycast_get(struct device * dev,
memset(&mesh_access, 0, sizeof(mesh_access)); memset(&mesh_access, 0, sizeof(mesh_access));
libertas_prepare_and_send_command(to_net_dev(dev)->priv, libertas_prepare_and_send_command(to_net_dev(dev)->priv,
cmd_mesh_access, CMD_MESH_ACCESS,
cmd_act_mesh_get_anycast, CMD_ACT_MESH_GET_ANYCAST,
cmd_option_waitforrsp, 0, (void *)&mesh_access); CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access);
return snprintf(buf, 12, "0x%X\n", le32_to_cpu(mesh_access.data[0])); return snprintf(buf, 12, "0x%X\n", le32_to_cpu(mesh_access.data[0]));
} }
...@@ -208,9 +208,9 @@ static ssize_t libertas_anycast_set(struct device * dev, ...@@ -208,9 +208,9 @@ static ssize_t libertas_anycast_set(struct device * dev,
mesh_access.data[0] = cpu_to_le32(datum); mesh_access.data[0] = cpu_to_le32(datum);
libertas_prepare_and_send_command((to_net_dev(dev))->priv, libertas_prepare_and_send_command((to_net_dev(dev))->priv,
cmd_mesh_access, CMD_MESH_ACCESS,
cmd_act_mesh_set_anycast, CMD_ACT_MESH_SET_ANYCAST,
cmd_option_waitforrsp, 0, (void *)&mesh_access); CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access);
return strlen(buf); return strlen(buf);
} }
...@@ -264,7 +264,7 @@ static int wlan_dev_open(struct net_device *dev) ...@@ -264,7 +264,7 @@ static int wlan_dev_open(struct net_device *dev)
priv->open = 1; priv->open = 1;
if (adapter->connect_status == libertas_connected) { if (adapter->connect_status == LIBERTAS_CONNECTED) {
netif_carrier_on(priv->dev); netif_carrier_on(priv->dev);
netif_carrier_on(priv->mesh_dev); netif_carrier_on(priv->mesh_dev);
} else { } else {
...@@ -439,7 +439,7 @@ static void wlan_tx_timeout(struct net_device *dev) ...@@ -439,7 +439,7 @@ static void wlan_tx_timeout(struct net_device *dev)
libertas_send_tx_feedback(priv); libertas_send_tx_feedback(priv);
} else } else
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
} else if (priv->adapter->connect_status == libertas_connected) { } else if (priv->adapter->connect_status == LIBERTAS_CONNECTED) {
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
} }
...@@ -480,9 +480,9 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr) ...@@ -480,9 +480,9 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr)
lbs_dbg_hex("addr:", phwaddr->sa_data, ETH_ALEN); lbs_dbg_hex("addr:", phwaddr->sa_data, ETH_ALEN);
memcpy(adapter->current_addr, phwaddr->sa_data, ETH_ALEN); memcpy(adapter->current_addr, phwaddr->sa_data, ETH_ALEN);
ret = libertas_prepare_and_send_command(priv, cmd_802_11_mac_address, ret = libertas_prepare_and_send_command(priv, CMD_802_11_MAC_ADDRESS,
cmd_act_set, CMD_ACT_SET,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
if (ret) { if (ret) {
lbs_deb_net("set MAC address failed\n"); lbs_deb_net("set MAC address failed\n");
...@@ -528,36 +528,36 @@ static void wlan_set_multicast_list(struct net_device *dev) ...@@ -528,36 +528,36 @@ static void wlan_set_multicast_list(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { if (dev->flags & IFF_PROMISC) {
lbs_deb_net("enable promiscuous mode\n"); lbs_deb_net("enable promiscuous mode\n");
adapter->currentpacketfilter |= adapter->currentpacketfilter |=
cmd_act_mac_promiscuous_enable; CMD_ACT_MAC_PROMISCUOUS_ENABLE;
adapter->currentpacketfilter &= adapter->currentpacketfilter &=
~(cmd_act_mac_all_multicast_enable | ~(CMD_ACT_MAC_ALL_MULTICAST_ENABLE |
cmd_act_mac_multicast_enable); CMD_ACT_MAC_MULTICAST_ENABLE);
} else { } else {
/* Multicast */ /* Multicast */
adapter->currentpacketfilter &= adapter->currentpacketfilter &=
~cmd_act_mac_promiscuous_enable; ~CMD_ACT_MAC_PROMISCUOUS_ENABLE;
if (dev->flags & IFF_ALLMULTI || dev->mc_count > if (dev->flags & IFF_ALLMULTI || dev->mc_count >
MRVDRV_MAX_MULTICAST_LIST_SIZE) { MRVDRV_MAX_MULTICAST_LIST_SIZE) {
lbs_deb_net( "enabling all multicast\n"); lbs_deb_net( "enabling all multicast\n");
adapter->currentpacketfilter |= adapter->currentpacketfilter |=
cmd_act_mac_all_multicast_enable; CMD_ACT_MAC_ALL_MULTICAST_ENABLE;
adapter->currentpacketfilter &= adapter->currentpacketfilter &=
~cmd_act_mac_multicast_enable; ~CMD_ACT_MAC_MULTICAST_ENABLE;
} else { } else {
adapter->currentpacketfilter &= adapter->currentpacketfilter &=
~cmd_act_mac_all_multicast_enable; ~CMD_ACT_MAC_ALL_MULTICAST_ENABLE;
if (!dev->mc_count) { if (!dev->mc_count) {
lbs_deb_net("no multicast addresses, " lbs_deb_net("no multicast addresses, "
"disabling multicast\n"); "disabling multicast\n");
adapter->currentpacketfilter &= adapter->currentpacketfilter &=
~cmd_act_mac_multicast_enable; ~CMD_ACT_MAC_MULTICAST_ENABLE;
} else { } else {
int i; int i;
adapter->currentpacketfilter |= adapter->currentpacketfilter |=
cmd_act_mac_multicast_enable; CMD_ACT_MAC_MULTICAST_ENABLE;
adapter->nr_of_multicastmacaddr = adapter->nr_of_multicastmacaddr =
wlan_copy_multicast_address(adapter, dev); wlan_copy_multicast_address(adapter, dev);
...@@ -577,8 +577,8 @@ static void wlan_set_multicast_list(struct net_device *dev) ...@@ -577,8 +577,8 @@ static void wlan_set_multicast_list(struct net_device *dev)
} }
/* send multicast addresses to firmware */ /* send multicast addresses to firmware */
libertas_prepare_and_send_command(priv, libertas_prepare_and_send_command(priv,
cmd_mac_multicast_adr, CMD_MAC_MULTICAST_ADR,
cmd_act_set, 0, 0, CMD_ACT_SET, 0, 0,
NULL); NULL);
} }
} }
...@@ -711,7 +711,7 @@ static int wlan_service_main_thread(void *data) ...@@ -711,7 +711,7 @@ static int wlan_service_main_thread(void *data)
if (adapter->psstate == PS_STATE_PRE_SLEEP) { if (adapter->psstate == PS_STATE_PRE_SLEEP) {
if (!priv->dnld_sent && !adapter->cur_cmd) { if (!priv->dnld_sent && !adapter->cur_cmd) {
if (adapter->connect_status == if (adapter->connect_status ==
libertas_connected) { LIBERTAS_CONNECTED) {
lbs_deb_thread( lbs_deb_thread(
"main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p " "main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p "
"dnld_sent=%d cur_cmd=%p, confirm now\n", "dnld_sent=%d cur_cmd=%p, confirm now\n",
...@@ -1005,9 +1005,9 @@ int libertas_remove_card(wlan_private *priv) ...@@ -1005,9 +1005,9 @@ int libertas_remove_card(wlan_private *priv)
cancel_delayed_work(&priv->assoc_work); cancel_delayed_work(&priv->assoc_work);
destroy_workqueue(priv->assoc_thread); destroy_workqueue(priv->assoc_thread);
if (adapter->psmode == wlan802_11powermodemax_psp) { if (adapter->psmode == WLAN802_11POWERMODEMAX_PSP) {
adapter->psmode = wlan802_11powermodecam; adapter->psmode = WLAN802_11POWERMODECAM;
libertas_ps_wakeup(priv, cmd_option_waitforrsp); libertas_ps_wakeup(priv, CMD_OPTION_WAITFORRSP);
} }
memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN); memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN);
......
...@@ -255,7 +255,7 @@ static void wlan_scan_create_channel_list(wlan_private * priv, ...@@ -255,7 +255,7 @@ static void wlan_scan_create_channel_list(wlan_private * priv,
for (rgnidx = 0; rgnidx < ARRAY_SIZE(adapter->region_channel); rgnidx++) { for (rgnidx = 0; rgnidx < ARRAY_SIZE(adapter->region_channel); rgnidx++) {
if (priv->adapter->enable11d && if (priv->adapter->enable11d &&
adapter->connect_status != libertas_connected) { adapter->connect_status != LIBERTAS_CONNECTED) {
/* Scan all the supported chan for the first scan */ /* Scan all the supported chan for the first scan */
if (!adapter->universal_channel[rgnidx].valid) if (!adapter->universal_channel[rgnidx].valid)
continue; continue;
...@@ -287,11 +287,11 @@ static void wlan_scan_create_channel_list(wlan_private * priv, ...@@ -287,11 +287,11 @@ static void wlan_scan_create_channel_list(wlan_private * priv,
case BAND_G: case BAND_G:
default: default:
scanchanlist[chanidx].radiotype = scanchanlist[chanidx].radiotype =
cmd_scan_radio_type_bg; CMD_SCAN_RADIO_TYPE_BG;
break; break;
} }
if (scantype == cmd_scan_type_passive) { if (scantype == CMD_SCAN_TYPE_PASSIVE) {
scanchanlist[chanidx].maxscantime = scanchanlist[chanidx].maxscantime =
cpu_to_le16(MRVDRV_PASSIVE_SCAN_CHAN_TIME); cpu_to_le16(MRVDRV_PASSIVE_SCAN_CHAN_TIME);
scanchanlist[chanidx].chanscanmode.passivescan = scanchanlist[chanidx].chanscanmode.passivescan =
...@@ -486,7 +486,7 @@ wlan_scan_setup_scan_config(wlan_private * priv, ...@@ -486,7 +486,7 @@ wlan_scan_setup_scan_config(wlan_private * priv,
scantype = puserscanin->chanlist[chanidx].scantype; scantype = puserscanin->chanlist[chanidx].scantype;
if (scantype == cmd_scan_type_passive) { if (scantype == CMD_SCAN_TYPE_PASSIVE) {
(pscanchanlist + (pscanchanlist +
chanidx)->chanscanmode.passivescan = 1; chanidx)->chanscanmode.passivescan = 1;
} else { } else {
...@@ -498,7 +498,7 @@ wlan_scan_setup_scan_config(wlan_private * priv, ...@@ -498,7 +498,7 @@ wlan_scan_setup_scan_config(wlan_private * priv,
scandur = scandur =
puserscanin->chanlist[chanidx].scantime; puserscanin->chanlist[chanidx].scantime;
} else { } else {
if (scantype == cmd_scan_type_passive) { if (scantype == CMD_SCAN_TYPE_PASSIVE) {
scandur = MRVDRV_PASSIVE_SCAN_CHAN_TIME; scandur = MRVDRV_PASSIVE_SCAN_CHAN_TIME;
} else { } else {
scandur = MRVDRV_ACTIVE_SCAN_CHAN_TIME; scandur = MRVDRV_ACTIVE_SCAN_CHAN_TIME;
...@@ -668,7 +668,7 @@ static int wlan_scan_channel_list(wlan_private * priv, ...@@ -668,7 +668,7 @@ static int wlan_scan_channel_list(wlan_private * priv,
} }
/* Send the scan command to the firmware with the specified cfg */ /* Send the scan command to the firmware with the specified cfg */
ret = libertas_prepare_and_send_command(priv, cmd_802_11_scan, 0, ret = libertas_prepare_and_send_command(priv, CMD_802_11_SCAN, 0,
0, 0, pscancfgout); 0, 0, pscancfgout);
if (scanned >= 2 && !full_scan) { if (scanned >= 2 && !full_scan) {
ret = 0; ret = 0;
...@@ -816,7 +816,7 @@ int wlan_scan_networks(wlan_private * priv, ...@@ -816,7 +816,7 @@ int wlan_scan_networks(wlan_private * priv,
mutex_unlock(&adapter->lock); mutex_unlock(&adapter->lock);
#endif #endif
if (priv->adapter->connect_status == libertas_connected) { if (priv->adapter->connect_status == LIBERTAS_CONNECTED) {
netif_carrier_on(priv->dev); netif_carrier_on(priv->dev);
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
netif_carrier_on(priv->mesh_dev); netif_carrier_on(priv->mesh_dev);
...@@ -1603,8 +1603,8 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, ...@@ -1603,8 +1603,8 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
/* Update RSSI if current BSS is a locally created ad-hoc BSS */ /* Update RSSI if current BSS is a locally created ad-hoc BSS */
if ((adapter->mode == IW_MODE_ADHOC) && adapter->adhoccreate) { if ((adapter->mode == IW_MODE_ADHOC) && adapter->adhoccreate) {
libertas_prepare_and_send_command(priv, cmd_802_11_rssi, 0, libertas_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
} }
mutex_lock(&adapter->lock); mutex_lock(&adapter->lock);
...@@ -1680,7 +1680,7 @@ int libertas_cmd_80211_scan(wlan_private * priv, ...@@ -1680,7 +1680,7 @@ int libertas_cmd_80211_scan(wlan_private * priv,
memcpy(pscan->bssid, pscancfg->bssid, ETH_ALEN); memcpy(pscan->bssid, pscancfg->bssid, ETH_ALEN);
memcpy(pscan->tlvbuffer, pscancfg->tlvbuffer, pscancfg->tlvbufferlen); memcpy(pscan->tlvbuffer, pscancfg->tlvbuffer, pscancfg->tlvbufferlen);
cmd->command = cpu_to_le16(cmd_802_11_scan); cmd->command = cpu_to_le16(CMD_802_11_SCAN);
/* size is equal to the sizeof(fixed portions) + the TLV len + header */ /* size is equal to the sizeof(fixed portions) + the TLV len + header */
cmd->size = cpu_to_le16(sizeof(pscan->bsstype) + ETH_ALEN cmd->size = cpu_to_le16(sizeof(pscan->bsstype) + ETH_ALEN
......
...@@ -283,7 +283,7 @@ void libertas_send_tx_feedback(wlan_private * priv) ...@@ -283,7 +283,7 @@ void libertas_send_tx_feedback(wlan_private * priv)
libertas_upload_rx_packet(priv, adapter->currenttxskb); libertas_upload_rx_packet(priv, adapter->currenttxskb);
adapter->currenttxskb = NULL; adapter->currenttxskb = NULL;
priv->adapter->TxLockFlag = 0; priv->adapter->TxLockFlag = 0;
if (priv->adapter->connect_status == libertas_connected) { if (priv->adapter->connect_status == LIBERTAS_CONNECTED) {
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
} }
......
...@@ -177,9 +177,9 @@ int wlan_radio_ioctl(wlan_private * priv, u8 option) ...@@ -177,9 +177,9 @@ int wlan_radio_ioctl(wlan_private * priv, u8 option)
adapter->radioon = option; adapter->radioon = option;
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_radio_control, CMD_802_11_RADIO_CONTROL,
cmd_act_set, CMD_ACT_SET,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
} }
lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
...@@ -221,7 +221,7 @@ static int get_active_data_rates(wlan_adapter * adapter, ...@@ -221,7 +221,7 @@ static int get_active_data_rates(wlan_adapter * adapter,
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
if (adapter->connect_status != libertas_connected) { if (adapter->connect_status != LIBERTAS_CONNECTED) {
if (adapter->mode == IW_MODE_INFRA) { if (adapter->mode == IW_MODE_INFRA) {
lbs_deb_wext("infra\n"); lbs_deb_wext("infra\n");
k = copyrates(rates, k, libertas_supported_rates, k = copyrates(rates, k, libertas_supported_rates,
...@@ -305,7 +305,7 @@ static int wlan_get_wap(struct net_device *dev, struct iw_request_info *info, ...@@ -305,7 +305,7 @@ static int wlan_get_wap(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
if (adapter->connect_status == libertas_connected) { if (adapter->connect_status == LIBERTAS_CONNECTED) {
memcpy(awrq->sa_data, adapter->curbssparams.bssid, ETH_ALEN); memcpy(awrq->sa_data, adapter->curbssparams.bssid, ETH_ALEN);
} else { } else {
memset(awrq->sa_data, 0, ETH_ALEN); memset(awrq->sa_data, 0, ETH_ALEN);
...@@ -382,7 +382,7 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, ...@@ -382,7 +382,7 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info,
/* Use nickname to indicate that mesh is on */ /* Use nickname to indicate that mesh is on */
if (adapter->connect_status == libertas_connected) { if (adapter->connect_status == LIBERTAS_CONNECTED) {
strncpy(extra, "Mesh", 12); strncpy(extra, "Mesh", 12);
extra[12] = '\0'; extra[12] = '\0';
dwrq->length = strlen(extra) + 1; dwrq->length = strlen(extra) + 1;
...@@ -414,8 +414,8 @@ static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info, ...@@ -414,8 +414,8 @@ static int wlan_set_rts(struct net_device *dev, struct iw_request_info *info,
adapter->rtsthsd = rthr; adapter->rtsthsd = rthr;
} }
ret = libertas_prepare_and_send_command(priv, cmd_802_11_snmp_mib, ret = libertas_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB,
cmd_act_set, cmd_option_waitforrsp, CMD_ACT_SET, CMD_OPTION_WAITFORRSP,
OID_802_11_RTS_THRESHOLD, &rthr); OID_802_11_RTS_THRESHOLD, &rthr);
lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
...@@ -432,8 +432,8 @@ static int wlan_get_rts(struct net_device *dev, struct iw_request_info *info, ...@@ -432,8 +432,8 @@ static int wlan_get_rts(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
adapter->rtsthsd = 0; adapter->rtsthsd = 0;
ret = libertas_prepare_and_send_command(priv, cmd_802_11_snmp_mib, ret = libertas_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB,
cmd_act_get, cmd_option_waitforrsp, CMD_ACT_GET, CMD_OPTION_WAITFORRSP,
OID_802_11_RTS_THRESHOLD, NULL); OID_802_11_RTS_THRESHOLD, NULL);
if (ret) if (ret)
goto out; goto out;
...@@ -467,8 +467,8 @@ static int wlan_set_frag(struct net_device *dev, struct iw_request_info *info, ...@@ -467,8 +467,8 @@ static int wlan_set_frag(struct net_device *dev, struct iw_request_info *info,
adapter->fragthsd = fthr; adapter->fragthsd = fthr;
} }
ret = libertas_prepare_and_send_command(priv, cmd_802_11_snmp_mib, ret = libertas_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB,
cmd_act_set, cmd_option_waitforrsp, CMD_ACT_SET, CMD_OPTION_WAITFORRSP,
OID_802_11_FRAGMENTATION_THRESHOLD, &fthr); OID_802_11_FRAGMENTATION_THRESHOLD, &fthr);
lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
...@@ -486,8 +486,8 @@ static int wlan_get_frag(struct net_device *dev, struct iw_request_info *info, ...@@ -486,8 +486,8 @@ static int wlan_get_frag(struct net_device *dev, struct iw_request_info *info,
adapter->fragthsd = 0; adapter->fragthsd = 0;
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_snmp_mib, CMD_802_11_SNMP_MIB,
cmd_act_get, cmd_option_waitforrsp, CMD_ACT_GET, CMD_OPTION_WAITFORRSP,
OID_802_11_FRAGMENTATION_THRESHOLD, NULL); OID_802_11_FRAGMENTATION_THRESHOLD, NULL);
if (ret) if (ret)
goto out; goto out;
...@@ -539,9 +539,9 @@ static int wlan_get_txpow(struct net_device *dev, ...@@ -539,9 +539,9 @@ static int wlan_get_txpow(struct net_device *dev,
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_rf_tx_power, CMD_802_11_RF_TX_POWER,
cmd_act_tx_power_opt_get, CMD_ACT_TX_POWER_OPT_GET,
cmd_option_waitforrsp, 0, NULL); CMD_OPTION_WAITFORRSP, 0, NULL);
if (ret) if (ret)
goto out; goto out;
...@@ -581,9 +581,9 @@ static int wlan_set_retry(struct net_device *dev, struct iw_request_info *info, ...@@ -581,9 +581,9 @@ static int wlan_set_retry(struct net_device *dev, struct iw_request_info *info,
/* Adding 1 to convert retry count to try count */ /* Adding 1 to convert retry count to try count */
adapter->txretrycount = vwrq->value + 1; adapter->txretrycount = vwrq->value + 1;
ret = libertas_prepare_and_send_command(priv, cmd_802_11_snmp_mib, ret = libertas_prepare_and_send_command(priv, CMD_802_11_SNMP_MIB,
cmd_act_set, CMD_ACT_SET,
cmd_option_waitforrsp, CMD_OPTION_WAITFORRSP,
OID_802_11_TX_RETRYCOUNT, NULL); OID_802_11_TX_RETRYCOUNT, NULL);
if (ret) if (ret)
...@@ -608,8 +608,8 @@ static int wlan_get_retry(struct net_device *dev, struct iw_request_info *info, ...@@ -608,8 +608,8 @@ static int wlan_get_retry(struct net_device *dev, struct iw_request_info *info,
adapter->txretrycount = 0; adapter->txretrycount = 0;
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_snmp_mib, CMD_802_11_SNMP_MIB,
cmd_act_get, cmd_option_waitforrsp, CMD_ACT_GET, CMD_OPTION_WAITFORRSP,
OID_802_11_TX_RETRYCOUNT, NULL); OID_802_11_TX_RETRYCOUNT, NULL);
if (ret) if (ret)
goto out; goto out;
...@@ -698,7 +698,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info, ...@@ -698,7 +698,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info,
range->num_frequency = 0; range->num_frequency = 0;
if (priv->adapter->enable11d && if (priv->adapter->enable11d &&
adapter->connect_status == libertas_connected) { adapter->connect_status == LIBERTAS_CONNECTED) {
u8 chan_no; u8 chan_no;
u8 band; u8 band;
...@@ -858,9 +858,9 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info, ...@@ -858,9 +858,9 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info,
*/ */
if (vwrq->disabled) { if (vwrq->disabled) {
adapter->psmode = wlan802_11powermodecam; adapter->psmode = WLAN802_11POWERMODECAM;
if (adapter->psstate != PS_STATE_FULL_POWER) { if (adapter->psstate != PS_STATE_FULL_POWER) {
libertas_ps_wakeup(priv, cmd_option_waitforrsp); libertas_ps_wakeup(priv, CMD_OPTION_WAITFORRSP);
} }
return 0; return 0;
...@@ -875,14 +875,14 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info, ...@@ -875,14 +875,14 @@ static int wlan_set_power(struct net_device *dev, struct iw_request_info *info,
return -EINVAL; return -EINVAL;
} }
if (adapter->psmode != wlan802_11powermodecam) { if (adapter->psmode != WLAN802_11POWERMODECAM) {
return 0; return 0;
} }
adapter->psmode = wlan802_11powermodemax_psp; adapter->psmode = WLAN802_11POWERMODEMAX_PSP;
if (adapter->connect_status == libertas_connected) { if (adapter->connect_status == LIBERTAS_CONNECTED) {
libertas_ps_sleep(priv, cmd_option_waitforrsp); libertas_ps_sleep(priv, CMD_OPTION_WAITFORRSP);
} }
lbs_deb_leave(LBS_DEB_WEXT); lbs_deb_leave(LBS_DEB_WEXT);
...@@ -900,8 +900,8 @@ static int wlan_get_power(struct net_device *dev, struct iw_request_info *info, ...@@ -900,8 +900,8 @@ static int wlan_get_power(struct net_device *dev, struct iw_request_info *info,
mode = adapter->psmode; mode = adapter->psmode;
if ((vwrq->disabled = (mode == wlan802_11powermodecam)) if ((vwrq->disabled = (mode == WLAN802_11POWERMODECAM))
|| adapter->connect_status == libertas_disconnected) || adapter->connect_status == LIBERTAS_DISCONNECTED)
{ {
goto out; goto out;
} }
...@@ -937,7 +937,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) ...@@ -937,7 +937,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
priv->wstats.status = adapter->mode; priv->wstats.status = adapter->mode;
/* If we're not associated, all quality values are meaningless */ /* If we're not associated, all quality values are meaningless */
if (adapter->connect_status != libertas_connected) if (adapter->connect_status != LIBERTAS_CONNECTED)
goto out; goto out;
/* Quality by RSSI */ /* Quality by RSSI */
...@@ -1000,9 +1000,9 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev) ...@@ -1000,9 +1000,9 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
stats_valid = 1; stats_valid = 1;
/* update stats asynchronously for future calls */ /* update stats asynchronously for future calls */
libertas_prepare_and_send_command(priv, cmd_802_11_rssi, 0, libertas_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
0, 0, NULL); 0, 0, NULL);
libertas_prepare_and_send_command(priv, cmd_802_11_get_log, 0, libertas_prepare_and_send_command(priv, CMD_802_11_GET_LOG, 0,
0, 0, NULL); 0, 0, NULL);
out: out:
if (!stats_valid) { if (!stats_valid) {
...@@ -1128,7 +1128,7 @@ static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info, ...@@ -1128,7 +1128,7 @@ static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info,
lbs_deb_wext("vwrq->value %d\n", vwrq->value); lbs_deb_wext("vwrq->value %d\n", vwrq->value);
if (vwrq->value == -1) { if (vwrq->value == -1) {
action = cmd_act_set_tx_auto; // Auto action = CMD_ACT_SET_tx_auto; // Auto
adapter->is_datarate_auto = 1; adapter->is_datarate_auto = 1;
adapter->datarate = 0; adapter->datarate = 0;
} else { } else {
...@@ -1155,12 +1155,12 @@ static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info, ...@@ -1155,12 +1155,12 @@ static int wlan_set_rate(struct net_device *dev, struct iw_request_info *info,
} }
adapter->datarate = data_rate; adapter->datarate = data_rate;
action = cmd_act_set_tx_fix_rate; action = CMD_ACT_SET_tx_fix_rate;
adapter->is_datarate_auto = 0; adapter->is_datarate_auto = 0;
} }
ret = libertas_prepare_and_send_command(priv, cmd_802_11_data_rate, ret = libertas_prepare_and_send_command(priv, CMD_802_11_DATA_RATE,
action, cmd_option_waitforrsp, 0, NULL); action, CMD_OPTION_WAITFORRSP, 0, NULL);
lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
return ret; return ret;
...@@ -1976,7 +1976,7 @@ static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info, ...@@ -1976,7 +1976,7 @@ static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info,
return 0; return 0;
} }
adapter->preamble = cmd_type_auto_preamble; adapter->preamble = CMD_TYPE_AUTO_PREAMBLE;
wlan_radio_ioctl(priv, RADIO_ON); wlan_radio_ioctl(priv, RADIO_ON);
...@@ -1993,9 +1993,9 @@ static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info, ...@@ -1993,9 +1993,9 @@ static int wlan_set_txpow(struct net_device *dev, struct iw_request_info *info,
lbs_deb_wext("txpower set %d dbm\n", dbm); lbs_deb_wext("txpower set %d dbm\n", dbm);
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_802_11_rf_tx_power, CMD_802_11_RF_TX_POWER,
cmd_act_tx_power_opt_set_low, CMD_ACT_TX_POWER_OPT_SET_LOW,
cmd_option_waitforrsp, 0, (void *)&dbm); CMD_OPTION_WAITFORRSP, 0, (void *)&dbm);
lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
return ret; return ret;
...@@ -2017,7 +2017,7 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, ...@@ -2017,7 +2017,7 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info,
/* /*
* Get the current SSID * Get the current SSID
*/ */
if (adapter->connect_status == libertas_connected) { if (adapter->connect_status == LIBERTAS_CONNECTED) {
memcpy(extra, adapter->curbssparams.ssid, memcpy(extra, adapter->curbssparams.ssid,
adapter->curbssparams.ssid_len); adapter->curbssparams.ssid_len);
extra[adapter->curbssparams.ssid_len] = '\0'; extra[adapter->curbssparams.ssid_len] = '\0';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册