Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66462
b: refs/heads/master
c: 6b63cd0
h: refs/heads/master
v: v3
  • Loading branch information
Holger Schurig authored and David S. Miller committed Oct 10, 2007
1 parent fb8fc7c commit f45e7cb
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 141 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ece561919326236c7fb791a5e883f0eb76af029e
refs/heads/master: 6b63cd0f420c3c3002024da6c9eff252a3772021
101 changes: 51 additions & 50 deletions trunk/drivers/net/wireless/libertas/cmdresp.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
lbs_deb_enter(LBS_DEB_CMD);

switch (type) {
case CMD_RET_MAC_REG_ACCESS:
case CMD_RET(CMD_MAC_REG_ACCESS):
{
struct cmd_ds_mac_reg_access *reg = &resp->params.macreg;

Expand All @@ -133,7 +133,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
break;
}

case CMD_RET_BBP_REG_ACCESS:
case CMD_RET(CMD_BBP_REG_ACCESS):
{
struct cmd_ds_bbp_reg_access *reg = &resp->params.bbpreg;

Expand All @@ -142,7 +142,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
break;
}

case CMD_RET_RF_REG_ACCESS:
case CMD_RET(CMD_RF_REG_ACCESS):
{
struct cmd_ds_rf_reg_access *reg = &resp->params.rfreg;

Expand Down Expand Up @@ -560,167 +560,168 @@ static inline int handle_cmd_response(u16 respcmd,
wlan_adapter *adapter = priv->adapter;

switch (respcmd) {
case CMD_RET_MAC_REG_ACCESS:
case CMD_RET_BBP_REG_ACCESS:
case CMD_RET_RF_REG_ACCESS:
case CMD_RET(CMD_MAC_REG_ACCESS):
case CMD_RET(CMD_BBP_REG_ACCESS):
case CMD_RET(CMD_RF_REG_ACCESS):
ret = wlan_ret_reg_access(priv, respcmd, resp);
break;

case CMD_RET_HW_SPEC_INFO:
case CMD_RET(CMD_GET_HW_SPEC):
ret = wlan_ret_get_hw_spec(priv, resp);
break;

case CMD_RET_802_11_SCAN:
case CMD_RET(CMD_802_11_SCAN):
ret = libertas_ret_80211_scan(priv, resp);
break;

case CMD_RET_802_11_GET_LOG:
case CMD_RET(CMD_802_11_GET_LOG):
ret = wlan_ret_get_log(priv, resp);
break;

case CMD_RET_802_11_ASSOCIATE:
case CMD_RET_802_11_REASSOCIATE:
case CMD_RET(CMD_802_11_ASSOCIATE):
case CMD_RET(CMD_802_11_REASSOCIATE):
ret = libertas_ret_80211_associate(priv, resp);
break;

case CMD_RET_802_11_DISASSOCIATE:
case CMD_RET_802_11_DEAUTHENTICATE:
case CMD_RET(CMD_802_11_DISASSOCIATE):
case CMD_RET(CMD_802_11_DEAUTHENTICATE):
ret = libertas_ret_80211_disassociate(priv, resp);
break;

case CMD_RET_802_11_AD_HOC_START:
case CMD_RET_802_11_AD_HOC_JOIN:
case CMD_RET(CMD_802_11_AD_HOC_START):
case CMD_RET(CMD_802_11_AD_HOC_JOIN):
ret = libertas_ret_80211_ad_hoc_start(priv, resp);
break;

case CMD_RET_802_11_STAT:
case CMD_RET(CMD_802_11_GET_STAT):
ret = wlan_ret_802_11_stat(priv, resp);
break;

case CMD_RET_802_11_SNMP_MIB:
case CMD_RET(CMD_802_11_SNMP_MIB):
ret = wlan_ret_802_11_snmp_mib(priv, resp);
break;

case CMD_RET_802_11_RF_TX_POWER:
case CMD_RET(CMD_802_11_RF_TX_POWER):
ret = wlan_ret_802_11_rf_tx_power(priv, resp);
break;

case CMD_RET_802_11_SET_AFC:
case CMD_RET_802_11_GET_AFC:
case CMD_RET(CMD_802_11_SET_AFC):
case CMD_RET(CMD_802_11_GET_AFC):
spin_lock_irqsave(&adapter->driver_lock, flags);
memmove(adapter->cur_cmd->pdata_buf, &resp->params.afc,
sizeof(struct cmd_ds_802_11_afc));
spin_unlock_irqrestore(&adapter->driver_lock, flags);

break;
case CMD_RET_802_11_RF_ANTENNA:
case CMD_RET(CMD_802_11_RF_ANTENNA):
ret = wlan_ret_802_11_rf_antenna(priv, resp);
break;

case CMD_RET_MAC_MULTICAST_ADR:
case CMD_RET_MAC_CONTROL:
case CMD_RET_802_11_SET_WEP:
case CMD_RET_802_11_RESET:
case CMD_RET_802_11_AUTHENTICATE:
case CMD_RET_802_11_RADIO_CONTROL:
case CMD_RET_802_11_BEACON_STOP:
case CMD_RET(CMD_MAC_MULTICAST_ADR):
case CMD_RET(CMD_MAC_CONTROL):
case CMD_RET(CMD_802_11_SET_WEP):
case CMD_RET(CMD_802_11_RESET):
case CMD_RET(CMD_802_11_AUTHENTICATE):
case CMD_RET(CMD_802_11_RADIO_CONTROL):
case CMD_RET(CMD_802_11_BEACON_STOP):
break;

case CMD_RET_802_11_ENABLE_RSN:
case CMD_RET(CMD_802_11_ENABLE_RSN):
ret = libertas_ret_802_11_enable_rsn(priv, resp);
break;

case CMD_RET_802_11_DATA_RATE:
case CMD_RET(CMD_802_11_DATA_RATE):
ret = wlan_ret_802_11_data_rate(priv, resp);
break;
case CMD_RET_802_11_RATE_ADAPT_RATESET:
case CMD_RET(CMD_802_11_RATE_ADAPT_RATESET):
ret = wlan_ret_802_11_rate_adapt_rateset(priv, resp);
break;
case CMD_RET_802_11_RF_CHANNEL:
case CMD_RET(CMD_802_11_RF_CHANNEL):
ret = wlan_ret_802_11_rf_channel(priv, resp);
break;

case CMD_RET_802_11_RSSI:
case CMD_RET(CMD_802_11_RSSI):
ret = wlan_ret_802_11_rssi(priv, resp);
break;

case CMD_RET_802_11_MAC_ADDRESS:
case CMD_RET(CMD_802_11_MAC_ADDRESS):
ret = wlan_ret_802_11_mac_address(priv, resp);
break;

case CMD_RET_802_11_AD_HOC_STOP:
case CMD_RET(CMD_802_11_AD_HOC_STOP):
ret = libertas_ret_80211_ad_hoc_stop(priv, resp);
break;

case CMD_RET_802_11_KEY_MATERIAL:
case CMD_RET(CMD_802_11_KEY_MATERIAL):
lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n");
ret = wlan_ret_802_11_key_material(priv, resp);
break;

case CMD_RET_802_11_EEPROM_ACCESS:
case CMD_RET(CMD_802_11_EEPROM_ACCESS):
ret = wlan_ret_802_11_eeprom_access(priv, resp);
break;

case CMD_RET_802_11D_DOMAIN_INFO:
case CMD_RET(CMD_802_11D_DOMAIN_INFO):
ret = libertas_ret_802_11d_domain_info(priv, resp);
break;

case CMD_RET_802_11_SLEEP_PARAMS:
case CMD_RET(CMD_802_11_SLEEP_PARAMS):
ret = wlan_ret_802_11_sleep_params(priv, resp);
break;
case CMD_RET_802_11_INACTIVITY_TIMEOUT:
case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT):
spin_lock_irqsave(&adapter->driver_lock, flags);
*((u16 *) adapter->cur_cmd->pdata_buf) =
le16_to_cpu(resp->params.inactivity_timeout.timeout);
spin_unlock_irqrestore(&adapter->driver_lock, flags);
break;

case CMD_RET_802_11_TPC_CFG:
case CMD_RET(CMD_802_11_TPC_CFG):
spin_lock_irqsave(&adapter->driver_lock, flags);
memmove(adapter->cur_cmd->pdata_buf, &resp->params.tpccfg,
sizeof(struct cmd_ds_802_11_tpc_cfg));
spin_unlock_irqrestore(&adapter->driver_lock, flags);
break;
case CMD_RET_802_11_LED_GPIO_CTRL:
case CMD_RET(CMD_802_11_LED_GPIO_CTRL):
spin_lock_irqsave(&adapter->driver_lock, flags);
memmove(adapter->cur_cmd->pdata_buf, &resp->params.ledgpio,
sizeof(struct cmd_ds_802_11_led_ctrl));
spin_unlock_irqrestore(&adapter->driver_lock, flags);
break;
case CMD_RET_802_11_PWR_CFG:
case CMD_RET(CMD_802_11_PWR_CFG):
spin_lock_irqsave(&adapter->driver_lock, flags);
memmove(adapter->cur_cmd->pdata_buf, &resp->params.pwrcfg,
sizeof(struct cmd_ds_802_11_pwr_cfg));
spin_unlock_irqrestore(&adapter->driver_lock, flags);

break;

case CMD_RET_GET_TSF:
case CMD_RET(CMD_GET_TSF):
spin_lock_irqsave(&adapter->driver_lock, flags);
memcpy(priv->adapter->cur_cmd->pdata_buf,
&resp->params.gettsf.tsfvalue, sizeof(u64));
spin_unlock_irqrestore(&adapter->driver_lock, flags);
break;
case CMD_RET_BT_ACCESS:
case CMD_RET(CMD_BT_ACCESS):
spin_lock_irqsave(&adapter->driver_lock, flags);
if (adapter->cur_cmd->pdata_buf)
memcpy(adapter->cur_cmd->pdata_buf,
&resp->params.bt.addr1, 2 * ETH_ALEN);
spin_unlock_irqrestore(&adapter->driver_lock, flags);
break;
case CMD_RET_FWT_ACCESS:
case CMD_RET(CMD_FWT_ACCESS):
spin_lock_irqsave(&adapter->driver_lock, flags);
if (adapter->cur_cmd->pdata_buf)
memcpy(adapter->cur_cmd->pdata_buf, &resp->params.fwt,
sizeof(resp->params.fwt));
spin_unlock_irqrestore(&adapter->driver_lock, flags);
break;
case CMD_RET_MESH_ACCESS:
case CMD_RET(CMD_MESH_ACCESS):
if (adapter->cur_cmd->pdata_buf)
memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh,
sizeof(resp->params.mesh));
break;
case CMD_RTE_802_11_TX_RATE_QUERY:
case CMD_RET(CMD_802_11_TX_RATE_QUERY):
priv->adapter->txrate = resp->params.txrate.txrate;
break;
default:
Expand Down Expand Up @@ -782,7 +783,7 @@ int libertas_process_rx_command(wlan_private * priv)
/* Store the response code to cur_cmd_retcode. */
adapter->cur_cmd_retcode = result;;

if (respcmd == CMD_RET_802_11_PS_MODE) {
if (respcmd == CMD_RET(CMD_802_11_PS_MODE)) {
struct cmd_ds_802_11_ps_mode *psmode = &resp->params.psmode;
u16 action = le16_to_cpu(psmode->action);

Expand Down Expand Up @@ -852,8 +853,8 @@ int libertas_process_rx_command(wlan_private * priv)
* Handling errors here
*/
switch (respcmd) {
case CMD_RET_HW_SPEC_INFO:
case CMD_RET_802_11_RESET:
case CMD_RET(CMD_GET_HW_SPEC):
case CMD_RET(CMD_802_11_RESET):
lbs_deb_cmd("CMD_RESP: Reset command failed\n");
break;

Expand Down
26 changes: 13 additions & 13 deletions trunk/drivers/net/wireless/libertas/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down Expand Up @@ -511,7 +511,7 @@ static u16 libertas_get_events_bitmap(wlan_private *priv)
return 0;
}

if (pcmdptr->command != CMD_RET_802_11_SUBSCRIBE_EVENT) {
if (pcmdptr->command != CMD_RET(CMD_802_11_SUBSCRIBE_EVENT)) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
return 0;
Expand Down Expand Up @@ -591,7 +591,7 @@ static ssize_t libertas_lowrssi_write(struct file *file,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down Expand Up @@ -644,7 +644,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down Expand Up @@ -743,7 +743,7 @@ static ssize_t libertas_lowsnr_write(struct file *file,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down Expand Up @@ -797,7 +797,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down Expand Up @@ -895,7 +895,7 @@ static ssize_t libertas_failcount_write(struct file *file,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down Expand Up @@ -948,7 +948,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
free_page(addr);
kfree(response_buf);
Expand Down Expand Up @@ -1045,7 +1045,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
free_page(addr);
kfree(response_buf);
Expand Down Expand Up @@ -1098,7 +1098,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down Expand Up @@ -1196,7 +1196,7 @@ static ssize_t libertas_highrssi_write(struct file *file,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
return 0;
Expand Down Expand Up @@ -1248,7 +1248,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down Expand Up @@ -1347,7 +1347,7 @@ static ssize_t libertas_highsnr_write(struct file *file,
return 0;
}

if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) {
if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
lbs_pr_err("command response incorrect!\n");
kfree(response_buf);
free_page(addr);
Expand Down
Loading

0 comments on commit f45e7cb

Please sign in to comment.