1
2
3
4 #ifndef _QTN_QLINK_H_
5 #define _QTN_QLINK_H_
6
7 #include <linux/ieee80211.h>
8
9 #define QLINK_PROTO_VER 15
10
11 #define QLINK_MACID_RSVD 0xFF
12 #define QLINK_VIFID_RSVD 0xFF
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 enum qlink_msg_type {
30 QLINK_MSG_TYPE_CMD = 1,
31 QLINK_MSG_TYPE_CMDRSP = 2,
32 QLINK_MSG_TYPE_EVENT = 3
33 };
34
35
36
37
38
39
40
41
42
43 struct qlink_msg_header {
44 __le16 type;
45 __le16 len;
46 } __packed;
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 enum qlink_hw_capab {
64 QLINK_HW_CAPAB_REG_UPDATE = BIT(0),
65 QLINK_HW_CAPAB_STA_INACT_TIMEOUT = BIT(1),
66 QLINK_HW_CAPAB_DFS_OFFLOAD = BIT(2),
67 QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR = BIT(3),
68 QLINK_HW_CAPAB_PWR_MGMT = BIT(4),
69 QLINK_HW_CAPAB_OBSS_SCAN = BIT(5),
70 QLINK_HW_CAPAB_SCAN_DWELL = BIT(6),
71 QLINK_HW_CAPAB_SAE = BIT(8),
72 };
73
74 enum qlink_iface_type {
75 QLINK_IFTYPE_AP = 1,
76 QLINK_IFTYPE_STATION = 2,
77 QLINK_IFTYPE_ADHOC = 3,
78 QLINK_IFTYPE_MONITOR = 4,
79 QLINK_IFTYPE_WDS = 5,
80 QLINK_IFTYPE_AP_VLAN = 6,
81 };
82
83
84
85
86
87
88
89
90
91
92 struct qlink_intf_info {
93 __le16 if_type;
94 __le16 vlanid;
95 u8 mac_addr[ETH_ALEN];
96 u8 use4addr;
97 u8 rsvd[1];
98 } __packed;
99
100 enum qlink_sta_flags {
101 QLINK_STA_FLAG_INVALID = 0,
102 QLINK_STA_FLAG_AUTHORIZED = BIT(0),
103 QLINK_STA_FLAG_SHORT_PREAMBLE = BIT(1),
104 QLINK_STA_FLAG_WME = BIT(2),
105 QLINK_STA_FLAG_MFP = BIT(3),
106 QLINK_STA_FLAG_AUTHENTICATED = BIT(4),
107 QLINK_STA_FLAG_TDLS_PEER = BIT(5),
108 QLINK_STA_FLAG_ASSOCIATED = BIT(6),
109 };
110
111 enum qlink_channel_width {
112 QLINK_CHAN_WIDTH_5 = 0,
113 QLINK_CHAN_WIDTH_10,
114 QLINK_CHAN_WIDTH_20_NOHT,
115 QLINK_CHAN_WIDTH_20,
116 QLINK_CHAN_WIDTH_40,
117 QLINK_CHAN_WIDTH_80,
118 QLINK_CHAN_WIDTH_80P80,
119 QLINK_CHAN_WIDTH_160,
120 };
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138 struct qlink_channel {
139 __le16 hw_value;
140 __le16 center_freq;
141 __le32 flags;
142 u8 band;
143 u8 max_antenna_gain;
144 u8 max_power;
145 u8 max_reg_power;
146 __le32 dfs_cac_ms;
147 u8 dfs_state;
148 u8 beacon_found;
149 u8 rsvd[2];
150 } __packed;
151
152
153
154
155
156
157
158
159
160 struct qlink_chandef {
161 struct qlink_channel chan;
162 __le16 center_freq1;
163 __le16 center_freq2;
164 u8 width;
165 u8 rsvd;
166 } __packed;
167
168 #define QLINK_MAX_NR_CIPHER_SUITES 5
169 #define QLINK_MAX_NR_AKM_SUITES 2
170
171 struct qlink_auth_encr {
172 __le32 wpa_versions;
173 __le32 cipher_group;
174 __le32 n_ciphers_pairwise;
175 __le32 ciphers_pairwise[QLINK_MAX_NR_CIPHER_SUITES];
176 __le32 n_akm_suites;
177 __le32 akm_suites[QLINK_MAX_NR_AKM_SUITES];
178 __le16 control_port_ethertype;
179 u8 auth_type;
180 u8 privacy;
181 u8 control_port;
182 u8 control_port_no_encrypt;
183 u8 rsvd[2];
184 } __packed;
185
186
187
188
189
190
191
192 struct qlink_sta_info_state {
193 __le32 mask;
194 __le32 value;
195 } __packed;
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221 enum qlink_cmd_type {
222 QLINK_CMD_FW_INIT = 0x0001,
223 QLINK_CMD_FW_DEINIT = 0x0002,
224 QLINK_CMD_REGISTER_MGMT = 0x0003,
225 QLINK_CMD_SEND_FRAME = 0x0004,
226 QLINK_CMD_MGMT_SET_APPIE = 0x0005,
227 QLINK_CMD_PHY_PARAMS_GET = 0x0011,
228 QLINK_CMD_PHY_PARAMS_SET = 0x0012,
229 QLINK_CMD_GET_HW_INFO = 0x0013,
230 QLINK_CMD_MAC_INFO = 0x0014,
231 QLINK_CMD_ADD_INTF = 0x0015,
232 QLINK_CMD_DEL_INTF = 0x0016,
233 QLINK_CMD_CHANGE_INTF = 0x0017,
234 QLINK_CMD_UPDOWN_INTF = 0x0018,
235 QLINK_CMD_REG_NOTIFY = 0x0019,
236 QLINK_CMD_BAND_INFO_GET = 0x001A,
237 QLINK_CMD_CHAN_SWITCH = 0x001B,
238 QLINK_CMD_CHAN_GET = 0x001C,
239 QLINK_CMD_START_CAC = 0x001D,
240 QLINK_CMD_START_AP = 0x0021,
241 QLINK_CMD_STOP_AP = 0x0022,
242 QLINK_CMD_SET_MAC_ACL = 0x0023,
243 QLINK_CMD_GET_STA_INFO = 0x0030,
244 QLINK_CMD_ADD_KEY = 0x0040,
245 QLINK_CMD_DEL_KEY = 0x0041,
246 QLINK_CMD_SET_DEFAULT_KEY = 0x0042,
247 QLINK_CMD_SET_DEFAULT_MGMT_KEY = 0x0043,
248 QLINK_CMD_CHANGE_STA = 0x0051,
249 QLINK_CMD_DEL_STA = 0x0052,
250 QLINK_CMD_SCAN = 0x0053,
251 QLINK_CMD_CHAN_STATS = 0x0054,
252 QLINK_CMD_CONNECT = 0x0060,
253 QLINK_CMD_DISCONNECT = 0x0061,
254 QLINK_CMD_PM_SET = 0x0062,
255 QLINK_CMD_WOWLAN_SET = 0x0063,
256 QLINK_CMD_EXTERNAL_AUTH = 0x0066,
257 };
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273 struct qlink_cmd {
274 struct qlink_msg_header mhdr;
275 __le16 cmd_id;
276 __le16 seq_num;
277 u8 rsvd[2];
278 u8 macid;
279 u8 vifid;
280 } __packed;
281
282
283
284
285
286
287
288
289
290 struct qlink_cmd_manage_intf {
291 struct qlink_cmd chdr;
292 struct qlink_intf_info intf_info;
293 } __packed;
294
295 enum qlink_mgmt_frame_type {
296 QLINK_MGMT_FRAME_ASSOC_REQ = 0x00,
297 QLINK_MGMT_FRAME_ASSOC_RESP = 0x01,
298 QLINK_MGMT_FRAME_REASSOC_REQ = 0x02,
299 QLINK_MGMT_FRAME_REASSOC_RESP = 0x03,
300 QLINK_MGMT_FRAME_PROBE_REQ = 0x04,
301 QLINK_MGMT_FRAME_PROBE_RESP = 0x05,
302 QLINK_MGMT_FRAME_BEACON = 0x06,
303 QLINK_MGMT_FRAME_ATIM = 0x07,
304 QLINK_MGMT_FRAME_DISASSOC = 0x08,
305 QLINK_MGMT_FRAME_AUTH = 0x09,
306 QLINK_MGMT_FRAME_DEAUTH = 0x0A,
307 QLINK_MGMT_FRAME_ACTION = 0x0B,
308
309 QLINK_MGMT_FRAME_TYPE_COUNT
310 };
311
312
313
314
315
316
317
318
319
320 struct qlink_cmd_mgmt_frame_register {
321 struct qlink_cmd chdr;
322 __le16 frame_type;
323 u8 do_register;
324 } __packed;
325
326
327
328
329
330 enum qlink_frame_tx_flags {
331 QLINK_FRAME_TX_FLAG_OFFCHAN = BIT(0),
332 QLINK_FRAME_TX_FLAG_NO_CCK = BIT(1),
333 QLINK_FRAME_TX_FLAG_ACK_NOWAIT = BIT(2),
334 QLINK_FRAME_TX_FLAG_8023 = BIT(3),
335 };
336
337
338
339
340
341
342
343
344
345 struct qlink_cmd_frame_tx {
346 struct qlink_cmd chdr;
347 __le32 cookie;
348 __le16 freq;
349 __le16 flags;
350 u8 frame_data[0];
351 } __packed;
352
353
354
355
356
357
358 struct qlink_cmd_get_sta_info {
359 struct qlink_cmd chdr;
360 u8 sta_addr[ETH_ALEN];
361 } __packed;
362
363
364
365
366
367
368
369
370
371
372
373 struct qlink_cmd_add_key {
374 struct qlink_cmd chdr;
375 u8 key_index;
376 u8 pairwise;
377 u8 addr[ETH_ALEN];
378 __le32 cipher;
379 __le16 vlanid;
380 u8 key_data[0];
381 } __packed;
382
383
384
385
386
387
388
389
390 struct qlink_cmd_del_key {
391 struct qlink_cmd chdr;
392 u8 key_index;
393 u8 pairwise;
394 u8 addr[ETH_ALEN];
395 } __packed;
396
397
398
399
400
401
402
403
404 struct qlink_cmd_set_def_key {
405 struct qlink_cmd chdr;
406 u8 key_index;
407 u8 unicast;
408 u8 multicast;
409 } __packed;
410
411
412
413
414
415
416 struct qlink_cmd_set_def_mgmt_key {
417 struct qlink_cmd chdr;
418 u8 key_index;
419 } __packed;
420
421
422
423
424
425
426
427
428
429 struct qlink_cmd_change_sta {
430 struct qlink_cmd chdr;
431 struct qlink_sta_info_state flag_update;
432 __le16 if_type;
433 __le16 vlanid;
434 u8 sta_addr[ETH_ALEN];
435 } __packed;
436
437
438
439
440
441
442 struct qlink_cmd_del_sta {
443 struct qlink_cmd chdr;
444 __le16 reason_code;
445 u8 subtype;
446 u8 sta_addr[ETH_ALEN];
447 } __packed;
448
449 enum qlink_sta_connect_flags {
450 QLINK_STA_CONNECT_DISABLE_HT = BIT(0),
451 QLINK_STA_CONNECT_DISABLE_VHT = BIT(1),
452 QLINK_STA_CONNECT_USE_RRM = BIT(2),
453 };
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473 struct qlink_cmd_connect {
474 struct qlink_cmd chdr;
475 u8 bssid[ETH_ALEN];
476 u8 bssid_hint[ETH_ALEN];
477 u8 prev_bssid[ETH_ALEN];
478 __le16 bg_scan_period;
479 __le32 flags;
480 struct ieee80211_ht_cap ht_capa;
481 struct ieee80211_ht_cap ht_capa_mask;
482 struct ieee80211_vht_cap vht_capa;
483 struct ieee80211_vht_cap vht_capa_mask;
484 struct qlink_auth_encr aen;
485 u8 mfp;
486 u8 pbss;
487 u8 rsvd[2];
488 u8 payload[0];
489 } __packed;
490
491
492
493
494
495
496
497
498 struct qlink_cmd_external_auth {
499 struct qlink_cmd chdr;
500 u8 bssid[ETH_ALEN];
501 __le16 status;
502 u8 payload[0];
503 } __packed;
504
505
506
507
508
509
510 struct qlink_cmd_disconnect {
511 struct qlink_cmd chdr;
512 __le16 reason;
513 } __packed;
514
515
516
517
518
519
520
521 struct qlink_cmd_updown {
522 struct qlink_cmd chdr;
523 u8 if_up;
524 } __packed;
525
526
527
528
529
530
531
532
533 enum qlink_band {
534 QLINK_BAND_2GHZ = BIT(0),
535 QLINK_BAND_5GHZ = BIT(1),
536 QLINK_BAND_60GHZ = BIT(2),
537 };
538
539
540
541
542
543
544 struct qlink_cmd_band_info_get {
545 struct qlink_cmd chdr;
546 u8 band;
547 } __packed;
548
549
550
551
552
553
554 struct qlink_cmd_get_chan_stats {
555 struct qlink_cmd chdr;
556 __le16 channel;
557 } __packed;
558
559
560
561
562
563
564 enum qlink_reg_initiator {
565 QLINK_REGDOM_SET_BY_CORE,
566 QLINK_REGDOM_SET_BY_USER,
567 QLINK_REGDOM_SET_BY_DRIVER,
568 QLINK_REGDOM_SET_BY_COUNTRY_IE,
569 };
570
571
572
573
574
575
576 enum qlink_user_reg_hint_type {
577 QLINK_USER_REG_HINT_USER = 0,
578 QLINK_USER_REG_HINT_CELL_BASE = 1,
579 QLINK_USER_REG_HINT_INDOOR = 2,
580 };
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595 struct qlink_cmd_reg_notify {
596 struct qlink_cmd chdr;
597 u8 alpha2[2];
598 u8 initiator;
599 u8 user_reg_hint_type;
600 u8 num_channels;
601 u8 dfs_region;
602 u8 slave_radar;
603 u8 rsvd[1];
604 u8 info[0];
605 } __packed;
606
607
608
609
610
611
612
613
614
615 struct qlink_cmd_chan_switch {
616 struct qlink_cmd chdr;
617 __le16 channel;
618 u8 radar_required;
619 u8 block_tx;
620 u8 beacon_count;
621 } __packed;
622
623
624
625
626
627
628 enum qlink_hidden_ssid {
629 QLINK_HIDDEN_SSID_NOT_IN_USE,
630 QLINK_HIDDEN_SSID_ZERO_LEN,
631 QLINK_HIDDEN_SSID_ZERO_CONTENTS
632 };
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647 struct qlink_cmd_start_ap {
648 struct qlink_cmd chdr;
649 __le16 beacon_interval;
650 __le16 inactivity_timeout;
651 u8 dtim_period;
652 u8 hidden_ssid;
653 u8 smps_mode;
654 u8 p2p_ctwindow;
655 u8 p2p_opp_ps;
656 u8 pbss;
657 u8 ht_required;
658 u8 vht_required;
659 struct qlink_auth_encr aen;
660 u8 info[0];
661 } __packed;
662
663
664
665
666
667
668
669 struct qlink_cmd_start_cac {
670 struct qlink_cmd chdr;
671 struct qlink_chandef chan;
672 __le32 cac_time_ms;
673 } __packed;
674
675 enum qlink_acl_policy {
676 QLINK_ACL_POLICY_ACCEPT_UNLESS_LISTED,
677 QLINK_ACL_POLICY_DENY_UNLESS_LISTED,
678 };
679
680 struct qlink_mac_address {
681 u8 addr[ETH_ALEN];
682 } __packed;
683
684
685
686
687
688
689
690
691 struct qlink_acl_data {
692 __le32 policy;
693 __le32 num_entries;
694 struct qlink_mac_address mac_addrs[0];
695 } __packed;
696
697
698
699
700
701
702
703 enum qlink_pm_mode {
704 QLINK_PM_OFF = 0,
705 QLINK_PM_AUTO_STANDBY = 1,
706 };
707
708
709
710
711
712
713
714
715 struct qlink_cmd_pm_set {
716 struct qlink_cmd chdr;
717 __le32 pm_standby_timer;
718 u8 pm_mode;
719 } __packed;
720
721
722
723
724
725
726
727
728 enum qlink_wowlan_trigger {
729 QLINK_WOWLAN_TRIG_DISCONNECT = BIT(0),
730 QLINK_WOWLAN_TRIG_MAGIC_PKT = BIT(1),
731 QLINK_WOWLAN_TRIG_PATTERN_PKT = BIT(2),
732 };
733
734
735
736
737
738
739 struct qlink_cmd_wowlan_set {
740 struct qlink_cmd chdr;
741 __le32 triggers;
742 u8 data[0];
743 } __packed;
744
745
746
747
748 enum qlink_cmd_result {
749 QLINK_CMD_RESULT_OK = 0,
750 QLINK_CMD_RESULT_INVALID,
751 QLINK_CMD_RESULT_ENOTSUPP,
752 QLINK_CMD_RESULT_ENOTFOUND,
753 QLINK_CMD_RESULT_EALREADY,
754 QLINK_CMD_RESULT_EADDRINUSE,
755 QLINK_CMD_RESULT_EADDRNOTAVAIL,
756 QLINK_CMD_RESULT_EBUSY,
757 };
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774 struct qlink_resp {
775 struct qlink_msg_header mhdr;
776 __le16 cmd_id;
777 __le16 seq_num;
778 __le16 result;
779 u8 macid;
780 u8 vifid;
781 } __packed;
782
783
784
785
786
787
788 enum qlink_dfs_regions {
789 QLINK_DFS_UNSET = 0,
790 QLINK_DFS_FCC = 1,
791 QLINK_DFS_ETSI = 2,
792 QLINK_DFS_JP = 3,
793 };
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816 struct qlink_resp_get_mac_info {
817 struct qlink_resp rhdr;
818 u8 dev_mac[ETH_ALEN];
819 u8 num_tx_chain;
820 u8 num_rx_chain;
821 struct ieee80211_vht_cap vht_cap_mod_mask;
822 struct ieee80211_ht_cap ht_cap_mod_mask;
823 __le16 max_ap_assoc_sta;
824 __le16 radar_detect_widths;
825 __le32 max_acl_mac_addrs;
826 u8 bands_cap;
827 u8 alpha2[2];
828 u8 n_reg_rules;
829 u8 dfs_region;
830 u8 rsvd[1];
831 u8 var_info[0];
832 } __packed;
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848 struct qlink_resp_get_hw_info {
849 struct qlink_resp rhdr;
850 __le32 fw_ver;
851 __le32 hw_capab;
852 __le32 bld_tmstamp;
853 __le32 plat_id;
854 __le32 hw_ver;
855 __le16 ql_proto_ver;
856 u8 num_mac;
857 u8 mac_bitmap;
858 u8 total_tx_chain;
859 u8 total_rx_chain;
860 u8 info[0];
861 } __packed;
862
863
864
865
866
867
868
869
870
871 struct qlink_resp_manage_intf {
872 struct qlink_resp rhdr;
873 struct qlink_intf_info intf_info;
874 } __packed;
875
876 enum qlink_sta_info_rate_flags {
877 QLINK_STA_INFO_RATE_FLAG_HT_MCS = BIT(0),
878 QLINK_STA_INFO_RATE_FLAG_VHT_MCS = BIT(1),
879 QLINK_STA_INFO_RATE_FLAG_SHORT_GI = BIT(2),
880 QLINK_STA_INFO_RATE_FLAG_60G = BIT(3),
881 };
882
883
884
885
886
887
888
889
890
891
892
893 struct qlink_resp_get_sta_info {
894 struct qlink_resp rhdr;
895 u8 sta_addr[ETH_ALEN];
896 u8 rsvd[2];
897 u8 info[0];
898 } __packed;
899
900
901
902
903
904
905
906
907
908 struct qlink_resp_band_info_get {
909 struct qlink_resp rhdr;
910 u8 band;
911 u8 num_chans;
912 u8 num_bitrates;
913 u8 rsvd[1];
914 u8 info[0];
915 } __packed;
916
917
918
919
920
921
922 struct qlink_resp_phy_params {
923 struct qlink_resp rhdr;
924 u8 info[0];
925 } __packed;
926
927
928
929
930
931
932 struct qlink_resp_get_chan_stats {
933 struct qlink_cmd rhdr;
934 u8 info[0];
935 } __packed;
936
937
938
939
940
941
942 struct qlink_resp_channel_get {
943 struct qlink_resp rhdr;
944 struct qlink_chandef chan;
945 } __packed;
946
947
948
949
950 enum qlink_event_type {
951 QLINK_EVENT_STA_ASSOCIATED = 0x0021,
952 QLINK_EVENT_STA_DEAUTH = 0x0022,
953 QLINK_EVENT_MGMT_RECEIVED = 0x0023,
954 QLINK_EVENT_SCAN_RESULTS = 0x0024,
955 QLINK_EVENT_SCAN_COMPLETE = 0x0025,
956 QLINK_EVENT_BSS_JOIN = 0x0026,
957 QLINK_EVENT_BSS_LEAVE = 0x0027,
958 QLINK_EVENT_FREQ_CHANGE = 0x0028,
959 QLINK_EVENT_RADAR = 0x0029,
960 QLINK_EVENT_EXTERNAL_AUTH = 0x0030,
961 };
962
963
964
965
966
967
968
969
970
971
972
973
974
975 struct qlink_event {
976 struct qlink_msg_header mhdr;
977 __le16 event_id;
978 u8 macid;
979 u8 vifid;
980 } __packed;
981
982
983
984
985
986
987
988
989 struct qlink_event_sta_assoc {
990 struct qlink_event ehdr;
991 u8 sta_addr[ETH_ALEN];
992 __le16 frame_control;
993 u8 ies[0];
994 } __packed;
995
996
997
998
999
1000
1001
1002 struct qlink_event_sta_deauth {
1003 struct qlink_event ehdr;
1004 u8 sta_addr[ETH_ALEN];
1005 __le16 reason;
1006 } __packed;
1007
1008
1009
1010
1011
1012
1013
1014
1015 struct qlink_event_bss_join {
1016 struct qlink_event ehdr;
1017 struct qlink_chandef chan;
1018 u8 bssid[ETH_ALEN];
1019 __le16 status;
1020 u8 ies[0];
1021 } __packed;
1022
1023
1024
1025
1026
1027
1028 struct qlink_event_bss_leave {
1029 struct qlink_event ehdr;
1030 __le16 reason;
1031 } __packed;
1032
1033
1034
1035
1036
1037
1038 struct qlink_event_freq_change {
1039 struct qlink_event ehdr;
1040 struct qlink_chandef chan;
1041 } __packed;
1042
1043 enum qlink_rxmgmt_flags {
1044 QLINK_RXMGMT_FLAG_ANSWERED = 1 << 0,
1045 };
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055 struct qlink_event_rxmgmt {
1056 struct qlink_event ehdr;
1057 __le32 freq;
1058 __le32 flags;
1059 s8 sig_dbm;
1060 u8 rsvd[3];
1061 u8 frame_data[0];
1062 } __packed;
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078 struct qlink_event_scan_result {
1079 struct qlink_event ehdr;
1080 __le64 tsf;
1081 __le16 freq;
1082 __le16 capab;
1083 __le16 bintval;
1084 s8 sig_dbm;
1085 u8 ssid_len;
1086 u8 ssid[IEEE80211_MAX_SSID_LEN];
1087 u8 bssid[ETH_ALEN];
1088 u8 rsvd[2];
1089 u8 payload[0];
1090 } __packed;
1091
1092
1093
1094
1095
1096
1097
1098 enum qlink_scan_complete_flags {
1099 QLINK_SCAN_NONE = 0,
1100 QLINK_SCAN_ABORTED = BIT(0),
1101 };
1102
1103
1104
1105
1106
1107
1108
1109 struct qlink_event_scan_complete {
1110 struct qlink_event ehdr;
1111 __le32 flags;
1112 } __packed;
1113
1114 enum qlink_radar_event {
1115 QLINK_RADAR_DETECTED,
1116 QLINK_RADAR_CAC_FINISHED,
1117 QLINK_RADAR_CAC_ABORTED,
1118 QLINK_RADAR_NOP_FINISHED,
1119 QLINK_RADAR_PRE_CAC_EXPIRED,
1120 QLINK_RADAR_CAC_STARTED,
1121 };
1122
1123
1124
1125
1126
1127
1128
1129 struct qlink_event_radar {
1130 struct qlink_event ehdr;
1131 struct qlink_chandef chan;
1132 u8 event;
1133 u8 rsvd[3];
1134 } __packed;
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145 struct qlink_event_external_auth {
1146 struct qlink_event ehdr;
1147 u8 ssid[IEEE80211_MAX_SSID_LEN];
1148 u8 ssid_len;
1149 u8 bssid[ETH_ALEN];
1150 __le32 akm_suite;
1151 u8 action;
1152 } __packed;
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175 enum qlink_tlv_id {
1176 QTN_TLV_ID_FRAG_THRESH = 0x0201,
1177 QTN_TLV_ID_RTS_THRESH = 0x0202,
1178 QTN_TLV_ID_SRETRY_LIMIT = 0x0203,
1179 QTN_TLV_ID_LRETRY_LIMIT = 0x0204,
1180 QTN_TLV_ID_REG_RULE = 0x0207,
1181 QTN_TLV_ID_CHANNEL = 0x020F,
1182 QTN_TLV_ID_CHANDEF = 0x0210,
1183 QTN_TLV_ID_STA_STATS_MAP = 0x0211,
1184 QTN_TLV_ID_STA_STATS = 0x0212,
1185 QTN_TLV_ID_COVERAGE_CLASS = 0x0213,
1186 QTN_TLV_ID_IFACE_LIMIT = 0x0214,
1187 QTN_TLV_ID_NUM_IFACE_COMB = 0x0215,
1188 QTN_TLV_ID_CHANNEL_STATS = 0x0216,
1189 QTN_TLV_ID_KEY = 0x0302,
1190 QTN_TLV_ID_SEQ = 0x0303,
1191 QTN_TLV_ID_IE_SET = 0x0305,
1192 QTN_TLV_ID_EXT_CAPABILITY_MASK = 0x0306,
1193 QTN_TLV_ID_ACL_DATA = 0x0307,
1194 QTN_TLV_ID_BUILD_NAME = 0x0401,
1195 QTN_TLV_ID_BUILD_REV = 0x0402,
1196 QTN_TLV_ID_BUILD_TYPE = 0x0403,
1197 QTN_TLV_ID_BUILD_LABEL = 0x0404,
1198 QTN_TLV_ID_HW_ID = 0x0405,
1199 QTN_TLV_ID_CALIBRATION_VER = 0x0406,
1200 QTN_TLV_ID_UBOOT_VER = 0x0407,
1201 QTN_TLV_ID_RANDOM_MAC_ADDR = 0x0408,
1202 QTN_TLV_ID_MAX_SCAN_SSIDS = 0x0409,
1203 QTN_TLV_ID_WOWLAN_CAPAB = 0x0410,
1204 QTN_TLV_ID_WOWLAN_PATTERN = 0x0411,
1205 QTN_TLV_ID_SCAN_FLUSH = 0x0412,
1206 QTN_TLV_ID_SCAN_DWELL_ACTIVE = 0x0413,
1207 QTN_TLV_ID_SCAN_DWELL_PASSIVE = 0x0416,
1208 QTN_TLV_ID_SCAN_SAMPLE_DURATION = 0x0417,
1209 };
1210
1211 struct qlink_tlv_hdr {
1212 __le16 type;
1213 __le16 len;
1214 u8 val[0];
1215 } __packed;
1216
1217 struct qlink_iface_comb_num {
1218 __le32 iface_comb_num;
1219 } __packed;
1220
1221 struct qlink_iface_limit {
1222 __le16 max_num;
1223 __le16 type;
1224 } __packed;
1225
1226 struct qlink_iface_limit_record {
1227 __le16 max_interfaces;
1228 u8 num_different_channels;
1229 u8 n_limits;
1230 struct qlink_iface_limit limits[0];
1231 } __packed;
1232
1233 #define QLINK_RSSI_OFFSET 120
1234
1235 struct qlink_tlv_frag_rts_thr {
1236 struct qlink_tlv_hdr hdr;
1237 __le32 thr;
1238 } __packed;
1239
1240 struct qlink_tlv_rlimit {
1241 struct qlink_tlv_hdr hdr;
1242 u8 rlimit;
1243 } __packed;
1244
1245 struct qlink_tlv_cclass {
1246 struct qlink_tlv_hdr hdr;
1247 u8 cclass;
1248 } __packed;
1249
1250
1251
1252
1253
1254
1255 enum qlink_reg_rule_flags {
1256 QLINK_RRF_NO_OFDM = BIT(0),
1257 QLINK_RRF_NO_CCK = BIT(1),
1258 QLINK_RRF_NO_INDOOR = BIT(2),
1259 QLINK_RRF_NO_OUTDOOR = BIT(3),
1260 QLINK_RRF_DFS = BIT(4),
1261 QLINK_RRF_PTP_ONLY = BIT(5),
1262 QLINK_RRF_PTMP_ONLY = BIT(6),
1263 QLINK_RRF_NO_IR = BIT(7),
1264 QLINK_RRF_AUTO_BW = BIT(8),
1265 QLINK_RRF_IR_CONCURRENT = BIT(9),
1266 QLINK_RRF_NO_HT40MINUS = BIT(10),
1267 QLINK_RRF_NO_HT40PLUS = BIT(11),
1268 QLINK_RRF_NO_80MHZ = BIT(12),
1269 QLINK_RRF_NO_160MHZ = BIT(13),
1270 };
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287 struct qlink_tlv_reg_rule {
1288 struct qlink_tlv_hdr hdr;
1289 __le32 start_freq_khz;
1290 __le32 end_freq_khz;
1291 __le32 max_bandwidth_khz;
1292 __le32 max_antenna_gain;
1293 __le32 max_eirp;
1294 __le32 flags;
1295 __le32 dfs_cac_ms;
1296 } __packed;
1297
1298 enum qlink_channel_flags {
1299 QLINK_CHAN_DISABLED = BIT(0),
1300 QLINK_CHAN_NO_IR = BIT(1),
1301 QLINK_CHAN_RADAR = BIT(3),
1302 QLINK_CHAN_NO_HT40PLUS = BIT(4),
1303 QLINK_CHAN_NO_HT40MINUS = BIT(5),
1304 QLINK_CHAN_NO_OFDM = BIT(6),
1305 QLINK_CHAN_NO_80MHZ = BIT(7),
1306 QLINK_CHAN_NO_160MHZ = BIT(8),
1307 QLINK_CHAN_INDOOR_ONLY = BIT(9),
1308 QLINK_CHAN_IR_CONCURRENT = BIT(10),
1309 QLINK_CHAN_NO_20MHZ = BIT(11),
1310 QLINK_CHAN_NO_10MHZ = BIT(12),
1311 };
1312
1313 enum qlink_dfs_state {
1314 QLINK_DFS_USABLE,
1315 QLINK_DFS_UNAVAILABLE,
1316 QLINK_DFS_AVAILABLE,
1317 };
1318
1319
1320
1321
1322
1323
1324
1325
1326 struct qlink_tlv_channel {
1327 struct qlink_tlv_hdr hdr;
1328 struct qlink_channel chan;
1329 } __packed;
1330
1331
1332
1333
1334
1335
1336
1337
1338 struct qlink_tlv_chandef {
1339 struct qlink_tlv_hdr hdr;
1340 struct qlink_chandef chdef;
1341 } __packed;
1342
1343 enum qlink_ie_set_type {
1344 QLINK_IE_SET_UNKNOWN,
1345 QLINK_IE_SET_ASSOC_REQ,
1346 QLINK_IE_SET_ASSOC_RESP,
1347 QLINK_IE_SET_PROBE_REQ,
1348 QLINK_IE_SET_SCAN,
1349 QLINK_IE_SET_BEACON_HEAD,
1350 QLINK_IE_SET_BEACON_TAIL,
1351 QLINK_IE_SET_BEACON_IES,
1352 QLINK_IE_SET_PROBE_RESP,
1353 QLINK_IE_SET_PROBE_RESP_IES,
1354 };
1355
1356
1357
1358
1359
1360
1361
1362
1363 struct qlink_tlv_ie_set {
1364 struct qlink_tlv_hdr hdr;
1365 u8 type;
1366 u8 flags;
1367 u8 ie_data[0];
1368 } __packed;
1369
1370 struct qlink_chan_stats {
1371 __le32 chan_num;
1372 __le32 cca_tx;
1373 __le32 cca_rx;
1374 __le32 cca_busy;
1375 __le32 cca_try;
1376 s8 chan_noise;
1377 } __packed;
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404 enum qlink_sta_info {
1405 QLINK_STA_INFO_CONNECTED_TIME,
1406 QLINK_STA_INFO_INACTIVE_TIME,
1407 QLINK_STA_INFO_RX_BYTES,
1408 QLINK_STA_INFO_TX_BYTES,
1409 QLINK_STA_INFO_RX_BYTES64,
1410 QLINK_STA_INFO_TX_BYTES64,
1411 QLINK_STA_INFO_RX_DROP_MISC,
1412 QLINK_STA_INFO_BEACON_RX,
1413 QLINK_STA_INFO_SIGNAL,
1414 QLINK_STA_INFO_SIGNAL_AVG,
1415 QLINK_STA_INFO_RX_BITRATE,
1416 QLINK_STA_INFO_TX_BITRATE,
1417 QLINK_STA_INFO_RX_PACKETS,
1418 QLINK_STA_INFO_TX_PACKETS,
1419 QLINK_STA_INFO_TX_RETRIES,
1420 QLINK_STA_INFO_TX_FAILED,
1421 QLINK_STA_INFO_STA_FLAGS,
1422 QLINK_STA_INFO_NUM,
1423 };
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434 struct qlink_sta_info_rate {
1435 __le16 rate;
1436 u8 flags;
1437 u8 mcs;
1438 u8 nss;
1439 u8 bw;
1440 } __packed;
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450 struct qlink_sta_stats {
1451 __le64 rx_bytes;
1452 __le64 tx_bytes;
1453 __le64 rx_beacon;
1454 __le64 rx_duration;
1455 __le64 t_offset;
1456 __le32 connected_time;
1457 __le32 inactive_time;
1458 __le32 rx_packets;
1459 __le32 tx_packets;
1460 __le32 tx_retries;
1461 __le32 tx_failed;
1462 __le32 rx_dropped_misc;
1463 __le32 beacon_loss_count;
1464 __le32 expected_throughput;
1465 struct qlink_sta_info_state sta_flags;
1466 struct qlink_sta_info_rate txrate;
1467 struct qlink_sta_info_rate rxrate;
1468 __le16 llid;
1469 __le16 plid;
1470 u8 local_pm;
1471 u8 peer_pm;
1472 u8 nonpeer_pm;
1473 u8 rx_beacon_signal_avg;
1474 u8 plink_state;
1475 u8 signal;
1476 u8 signal_avg;
1477 u8 rsvd[1];
1478 };
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491 struct qlink_random_mac_addr {
1492 u8 mac_addr[ETH_ALEN];
1493 u8 mac_addr_mask[ETH_ALEN];
1494 } __packed;
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506 struct qlink_wowlan_capab_data {
1507 __le16 version;
1508 __le16 len;
1509 u8 data[0];
1510 } __packed;
1511
1512
1513
1514
1515
1516
1517
1518
1519 struct qlink_wowlan_support {
1520 __le32 n_patterns;
1521 __le32 pattern_max_len;
1522 __le32 pattern_min_len;
1523 } __packed;
1524
1525 #endif