diff options
author | Ben Cahill <ben.m.cahill@intel.com> | 2007-11-28 22:10:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:34 -0500 |
commit | 529699815b79f15a6644786dc4d6e9dd5153a447 (patch) | |
tree | 434b6493483bc5cb8075cc8c1529e59b369a8ea8 /drivers/net/wireless/iwlwifi/iwl-3945-commands.h | |
parent | 2054a00bb83409345d14a944e25c15e6ea317651 (diff) |
iwlwifi: add comments to Tx commands
Add comments to Tx commands
Clean up unused definitions in iwl-3945-commands.h
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-3945-commands.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-commands.h | 161 |
1 files changed, 92 insertions, 69 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h index 4885971a1536..3cac2c8ccf60 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h | |||
@@ -743,36 +743,86 @@ struct iwl4965_rx_mpdu_res_start { | |||
743 | * (5) | 743 | * (5) |
744 | * Tx Commands & Responses: | 744 | * Tx Commands & Responses: |
745 | * | 745 | * |
746 | * Driver must place each REPLY_TX command into one of the prioritized Tx | ||
747 | * queues in host DRAM, shared between driver and device. When the device's | ||
748 | * Tx scheduler and uCode are preparing to transmit, the device pulls the | ||
749 | * Tx command over the PCI bus via one of the device's Tx DMA channels, | ||
750 | * to fill an internal FIFO from which data will be transmitted. | ||
751 | * | ||
752 | * uCode handles all timing and protocol related to control frames | ||
753 | * (RTS/CTS/ACK), based on flags in the Tx command. | ||
754 | * | ||
755 | * uCode handles retrying Tx when an ACK is expected but not received. | ||
756 | * This includes trying lower data rates than the one requested in the Tx | ||
757 | * command, as set up by the REPLY_RATE_SCALE (for 3945) or | ||
758 | * REPLY_TX_LINK_QUALITY_CMD (4965). | ||
759 | * | ||
760 | * Driver sets up transmit power for various rates via REPLY_TX_PWR_TABLE_CMD. | ||
761 | * This command must be executed after every RXON command, before Tx can occur. | ||
746 | *****************************************************************************/ | 762 | *****************************************************************************/ |
747 | 763 | ||
748 | /* Tx flags */ | 764 | /* REPLY_TX Tx flags field */ |
765 | |||
766 | /* 1: Use Request-To-Send protocol before this frame. | ||
767 | * Mutually exclusive vs. TX_CMD_FLG_CTS_MSK. */ | ||
749 | #define TX_CMD_FLG_RTS_MSK __constant_cpu_to_le32(1 << 1) | 768 | #define TX_CMD_FLG_RTS_MSK __constant_cpu_to_le32(1 << 1) |
769 | |||
770 | /* 1: Transmit Clear-To-Send to self before this frame. | ||
771 | * Driver should set this for AUTH/DEAUTH/ASSOC-REQ/REASSOC mgmnt frames. | ||
772 | * Mutually exclusive vs. TX_CMD_FLG_RTS_MSK. */ | ||
750 | #define TX_CMD_FLG_CTS_MSK __constant_cpu_to_le32(1 << 2) | 773 | #define TX_CMD_FLG_CTS_MSK __constant_cpu_to_le32(1 << 2) |
774 | |||
775 | /* 1: Expect ACK from receiving station | ||
776 | * 0: Don't expect ACK (MAC header's duration field s/b 0) | ||
777 | * Set this for unicast frames, but not broadcast/multicast. */ | ||
751 | #define TX_CMD_FLG_ACK_MSK __constant_cpu_to_le32(1 << 3) | 778 | #define TX_CMD_FLG_ACK_MSK __constant_cpu_to_le32(1 << 3) |
779 | |||
780 | /* 1: Use rate scale table (see REPLY_TX_LINK_QUALITY_CMD). | ||
781 | * Tx command's initial_rate_index indicates first rate to try; | ||
782 | * uCode walks through table for additional Tx attempts. | ||
783 | * 0: Use Tx rate/MCS from Tx command's rate_n_flags field. | ||
784 | * This rate will be used for all Tx attempts; it will not be scaled. */ | ||
752 | #define TX_CMD_FLG_STA_RATE_MSK __constant_cpu_to_le32(1 << 4) | 785 | #define TX_CMD_FLG_STA_RATE_MSK __constant_cpu_to_le32(1 << 4) |
786 | |||
787 | /* 1: Expect immediate block-ack. | ||
788 | * Set when Txing a block-ack request frame. Also set TX_CMD_FLG_ACK_MSK. */ | ||
753 | #define TX_CMD_FLG_IMM_BA_RSP_MASK __constant_cpu_to_le32(1 << 6) | 789 | #define TX_CMD_FLG_IMM_BA_RSP_MASK __constant_cpu_to_le32(1 << 6) |
790 | |||
791 | /* 1: Frame requires full Tx-Op protection. | ||
792 | * Set this if either RTS or CTS Tx Flag gets set. */ | ||
754 | #define TX_CMD_FLG_FULL_TXOP_PROT_MSK __constant_cpu_to_le32(1 << 7) | 793 | #define TX_CMD_FLG_FULL_TXOP_PROT_MSK __constant_cpu_to_le32(1 << 7) |
794 | |||
795 | /* Tx antenna selection field; used only for 3945, reserved (0) for 4965. | ||
796 | * Set field to "0" to allow 3945 uCode to select antenna (normal usage). */ | ||
755 | #define TX_CMD_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0xf00) | 797 | #define TX_CMD_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0xf00) |
756 | #define TX_CMD_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8) | 798 | #define TX_CMD_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8) |
757 | #define TX_CMD_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9) | 799 | #define TX_CMD_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9) |
758 | 800 | ||
759 | /* ucode ignores BT priority for this frame */ | 801 | /* 1: Ignore Bluetooth priority for this frame. |
802 | * 0: Delay Tx until Bluetooth device is done (normal usage). */ | ||
760 | #define TX_CMD_FLG_BT_DIS_MSK __constant_cpu_to_le32(1 << 12) | 803 | #define TX_CMD_FLG_BT_DIS_MSK __constant_cpu_to_le32(1 << 12) |
761 | 804 | ||
762 | /* ucode overrides sequence control */ | 805 | /* 1: uCode overrides sequence control field in MAC header. |
806 | * 0: Driver provides sequence control field in MAC header. | ||
807 | * Set this for management frames, non-QOS data frames, non-unicast frames, | ||
808 | * and also in Tx command embedded in REPLY_SCAN_CMD for active scans. */ | ||
763 | #define TX_CMD_FLG_SEQ_CTL_MSK __constant_cpu_to_le32(1 << 13) | 809 | #define TX_CMD_FLG_SEQ_CTL_MSK __constant_cpu_to_le32(1 << 13) |
764 | 810 | ||
765 | /* signal that this frame is non-last MPDU */ | 811 | /* 1: This frame is non-last MPDU; more fragments are coming. |
812 | * 0: Last fragment, or not using fragmentation. */ | ||
766 | #define TX_CMD_FLG_MORE_FRAG_MSK __constant_cpu_to_le32(1 << 14) | 813 | #define TX_CMD_FLG_MORE_FRAG_MSK __constant_cpu_to_le32(1 << 14) |
767 | 814 | ||
768 | /* calculate TSF in outgoing frame */ | 815 | /* 1: uCode calculates and inserts Timestamp Function (TSF) in outgoing frame. |
816 | * 0: No TSF required in outgoing frame. | ||
817 | * Set this for transmitting beacons and probe responses. */ | ||
769 | #define TX_CMD_FLG_TSF_MSK __constant_cpu_to_le32(1 << 16) | 818 | #define TX_CMD_FLG_TSF_MSK __constant_cpu_to_le32(1 << 16) |
770 | 819 | ||
771 | /* activate TX calibration. */ | 820 | /* 1: Driver inserted 2 bytes pad after the MAC header, for (required) dword |
772 | #define TX_CMD_FLG_CALIB_MSK __constant_cpu_to_le32(1 << 17) | 821 | * alignment of frame's payload data field. |
773 | 822 | * 0: No pad | |
774 | /* signals that 2 bytes pad was inserted | 823 | * Set this for MAC headers with 26 or 30 bytes, i.e. those with QOS or ADDR4 |
775 | after the MAC header */ | 824 | * field (but not both). Driver must align frame data (i.e. data following |
825 | * MAC header) to DWORD boundary. */ | ||
776 | #define TX_CMD_FLG_MH_PAD_MSK __constant_cpu_to_le32(1 << 20) | 826 | #define TX_CMD_FLG_MH_PAD_MSK __constant_cpu_to_le32(1 << 20) |
777 | 827 | ||
778 | /* HCCA-AP - disable duration overwriting. */ | 828 | /* HCCA-AP - disable duration overwriting. */ |
@@ -789,23 +839,33 @@ struct iwl4965_rx_mpdu_res_start { | |||
789 | #define TX_CMD_SEC_KEY128 0x08 | 839 | #define TX_CMD_SEC_KEY128 0x08 |
790 | 840 | ||
791 | /* | 841 | /* |
792 | * TX command Frame life time | ||
793 | */ | ||
794 | |||
795 | struct iwl3945_dram_scratch { | ||
796 | u8 try_cnt; | ||
797 | u8 bt_kill_cnt; | ||
798 | __le16 reserved; | ||
799 | } __attribute__ ((packed)); | ||
800 | |||
801 | /* | ||
802 | * REPLY_TX = 0x1c (command) | 842 | * REPLY_TX = 0x1c (command) |
803 | */ | 843 | */ |
804 | struct iwl3945_tx_cmd { | 844 | struct iwl3945_tx_cmd { |
845 | /* | ||
846 | * MPDU byte count: | ||
847 | * MAC header (24/26/30/32 bytes) + 2 bytes pad if 26/30 header size, | ||
848 | * + 8 byte IV for CCM or TKIP (not used for WEP) | ||
849 | * + Data payload | ||
850 | * + 8-byte MIC (not used for CCM/WEP) | ||
851 | * NOTE: Does not include Tx command bytes, post-MAC pad bytes, | ||
852 | * MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.i | ||
853 | * Range: 14-2342 bytes. | ||
854 | */ | ||
805 | __le16 len; | 855 | __le16 len; |
856 | |||
857 | /* | ||
858 | * MPDU or MSDU byte count for next frame. | ||
859 | * Used for fragmentation and bursting, but not 11n aggregation. | ||
860 | * Same as "len", but for next frame. Set to 0 if not applicable. | ||
861 | */ | ||
806 | __le16 next_frame_len; | 862 | __le16 next_frame_len; |
807 | __le32 tx_flags; | 863 | |
864 | __le32 tx_flags; /* TX_CMD_FLG_* */ | ||
865 | |||
808 | u8 rate; | 866 | u8 rate; |
867 | |||
868 | /* Index of recipient station in uCode's station table */ | ||
809 | u8 sta_id; | 869 | u8 sta_id; |
810 | u8 tid_tspec; | 870 | u8 tid_tspec; |
811 | u8 sec_ctl; | 871 | u8 sec_ctl; |
@@ -827,7 +887,17 @@ struct iwl3945_tx_cmd { | |||
827 | __le16 pm_frame_timeout; | 887 | __le16 pm_frame_timeout; |
828 | __le16 attempt_duration; | 888 | __le16 attempt_duration; |
829 | } timeout; | 889 | } timeout; |
890 | |||
891 | /* | ||
892 | * Duration of EDCA burst Tx Opportunity, in 32-usec units. | ||
893 | * Set this if txop time is not specified by HCCA protocol (e.g. by AP). | ||
894 | */ | ||
830 | __le16 driver_txop; | 895 | __le16 driver_txop; |
896 | |||
897 | /* | ||
898 | * MAC header goes here, followed by 2 bytes padding if MAC header | ||
899 | * length is 26 or 30 bytes, followed by payload data | ||
900 | */ | ||
831 | u8 payload[0]; | 901 | u8 payload[0]; |
832 | struct ieee80211_hdr hdr[0]; | 902 | struct ieee80211_hdr hdr[0]; |
833 | } __attribute__ ((packed)); | 903 | } __attribute__ ((packed)); |
@@ -899,37 +969,6 @@ enum { | |||
899 | TX_ABORT_REQUIRED_MSK = 0x80000000, /* bits 31:31 */ | 969 | TX_ABORT_REQUIRED_MSK = 0x80000000, /* bits 31:31 */ |
900 | }; | 970 | }; |
901 | 971 | ||
902 | /* ******************************* | ||
903 | * TX aggregation state | ||
904 | ******************************* */ | ||
905 | |||
906 | enum { | ||
907 | AGG_TX_STATE_TRANSMITTED = 0x00, | ||
908 | AGG_TX_STATE_UNDERRUN_MSK = 0x01, | ||
909 | AGG_TX_STATE_BT_PRIO_MSK = 0x02, | ||
910 | AGG_TX_STATE_FEW_BYTES_MSK = 0x04, | ||
911 | AGG_TX_STATE_ABORT_MSK = 0x08, | ||
912 | AGG_TX_STATE_LAST_SENT_TTL_MSK = 0x10, | ||
913 | AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK = 0x20, | ||
914 | AGG_TX_STATE_LAST_SENT_BT_KILL_MSK = 0x40, | ||
915 | AGG_TX_STATE_SCD_QUERY_MSK = 0x80, | ||
916 | AGG_TX_STATE_TEST_BAD_CRC32_MSK = 0x100, | ||
917 | AGG_TX_STATE_RESPONSE_MSK = 0x1ff, | ||
918 | AGG_TX_STATE_DUMP_TX_MSK = 0x200, | ||
919 | AGG_TX_STATE_DELAY_TX_MSK = 0x400 | ||
920 | }; | ||
921 | |||
922 | #define AGG_TX_STATE_LAST_SENT_MSK \ | ||
923 | (AGG_TX_STATE_LAST_SENT_TTL_MSK | \ | ||
924 | AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \ | ||
925 | AGG_TX_STATE_LAST_SENT_BT_KILL_MSK) | ||
926 | |||
927 | #define AGG_TX_STATE_TRY_CNT_POS 12 | ||
928 | #define AGG_TX_STATE_TRY_CNT_MSK 0xf000 | ||
929 | |||
930 | #define AGG_TX_STATE_SEQ_NUM_POS 16 | ||
931 | #define AGG_TX_STATE_SEQ_NUM_MSK 0xffff0000 | ||
932 | |||
933 | /* | 972 | /* |
934 | * REPLY_TX = 0x1c (response) | 973 | * REPLY_TX = 0x1c (response) |
935 | */ | 974 | */ |
@@ -939,23 +978,7 @@ struct iwl3945_tx_resp { | |||
939 | u8 bt_kill_count; | 978 | u8 bt_kill_count; |
940 | u8 rate; | 979 | u8 rate; |
941 | __le32 wireless_media_time; | 980 | __le32 wireless_media_time; |
942 | __le32 status; /* TX status (for aggregation status of 1st frame) */ | 981 | __le32 status; /* TX status */ |
943 | } __attribute__ ((packed)); | ||
944 | |||
945 | /* | ||
946 | * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command) | ||
947 | */ | ||
948 | struct iwl3945_compressed_ba_resp { | ||
949 | __le32 sta_addr_lo32; | ||
950 | __le16 sta_addr_hi16; | ||
951 | __le16 reserved; | ||
952 | u8 sta_id; | ||
953 | u8 tid; | ||
954 | __le16 ba_seq_ctl; | ||
955 | __le32 ba_bitmap0; | ||
956 | __le32 ba_bitmap1; | ||
957 | __le16 scd_flow; | ||
958 | __le16 scd_ssn; | ||
959 | } __attribute__ ((packed)); | 982 | } __attribute__ ((packed)); |
960 | 983 | ||
961 | /* | 984 | /* |