diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-12-18 21:37:04 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:58:53 -0500 |
commit | 600c0e11ea6161e00e8cb4b4dda39a64ce988c60 (patch) | |
tree | 282d6b6d4a4b2bed814509083669c68da5e8c097 /drivers/net/wireless/iwlwifi/iwl-3945-commands.h | |
parent | b936d9be05d66172b2c035eaca002a134f078c64 (diff) |
iwlwifi: use iwl-commands.h also in 3945
This patch uses iwl-commands.h also for iwl3945
more clean ups are required but this get to stage where it
compiles cleanly.
Most massive changes are in spectrum and power managment.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@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 | 426 |
1 files changed, 18 insertions, 408 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h index e9ccd07db8d4..acc584f4377b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h | |||
@@ -75,74 +75,6 @@ | |||
75 | #define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8) | 75 | #define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8) |
76 | #define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF) | 76 | #define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF) |
77 | 77 | ||
78 | enum { | ||
79 | REPLY_ALIVE = 0x1, | ||
80 | REPLY_ERROR = 0x2, | ||
81 | |||
82 | /* RXON and QOS commands */ | ||
83 | REPLY_RXON = 0x10, | ||
84 | REPLY_RXON_ASSOC = 0x11, | ||
85 | REPLY_QOS_PARAM = 0x13, | ||
86 | REPLY_RXON_TIMING = 0x14, | ||
87 | |||
88 | /* Multi-Station support */ | ||
89 | REPLY_ADD_STA = 0x18, | ||
90 | REPLY_REMOVE_STA = 0x19, /* not used */ | ||
91 | REPLY_REMOVE_ALL_STA = 0x1a, /* not used */ | ||
92 | |||
93 | /* RX, TX, LEDs */ | ||
94 | REPLY_3945_RX = 0x1b, /* 3945 only */ | ||
95 | REPLY_TX = 0x1c, | ||
96 | REPLY_RATE_SCALE = 0x47, /* 3945 only */ | ||
97 | REPLY_LEDS_CMD = 0x48, | ||
98 | REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* 4965 only */ | ||
99 | |||
100 | /* 802.11h related */ | ||
101 | RADAR_NOTIFICATION = 0x70, /* not used */ | ||
102 | REPLY_QUIET_CMD = 0x71, /* not used */ | ||
103 | REPLY_CHANNEL_SWITCH = 0x72, | ||
104 | CHANNEL_SWITCH_NOTIFICATION = 0x73, | ||
105 | REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74, | ||
106 | SPECTRUM_MEASURE_NOTIFICATION = 0x75, | ||
107 | |||
108 | /* Power Management */ | ||
109 | POWER_TABLE_CMD = 0x77, | ||
110 | PM_SLEEP_NOTIFICATION = 0x7A, | ||
111 | PM_DEBUG_STATISTIC_NOTIFIC = 0x7B, | ||
112 | |||
113 | /* Scan commands and notifications */ | ||
114 | REPLY_SCAN_CMD = 0x80, | ||
115 | REPLY_SCAN_ABORT_CMD = 0x81, | ||
116 | SCAN_START_NOTIFICATION = 0x82, | ||
117 | SCAN_RESULTS_NOTIFICATION = 0x83, | ||
118 | SCAN_COMPLETE_NOTIFICATION = 0x84, | ||
119 | |||
120 | /* IBSS/AP commands */ | ||
121 | BEACON_NOTIFICATION = 0x90, | ||
122 | REPLY_TX_BEACON = 0x91, | ||
123 | WHO_IS_AWAKE_NOTIFICATION = 0x94, /* not used */ | ||
124 | |||
125 | /* Miscellaneous commands */ | ||
126 | QUIET_NOTIFICATION = 0x96, /* not used */ | ||
127 | REPLY_TX_PWR_TABLE_CMD = 0x97, | ||
128 | MEASURE_ABORT_NOTIFICATION = 0x99, /* not used */ | ||
129 | |||
130 | /* Bluetooth device coexistence config command */ | ||
131 | REPLY_BT_CONFIG = 0x9b, | ||
132 | |||
133 | /* Statistics */ | ||
134 | REPLY_STATISTICS_CMD = 0x9c, | ||
135 | STATISTICS_NOTIFICATION = 0x9d, | ||
136 | |||
137 | /* RF-KILL commands and notifications */ | ||
138 | REPLY_CARD_STATE_CMD = 0xa0, | ||
139 | CARD_STATE_NOTIFICATION = 0xa1, | ||
140 | |||
141 | /* Missed beacons notification */ | ||
142 | MISSED_BEACONS_NOTIFICATION = 0xa2, | ||
143 | |||
144 | REPLY_MAX = 0xff | ||
145 | }; | ||
146 | 78 | ||
147 | /* Tx rates */ | 79 | /* Tx rates */ |
148 | #define IWL_CCK_RATES 4 | 80 | #define IWL_CCK_RATES 4 |
@@ -320,17 +252,6 @@ struct iwl3945_error_resp { | |||
320 | * | 252 | * |
321 | *****************************************************************************/ | 253 | *****************************************************************************/ |
322 | 254 | ||
323 | /* | ||
324 | * Rx config defines & structure | ||
325 | */ | ||
326 | /* rx_config device types */ | ||
327 | enum { | ||
328 | RXON_DEV_TYPE_AP = 1, | ||
329 | RXON_DEV_TYPE_ESS = 3, | ||
330 | RXON_DEV_TYPE_IBSS = 4, | ||
331 | RXON_DEV_TYPE_SNIFFER = 6, | ||
332 | }; | ||
333 | |||
334 | /* rx_config flags */ | 255 | /* rx_config flags */ |
335 | /* band & modulation selection */ | 256 | /* band & modulation selection */ |
336 | #define RXON_FLG_BAND_24G_MSK cpu_to_le32(1 << 0) | 257 | #define RXON_FLG_BAND_24G_MSK cpu_to_le32(1 << 0) |
@@ -546,18 +467,6 @@ struct iwl3945_qosparam_cmd { | |||
546 | #define STA_MODIFY_TID_DISABLE_TX 0x02 | 467 | #define STA_MODIFY_TID_DISABLE_TX 0x02 |
547 | #define STA_MODIFY_TX_RATE_MSK 0x04 | 468 | #define STA_MODIFY_TX_RATE_MSK 0x04 |
548 | 469 | ||
549 | /* | ||
550 | * Antenna masks: | ||
551 | * bit14:15 01 B inactive, A active | ||
552 | * 10 B active, A inactive | ||
553 | * 11 Both active | ||
554 | */ | ||
555 | #define RATE_MCS_ANT_A_POS 14 | ||
556 | #define RATE_MCS_ANT_B_POS 15 | ||
557 | #define RATE_MCS_ANT_A_MSK 0x4000 | ||
558 | #define RATE_MCS_ANT_B_MSK 0x8000 | ||
559 | #define RATE_MCS_ANT_AB_MSK 0xc000 | ||
560 | |||
561 | struct iwl3945_keyinfo { | 470 | struct iwl3945_keyinfo { |
562 | __le16 key_flags; | 471 | __le16 key_flags; |
563 | u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ | 472 | u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ |
@@ -568,26 +477,6 @@ struct iwl3945_keyinfo { | |||
568 | u8 key[16]; /* 16-byte unicast decryption key */ | 477 | u8 key[16]; /* 16-byte unicast decryption key */ |
569 | } __attribute__ ((packed)); | 478 | } __attribute__ ((packed)); |
570 | 479 | ||
571 | /** | ||
572 | * struct sta_id_modify | ||
573 | * @addr[ETH_ALEN]: station's MAC address | ||
574 | * @sta_id: index of station in uCode's station table | ||
575 | * @modify_mask: STA_MODIFY_*, 1: modify, 0: don't change | ||
576 | * | ||
577 | * Driver selects unused table index when adding new station, | ||
578 | * or the index to a pre-existing station entry when modifying that station. | ||
579 | * Some indexes have special purposes (IWL_AP_ID, index 0, is for AP). | ||
580 | * | ||
581 | * modify_mask flags select which parameters to modify vs. leave alone. | ||
582 | */ | ||
583 | struct sta_id_modify { | ||
584 | u8 addr[ETH_ALEN]; | ||
585 | __le16 reserved1; | ||
586 | u8 sta_id; | ||
587 | u8 modify_mask; | ||
588 | __le16 reserved2; | ||
589 | } __attribute__ ((packed)); | ||
590 | |||
591 | /* | 480 | /* |
592 | * REPLY_ADD_STA = 0x18 (command) | 481 | * REPLY_ADD_STA = 0x18 (command) |
593 | * | 482 | * |
@@ -881,73 +770,6 @@ struct iwl3945_tx_cmd { | |||
881 | struct ieee80211_hdr hdr[0]; | 770 | struct ieee80211_hdr hdr[0]; |
882 | } __attribute__ ((packed)); | 771 | } __attribute__ ((packed)); |
883 | 772 | ||
884 | /* TX command response is sent after *all* transmission attempts. | ||
885 | * | ||
886 | * NOTES: | ||
887 | * | ||
888 | * TX_STATUS_FAIL_NEXT_FRAG | ||
889 | * | ||
890 | * If the fragment flag in the MAC header for the frame being transmitted | ||
891 | * is set and there is insufficient time to transmit the next frame, the | ||
892 | * TX status will be returned with 'TX_STATUS_FAIL_NEXT_FRAG'. | ||
893 | * | ||
894 | * TX_STATUS_FIFO_UNDERRUN | ||
895 | * | ||
896 | * Indicates the host did not provide bytes to the FIFO fast enough while | ||
897 | * a TX was in progress. | ||
898 | * | ||
899 | * TX_STATUS_FAIL_MGMNT_ABORT | ||
900 | * | ||
901 | * This status is only possible if the ABORT ON MGMT RX parameter was | ||
902 | * set to true with the TX command. | ||
903 | * | ||
904 | * If the MSB of the status parameter is set then an abort sequence is | ||
905 | * required. This sequence consists of the host activating the TX Abort | ||
906 | * control line, and then waiting for the TX Abort command response. This | ||
907 | * indicates that a the device is no longer in a transmit state, and that the | ||
908 | * command FIFO has been cleared. The host must then deactivate the TX Abort | ||
909 | * control line. Receiving is still allowed in this case. | ||
910 | */ | ||
911 | enum { | ||
912 | TX_STATUS_SUCCESS = 0x01, | ||
913 | TX_STATUS_DIRECT_DONE = 0x02, | ||
914 | TX_STATUS_FAIL_SHORT_LIMIT = 0x82, | ||
915 | TX_STATUS_FAIL_LONG_LIMIT = 0x83, | ||
916 | TX_STATUS_FAIL_FIFO_UNDERRUN = 0x84, | ||
917 | TX_STATUS_FAIL_MGMNT_ABORT = 0x85, | ||
918 | TX_STATUS_FAIL_NEXT_FRAG = 0x86, | ||
919 | TX_STATUS_FAIL_LIFE_EXPIRE = 0x87, | ||
920 | TX_STATUS_FAIL_DEST_PS = 0x88, | ||
921 | TX_STATUS_FAIL_ABORTED = 0x89, | ||
922 | TX_STATUS_FAIL_BT_RETRY = 0x8a, | ||
923 | TX_STATUS_FAIL_STA_INVALID = 0x8b, | ||
924 | TX_STATUS_FAIL_FRAG_DROPPED = 0x8c, | ||
925 | TX_STATUS_FAIL_TID_DISABLE = 0x8d, | ||
926 | TX_STATUS_FAIL_FRAME_FLUSHED = 0x8e, | ||
927 | TX_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f, | ||
928 | TX_STATUS_FAIL_TX_LOCKED = 0x90, | ||
929 | TX_STATUS_FAIL_NO_BEACON_ON_RADAR = 0x91, | ||
930 | }; | ||
931 | |||
932 | #define TX_PACKET_MODE_REGULAR 0x0000 | ||
933 | #define TX_PACKET_MODE_BURST_SEQ 0x0100 | ||
934 | #define TX_PACKET_MODE_BURST_FIRST 0x0200 | ||
935 | |||
936 | enum { | ||
937 | TX_POWER_PA_NOT_ACTIVE = 0x0, | ||
938 | }; | ||
939 | |||
940 | enum { | ||
941 | TX_STATUS_MSK = 0x000000ff, /* bits 0:7 */ | ||
942 | TX_STATUS_DELAY_MSK = 0x00000040, | ||
943 | TX_STATUS_ABORT_MSK = 0x00000080, | ||
944 | TX_PACKET_MODE_MSK = 0x0000ff00, /* bits 8:15 */ | ||
945 | TX_FIFO_NUMBER_MSK = 0x00070000, /* bits 16:18 */ | ||
946 | TX_RESERVED = 0x00780000, /* bits 19:22 */ | ||
947 | TX_POWER_PA_DETECT_MSK = 0x7f800000, /* bits 23:30 */ | ||
948 | TX_ABORT_REQUIRED_MSK = 0x80000000, /* bits 31:31 */ | ||
949 | }; | ||
950 | |||
951 | /* | 773 | /* |
952 | * REPLY_TX = 0x1c (response) | 774 | * REPLY_TX = 0x1c (response) |
953 | */ | 775 | */ |
@@ -1038,191 +860,6 @@ struct iwl3945_measure_channel { | |||
1038 | __le16 reserved; | 860 | __le16 reserved; |
1039 | } __attribute__ ((packed)); | 861 | } __attribute__ ((packed)); |
1040 | 862 | ||
1041 | /* | ||
1042 | * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command) | ||
1043 | */ | ||
1044 | struct iwl3945_spectrum_cmd { | ||
1045 | __le16 len; /* number of bytes starting from token */ | ||
1046 | u8 token; /* token id */ | ||
1047 | u8 id; /* measurement id -- 0 or 1 */ | ||
1048 | u8 origin; /* 0 = TGh, 1 = other, 2 = TGk */ | ||
1049 | u8 periodic; /* 1 = periodic */ | ||
1050 | __le16 path_loss_timeout; | ||
1051 | __le32 start_time; /* start time in extended beacon format */ | ||
1052 | __le32 reserved2; | ||
1053 | __le32 flags; /* rxon flags */ | ||
1054 | __le32 filter_flags; /* rxon filter flags */ | ||
1055 | __le16 channel_count; /* minimum 1, maximum 10 */ | ||
1056 | __le16 reserved3; | ||
1057 | struct iwl3945_measure_channel channels[10]; | ||
1058 | } __attribute__ ((packed)); | ||
1059 | |||
1060 | /* | ||
1061 | * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response) | ||
1062 | */ | ||
1063 | struct iwl3945_spectrum_resp { | ||
1064 | u8 token; | ||
1065 | u8 id; /* id of the prior command replaced, or 0xff */ | ||
1066 | __le16 status; /* 0 - command will be handled | ||
1067 | * 1 - cannot handle (conflicts with another | ||
1068 | * measurement) */ | ||
1069 | } __attribute__ ((packed)); | ||
1070 | |||
1071 | enum iwl3945_measurement_state { | ||
1072 | IWL_MEASUREMENT_START = 0, | ||
1073 | IWL_MEASUREMENT_STOP = 1, | ||
1074 | }; | ||
1075 | |||
1076 | enum iwl3945_measurement_status { | ||
1077 | IWL_MEASUREMENT_OK = 0, | ||
1078 | IWL_MEASUREMENT_CONCURRENT = 1, | ||
1079 | IWL_MEASUREMENT_CSA_CONFLICT = 2, | ||
1080 | IWL_MEASUREMENT_TGH_CONFLICT = 3, | ||
1081 | /* 4-5 reserved */ | ||
1082 | IWL_MEASUREMENT_STOPPED = 6, | ||
1083 | IWL_MEASUREMENT_TIMEOUT = 7, | ||
1084 | IWL_MEASUREMENT_PERIODIC_FAILED = 8, | ||
1085 | }; | ||
1086 | |||
1087 | #define NUM_ELEMENTS_IN_HISTOGRAM 8 | ||
1088 | |||
1089 | struct iwl3945_measurement_histogram { | ||
1090 | __le32 ofdm[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 0.8usec counts */ | ||
1091 | __le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */ | ||
1092 | } __attribute__ ((packed)); | ||
1093 | |||
1094 | /* clear channel availability counters */ | ||
1095 | struct iwl3945_measurement_cca_counters { | ||
1096 | __le32 ofdm; | ||
1097 | __le32 cck; | ||
1098 | } __attribute__ ((packed)); | ||
1099 | |||
1100 | enum iwl3945_measure_type { | ||
1101 | IWL_MEASURE_BASIC = (1 << 0), | ||
1102 | IWL_MEASURE_CHANNEL_LOAD = (1 << 1), | ||
1103 | IWL_MEASURE_HISTOGRAM_RPI = (1 << 2), | ||
1104 | IWL_MEASURE_HISTOGRAM_NOISE = (1 << 3), | ||
1105 | IWL_MEASURE_FRAME = (1 << 4), | ||
1106 | /* bits 5:6 are reserved */ | ||
1107 | IWL_MEASURE_IDLE = (1 << 7), | ||
1108 | }; | ||
1109 | |||
1110 | /* | ||
1111 | * SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command) | ||
1112 | */ | ||
1113 | struct iwl3945_spectrum_notification { | ||
1114 | u8 id; /* measurement id -- 0 or 1 */ | ||
1115 | u8 token; | ||
1116 | u8 channel_index; /* index in measurement channel list */ | ||
1117 | u8 state; /* 0 - start, 1 - stop */ | ||
1118 | __le32 start_time; /* lower 32-bits of TSF */ | ||
1119 | u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */ | ||
1120 | u8 channel; | ||
1121 | u8 type; /* see enum iwl3945_measurement_type */ | ||
1122 | u8 reserved1; | ||
1123 | /* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only | ||
1124 | * valid if applicable for measurement type requested. */ | ||
1125 | __le32 cca_ofdm; /* cca fraction time in 40Mhz clock periods */ | ||
1126 | __le32 cca_cck; /* cca fraction time in 44Mhz clock periods */ | ||
1127 | __le32 cca_time; /* channel load time in usecs */ | ||
1128 | u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 - | ||
1129 | * unidentified */ | ||
1130 | u8 reserved2[3]; | ||
1131 | struct iwl3945_measurement_histogram histogram; | ||
1132 | __le32 stop_time; /* lower 32-bits of TSF */ | ||
1133 | __le32 status; /* see iwl3945_measurement_status */ | ||
1134 | } __attribute__ ((packed)); | ||
1135 | |||
1136 | /****************************************************************************** | ||
1137 | * (7) | ||
1138 | * Power Management Commands, Responses, Notifications: | ||
1139 | * | ||
1140 | *****************************************************************************/ | ||
1141 | |||
1142 | /** | ||
1143 | * struct iwl3945_powertable_cmd - Power Table Command | ||
1144 | * @flags: See below: | ||
1145 | * | ||
1146 | * POWER_TABLE_CMD = 0x77 (command, has simple generic response) | ||
1147 | * | ||
1148 | * PM allow: | ||
1149 | * bit 0 - '0' Driver not allow power management | ||
1150 | * '1' Driver allow PM (use rest of parameters) | ||
1151 | * uCode send sleep notifications: | ||
1152 | * bit 1 - '0' Don't send sleep notification | ||
1153 | * '1' send sleep notification (SEND_PM_NOTIFICATION) | ||
1154 | * Sleep over DTIM | ||
1155 | * bit 2 - '0' PM have to walk up every DTIM | ||
1156 | * '1' PM could sleep over DTIM till listen Interval. | ||
1157 | * PCI power managed | ||
1158 | * bit 3 - '0' (PCI_LINK_CTRL & 0x1) | ||
1159 | * '1' !(PCI_LINK_CTRL & 0x1) | ||
1160 | * Force sleep Modes | ||
1161 | * bit 31/30- '00' use both mac/xtal sleeps | ||
1162 | * '01' force Mac sleep | ||
1163 | * '10' force xtal sleep | ||
1164 | * '11' Illegal set | ||
1165 | * | ||
1166 | * NOTE: if sleep_interval[SLEEP_INTRVL_TABLE_SIZE-1] > DTIM period then | ||
1167 | * ucode assume sleep over DTIM is allowed and we don't need to wakeup | ||
1168 | * for every DTIM. | ||
1169 | */ | ||
1170 | #define IWL_POWER_VEC_SIZE 5 | ||
1171 | |||
1172 | #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK cpu_to_le32(1 << 0) | ||
1173 | #define IWL_POWER_SLEEP_OVER_DTIM_MSK cpu_to_le32(1 << 2) | ||
1174 | #define IWL_POWER_PCI_PM_MSK cpu_to_le32(1 << 3) | ||
1175 | struct iwl3945_powertable_cmd { | ||
1176 | __le32 flags; | ||
1177 | __le32 rx_data_timeout; | ||
1178 | __le32 tx_data_timeout; | ||
1179 | __le32 sleep_interval[IWL_POWER_VEC_SIZE]; | ||
1180 | } __attribute__((packed)); | ||
1181 | |||
1182 | /* | ||
1183 | * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command) | ||
1184 | * 3945 and 4965 identical. | ||
1185 | */ | ||
1186 | struct iwl3945_sleep_notification { | ||
1187 | u8 pm_sleep_mode; | ||
1188 | u8 pm_wakeup_src; | ||
1189 | __le16 reserved; | ||
1190 | __le32 sleep_time; | ||
1191 | __le32 tsf_low; | ||
1192 | __le32 bcon_timer; | ||
1193 | } __attribute__ ((packed)); | ||
1194 | |||
1195 | /* Sleep states. 3945 and 4965 identical. */ | ||
1196 | enum { | ||
1197 | IWL_PM_NO_SLEEP = 0, | ||
1198 | IWL_PM_SLP_MAC = 1, | ||
1199 | IWL_PM_SLP_FULL_MAC_UNASSOCIATE = 2, | ||
1200 | IWL_PM_SLP_FULL_MAC_CARD_STATE = 3, | ||
1201 | IWL_PM_SLP_PHY = 4, | ||
1202 | IWL_PM_SLP_REPENT = 5, | ||
1203 | IWL_PM_WAKEUP_BY_TIMER = 6, | ||
1204 | IWL_PM_WAKEUP_BY_DRIVER = 7, | ||
1205 | IWL_PM_WAKEUP_BY_RFKILL = 8, | ||
1206 | /* 3 reserved */ | ||
1207 | IWL_PM_NUM_OF_MODES = 12, | ||
1208 | }; | ||
1209 | |||
1210 | /* | ||
1211 | * REPLY_CARD_STATE_CMD = 0xa0 (command, has simple generic response) | ||
1212 | */ | ||
1213 | #define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */ | ||
1214 | #define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */ | ||
1215 | #define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */ | ||
1216 | struct iwl3945_card_state_cmd { | ||
1217 | __le32 status; /* CARD_STATE_CMD_* request new power state */ | ||
1218 | } __attribute__ ((packed)); | ||
1219 | |||
1220 | /* | ||
1221 | * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command) | ||
1222 | */ | ||
1223 | struct iwl3945_card_state_notif { | ||
1224 | __le32 flags; | ||
1225 | } __attribute__ ((packed)); | ||
1226 | 863 | ||
1227 | #define HW_CARD_DISABLED 0x01 | 864 | #define HW_CARD_DISABLED 0x01 |
1228 | #define SW_CARD_DISABLED 0x02 | 865 | #define SW_CARD_DISABLED 0x02 |
@@ -1288,7 +925,8 @@ struct iwl3945_ssid_ie { | |||
1288 | u8 ssid[32]; | 925 | u8 ssid[32]; |
1289 | } __attribute__ ((packed)); | 926 | } __attribute__ ((packed)); |
1290 | 927 | ||
1291 | #define PROBE_OPTION_MAX 0x4 | 928 | /* uCode API-1 take 4 probes */ |
929 | #define PROBE_OPTION_MAX_API1 0x4 | ||
1292 | #define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF) | 930 | #define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF) |
1293 | #define IWL_GOOD_CRC_TH cpu_to_le16(1) | 931 | #define IWL_GOOD_CRC_TH cpu_to_le16(1) |
1294 | #define IWL_MAX_SCAN_SIZE 1024 | 932 | #define IWL_MAX_SCAN_SIZE 1024 |
@@ -1369,7 +1007,7 @@ struct iwl3945_scan_cmd { | |||
1369 | struct iwl3945_tx_cmd tx_cmd; | 1007 | struct iwl3945_tx_cmd tx_cmd; |
1370 | 1008 | ||
1371 | /* For directed active scans (set to all-0s otherwise) */ | 1009 | /* For directed active scans (set to all-0s otherwise) */ |
1372 | struct iwl3945_ssid_ie direct_scan[PROBE_OPTION_MAX]; | 1010 | struct iwl3945_ssid_ie direct_scan[PROBE_OPTION_MAX_API1]; |
1373 | 1011 | ||
1374 | /* | 1012 | /* |
1375 | * Probe request frame, followed by channel list. | 1013 | * Probe request frame, followed by channel list. |
@@ -1476,29 +1114,7 @@ struct iwl3945_tx_beacon_cmd { | |||
1476 | * | 1114 | * |
1477 | *****************************************************************************/ | 1115 | *****************************************************************************/ |
1478 | 1116 | ||
1479 | #define IWL_TEMP_CONVERT 260 | 1117 | struct iwl39_statistics_rx_phy { |
1480 | |||
1481 | #define SUP_RATE_11A_MAX_NUM_CHANNELS 8 | ||
1482 | #define SUP_RATE_11B_MAX_NUM_CHANNELS 4 | ||
1483 | #define SUP_RATE_11G_MAX_NUM_CHANNELS 12 | ||
1484 | |||
1485 | /* Used for passing to driver number of successes and failures per rate */ | ||
1486 | struct rate_histogram { | ||
1487 | union { | ||
1488 | __le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; | ||
1489 | __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; | ||
1490 | __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; | ||
1491 | } success; | ||
1492 | union { | ||
1493 | __le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; | ||
1494 | __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; | ||
1495 | __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; | ||
1496 | } failed; | ||
1497 | } __attribute__ ((packed)); | ||
1498 | |||
1499 | /* statistics command response */ | ||
1500 | |||
1501 | struct statistics_rx_phy { | ||
1502 | __le32 ina_cnt; | 1118 | __le32 ina_cnt; |
1503 | __le32 fina_cnt; | 1119 | __le32 fina_cnt; |
1504 | __le32 plcp_err; | 1120 | __le32 plcp_err; |
@@ -1516,7 +1132,7 @@ struct statistics_rx_phy { | |||
1516 | __le32 sent_cts_cnt; | 1132 | __le32 sent_cts_cnt; |
1517 | } __attribute__ ((packed)); | 1133 | } __attribute__ ((packed)); |
1518 | 1134 | ||
1519 | struct statistics_rx_non_phy { | 1135 | struct iwl39_statistics_rx_non_phy { |
1520 | __le32 bogus_cts; /* CTS received when not expecting CTS */ | 1136 | __le32 bogus_cts; /* CTS received when not expecting CTS */ |
1521 | __le32 bogus_ack; /* ACK received when not expecting ACK */ | 1137 | __le32 bogus_ack; /* ACK received when not expecting ACK */ |
1522 | __le32 non_bssid_frames; /* number of frames with BSSID that | 1138 | __le32 non_bssid_frames; /* number of frames with BSSID that |
@@ -1527,13 +1143,13 @@ struct statistics_rx_non_phy { | |||
1527 | * our serving channel */ | 1143 | * our serving channel */ |
1528 | } __attribute__ ((packed)); | 1144 | } __attribute__ ((packed)); |
1529 | 1145 | ||
1530 | struct statistics_rx { | 1146 | struct iwl39_statistics_rx { |
1531 | struct statistics_rx_phy ofdm; | 1147 | struct iwl39_statistics_rx_phy ofdm; |
1532 | struct statistics_rx_phy cck; | 1148 | struct iwl39_statistics_rx_phy cck; |
1533 | struct statistics_rx_non_phy general; | 1149 | struct iwl39_statistics_rx_non_phy general; |
1534 | } __attribute__ ((packed)); | 1150 | } __attribute__ ((packed)); |
1535 | 1151 | ||
1536 | struct statistics_tx { | 1152 | struct iwl39_statistics_tx { |
1537 | __le32 preamble_cnt; | 1153 | __le32 preamble_cnt; |
1538 | __le32 rx_detected_cnt; | 1154 | __le32 rx_detected_cnt; |
1539 | __le32 bt_prio_defer_cnt; | 1155 | __le32 bt_prio_defer_cnt; |
@@ -1545,27 +1161,21 @@ struct statistics_tx { | |||
1545 | __le32 actual_ack_cnt; | 1161 | __le32 actual_ack_cnt; |
1546 | } __attribute__ ((packed)); | 1162 | } __attribute__ ((packed)); |
1547 | 1163 | ||
1548 | struct statistics_dbg { | 1164 | struct iwl39_statistics_div { |
1549 | __le32 burst_check; | ||
1550 | __le32 burst_count; | ||
1551 | __le32 reserved[4]; | ||
1552 | } __attribute__ ((packed)); | ||
1553 | |||
1554 | struct statistics_div { | ||
1555 | __le32 tx_on_a; | 1165 | __le32 tx_on_a; |
1556 | __le32 tx_on_b; | 1166 | __le32 tx_on_b; |
1557 | __le32 exec_time; | 1167 | __le32 exec_time; |
1558 | __le32 probe_time; | 1168 | __le32 probe_time; |
1559 | } __attribute__ ((packed)); | 1169 | } __attribute__ ((packed)); |
1560 | 1170 | ||
1561 | struct statistics_general { | 1171 | struct iwl39_statistics_general { |
1562 | __le32 temperature; | 1172 | __le32 temperature; |
1563 | struct statistics_dbg dbg; | 1173 | struct statistics_dbg dbg; |
1564 | __le32 sleep_time; | 1174 | __le32 sleep_time; |
1565 | __le32 slots_out; | 1175 | __le32 slots_out; |
1566 | __le32 slots_idle; | 1176 | __le32 slots_idle; |
1567 | __le32 ttl_timestamp; | 1177 | __le32 ttl_timestamp; |
1568 | struct statistics_div div; | 1178 | struct iwl39_statistics_div div; |
1569 | } __attribute__ ((packed)); | 1179 | } __attribute__ ((packed)); |
1570 | 1180 | ||
1571 | /* | 1181 | /* |
@@ -1688,14 +1298,14 @@ struct iwl3945_rx_packet { | |||
1688 | struct iwl3945_alive_resp alive_frame; | 1298 | struct iwl3945_alive_resp alive_frame; |
1689 | struct iwl3945_rx_frame rx_frame; | 1299 | struct iwl3945_rx_frame rx_frame; |
1690 | struct iwl3945_tx_resp tx_resp; | 1300 | struct iwl3945_tx_resp tx_resp; |
1691 | struct iwl3945_spectrum_notification spectrum_notif; | 1301 | struct iwl_spectrum_notification spectrum_notif; |
1692 | struct iwl3945_csa_notification csa_notif; | 1302 | struct iwl_csa_notification csa_notif; |
1693 | struct iwl3945_error_resp err_resp; | 1303 | struct iwl3945_error_resp err_resp; |
1694 | struct iwl3945_card_state_notif card_state_notif; | 1304 | struct iwl_card_state_notif card_state_notif; |
1695 | struct iwl3945_beacon_notif beacon_status; | 1305 | struct iwl3945_beacon_notif beacon_status; |
1696 | struct iwl3945_add_sta_resp add_sta; | 1306 | struct iwl3945_add_sta_resp add_sta; |
1697 | struct iwl3945_sleep_notification sleep_notif; | 1307 | struct iwl_sleep_notification sleep_notif; |
1698 | struct iwl3945_spectrum_resp spectrum; | 1308 | struct iwl_spectrum_resp spectrum; |
1699 | struct iwl3945_notif_statistics stats; | 1309 | struct iwl3945_notif_statistics stats; |
1700 | __le32 status; | 1310 | __le32 status; |
1701 | u8 raw[0]; | 1311 | u8 raw[0]; |