diff options
author | Ben Cahill <ben.m.cahill@intel.com> | 2007-11-28 22:10:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:33 -0500 |
commit | 2054a00bb83409345d14a944e25c15e6ea317651 (patch) | |
tree | 451c6fcc7642649070a816bee4260bb0da48fb77 /drivers/net/wireless/iwlwifi/iwl-4965-commands.h | |
parent | 80cc0c382db318de88577eff027d5c4097abef81 (diff) |
iwlwifi: add comments to QOS and ADD_STA commands
Add comments to QOS and ADD_STA commands
Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-commands.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-commands.h | 99 |
1 files changed, 85 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h index 0813e3e3ef67..44addea5062b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h | |||
@@ -650,6 +650,23 @@ struct iwl4965_csa_notification { | |||
650 | * Quality-of-Service (QOS) Commands & Responses: | 650 | * Quality-of-Service (QOS) Commands & Responses: |
651 | * | 651 | * |
652 | *****************************************************************************/ | 652 | *****************************************************************************/ |
653 | |||
654 | /** | ||
655 | * struct iwl_ac_qos -- QOS timing params for REPLY_QOS_PARAM | ||
656 | * One for each of 4 EDCA access categories in struct iwl_qosparam_cmd | ||
657 | * | ||
658 | * @cw_min: Contention window, start value in numbers of slots. | ||
659 | * Should be a power-of-2, minus 1. Device's default is 0x0f. | ||
660 | * @cw_max: Contention window, max value in numbers of slots. | ||
661 | * Should be a power-of-2, minus 1. Device's default is 0x3f. | ||
662 | * @aifsn: Number of slots in Arbitration Interframe Space (before | ||
663 | * performing random backoff timing prior to Tx). Device default 1. | ||
664 | * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0. | ||
665 | * | ||
666 | * Device will automatically increase contention window by (2*CW) + 1 for each | ||
667 | * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW | ||
668 | * value, to cap the CW value. | ||
669 | */ | ||
653 | struct iwl4965_ac_qos { | 670 | struct iwl4965_ac_qos { |
654 | __le16 cw_min; | 671 | __le16 cw_min; |
655 | __le16 cw_max; | 672 | __le16 cw_max; |
@@ -663,14 +680,14 @@ struct iwl4965_ac_qos { | |||
663 | #define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02) | 680 | #define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02) |
664 | #define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10) | 681 | #define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10) |
665 | 682 | ||
666 | /* | 683 | /* Number of Access Categories (AC) (EDCA), queues 0..3 */ |
667 | * TXFIFO Queue number defines | ||
668 | */ | ||
669 | /* number of Access categories (AC) (EDCA), queues 0..3 */ | ||
670 | #define AC_NUM 4 | 684 | #define AC_NUM 4 |
671 | 685 | ||
672 | /* | 686 | /* |
673 | * REPLY_QOS_PARAM = 0x13 (command, has simple generic response) | 687 | * REPLY_QOS_PARAM = 0x13 (command, has simple generic response) |
688 | * | ||
689 | * This command sets up timings for each of the 4 prioritized EDCA Tx FIFOs | ||
690 | * 0: Background, 1: Best Effort, 2: Video, 3: Voice. | ||
674 | */ | 691 | */ |
675 | struct iwl4965_qosparam_cmd { | 692 | struct iwl4965_qosparam_cmd { |
676 | __le32 qos_flags; | 693 | __le32 qos_flags; |
@@ -685,13 +702,11 @@ struct iwl4965_qosparam_cmd { | |||
685 | /* | 702 | /* |
686 | * Multi station support | 703 | * Multi station support |
687 | */ | 704 | */ |
705 | |||
706 | /* Special, dedicated locations within device's station table */ | ||
688 | #define IWL_AP_ID 0 | 707 | #define IWL_AP_ID 0 |
689 | #define IWL_MULTICAST_ID 1 | 708 | #define IWL_MULTICAST_ID 1 |
690 | #define IWL_STA_ID 2 | 709 | #define IWL_STA_ID 2 |
691 | |||
692 | #define IWL3945_BROADCAST_ID 24 | ||
693 | #define IWL3945_STATION_COUNT 25 | ||
694 | |||
695 | #define IWL4965_BROADCAST_ID 31 | 710 | #define IWL4965_BROADCAST_ID 31 |
696 | #define IWL4965_STATION_COUNT 32 | 711 | #define IWL4965_STATION_COUNT 32 |
697 | 712 | ||
@@ -708,6 +723,7 @@ struct iwl4965_qosparam_cmd { | |||
708 | #define STA_FLG_AGG_MPDU_DENSITY_POS (23) | 723 | #define STA_FLG_AGG_MPDU_DENSITY_POS (23) |
709 | #define STA_FLG_AGG_MPDU_DENSITY_MSK __constant_cpu_to_le32(7 << 23) | 724 | #define STA_FLG_AGG_MPDU_DENSITY_MSK __constant_cpu_to_le32(7 << 23) |
710 | 725 | ||
726 | /* Use in mode field. 1: modify existing entry, 0: add new station entry */ | ||
711 | #define STA_CONTROL_MODIFY_MSK 0x01 | 727 | #define STA_CONTROL_MODIFY_MSK 0x01 |
712 | 728 | ||
713 | /* key flags __le16*/ | 729 | /* key flags __le16*/ |
@@ -720,12 +736,15 @@ struct iwl4965_qosparam_cmd { | |||
720 | #define STA_KEY_FLG_KEYID_POS 8 | 736 | #define STA_KEY_FLG_KEYID_POS 8 |
721 | #define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800) | 737 | #define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800) |
722 | 738 | ||
723 | /* modify flags */ | 739 | /* Flags indicate whether to modify vs. don't change various station params */ |
724 | #define STA_MODIFY_KEY_MASK 0x01 | 740 | #define STA_MODIFY_KEY_MASK 0x01 |
725 | #define STA_MODIFY_TID_DISABLE_TX 0x02 | 741 | #define STA_MODIFY_TID_DISABLE_TX 0x02 |
726 | #define STA_MODIFY_TX_RATE_MSK 0x04 | 742 | #define STA_MODIFY_TX_RATE_MSK 0x04 |
727 | #define STA_MODIFY_ADDBA_TID_MSK 0x08 | 743 | #define STA_MODIFY_ADDBA_TID_MSK 0x08 |
728 | #define STA_MODIFY_DELBA_TID_MSK 0x10 | 744 | #define STA_MODIFY_DELBA_TID_MSK 0x10 |
745 | |||
746 | /* Receiver address (actually, Rx station's index into station table), | ||
747 | * combined with Traffic ID (QOS priority), in format used by Tx Scheduler */ | ||
729 | #define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid)) | 748 | #define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid)) |
730 | 749 | ||
731 | struct iwl4965_keyinfo { | 750 | struct iwl4965_keyinfo { |
@@ -737,6 +756,18 @@ struct iwl4965_keyinfo { | |||
737 | u8 key[16]; /* 16-byte unicast decryption key */ | 756 | u8 key[16]; /* 16-byte unicast decryption key */ |
738 | } __attribute__ ((packed)); | 757 | } __attribute__ ((packed)); |
739 | 758 | ||
759 | /** | ||
760 | * struct sta_id_modify | ||
761 | * @addr[ETH_ALEN]: station's MAC address | ||
762 | * @sta_id: index of station in uCode's station table | ||
763 | * @modify_mask: STA_MODIFY_*, 1: modify, 0: don't change | ||
764 | * | ||
765 | * Driver selects unused table index when adding new station, | ||
766 | * or the index to a pre-existing station entry when modifying that station. | ||
767 | * Some indexes have special purposes (IWL_AP_ID, index 0, is for AP). | ||
768 | * | ||
769 | * modify_mask flags select which parameters to modify vs. leave alone. | ||
770 | */ | ||
740 | struct sta_id_modify { | 771 | struct sta_id_modify { |
741 | u8 addr[ETH_ALEN]; | 772 | u8 addr[ETH_ALEN]; |
742 | __le16 reserved1; | 773 | __le16 reserved1; |
@@ -747,30 +778,70 @@ struct sta_id_modify { | |||
747 | 778 | ||
748 | /* | 779 | /* |
749 | * REPLY_ADD_STA = 0x18 (command) | 780 | * REPLY_ADD_STA = 0x18 (command) |
781 | * | ||
782 | * The device contains an internal table of per-station information, | ||
783 | * with info on security keys, aggregation parameters, and Tx rates for | ||
784 | * initial Tx attempt and any retries (4965 uses REPLY_TX_LINK_QUALITY_CMD, | ||
785 | * 3945 uses REPLY_RATE_SCALE to set up rate tables). | ||
786 | * | ||
787 | * REPLY_ADD_STA sets up the table entry for one station, either creating | ||
788 | * a new entry, or modifying a pre-existing one. | ||
789 | * | ||
790 | * NOTE: RXON command (without "associated" bit set) wipes the station table | ||
791 | * clean. Moving into RF_KILL state does this also. Driver must set up | ||
792 | * new station table before transmitting anything on the RXON channel | ||
793 | * (except active scans or active measurements; those commands carry | ||
794 | * their own txpower/rate setup data). | ||
795 | * | ||
796 | * When getting started on a new channel, driver must set up the | ||
797 | * IWL_BROADCAST_ID entry (last entry in the table). For a client | ||
798 | * station in a BSS, once an AP is selected, driver sets up the AP STA | ||
799 | * in the IWL_AP_ID entry (1st entry in the table). BROADCAST and AP | ||
800 | * are all that are needed for a BSS client station. If the device is | ||
801 | * used as AP, or in an IBSS network, driver must set up station table | ||
802 | * entries for all STAs in network, starting with index IWL_STA_ID. | ||
750 | */ | 803 | */ |
751 | struct iwl4965_addsta_cmd { | 804 | struct iwl4965_addsta_cmd { |
752 | u8 mode; | 805 | u8 mode; /* 1: modify existing, 0: add new station */ |
753 | u8 reserved[3]; | 806 | u8 reserved[3]; |
754 | struct sta_id_modify sta; | 807 | struct sta_id_modify sta; |
755 | struct iwl4965_keyinfo key; | 808 | struct iwl4965_keyinfo key; |
756 | __le32 station_flags; | 809 | __le32 station_flags; /* STA_FLG_* */ |
757 | __le32 station_flags_msk; | 810 | __le32 station_flags_msk; /* STA_FLG_* */ |
811 | |||
812 | /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID) | ||
813 | * corresponding to bit (e.g. bit 5 controls TID 5). | ||
814 | * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */ | ||
758 | __le16 tid_disable_tx; | 815 | __le16 tid_disable_tx; |
816 | |||
759 | __le16 reserved1; | 817 | __le16 reserved1; |
818 | |||
819 | /* TID for which to add block-ack support. | ||
820 | * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ | ||
760 | u8 add_immediate_ba_tid; | 821 | u8 add_immediate_ba_tid; |
822 | |||
823 | /* TID for which to remove block-ack support. | ||
824 | * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */ | ||
761 | u8 remove_immediate_ba_tid; | 825 | u8 remove_immediate_ba_tid; |
826 | |||
827 | /* Starting Sequence Number for added block-ack support. | ||
828 | * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ | ||
762 | __le16 add_immediate_ba_ssn; | 829 | __le16 add_immediate_ba_ssn; |
830 | |||
763 | __le32 reserved2; | 831 | __le32 reserved2; |
764 | } __attribute__ ((packed)); | 832 | } __attribute__ ((packed)); |
765 | 833 | ||
834 | #define ADD_STA_SUCCESS_MSK 0x1 | ||
835 | #define ADD_STA_NO_ROOM_IN_TABLE 0x2 | ||
836 | #define ADD_STA_NO_BLOCK_ACK_RESOURCE 0x4 | ||
837 | #define ADD_STA_MODIFY_NON_EXIST_STA 0x8 | ||
766 | /* | 838 | /* |
767 | * REPLY_ADD_STA = 0x18 (response) | 839 | * REPLY_ADD_STA = 0x18 (response) |
768 | */ | 840 | */ |
769 | struct iwl4965_add_sta_resp { | 841 | struct iwl4965_add_sta_resp { |
770 | u8 status; | 842 | u8 status; /* ADD_STA_* */ |
771 | } __attribute__ ((packed)); | 843 | } __attribute__ ((packed)); |
772 | 844 | ||
773 | #define ADD_STA_SUCCESS_MSK 0x1 | ||
774 | 845 | ||
775 | /****************************************************************************** | 846 | /****************************************************************************** |
776 | * (4) | 847 | * (4) |