diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-commands.h | 426 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-led.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 31 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 31 |
7 files changed, 61 insertions, 442 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]; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/drivers/net/wireless/iwlwifi/iwl-3945-led.c index b0d420f68ec4..525e90bdc47f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-led.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/etherdevice.h> | 38 | #include <linux/etherdevice.h> |
39 | #include <asm/unaligned.h> | 39 | #include <asm/unaligned.h> |
40 | 40 | ||
41 | #include "iwl-commands.h" | ||
41 | #include "iwl-3945-commands.h" | 42 | #include "iwl-3945-commands.h" |
42 | #include "iwl-3945.h" | 43 | #include "iwl-3945.h" |
43 | 44 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index 56226032333a..2da42b89540a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -36,6 +36,7 @@ | |||
36 | 36 | ||
37 | #include <linux/workqueue.h> | 37 | #include <linux/workqueue.h> |
38 | 38 | ||
39 | #include "iwl-commands.h" | ||
39 | #include "iwl-3945-commands.h" | 40 | #include "iwl-3945-commands.h" |
40 | #include "iwl-3945.h" | 41 | #include "iwl-3945.h" |
41 | 42 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index c16640ddd3d6..11e047de6cc9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -40,6 +40,7 @@ | |||
40 | 40 | ||
41 | #include "iwl-3945-core.h" | 41 | #include "iwl-3945-core.h" |
42 | #include "iwl-3945-fh.h" | 42 | #include "iwl-3945-fh.h" |
43 | #include "iwl-commands.h" | ||
43 | #include "iwl-3945-commands.h" | 44 | #include "iwl-3945-commands.h" |
44 | #include "iwl-3945.h" | 45 | #include "iwl-3945.h" |
45 | #include "iwl-helpers.h" | 46 | #include "iwl-helpers.h" |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index d07aafe5ccc5..00109324b33c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -250,7 +250,7 @@ struct iwl3945_clip_group { | |||
250 | /* Power management (not Tx power) structures */ | 250 | /* Power management (not Tx power) structures */ |
251 | 251 | ||
252 | struct iwl3945_power_vec_entry { | 252 | struct iwl3945_power_vec_entry { |
253 | struct iwl3945_powertable_cmd cmd; | 253 | struct iwl_powertable_cmd cmd; |
254 | u8 no_dtim; | 254 | u8 no_dtim; |
255 | }; | 255 | }; |
256 | #define IWL_POWER_RANGE_0 (0) | 256 | #define IWL_POWER_RANGE_0 (0) |
@@ -289,12 +289,6 @@ struct iwl3945_frame { | |||
289 | struct list_head list; | 289 | struct list_head list; |
290 | }; | 290 | }; |
291 | 291 | ||
292 | #define SEQ_TO_QUEUE(x) ((x >> 8) & 0xbf) | ||
293 | #define QUEUE_TO_SEQ(x) ((x & 0xbf) << 8) | ||
294 | #define SEQ_TO_INDEX(x) ((u8)(x & 0xff)) | ||
295 | #define INDEX_TO_SEQ(x) ((u8)(x & 0xff)) | ||
296 | #define SEQ_HUGE_FRAME (0x4000) | ||
297 | #define SEQ_RX_FRAME __constant_cpu_to_le16(0x8000) | ||
298 | #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) | 292 | #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) |
299 | #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) | 293 | #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) |
300 | #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) | 294 | #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) |
@@ -344,7 +338,7 @@ struct iwl3945_cmd { | |||
344 | u32 val32; | 338 | u32 val32; |
345 | struct iwl3945_bt_cmd bt; | 339 | struct iwl3945_bt_cmd bt; |
346 | struct iwl3945_rxon_time_cmd rxon_time; | 340 | struct iwl3945_rxon_time_cmd rxon_time; |
347 | struct iwl3945_powertable_cmd powertable; | 341 | struct iwl_powertable_cmd powertable; |
348 | struct iwl3945_qosparam_cmd qosparam; | 342 | struct iwl3945_qosparam_cmd qosparam; |
349 | struct iwl3945_tx_cmd tx; | 343 | struct iwl3945_tx_cmd tx; |
350 | struct iwl3945_tx_beacon_cmd tx_beacon; | 344 | struct iwl3945_tx_beacon_cmd tx_beacon; |
@@ -707,7 +701,7 @@ struct iwl3945_priv { | |||
707 | 701 | ||
708 | #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT | 702 | #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT |
709 | /* spectrum measurement report caching */ | 703 | /* spectrum measurement report caching */ |
710 | struct iwl3945_spectrum_notification measure_report; | 704 | struct iwl_spectrum_notification measure_report; |
711 | u8 measurement_status; | 705 | u8 measurement_status; |
712 | #endif | 706 | #endif |
713 | /* ucode beacon time */ | 707 | /* ucode beacon time */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index ba997204c8d4..20ab7fb75c3c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -300,11 +300,12 @@ struct iwl_cmd_header { | |||
300 | * 5350 has 3 transmitters | 300 | * 5350 has 3 transmitters |
301 | * bit14:16 | 301 | * bit14:16 |
302 | */ | 302 | */ |
303 | #define RATE_MCS_ANT_POS 14 | 303 | #define RATE_MCS_ANT_POS 14 |
304 | #define RATE_MCS_ANT_A_MSK 0x04000 | 304 | #define RATE_MCS_ANT_A_MSK 0x04000 |
305 | #define RATE_MCS_ANT_B_MSK 0x08000 | 305 | #define RATE_MCS_ANT_B_MSK 0x08000 |
306 | #define RATE_MCS_ANT_C_MSK 0x10000 | 306 | #define RATE_MCS_ANT_C_MSK 0x10000 |
307 | #define RATE_MCS_ANT_ABC_MSK 0x1C000 | 307 | #define RATE_MCS_ANT_AB_MSK (RATE_MCS_ANT_A_MSK | RATE_MCS_ANT_B_MSK) |
308 | #define RATE_MCS_ANT_ABC_MSK (RATE_MCS_ANT_AB_MSK | RATE_MCS_ANT_C_MSK) | ||
308 | #define RATE_ANT_NUM 3 | 309 | #define RATE_ANT_NUM 3 |
309 | 310 | ||
310 | #define POWER_TABLE_NUM_ENTRIES 33 | 311 | #define POWER_TABLE_NUM_ENTRIES 33 |
@@ -2044,15 +2045,23 @@ struct iwl_spectrum_notification { | |||
2044 | */ | 2045 | */ |
2045 | #define IWL_POWER_VEC_SIZE 5 | 2046 | #define IWL_POWER_VEC_SIZE 5 |
2046 | 2047 | ||
2047 | #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK cpu_to_le16(1 << 0) | 2048 | #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK cpu_to_le16(BIT(0)) |
2048 | #define IWL_POWER_SLEEP_OVER_DTIM_MSK cpu_to_le16(1 << 2) | 2049 | #define IWL_POWER_SLEEP_OVER_DTIM_MSK cpu_to_le16(BIT(2)) |
2049 | #define IWL_POWER_PCI_PM_MSK cpu_to_le16(1 << 3) | 2050 | #define IWL_POWER_PCI_PM_MSK cpu_to_le16(BIT(3)) |
2050 | #define IWL_POWER_FAST_PD cpu_to_le16(1 << 4) | 2051 | #define IWL_POWER_FAST_PD cpu_to_le16(BIT(4)) |
2052 | |||
2053 | struct iwl3945_powertable_cmd { | ||
2054 | __le16 flags; | ||
2055 | u8 reserved[2]; | ||
2056 | __le32 rx_data_timeout; | ||
2057 | __le32 tx_data_timeout; | ||
2058 | __le32 sleep_interval[IWL_POWER_VEC_SIZE]; | ||
2059 | } __attribute__ ((packed)); | ||
2051 | 2060 | ||
2052 | struct iwl_powertable_cmd { | 2061 | struct iwl_powertable_cmd { |
2053 | __le16 flags; | 2062 | __le16 flags; |
2054 | u8 keep_alive_seconds; | 2063 | u8 keep_alive_seconds; /* 3945 reserved */ |
2055 | u8 debug_flags; | 2064 | u8 debug_flags; /* 3945 reserved */ |
2056 | __le32 rx_data_timeout; | 2065 | __le32 rx_data_timeout; |
2057 | __le32 tx_data_timeout; | 2066 | __le32 tx_data_timeout; |
2058 | __le32 sleep_interval[IWL_POWER_VEC_SIZE]; | 2067 | __le32 sleep_interval[IWL_POWER_VEC_SIZE]; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index d5fb65e54343..13a0b9a3ec7d 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <asm/div64.h> | 47 | #include <asm/div64.h> |
48 | 48 | ||
49 | #include "iwl-3945-core.h" | 49 | #include "iwl-3945-core.h" |
50 | #include "iwl-commands.h" | ||
50 | #include "iwl-3945-commands.h" | 51 | #include "iwl-3945-commands.h" |
51 | #include "iwl-3945.h" | 52 | #include "iwl-3945.h" |
52 | #include "iwl-3945-fh.h" | 53 | #include "iwl-3945-fh.h" |
@@ -634,7 +635,7 @@ static int iwl3945_enqueue_hcmd(struct iwl3945_priv *priv, struct iwl3945_host_c | |||
634 | out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(IWL_CMD_QUEUE_NUM) | | 635 | out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(IWL_CMD_QUEUE_NUM) | |
635 | INDEX_TO_SEQ(q->write_ptr)); | 636 | INDEX_TO_SEQ(q->write_ptr)); |
636 | if (out_cmd->meta.flags & CMD_SIZE_HUGE) | 637 | if (out_cmd->meta.flags & CMD_SIZE_HUGE) |
637 | out_cmd->hdr.sequence |= cpu_to_le16(SEQ_HUGE_FRAME); | 638 | out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; |
638 | 639 | ||
639 | phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx + | 640 | phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx + |
640 | offsetof(struct iwl3945_cmd, hdr); | 641 | offsetof(struct iwl3945_cmd, hdr); |
@@ -1804,8 +1805,9 @@ static void iwl3945_activate_qos(struct iwl3945_priv *priv, u8 force) | |||
1804 | */ | 1805 | */ |
1805 | #define MSEC_TO_USEC 1024 | 1806 | #define MSEC_TO_USEC 1024 |
1806 | 1807 | ||
1807 | #define NOSLP __constant_cpu_to_le32(0) | 1808 | |
1808 | #define SLP IWL_POWER_DRIVER_ALLOW_SLEEP_MSK | 1809 | #define NOSLP __constant_cpu_to_le16(0), 0, 0 |
1810 | #define SLP IWL_POWER_DRIVER_ALLOW_SLEEP_MSK, 0, 0 | ||
1809 | #define SLP_TIMEOUT(T) __constant_cpu_to_le32((T) * MSEC_TO_USEC) | 1811 | #define SLP_TIMEOUT(T) __constant_cpu_to_le32((T) * MSEC_TO_USEC) |
1810 | #define SLP_VEC(X0, X1, X2, X3, X4) {__constant_cpu_to_le32(X0), \ | 1812 | #define SLP_VEC(X0, X1, X2, X3, X4) {__constant_cpu_to_le32(X0), \ |
1811 | __constant_cpu_to_le32(X1), \ | 1813 | __constant_cpu_to_le32(X1), \ |
@@ -1813,7 +1815,6 @@ static void iwl3945_activate_qos(struct iwl3945_priv *priv, u8 force) | |||
1813 | __constant_cpu_to_le32(X3), \ | 1815 | __constant_cpu_to_le32(X3), \ |
1814 | __constant_cpu_to_le32(X4)} | 1816 | __constant_cpu_to_le32(X4)} |
1815 | 1817 | ||
1816 | |||
1817 | /* default power management (not Tx power) table values */ | 1818 | /* default power management (not Tx power) table values */ |
1818 | /* for TIM 0-10 */ | 1819 | /* for TIM 0-10 */ |
1819 | static struct iwl3945_power_vec_entry range_0[IWL_POWER_AC] = { | 1820 | static struct iwl3945_power_vec_entry range_0[IWL_POWER_AC] = { |
@@ -1862,7 +1863,7 @@ int iwl3945_power_init_handle(struct iwl3945_priv *priv) | |||
1862 | if (rc != 0) | 1863 | if (rc != 0) |
1863 | return 0; | 1864 | return 0; |
1864 | else { | 1865 | else { |
1865 | struct iwl3945_powertable_cmd *cmd; | 1866 | struct iwl_powertable_cmd *cmd; |
1866 | 1867 | ||
1867 | IWL_DEBUG_POWER("adjust power command flags\n"); | 1868 | IWL_DEBUG_POWER("adjust power command flags\n"); |
1868 | 1869 | ||
@@ -1879,7 +1880,7 @@ int iwl3945_power_init_handle(struct iwl3945_priv *priv) | |||
1879 | } | 1880 | } |
1880 | 1881 | ||
1881 | static int iwl3945_update_power_cmd(struct iwl3945_priv *priv, | 1882 | static int iwl3945_update_power_cmd(struct iwl3945_priv *priv, |
1882 | struct iwl3945_powertable_cmd *cmd, u32 mode) | 1883 | struct iwl_powertable_cmd *cmd, u32 mode) |
1883 | { | 1884 | { |
1884 | int rc = 0, i; | 1885 | int rc = 0, i; |
1885 | u8 skip; | 1886 | u8 skip; |
@@ -1946,7 +1947,7 @@ static int iwl3945_send_power_mode(struct iwl3945_priv *priv, u32 mode) | |||
1946 | { | 1947 | { |
1947 | u32 uninitialized_var(final_mode); | 1948 | u32 uninitialized_var(final_mode); |
1948 | int rc; | 1949 | int rc; |
1949 | struct iwl3945_powertable_cmd cmd; | 1950 | struct iwl_powertable_cmd cmd; |
1950 | 1951 | ||
1951 | /* If on battery, set to 3, | 1952 | /* If on battery, set to 3, |
1952 | * if plugged into AC power, set to CAM ("continuously aware mode"), | 1953 | * if plugged into AC power, set to CAM ("continuously aware mode"), |
@@ -1965,7 +1966,9 @@ static int iwl3945_send_power_mode(struct iwl3945_priv *priv, u32 mode) | |||
1965 | 1966 | ||
1966 | iwl3945_update_power_cmd(priv, &cmd, final_mode); | 1967 | iwl3945_update_power_cmd(priv, &cmd, final_mode); |
1967 | 1968 | ||
1968 | rc = iwl3945_send_cmd_pdu(priv, POWER_TABLE_CMD, sizeof(cmd), &cmd); | 1969 | /* FIXME use get_hcmd_size 3945 command is 4 bytes shorter */ |
1970 | rc = iwl3945_send_cmd_pdu(priv, POWER_TABLE_CMD, | ||
1971 | sizeof(struct iwl3945_powertable_cmd), &cmd); | ||
1969 | 1972 | ||
1970 | if (final_mode == IWL_POWER_MODE_CAM) | 1973 | if (final_mode == IWL_POWER_MODE_CAM) |
1971 | clear_bit(STATUS_POWER_PMI, &priv->status); | 1974 | clear_bit(STATUS_POWER_PMI, &priv->status); |
@@ -2867,7 +2870,7 @@ static int iwl3945_get_measurement(struct iwl3945_priv *priv, | |||
2867 | struct ieee80211_measurement_params *params, | 2870 | struct ieee80211_measurement_params *params, |
2868 | u8 type) | 2871 | u8 type) |
2869 | { | 2872 | { |
2870 | struct iwl3945_spectrum_cmd spectrum; | 2873 | struct iwl_spectrum_cmd spectrum; |
2871 | struct iwl3945_rx_packet *res; | 2874 | struct iwl3945_rx_packet *res; |
2872 | struct iwl3945_host_cmd cmd = { | 2875 | struct iwl3945_host_cmd cmd = { |
2873 | .id = REPLY_SPECTRUM_MEASUREMENT_CMD, | 2876 | .id = REPLY_SPECTRUM_MEASUREMENT_CMD, |
@@ -3008,7 +3011,7 @@ static void iwl3945_rx_csa(struct iwl3945_priv *priv, struct iwl3945_rx_mem_buff | |||
3008 | { | 3011 | { |
3009 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; | 3012 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; |
3010 | struct iwl3945_rxon_cmd *rxon = (void *)&priv->active_rxon; | 3013 | struct iwl3945_rxon_cmd *rxon = (void *)&priv->active_rxon; |
3011 | struct iwl3945_csa_notification *csa = &(pkt->u.csa_notif); | 3014 | struct iwl_csa_notification *csa = &(pkt->u.csa_notif); |
3012 | IWL_DEBUG_11H("CSA notif: channel %d, status %d\n", | 3015 | IWL_DEBUG_11H("CSA notif: channel %d, status %d\n", |
3013 | le16_to_cpu(csa->channel), le32_to_cpu(csa->status)); | 3016 | le16_to_cpu(csa->channel), le32_to_cpu(csa->status)); |
3014 | rxon->channel = csa->channel; | 3017 | rxon->channel = csa->channel; |
@@ -3020,7 +3023,7 @@ static void iwl3945_rx_spectrum_measure_notif(struct iwl3945_priv *priv, | |||
3020 | { | 3023 | { |
3021 | #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT | 3024 | #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT |
3022 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; | 3025 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; |
3023 | struct iwl3945_spectrum_notification *report = &(pkt->u.spectrum_notif); | 3026 | struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif); |
3024 | 3027 | ||
3025 | if (!report->state) { | 3028 | if (!report->state) { |
3026 | IWL_DEBUG(IWL_DL_11H | IWL_DL_INFO, | 3029 | IWL_DEBUG(IWL_DL_11H | IWL_DL_INFO, |
@@ -3038,7 +3041,7 @@ static void iwl3945_rx_pm_sleep_notif(struct iwl3945_priv *priv, | |||
3038 | { | 3041 | { |
3039 | #ifdef CONFIG_IWL3945_DEBUG | 3042 | #ifdef CONFIG_IWL3945_DEBUG |
3040 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; | 3043 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; |
3041 | struct iwl3945_sleep_notification *sleep = &(pkt->u.sleep_notif); | 3044 | struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif); |
3042 | IWL_DEBUG_RX("sleep mode: %d, src: %d\n", | 3045 | IWL_DEBUG_RX("sleep mode: %d, src: %d\n", |
3043 | sleep->pm_sleep_mode, sleep->pm_wakeup_src); | 3046 | sleep->pm_sleep_mode, sleep->pm_wakeup_src); |
3044 | #endif | 3047 | #endif |
@@ -3345,7 +3348,7 @@ static void iwl3945_tx_cmd_complete(struct iwl3945_priv *priv, | |||
3345 | u16 sequence = le16_to_cpu(pkt->hdr.sequence); | 3348 | u16 sequence = le16_to_cpu(pkt->hdr.sequence); |
3346 | int txq_id = SEQ_TO_QUEUE(sequence); | 3349 | int txq_id = SEQ_TO_QUEUE(sequence); |
3347 | int index = SEQ_TO_INDEX(sequence); | 3350 | int index = SEQ_TO_INDEX(sequence); |
3348 | int huge = sequence & SEQ_HUGE_FRAME; | 3351 | int huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME); |
3349 | int cmd_index; | 3352 | int cmd_index; |
3350 | struct iwl3945_cmd *cmd; | 3353 | struct iwl3945_cmd *cmd; |
3351 | 3354 | ||
@@ -7407,7 +7410,7 @@ static ssize_t show_measurement(struct device *d, | |||
7407 | struct device_attribute *attr, char *buf) | 7410 | struct device_attribute *attr, char *buf) |
7408 | { | 7411 | { |
7409 | struct iwl3945_priv *priv = dev_get_drvdata(d); | 7412 | struct iwl3945_priv *priv = dev_get_drvdata(d); |
7410 | struct iwl3945_spectrum_notification measure_report; | 7413 | struct iwl_spectrum_notification measure_report; |
7411 | u32 size = sizeof(measure_report), len = 0, ofs = 0; | 7414 | u32 size = sizeof(measure_report), len = 0, ofs = 0; |
7412 | u8 *data = (u8 *)&measure_report; | 7415 | u8 *data = (u8 *)&measure_report; |
7413 | unsigned long flags; | 7416 | unsigned long flags; |