aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-commands.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h243
1 files changed, 228 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index d16a853f376a..fb6f5ffb9f1d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -93,6 +93,11 @@ enum {
93 REPLY_LEDS_CMD = 0x48, 93 REPLY_LEDS_CMD = 0x48,
94 REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* 4965 only */ 94 REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* 4965 only */
95 95
96 /* WiMAX coexistence */
97 COEX_PRIORITY_TABLE_CMD = 0x5a, /*5000 only */
98 COEX_MEDIUM_NOTIFICATION = 0x5b,
99 COEX_EVENT_CMD = 0x5c,
100
96 /* 802.11h related */ 101 /* 802.11h related */
97 RADAR_NOTIFICATION = 0x70, /* not used */ 102 RADAR_NOTIFICATION = 0x70, /* not used */
98 REPLY_QUIET_CMD = 0x71, /* not used */ 103 REPLY_QUIET_CMD = 0x71, /* not used */
@@ -368,7 +373,7 @@ struct iwl4965_tx_power_db {
368 * 3) Tx gain compensation to balance 4965's 2 Tx chains for MIMO operation, 373 * 3) Tx gain compensation to balance 4965's 2 Tx chains for MIMO operation,
369 * for each of 5 frequency ranges. 374 * for each of 5 frequency ranges.
370 */ 375 */
371struct iwl4965_init_alive_resp { 376struct iwl_init_alive_resp {
372 u8 ucode_minor; 377 u8 ucode_minor;
373 u8 ucode_major; 378 u8 ucode_major;
374 __le16 reserved1; 379 __le16 reserved1;
@@ -444,7 +449,7 @@ struct iwl4965_init_alive_resp {
444 * The Linux driver can print both logs to the system log when a uCode error 449 * The Linux driver can print both logs to the system log when a uCode error
445 * occurs. 450 * occurs.
446 */ 451 */
447struct iwl4965_alive_resp { 452struct iwl_alive_resp {
448 u8 ucode_minor; 453 u8 ucode_minor;
449 u8 ucode_major; 454 u8 ucode_major;
450 __le16 reserved1; 455 __le16 reserved1;
@@ -468,7 +473,7 @@ union tsf {
468/* 473/*
469 * REPLY_ERROR = 0x2 (response only, not a command) 474 * REPLY_ERROR = 0x2 (response only, not a command)
470 */ 475 */
471struct iwl4965_error_resp { 476struct iwl_error_resp {
472 __le32 error_type; 477 __le32 error_type;
473 u8 cmd_id; 478 u8 cmd_id;
474 u8 reserved1; 479 u8 reserved1;
@@ -600,6 +605,46 @@ struct iwl4965_rxon_cmd {
600 u8 ofdm_ht_dual_stream_basic_rates; 605 u8 ofdm_ht_dual_stream_basic_rates;
601} __attribute__ ((packed)); 606} __attribute__ ((packed));
602 607
608/* 5000 HW just extend this cmmand */
609struct iwl_rxon_cmd {
610 u8 node_addr[6];
611 __le16 reserved1;
612 u8 bssid_addr[6];
613 __le16 reserved2;
614 u8 wlap_bssid_addr[6];
615 __le16 reserved3;
616 u8 dev_type;
617 u8 air_propagation;
618 __le16 rx_chain;
619 u8 ofdm_basic_rates;
620 u8 cck_basic_rates;
621 __le16 assoc_id;
622 __le32 flags;
623 __le32 filter_flags;
624 __le16 channel;
625 u8 ofdm_ht_single_stream_basic_rates;
626 u8 ofdm_ht_dual_stream_basic_rates;
627 u8 ofdm_ht_triple_stream_basic_rates;
628 u8 reserved5;
629 __le16 acquisition_data;
630 __le16 reserved6;
631} __attribute__ ((packed));
632
633struct iwl5000_rxon_assoc_cmd {
634 __le32 flags;
635 __le32 filter_flags;
636 u8 ofdm_basic_rates;
637 u8 cck_basic_rates;
638 __le16 reserved1;
639 u8 ofdm_ht_single_stream_basic_rates;
640 u8 ofdm_ht_dual_stream_basic_rates;
641 u8 ofdm_ht_triple_stream_basic_rates;
642 u8 reserved2;
643 __le16 rx_chain_select_flags;
644 __le16 acquisition_data;
645 __le32 reserved3;
646} __attribute__ ((packed));
647
603/* 648/*
604 * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) 649 * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
605 */ 650 */
@@ -614,6 +659,9 @@ struct iwl4965_rxon_assoc_cmd {
614 __le16 reserved; 659 __le16 reserved;
615} __attribute__ ((packed)); 660} __attribute__ ((packed));
616 661
662
663
664
617/* 665/*
618 * REPLY_RXON_TIMING = 0x14 (command, has simple generic response) 666 * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
619 */ 667 */
@@ -897,10 +945,28 @@ struct iwl_addsta_cmd {
897/* 945/*
898 * REPLY_ADD_STA = 0x18 (response) 946 * REPLY_ADD_STA = 0x18 (response)
899 */ 947 */
900struct iwl4965_add_sta_resp { 948struct iwl_add_sta_resp {
901 u8 status; /* ADD_STA_* */ 949 u8 status; /* ADD_STA_* */
902} __attribute__ ((packed)); 950} __attribute__ ((packed));
903 951
952#define REM_STA_SUCCESS_MSK 0x1
953/*
954 * REPLY_REM_STA = 0x19 (response)
955 */
956struct iwl_rem_sta_resp {
957 u8 status;
958} __attribute__ ((packed));
959
960/*
961 * REPLY_REM_STA = 0x19 (command)
962 */
963struct iwl_rem_sta_cmd {
964 u8 num_sta; /* number of removed stations */
965 u8 reserved[3];
966 u8 addr[ETH_ALEN]; /* MAC addr of the first station */
967 u8 reserved2[2];
968} __attribute__ ((packed));
969
904/* 970/*
905 * REPLY_WEP_KEY = 0x20 971 * REPLY_WEP_KEY = 0x20
906 */ 972 */
@@ -1170,7 +1236,7 @@ struct iwl4965_dram_scratch {
1170/* 1236/*
1171 * REPLY_TX = 0x1c (command) 1237 * REPLY_TX = 0x1c (command)
1172 */ 1238 */
1173struct iwl4965_tx_cmd { 1239struct iwl_tx_cmd {
1174 /* 1240 /*
1175 * MPDU byte count: 1241 * MPDU byte count:
1176 * MAC header (24/26/30/32 bytes) + 2 bytes pad if 26/30 header size, 1242 * MAC header (24/26/30/32 bytes) + 2 bytes pad if 26/30 header size,
@@ -1316,6 +1382,15 @@ enum {
1316 TX_ABORT_REQUIRED_MSK = 0x80000000, /* bits 31:31 */ 1382 TX_ABORT_REQUIRED_MSK = 0x80000000, /* bits 31:31 */
1317}; 1383};
1318 1384
1385static inline int iwl_is_tx_success(u32 status)
1386{
1387 status &= TX_STATUS_MSK;
1388 return (status == TX_STATUS_SUCCESS)
1389 || (status == TX_STATUS_DIRECT_DONE);
1390}
1391
1392
1393
1319/* ******************************* 1394/* *******************************
1320 * TX aggregation status 1395 * TX aggregation status
1321 ******************************* */ 1396 ******************************* */
@@ -1370,6 +1445,11 @@ enum {
1370 * within the sending station (this 4965), rather than whether it was 1445 * within the sending station (this 4965), rather than whether it was
1371 * received successfully by the destination station. 1446 * received successfully by the destination station.
1372 */ 1447 */
1448struct agg_tx_status {
1449 __le16 status;
1450 __le16 sequence;
1451} __attribute__ ((packed));
1452
1373struct iwl4965_tx_resp { 1453struct iwl4965_tx_resp {
1374 u8 frame_count; /* 1 no aggregation, >1 aggregation */ 1454 u8 frame_count; /* 1 no aggregation, >1 aggregation */
1375 u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */ 1455 u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */
@@ -1404,11 +1484,6 @@ struct iwl4965_tx_resp {
1404 __le32 status; /* TX status (for aggregation status of 1st frame) */ 1484 __le32 status; /* TX status (for aggregation status of 1st frame) */
1405} __attribute__ ((packed)); 1485} __attribute__ ((packed));
1406 1486
1407struct agg_tx_status {
1408 __le16 status;
1409 __le16 sequence;
1410} __attribute__ ((packed));
1411
1412struct iwl4965_tx_resp_agg { 1487struct iwl4965_tx_resp_agg {
1413 u8 frame_count; /* 1 no aggregation, >1 aggregation */ 1488 u8 frame_count; /* 1 no aggregation, >1 aggregation */
1414 u8 reserved1; 1489 u8 reserved1;
@@ -1423,6 +1498,44 @@ struct iwl4965_tx_resp_agg {
1423 /* of 1st frame) */ 1498 /* of 1st frame) */
1424} __attribute__ ((packed)); 1499} __attribute__ ((packed));
1425 1500
1501struct iwl5000_tx_resp {
1502 u8 frame_count; /* 1 no aggregation, >1 aggregation */
1503 u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */
1504 u8 failure_rts; /* # failures due to unsuccessful RTS */
1505 u8 failure_frame; /* # failures due to no ACK (unused for agg) */
1506
1507 /* For non-agg: Rate at which frame was successful.
1508 * For agg: Rate at which all frames were transmitted. */
1509 __le32 rate_n_flags; /* RATE_MCS_* */
1510
1511 /* For non-agg: RTS + CTS + frame tx attempts time + ACK.
1512 * For agg: RTS + CTS + aggregation tx time + block-ack time. */
1513 __le16 wireless_media_time; /* uSecs */
1514
1515 __le16 reserved;
1516 __le32 pa_power1; /* RF power amplifier measurement (not used) */
1517 __le32 pa_power2;
1518
1519 __le32 tfd_info;
1520 __le16 seq_ctl;
1521 __le16 byte_cnt;
1522 __le32 tlc_info;
1523 /*
1524 * For non-agg: frame status TX_STATUS_*
1525 * For agg: status of 1st frame, AGG_TX_STATE_*; other frame status
1526 * fields follow this one, up to frame_count.
1527 * Bit fields:
1528 * 11- 0: AGG_TX_STATE_* status code
1529 * 15-12: Retry count for 1st frame in aggregation (retries
1530 * occur if tx failed for this frame when it was a
1531 * member of a previous aggregation block). If rate
1532 * scaling is used, retry count indicates the rate
1533 * table entry used for all frames in the new agg.
1534 * 31-16: Sequence # for this frame's Tx cmd (not SSN!)
1535 */
1536 struct agg_tx_status status; /* TX status (in aggregation -
1537 * status of 1st frame) */
1538} __attribute__ ((packed));
1426/* 1539/*
1427 * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command) 1540 * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
1428 * 1541 *
@@ -2109,7 +2222,7 @@ struct iwl4965_scan_cmd {
2109 2222
2110 /* For active scans (set to all-0s for passive scans). 2223 /* For active scans (set to all-0s for passive scans).
2111 * Does not include payload. Must specify Tx rate; no rate scaling. */ 2224 * Does not include payload. Must specify Tx rate; no rate scaling. */
2112 struct iwl4965_tx_cmd tx_cmd; 2225 struct iwl_tx_cmd tx_cmd;
2113 2226
2114 /* For directed active scans (set to all-0s otherwise) */ 2227 /* For directed active scans (set to all-0s otherwise) */
2115 struct iwl4965_ssid_ie direct_scan[PROBE_OPTION_MAX]; 2228 struct iwl4965_ssid_ie direct_scan[PROBE_OPTION_MAX];
@@ -2206,7 +2319,7 @@ struct iwl4965_beacon_notif {
2206 * REPLY_TX_BEACON = 0x91 (command, has simple generic response) 2319 * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
2207 */ 2320 */
2208struct iwl4965_tx_beacon_cmd { 2321struct iwl4965_tx_beacon_cmd {
2209 struct iwl4965_tx_cmd tx; 2322 struct iwl_tx_cmd tx;
2210 __le16 tim_idx; 2323 __le16 tim_idx;
2211 u8 tim_size; 2324 u8 tim_size;
2212 u8 reserved1; 2325 u8 reserved1;
@@ -2729,10 +2842,59 @@ enum {
2729 IWL5000_PHY_CALIBRATE_AGC_TABLE_CMD = 14, 2842 IWL5000_PHY_CALIBRATE_AGC_TABLE_CMD = 14,
2730 IWL5000_PHY_CALIBRATE_CRYSTAL_FRQ_CMD = 15, 2843 IWL5000_PHY_CALIBRATE_CRYSTAL_FRQ_CMD = 15,
2731 IWL5000_PHY_CALIBRATE_BASE_BAND_CMD = 16, 2844 IWL5000_PHY_CALIBRATE_BASE_BAND_CMD = 16,
2845 IWL5000_PHY_CALIBRATE_TX_IQ_PERD_CMD = 17,
2732 IWL5000_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD = 18, 2846 IWL5000_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD = 18,
2733 IWL5000_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD = 19, 2847 IWL5000_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD = 19,
2734}; 2848};
2735 2849
2850enum {
2851 CALIBRATION_CFG_CMD = 0x65,
2852 CALIBRATION_RES_NOTIFICATION = 0x66,
2853 CALIBRATION_COMPLETE_NOTIFICATION = 0x67
2854};
2855
2856struct iwl_cal_crystal_freq_cmd {
2857 u8 cap_pin1;
2858 u8 cap_pin2;
2859} __attribute__ ((packed));
2860
2861struct iwl5000_calibration {
2862 u8 op_code;
2863 u8 first_group;
2864 u8 num_groups;
2865 u8 all_data_valid;
2866 struct iwl_cal_crystal_freq_cmd data;
2867} __attribute__ ((packed));
2868
2869#define IWL_CALIB_INIT_CFG_ALL __constant_cpu_to_le32(0xffffffff)
2870
2871struct iwl_calib_cfg_elmnt_s {
2872 __le32 is_enable;
2873 __le32 start;
2874 __le32 send_res;
2875 __le32 apply_res;
2876 __le32 reserved;
2877} __attribute__ ((packed));
2878
2879struct iwl_calib_cfg_status_s {
2880 struct iwl_calib_cfg_elmnt_s once;
2881 struct iwl_calib_cfg_elmnt_s perd;
2882 __le32 flags;
2883} __attribute__ ((packed));
2884
2885struct iwl5000_calib_cfg_cmd {
2886 struct iwl_calib_cfg_status_s ucd_calib_cfg;
2887 struct iwl_calib_cfg_status_s drv_calib_cfg;
2888 __le32 reserved1;
2889} __attribute__ ((packed));
2890
2891struct iwl5000_calib_hdr {
2892 u8 op_code;
2893 u8 first_group;
2894 u8 groups_num;
2895 u8 data_valid;
2896} __attribute__ ((packed));
2897
2736struct iwl5000_calibration_chain_noise_reset_cmd { 2898struct iwl5000_calibration_chain_noise_reset_cmd {
2737 u8 op_code; /* IWL5000_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */ 2899 u8 op_code; /* IWL5000_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */
2738 u8 flags; /* not used */ 2900 u8 flags; /* not used */
@@ -2771,6 +2933,55 @@ struct iwl4965_led_cmd {
2771 u8 reserved; 2933 u8 reserved;
2772} __attribute__ ((packed)); 2934} __attribute__ ((packed));
2773 2935
2936/*
2937 * Coexistence WIFI/WIMAX Command
2938 * COEX_PRIORITY_TABLE_CMD = 0x5a
2939 *
2940 */
2941enum {
2942 COEX_UNASSOC_IDLE = 0,
2943 COEX_UNASSOC_MANUAL_SCAN = 1,
2944 COEX_UNASSOC_AUTO_SCAN = 2,
2945 COEX_CALIBRATION = 3,
2946 COEX_PERIODIC_CALIBRATION = 4,
2947 COEX_CONNECTION_ESTAB = 5,
2948 COEX_ASSOCIATED_IDLE = 6,
2949 COEX_ASSOC_MANUAL_SCAN = 7,
2950 COEX_ASSOC_AUTO_SCAN = 8,
2951 COEX_ASSOC_ACTIVE_LEVEL = 9,
2952 COEX_RF_ON = 10,
2953 COEX_RF_OFF = 11,
2954 COEX_STAND_ALONE_DEBUG = 12,
2955 COEX_IPAN_ASSOC_LEVEL = 13,
2956 COEX_RSRVD1 = 14,
2957 COEX_RSRVD2 = 15,
2958 COEX_NUM_OF_EVENTS = 16
2959};
2960
2961struct iwl_wimax_coex_event_entry {
2962 u8 request_prio;
2963 u8 win_medium_prio;
2964 u8 reserved;
2965 u8 flags;
2966} __attribute__ ((packed));
2967
2968/* COEX flag masks */
2969
2970/* Staion table is valid */
2971#define COEX_FLAGS_STA_TABLE_VALID_MSK (0x1)
2972/* UnMask wakeup src at unassociated sleep */
2973#define COEX_FLAGS_UNASSOC_WA_UNMASK_MSK (0x4)
2974/* UnMask wakeup src at associated sleep */
2975#define COEX_FLAGS_ASSOC_WA_UNMASK_MSK (0x8)
2976/* Enable CoEx feature. */
2977#define COEX_FLAGS_COEX_ENABLE_MSK (0x80)
2978
2979struct iwl_wimax_coex_cmd {
2980 u8 flags;
2981 u8 reserved[3];
2982 struct iwl_wimax_coex_event_entry sta_prio[COEX_NUM_OF_EVENTS];
2983} __attribute__ ((packed));
2984
2774/****************************************************************************** 2985/******************************************************************************
2775 * (13) 2986 * (13)
2776 * Union of all expected notifications/responses: 2987 * Union of all expected notifications/responses:
@@ -2781,20 +2992,22 @@ struct iwl_rx_packet {
2781 __le32 len; 2992 __le32 len;
2782 struct iwl_cmd_header hdr; 2993 struct iwl_cmd_header hdr;
2783 union { 2994 union {
2784 struct iwl4965_alive_resp alive_frame; 2995 struct iwl_alive_resp alive_frame;
2785 struct iwl4965_rx_frame rx_frame; 2996 struct iwl4965_rx_frame rx_frame;
2786 struct iwl4965_tx_resp tx_resp; 2997 struct iwl4965_tx_resp tx_resp;
2787 struct iwl4965_spectrum_notification spectrum_notif; 2998 struct iwl4965_spectrum_notification spectrum_notif;
2788 struct iwl4965_csa_notification csa_notif; 2999 struct iwl4965_csa_notification csa_notif;
2789 struct iwl4965_error_resp err_resp; 3000 struct iwl_error_resp err_resp;
2790 struct iwl4965_card_state_notif card_state_notif; 3001 struct iwl4965_card_state_notif card_state_notif;
2791 struct iwl4965_beacon_notif beacon_status; 3002 struct iwl4965_beacon_notif beacon_status;
2792 struct iwl4965_add_sta_resp add_sta; 3003 struct iwl_add_sta_resp add_sta;
3004 struct iwl_rem_sta_resp rem_sta;
2793 struct iwl4965_sleep_notification sleep_notif; 3005 struct iwl4965_sleep_notification sleep_notif;
2794 struct iwl4965_spectrum_resp spectrum; 3006 struct iwl4965_spectrum_resp spectrum;
2795 struct iwl4965_notif_statistics stats; 3007 struct iwl4965_notif_statistics stats;
2796 struct iwl4965_compressed_ba_resp compressed_ba; 3008 struct iwl4965_compressed_ba_resp compressed_ba;
2797 struct iwl4965_missed_beacon_notif missed_beacon; 3009 struct iwl4965_missed_beacon_notif missed_beacon;
3010 struct iwl5000_calibration calib;
2798 __le32 status; 3011 __le32 status;
2799 u8 raw[0]; 3012 u8 raw[0];
2800 } u; 3013 } u;