aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c101
-rw-r--r--drivers/net/wireless/libertas/debugfs.c26
-rw-r--r--drivers/net/wireless/libertas/host.h87
-rw-r--r--drivers/net/wireless/libertas/join.c2
4 files changed, 76 insertions, 140 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 6166bbc0528e..ae11e1f2739f 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -124,7 +124,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
124 lbs_deb_enter(LBS_DEB_CMD); 124 lbs_deb_enter(LBS_DEB_CMD);
125 125
126 switch (type) { 126 switch (type) {
127 case CMD_RET_MAC_REG_ACCESS: 127 case CMD_RET(CMD_MAC_REG_ACCESS):
128 { 128 {
129 struct cmd_ds_mac_reg_access *reg = &resp->params.macreg; 129 struct cmd_ds_mac_reg_access *reg = &resp->params.macreg;
130 130
@@ -133,7 +133,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
133 break; 133 break;
134 } 134 }
135 135
136 case CMD_RET_BBP_REG_ACCESS: 136 case CMD_RET(CMD_BBP_REG_ACCESS):
137 { 137 {
138 struct cmd_ds_bbp_reg_access *reg = &resp->params.bbpreg; 138 struct cmd_ds_bbp_reg_access *reg = &resp->params.bbpreg;
139 139
@@ -142,7 +142,7 @@ static int wlan_ret_reg_access(wlan_private * priv,
142 break; 142 break;
143 } 143 }
144 144
145 case CMD_RET_RF_REG_ACCESS: 145 case CMD_RET(CMD_RF_REG_ACCESS):
146 { 146 {
147 struct cmd_ds_rf_reg_access *reg = &resp->params.rfreg; 147 struct cmd_ds_rf_reg_access *reg = &resp->params.rfreg;
148 148
@@ -560,134 +560,135 @@ static inline int handle_cmd_response(u16 respcmd,
560 wlan_adapter *adapter = priv->adapter; 560 wlan_adapter *adapter = priv->adapter;
561 561
562 switch (respcmd) { 562 switch (respcmd) {
563 case CMD_RET_MAC_REG_ACCESS: 563 case CMD_RET(CMD_MAC_REG_ACCESS):
564 case CMD_RET_BBP_REG_ACCESS: 564 case CMD_RET(CMD_BBP_REG_ACCESS):
565 case CMD_RET_RF_REG_ACCESS: 565 case CMD_RET(CMD_RF_REG_ACCESS):
566 ret = wlan_ret_reg_access(priv, respcmd, resp); 566 ret = wlan_ret_reg_access(priv, respcmd, resp);
567 break; 567 break;
568 568
569 case CMD_RET_HW_SPEC_INFO: 569 case CMD_RET(CMD_GET_HW_SPEC):
570 ret = wlan_ret_get_hw_spec(priv, resp); 570 ret = wlan_ret_get_hw_spec(priv, resp);
571 break; 571 break;
572 572
573 case CMD_RET_802_11_SCAN: 573 case CMD_RET(CMD_802_11_SCAN):
574 ret = libertas_ret_80211_scan(priv, resp); 574 ret = libertas_ret_80211_scan(priv, resp);
575 break; 575 break;
576 576
577 case CMD_RET_802_11_GET_LOG: 577 case CMD_RET(CMD_802_11_GET_LOG):
578 ret = wlan_ret_get_log(priv, resp); 578 ret = wlan_ret_get_log(priv, resp);
579 break; 579 break;
580 580
581 case CMD_RET_802_11_ASSOCIATE: 581 case CMD_RET_802_11_ASSOCIATE:
582 case CMD_RET_802_11_REASSOCIATE: 582 case CMD_RET(CMD_802_11_ASSOCIATE):
583 case CMD_RET(CMD_802_11_REASSOCIATE):
583 ret = libertas_ret_80211_associate(priv, resp); 584 ret = libertas_ret_80211_associate(priv, resp);
584 break; 585 break;
585 586
586 case CMD_RET_802_11_DISASSOCIATE: 587 case CMD_RET(CMD_802_11_DISASSOCIATE):
587 case CMD_RET_802_11_DEAUTHENTICATE: 588 case CMD_RET(CMD_802_11_DEAUTHENTICATE):
588 ret = libertas_ret_80211_disassociate(priv, resp); 589 ret = libertas_ret_80211_disassociate(priv, resp);
589 break; 590 break;
590 591
591 case CMD_RET_802_11_AD_HOC_START: 592 case CMD_RET(CMD_802_11_AD_HOC_START):
592 case CMD_RET_802_11_AD_HOC_JOIN: 593 case CMD_RET(CMD_802_11_AD_HOC_JOIN):
593 ret = libertas_ret_80211_ad_hoc_start(priv, resp); 594 ret = libertas_ret_80211_ad_hoc_start(priv, resp);
594 break; 595 break;
595 596
596 case CMD_RET_802_11_STAT: 597 case CMD_RET(CMD_802_11_GET_STAT):
597 ret = wlan_ret_802_11_stat(priv, resp); 598 ret = wlan_ret_802_11_stat(priv, resp);
598 break; 599 break;
599 600
600 case CMD_RET_802_11_SNMP_MIB: 601 case CMD_RET(CMD_802_11_SNMP_MIB):
601 ret = wlan_ret_802_11_snmp_mib(priv, resp); 602 ret = wlan_ret_802_11_snmp_mib(priv, resp);
602 break; 603 break;
603 604
604 case CMD_RET_802_11_RF_TX_POWER: 605 case CMD_RET(CMD_802_11_RF_TX_POWER):
605 ret = wlan_ret_802_11_rf_tx_power(priv, resp); 606 ret = wlan_ret_802_11_rf_tx_power(priv, resp);
606 break; 607 break;
607 608
608 case CMD_RET_802_11_SET_AFC: 609 case CMD_RET(CMD_802_11_SET_AFC):
609 case CMD_RET_802_11_GET_AFC: 610 case CMD_RET(CMD_802_11_GET_AFC):
610 spin_lock_irqsave(&adapter->driver_lock, flags); 611 spin_lock_irqsave(&adapter->driver_lock, flags);
611 memmove(adapter->cur_cmd->pdata_buf, &resp->params.afc, 612 memmove(adapter->cur_cmd->pdata_buf, &resp->params.afc,
612 sizeof(struct cmd_ds_802_11_afc)); 613 sizeof(struct cmd_ds_802_11_afc));
613 spin_unlock_irqrestore(&adapter->driver_lock, flags); 614 spin_unlock_irqrestore(&adapter->driver_lock, flags);
614 615
615 break; 616 break;
616 case CMD_RET_802_11_RF_ANTENNA: 617 case CMD_RET(CMD_802_11_RF_ANTENNA):
617 ret = wlan_ret_802_11_rf_antenna(priv, resp); 618 ret = wlan_ret_802_11_rf_antenna(priv, resp);
618 break; 619 break;
619 620
620 case CMD_RET_MAC_MULTICAST_ADR: 621 case CMD_RET(CMD_MAC_MULTICAST_ADR):
621 case CMD_RET_MAC_CONTROL: 622 case CMD_RET(CMD_MAC_CONTROL):
622 case CMD_RET_802_11_SET_WEP: 623 case CMD_RET(CMD_802_11_SET_WEP):
623 case CMD_RET_802_11_RESET: 624 case CMD_RET(CMD_802_11_RESET):
624 case CMD_RET_802_11_AUTHENTICATE: 625 case CMD_RET(CMD_802_11_AUTHENTICATE):
625 case CMD_RET_802_11_RADIO_CONTROL: 626 case CMD_RET(CMD_802_11_RADIO_CONTROL):
626 case CMD_RET_802_11_BEACON_STOP: 627 case CMD_RET(CMD_802_11_BEACON_STOP):
627 break; 628 break;
628 629
629 case CMD_RET_802_11_ENABLE_RSN: 630 case CMD_RET(CMD_802_11_ENABLE_RSN):
630 ret = libertas_ret_802_11_enable_rsn(priv, resp); 631 ret = libertas_ret_802_11_enable_rsn(priv, resp);
631 break; 632 break;
632 633
633 case CMD_RET_802_11_DATA_RATE: 634 case CMD_RET(CMD_802_11_DATA_RATE):
634 ret = wlan_ret_802_11_data_rate(priv, resp); 635 ret = wlan_ret_802_11_data_rate(priv, resp);
635 break; 636 break;
636 case CMD_RET_802_11_RATE_ADAPT_RATESET: 637 case CMD_RET(CMD_802_11_RATE_ADAPT_RATESET):
637 ret = wlan_ret_802_11_rate_adapt_rateset(priv, resp); 638 ret = wlan_ret_802_11_rate_adapt_rateset(priv, resp);
638 break; 639 break;
639 case CMD_RET_802_11_RF_CHANNEL: 640 case CMD_RET(CMD_802_11_RF_CHANNEL):
640 ret = wlan_ret_802_11_rf_channel(priv, resp); 641 ret = wlan_ret_802_11_rf_channel(priv, resp);
641 break; 642 break;
642 643
643 case CMD_RET_802_11_RSSI: 644 case CMD_RET(CMD_802_11_RSSI):
644 ret = wlan_ret_802_11_rssi(priv, resp); 645 ret = wlan_ret_802_11_rssi(priv, resp);
645 break; 646 break;
646 647
647 case CMD_RET_802_11_MAC_ADDRESS: 648 case CMD_RET(CMD_802_11_MAC_ADDRESS):
648 ret = wlan_ret_802_11_mac_address(priv, resp); 649 ret = wlan_ret_802_11_mac_address(priv, resp);
649 break; 650 break;
650 651
651 case CMD_RET_802_11_AD_HOC_STOP: 652 case CMD_RET(CMD_802_11_AD_HOC_STOP):
652 ret = libertas_ret_80211_ad_hoc_stop(priv, resp); 653 ret = libertas_ret_80211_ad_hoc_stop(priv, resp);
653 break; 654 break;
654 655
655 case CMD_RET_802_11_KEY_MATERIAL: 656 case CMD_RET(CMD_802_11_KEY_MATERIAL):
656 lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n"); 657 lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n");
657 ret = wlan_ret_802_11_key_material(priv, resp); 658 ret = wlan_ret_802_11_key_material(priv, resp);
658 break; 659 break;
659 660
660 case CMD_RET_802_11_EEPROM_ACCESS: 661 case CMD_RET(CMD_802_11_EEPROM_ACCESS):
661 ret = wlan_ret_802_11_eeprom_access(priv, resp); 662 ret = wlan_ret_802_11_eeprom_access(priv, resp);
662 break; 663 break;
663 664
664 case CMD_RET_802_11D_DOMAIN_INFO: 665 case CMD_RET(CMD_802_11D_DOMAIN_INFO):
665 ret = libertas_ret_802_11d_domain_info(priv, resp); 666 ret = libertas_ret_802_11d_domain_info(priv, resp);
666 break; 667 break;
667 668
668 case CMD_RET_802_11_SLEEP_PARAMS: 669 case CMD_RET(CMD_802_11_SLEEP_PARAMS):
669 ret = wlan_ret_802_11_sleep_params(priv, resp); 670 ret = wlan_ret_802_11_sleep_params(priv, resp);
670 break; 671 break;
671 case CMD_RET_802_11_INACTIVITY_TIMEOUT: 672 case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT):
672 spin_lock_irqsave(&adapter->driver_lock, flags); 673 spin_lock_irqsave(&adapter->driver_lock, flags);
673 *((u16 *) adapter->cur_cmd->pdata_buf) = 674 *((u16 *) adapter->cur_cmd->pdata_buf) =
674 le16_to_cpu(resp->params.inactivity_timeout.timeout); 675 le16_to_cpu(resp->params.inactivity_timeout.timeout);
675 spin_unlock_irqrestore(&adapter->driver_lock, flags); 676 spin_unlock_irqrestore(&adapter->driver_lock, flags);
676 break; 677 break;
677 678
678 case CMD_RET_802_11_TPC_CFG: 679 case CMD_RET(CMD_802_11_TPC_CFG):
679 spin_lock_irqsave(&adapter->driver_lock, flags); 680 spin_lock_irqsave(&adapter->driver_lock, flags);
680 memmove(adapter->cur_cmd->pdata_buf, &resp->params.tpccfg, 681 memmove(adapter->cur_cmd->pdata_buf, &resp->params.tpccfg,
681 sizeof(struct cmd_ds_802_11_tpc_cfg)); 682 sizeof(struct cmd_ds_802_11_tpc_cfg));
682 spin_unlock_irqrestore(&adapter->driver_lock, flags); 683 spin_unlock_irqrestore(&adapter->driver_lock, flags);
683 break; 684 break;
684 case CMD_RET_802_11_LED_GPIO_CTRL: 685 case CMD_RET(CMD_802_11_LED_GPIO_CTRL):
685 spin_lock_irqsave(&adapter->driver_lock, flags); 686 spin_lock_irqsave(&adapter->driver_lock, flags);
686 memmove(adapter->cur_cmd->pdata_buf, &resp->params.ledgpio, 687 memmove(adapter->cur_cmd->pdata_buf, &resp->params.ledgpio,
687 sizeof(struct cmd_ds_802_11_led_ctrl)); 688 sizeof(struct cmd_ds_802_11_led_ctrl));
688 spin_unlock_irqrestore(&adapter->driver_lock, flags); 689 spin_unlock_irqrestore(&adapter->driver_lock, flags);
689 break; 690 break;
690 case CMD_RET_802_11_PWR_CFG: 691 case CMD_RET(CMD_802_11_PWR_CFG):
691 spin_lock_irqsave(&adapter->driver_lock, flags); 692 spin_lock_irqsave(&adapter->driver_lock, flags);
692 memmove(adapter->cur_cmd->pdata_buf, &resp->params.pwrcfg, 693 memmove(adapter->cur_cmd->pdata_buf, &resp->params.pwrcfg,
693 sizeof(struct cmd_ds_802_11_pwr_cfg)); 694 sizeof(struct cmd_ds_802_11_pwr_cfg));
@@ -695,32 +696,32 @@ static inline int handle_cmd_response(u16 respcmd,
695 696
696 break; 697 break;
697 698
698 case CMD_RET_GET_TSF: 699 case CMD_RET(CMD_GET_TSF):
699 spin_lock_irqsave(&adapter->driver_lock, flags); 700 spin_lock_irqsave(&adapter->driver_lock, flags);
700 memcpy(priv->adapter->cur_cmd->pdata_buf, 701 memcpy(priv->adapter->cur_cmd->pdata_buf,
701 &resp->params.gettsf.tsfvalue, sizeof(u64)); 702 &resp->params.gettsf.tsfvalue, sizeof(u64));
702 spin_unlock_irqrestore(&adapter->driver_lock, flags); 703 spin_unlock_irqrestore(&adapter->driver_lock, flags);
703 break; 704 break;
704 case CMD_RET_BT_ACCESS: 705 case CMD_RET(CMD_BT_ACCESS):
705 spin_lock_irqsave(&adapter->driver_lock, flags); 706 spin_lock_irqsave(&adapter->driver_lock, flags);
706 if (adapter->cur_cmd->pdata_buf) 707 if (adapter->cur_cmd->pdata_buf)
707 memcpy(adapter->cur_cmd->pdata_buf, 708 memcpy(adapter->cur_cmd->pdata_buf,
708 &resp->params.bt.addr1, 2 * ETH_ALEN); 709 &resp->params.bt.addr1, 2 * ETH_ALEN);
709 spin_unlock_irqrestore(&adapter->driver_lock, flags); 710 spin_unlock_irqrestore(&adapter->driver_lock, flags);
710 break; 711 break;
711 case CMD_RET_FWT_ACCESS: 712 case CMD_RET(CMD_FWT_ACCESS):
712 spin_lock_irqsave(&adapter->driver_lock, flags); 713 spin_lock_irqsave(&adapter->driver_lock, flags);
713 if (adapter->cur_cmd->pdata_buf) 714 if (adapter->cur_cmd->pdata_buf)
714 memcpy(adapter->cur_cmd->pdata_buf, &resp->params.fwt, 715 memcpy(adapter->cur_cmd->pdata_buf, &resp->params.fwt,
715 sizeof(resp->params.fwt)); 716 sizeof(resp->params.fwt));
716 spin_unlock_irqrestore(&adapter->driver_lock, flags); 717 spin_unlock_irqrestore(&adapter->driver_lock, flags);
717 break; 718 break;
718 case CMD_RET_MESH_ACCESS: 719 case CMD_RET(CMD_MESH_ACCESS):
719 if (adapter->cur_cmd->pdata_buf) 720 if (adapter->cur_cmd->pdata_buf)
720 memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh, 721 memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh,
721 sizeof(resp->params.mesh)); 722 sizeof(resp->params.mesh));
722 break; 723 break;
723 case CMD_RTE_802_11_TX_RATE_QUERY: 724 case CMD_RET(CMD_802_11_TX_RATE_QUERY):
724 priv->adapter->txrate = resp->params.txrate.txrate; 725 priv->adapter->txrate = resp->params.txrate.txrate;
725 break; 726 break;
726 default: 727 default:
@@ -782,7 +783,7 @@ int libertas_process_rx_command(wlan_private * priv)
782 /* Store the response code to cur_cmd_retcode. */ 783 /* Store the response code to cur_cmd_retcode. */
783 adapter->cur_cmd_retcode = result;; 784 adapter->cur_cmd_retcode = result;;
784 785
785 if (respcmd == CMD_RET_802_11_PS_MODE) { 786 if (respcmd == CMD_RET(CMD_802_11_PS_MODE)) {
786 struct cmd_ds_802_11_ps_mode *psmode = &resp->params.psmode; 787 struct cmd_ds_802_11_ps_mode *psmode = &resp->params.psmode;
787 u16 action = le16_to_cpu(psmode->action); 788 u16 action = le16_to_cpu(psmode->action);
788 789
@@ -852,8 +853,8 @@ int libertas_process_rx_command(wlan_private * priv)
852 * Handling errors here 853 * Handling errors here
853 */ 854 */
854 switch (respcmd) { 855 switch (respcmd) {
855 case CMD_RET_HW_SPEC_INFO: 856 case CMD_RET(CMD_GET_HW_SPEC):
856 case CMD_RET_802_11_RESET: 857 case CMD_RET(CMD_802_11_RESET):
857 lbs_deb_cmd("CMD_RESP: Reset command failed\n"); 858 lbs_deb_cmd("CMD_RESP: Reset command failed\n");
858 break; 859 break;
859 860
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 9439005db4e6..4b9533a66511 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -447,7 +447,7 @@ static ssize_t libertas_lowrssi_read(struct file *file, char __user *userbuf,
447 return 0; 447 return 0;
448 } 448 }
449 449
450 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 450 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
451 lbs_pr_err("command response incorrect!\n"); 451 lbs_pr_err("command response incorrect!\n");
452 kfree(response_buf); 452 kfree(response_buf);
453 free_page(addr); 453 free_page(addr);
@@ -511,7 +511,7 @@ static u16 libertas_get_events_bitmap(wlan_private *priv)
511 return 0; 511 return 0;
512 } 512 }
513 513
514 if (pcmdptr->command != CMD_RET_802_11_SUBSCRIBE_EVENT) { 514 if (pcmdptr->command != CMD_RET(CMD_802_11_SUBSCRIBE_EVENT)) {
515 lbs_pr_err("command response incorrect!\n"); 515 lbs_pr_err("command response incorrect!\n");
516 kfree(response_buf); 516 kfree(response_buf);
517 return 0; 517 return 0;
@@ -591,7 +591,7 @@ static ssize_t libertas_lowrssi_write(struct file *file,
591 return 0; 591 return 0;
592 } 592 }
593 593
594 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 594 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
595 lbs_pr_err("command response incorrect!\n"); 595 lbs_pr_err("command response incorrect!\n");
596 kfree(response_buf); 596 kfree(response_buf);
597 free_page(addr); 597 free_page(addr);
@@ -644,7 +644,7 @@ static ssize_t libertas_lowsnr_read(struct file *file, char __user *userbuf,
644 return 0; 644 return 0;
645 } 645 }
646 646
647 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 647 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
648 lbs_pr_err("command response incorrect!\n"); 648 lbs_pr_err("command response incorrect!\n");
649 kfree(response_buf); 649 kfree(response_buf);
650 free_page(addr); 650 free_page(addr);
@@ -743,7 +743,7 @@ static ssize_t libertas_lowsnr_write(struct file *file,
743 return 0; 743 return 0;
744 } 744 }
745 745
746 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 746 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
747 lbs_pr_err("command response incorrect!\n"); 747 lbs_pr_err("command response incorrect!\n");
748 kfree(response_buf); 748 kfree(response_buf);
749 free_page(addr); 749 free_page(addr);
@@ -797,7 +797,7 @@ static ssize_t libertas_failcount_read(struct file *file, char __user *userbuf,
797 return 0; 797 return 0;
798 } 798 }
799 799
800 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 800 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
801 lbs_pr_err("command response incorrect!\n"); 801 lbs_pr_err("command response incorrect!\n");
802 kfree(response_buf); 802 kfree(response_buf);
803 free_page(addr); 803 free_page(addr);
@@ -895,7 +895,7 @@ static ssize_t libertas_failcount_write(struct file *file,
895 return 0; 895 return 0;
896 } 896 }
897 897
898 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 898 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
899 lbs_pr_err("command response incorrect!\n"); 899 lbs_pr_err("command response incorrect!\n");
900 kfree(response_buf); 900 kfree(response_buf);
901 free_page(addr); 901 free_page(addr);
@@ -948,7 +948,7 @@ static ssize_t libertas_bcnmiss_read(struct file *file, char __user *userbuf,
948 return 0; 948 return 0;
949 } 949 }
950 950
951 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 951 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
952 lbs_pr_err("command response incorrect!\n"); 952 lbs_pr_err("command response incorrect!\n");
953 free_page(addr); 953 free_page(addr);
954 kfree(response_buf); 954 kfree(response_buf);
@@ -1045,7 +1045,7 @@ static ssize_t libertas_bcnmiss_write(struct file *file,
1045 return 0; 1045 return 0;
1046 } 1046 }
1047 1047
1048 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 1048 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
1049 lbs_pr_err("command response incorrect!\n"); 1049 lbs_pr_err("command response incorrect!\n");
1050 free_page(addr); 1050 free_page(addr);
1051 kfree(response_buf); 1051 kfree(response_buf);
@@ -1098,7 +1098,7 @@ static ssize_t libertas_highrssi_read(struct file *file, char __user *userbuf,
1098 return 0; 1098 return 0;
1099 } 1099 }
1100 1100
1101 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 1101 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
1102 lbs_pr_err("command response incorrect!\n"); 1102 lbs_pr_err("command response incorrect!\n");
1103 kfree(response_buf); 1103 kfree(response_buf);
1104 free_page(addr); 1104 free_page(addr);
@@ -1196,7 +1196,7 @@ static ssize_t libertas_highrssi_write(struct file *file,
1196 return 0; 1196 return 0;
1197 } 1197 }
1198 1198
1199 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 1199 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
1200 lbs_pr_err("command response incorrect!\n"); 1200 lbs_pr_err("command response incorrect!\n");
1201 kfree(response_buf); 1201 kfree(response_buf);
1202 return 0; 1202 return 0;
@@ -1248,7 +1248,7 @@ static ssize_t libertas_highsnr_read(struct file *file, char __user *userbuf,
1248 return 0; 1248 return 0;
1249 } 1249 }
1250 1250
1251 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 1251 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
1252 lbs_pr_err("command response incorrect!\n"); 1252 lbs_pr_err("command response incorrect!\n");
1253 kfree(response_buf); 1253 kfree(response_buf);
1254 free_page(addr); 1254 free_page(addr);
@@ -1347,7 +1347,7 @@ static ssize_t libertas_highsnr_write(struct file *file,
1347 return 0; 1347 return 0;
1348 } 1348 }
1349 1349
1350 if (pcmdptr->command != cpu_to_le16(CMD_RET_802_11_SUBSCRIBE_EVENT)) { 1350 if (pcmdptr->command != cpu_to_le16(CMD_RET(CMD_802_11_SUBSCRIBE_EVENT))) {
1351 lbs_pr_err("command response incorrect!\n"); 1351 lbs_pr_err("command response incorrect!\n");
1352 kfree(response_buf); 1352 kfree(response_buf);
1353 free_page(addr); 1353 free_page(addr);
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index 12d5dd9af40c..c6b44c831594 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -22,7 +22,17 @@
22 22
23#define CMD_OPTION_WAITFORRSP 0x0002 23#define CMD_OPTION_WAITFORRSP 0x0002
24 24
25/** Host command ID */ 25/** Host command IDs */
26
27/* Return command are almost always the same as the host command, but with
28 * bit 15 set high. There are a few exceptions, though...
29 */
30#define CMD_RET(cmd) (0x8000 | cmd)
31
32/* Return command convention exceptions: */
33#define CMD_RET_802_11_ASSOCIATE 0x8012
34
35/* Command codes */
26#define CMD_CODE_DNLD 0x0002 36#define CMD_CODE_DNLD 0x0002
27#define CMD_GET_HW_SPEC 0x0003 37#define CMD_GET_HW_SPEC 0x0003
28#define CMD_EEPROM_UPDATE 0x0004 38#define CMD_EEPROM_UPDATE 0x0004
@@ -97,13 +107,10 @@
97#define CMD_GET_TSF 0x0080 107#define CMD_GET_TSF 0x0080
98 108
99#define CMD_BT_ACCESS 0x0087 109#define CMD_BT_ACCESS 0x0087
100#define CMD_RET_BT_ACCESS 0x8087
101 110
102#define CMD_FWT_ACCESS 0x0095 111#define CMD_FWT_ACCESS 0x0095
103#define CMD_RET_FWT_ACCESS 0x8095
104 112
105#define CMD_MESH_ACCESS 0x009b 113#define CMD_MESH_ACCESS 0x009b
106#define CMD_RET_MESH_ACCESS 0x809b
107 114
108/* For the IEEE Power Save */ 115/* For the IEEE Power Save */
109#define CMD_SUBCMD_ENTER_PS 0x0030 116#define CMD_SUBCMD_ENTER_PS 0x0030
@@ -112,46 +119,6 @@
112#define CMD_SUBCMD_FULL_POWERDOWN 0x0035 119#define CMD_SUBCMD_FULL_POWERDOWN 0x0035
113#define CMD_SUBCMD_FULL_POWERUP 0x0036 120#define CMD_SUBCMD_FULL_POWERUP 0x0036
114 121
115/* command RET code, MSB is set to 1 */
116#define CMD_RET_HW_SPEC_INFO 0x8003
117#define CMD_RET_EEPROM_UPDATE 0x8004
118#define CMD_RET_802_11_RESET 0x8005
119#define CMD_RET_802_11_SCAN 0x8006
120#define CMD_RET_802_11_GET_LOG 0x800b
121#define CMD_RET_MAC_CONTROL 0x8028
122#define CMD_RET_MAC_MULTICAST_ADR 0x8010
123#define CMD_RET_802_11_AUTHENTICATE 0x8011
124#define CMD_RET_802_11_DEAUTHENTICATE 0x8024
125#define CMD_RET_802_11_ASSOCIATE 0x8012
126#define CMD_RET_802_11_REASSOCIATE 0x8025
127#define CMD_RET_802_11_DISASSOCIATE 0x8026
128#define CMD_RET_802_11_SET_WEP 0x8013
129#define CMD_RET_802_11_STAT 0x8014
130#define CMD_RET_802_3_STAT 0x8015
131#define CMD_RET_802_11_SNMP_MIB 0x8016
132#define CMD_RET_MAC_REG_MAP 0x8017
133#define CMD_RET_BBP_REG_MAP 0x8018
134#define CMD_RET_RF_REG_MAP 0x8023
135#define CMD_RET_MAC_REG_ACCESS 0x8019
136#define CMD_RET_BBP_REG_ACCESS 0x801a
137#define CMD_RET_RF_REG_ACCESS 0x801b
138#define CMD_RET_802_11_RADIO_CONTROL 0x801c
139#define CMD_RET_802_11_RF_CHANNEL 0x801d
140#define CMD_RET_802_11_RSSI 0x801f
141#define CMD_RET_802_11_RF_TX_POWER 0x801e
142#define CMD_RET_802_11_RF_ANTENNA 0x8020
143#define CMD_RET_802_11_PS_MODE 0x8021
144#define CMD_RET_802_11_DATA_RATE 0x8022
145
146#define CMD_RET_802_11_AD_HOC_START 0x802B
147#define CMD_RET_802_11_AD_HOC_JOIN 0x802C
148
149#define CMD_RET_802_11_QUERY_TKIP_REPLY_CNTRS 0x802e
150#define CMD_RET_802_11_ENABLE_RSN 0x802f
151#define CMD_RET_802_11_PAIRWISE_TSC 0x8036
152#define CMD_RET_802_11_GROUP_TSC 0x8037
153#define CMD_RET_802_11_KEY_MATERIAL 0x805e
154
155#define CMD_ENABLE_RSN 0x0001 122#define CMD_ENABLE_RSN 0x0001
156#define CMD_DISABLE_RSN 0x0000 123#define CMD_DISABLE_RSN 0x0000
157 124
@@ -162,38 +129,6 @@
162#define CMD_ACT_SET_AES (CMD_ACT_SET + 2) 129#define CMD_ACT_SET_AES (CMD_ACT_SET + 2)
163#define CMD_ACT_REMOVE_AES (CMD_ACT_SET + 3) 130#define CMD_ACT_REMOVE_AES (CMD_ACT_SET + 3)
164 131
165#define CMD_RET_802_11_SET_AFC 0x803c
166#define CMD_RET_802_11_GET_AFC 0x803d
167
168#define CMD_RET_802_11_AD_HOC_STOP 0x8040
169
170#define CMD_RET_802_11_BEACON_STOP 0x8049
171
172#define CMD_RET_802_11_MAC_ADDRESS 0x804D
173#define CMD_RET_802_11_EEPROM_ACCESS 0x8059
174
175#define CMD_RET_802_11_BAND_CONFIG 0x8058
176
177#define CMD_RET_802_11_SLEEP_PARAMS 0x8066
178
179#define CMD_RET_802_11_INACTIVITY_TIMEOUT 0x8067
180
181#define CMD_RET_802_11D_DOMAIN_INFO (0x8000 | \
182 CMD_802_11D_DOMAIN_INFO)
183
184#define CMD_RET_802_11_TPC_CFG (CMD_802_11_TPC_CFG | 0x8000)
185#define CMD_RET_802_11_PWR_CFG (CMD_802_11_PWR_CFG | 0x8000)
186
187#define CMD_RET_802_11_LED_GPIO_CTRL 0x804e
188
189#define CMD_RET_802_11_SUBSCRIBE_EVENT (CMD_802_11_SUBSCRIBE_EVENT | 0x8000)
190
191#define CMD_RET_802_11_RATE_ADAPT_RATESET (CMD_802_11_RATE_ADAPT_RATESET | 0x8000)
192
193#define CMD_RTE_802_11_TX_RATE_QUERY (CMD_802_11_TX_RATE_QUERY | 0x8000)
194
195#define CMD_RET_GET_TSF 0x8080
196
197/* Define action or option for CMD_802_11_SET_WEP */ 132/* Define action or option for CMD_802_11_SET_WEP */
198#define CMD_ACT_ADD 0x0002 133#define CMD_ACT_ADD 0x0002
199#define CMD_ACT_REMOVE 0x0004 134#define CMD_ACT_REMOVE 0x0004
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index 2b538ab51d40..08034917d4b5 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -814,7 +814,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
814 /* Send a Media Connected event, according to the Spec */ 814 /* Send a Media Connected event, according to the Spec */
815 adapter->connect_status = LIBERTAS_CONNECTED; 815 adapter->connect_status = LIBERTAS_CONNECTED;
816 816
817 if (command == CMD_RET_802_11_AD_HOC_START) { 817 if (command == CMD_RET(CMD_802_11_AD_HOC_START)) {
818 /* Update the created network descriptor with the new BSSID */ 818 /* Update the created network descriptor with the new BSSID */
819 memcpy(bss->bssid, padhocresult->bssid, ETH_ALEN); 819 memcpy(bss->bssid, padhocresult->bssid, ETH_ALEN);
820 } 820 }