diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-11-28 10:56:03 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-28 10:56:03 -0500 |
commit | 79d38f7d6cf545ff838dd5227869f3916d1d100d (patch) | |
tree | 859c8071aab68fd32f36ffb9ebc04cf12db6e5e0 /include/net | |
parent | 03f52a0a554210d5049eeed9f1bb29047dc807cb (diff) | |
parent | 0751f8654602e4255f0b9c17784d8100d5896010 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
drivers/net/wireless/iwlwifi/pcie/tx.c
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/amp.h | 4 | ||||
-rw-r--r-- | include/net/bluetooth/hci.h | 29 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 48 | ||||
-rw-r--r-- | include/net/bluetooth/l2cap.h | 38 | ||||
-rw-r--r-- | include/net/cfg80211.h | 223 | ||||
-rw-r--r-- | include/net/mac80211.h | 158 | ||||
-rw-r--r-- | include/net/nfc/hci.h | 3 |
7 files changed, 412 insertions, 91 deletions
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h index 2e7c79ea046..7ea3db77ba8 100644 --- a/include/net/bluetooth/amp.h +++ b/include/net/bluetooth/amp.h | |||
@@ -46,5 +46,9 @@ void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | |||
46 | struct hci_conn *hcon); | 46 | struct hci_conn *hcon); |
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | 47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); |
48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | 48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); |
49 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); | ||
50 | void amp_create_logical_link(struct l2cap_chan *chan); | ||
51 | void amp_disconnect_logical_link(struct hci_chan *hchan); | ||
52 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); | ||
49 | 53 | ||
50 | #endif /* __AMP_H */ | 54 | #endif /* __AMP_H */ |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 88cbbda6102..45eee08157b 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -115,6 +115,7 @@ enum { | |||
115 | HCI_SSP_ENABLED, | 115 | HCI_SSP_ENABLED, |
116 | HCI_HS_ENABLED, | 116 | HCI_HS_ENABLED, |
117 | HCI_LE_ENABLED, | 117 | HCI_LE_ENABLED, |
118 | HCI_LE_PERIPHERAL, | ||
118 | HCI_CONNECTABLE, | 119 | HCI_CONNECTABLE, |
119 | HCI_DISCOVERABLE, | 120 | HCI_DISCOVERABLE, |
120 | HCI_LINK_SECURITY, | 121 | HCI_LINK_SECURITY, |
@@ -153,7 +154,7 @@ enum { | |||
153 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 154 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
154 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ | 155 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
155 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ | 156 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ |
156 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ | 157 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
157 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ | 158 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ |
158 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 159 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
159 | 160 | ||
@@ -318,6 +319,9 @@ enum { | |||
318 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 | 319 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 |
319 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 | 320 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 |
320 | 321 | ||
322 | /* The core spec defines 127 as the "not available" value */ | ||
323 | #define HCI_TX_POWER_INVALID 127 | ||
324 | |||
321 | /* Extended Inquiry Response field types */ | 325 | /* Extended Inquiry Response field types */ |
322 | #define EIR_FLAGS 0x01 /* flags */ | 326 | #define EIR_FLAGS 0x01 /* flags */ |
323 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ | 327 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ |
@@ -334,6 +338,13 @@ enum { | |||
334 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ | 338 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ |
335 | #define EIR_DEVICE_ID 0x10 /* device ID */ | 339 | #define EIR_DEVICE_ID 0x10 /* device ID */ |
336 | 340 | ||
341 | /* Low Energy Advertising Flags */ | ||
342 | #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ | ||
343 | #define LE_AD_GENERAL 0x02 /* General Discoverable */ | ||
344 | #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ | ||
345 | #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ | ||
346 | #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ | ||
347 | |||
337 | /* ----- HCI Commands ---- */ | 348 | /* ----- HCI Commands ---- */ |
338 | #define HCI_OP_NOP 0x0000 | 349 | #define HCI_OP_NOP 0x0000 |
339 | 350 | ||
@@ -932,6 +943,22 @@ struct hci_rp_le_read_buffer_size { | |||
932 | __u8 le_max_pkt; | 943 | __u8 le_max_pkt; |
933 | } __packed; | 944 | } __packed; |
934 | 945 | ||
946 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 | ||
947 | struct hci_rp_le_read_adv_tx_power { | ||
948 | __u8 status; | ||
949 | __s8 tx_power; | ||
950 | } __packed; | ||
951 | |||
952 | #define HCI_MAX_AD_LENGTH 31 | ||
953 | |||
954 | #define HCI_OP_LE_SET_ADV_DATA 0x2008 | ||
955 | struct hci_cp_le_set_adv_data { | ||
956 | __u8 length; | ||
957 | __u8 data[HCI_MAX_AD_LENGTH]; | ||
958 | } __packed; | ||
959 | |||
960 | #define HCI_OP_LE_SET_ADV_ENABLE 0x200a | ||
961 | |||
935 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b | 962 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b |
936 | struct hci_cp_le_set_scan_param { | 963 | struct hci_cp_le_set_scan_param { |
937 | __u8 type; | 964 | __u8 type; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 9fe8e2dec87..ef5b85dac3f 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -278,6 +278,10 @@ struct hci_dev { | |||
278 | struct work_struct le_scan; | 278 | struct work_struct le_scan; |
279 | struct le_scan_params le_scan_params; | 279 | struct le_scan_params le_scan_params; |
280 | 280 | ||
281 | __s8 adv_tx_power; | ||
282 | __u8 adv_data[HCI_MAX_AD_LENGTH]; | ||
283 | __u8 adv_data_len; | ||
284 | |||
281 | int (*open)(struct hci_dev *hdev); | 285 | int (*open)(struct hci_dev *hdev); |
282 | int (*close)(struct hci_dev *hdev); | 286 | int (*close)(struct hci_dev *hdev); |
283 | int (*flush)(struct hci_dev *hdev); | 287 | int (*flush)(struct hci_dev *hdev); |
@@ -355,6 +359,7 @@ struct hci_chan { | |||
355 | struct hci_conn *conn; | 359 | struct hci_conn *conn; |
356 | struct sk_buff_head data_q; | 360 | struct sk_buff_head data_q; |
357 | unsigned int sent; | 361 | unsigned int sent; |
362 | __u8 state; | ||
358 | }; | 363 | }; |
359 | 364 | ||
360 | extern struct list_head hci_dev_list; | 365 | extern struct list_head hci_dev_list; |
@@ -682,7 +687,7 @@ static inline uint8_t __hci_num_ctrl(void) | |||
682 | } | 687 | } |
683 | 688 | ||
684 | struct hci_dev *hci_dev_get(int index); | 689 | struct hci_dev *hci_dev_get(int index); |
685 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 690 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); |
686 | 691 | ||
687 | struct hci_dev *hci_alloc_dev(void); | 692 | struct hci_dev *hci_alloc_dev(void); |
688 | void hci_free_dev(struct hci_dev *hdev); | 693 | void hci_free_dev(struct hci_dev *hdev); |
@@ -731,6 +736,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash, | |||
731 | u8 *randomizer); | 736 | u8 *randomizer); |
732 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | 737 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); |
733 | 738 | ||
739 | int hci_update_ad(struct hci_dev *hdev); | ||
740 | |||
734 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 741 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
735 | 742 | ||
736 | int hci_recv_frame(struct sk_buff *skb); | 743 | int hci_recv_frame(struct sk_buff *skb); |
@@ -747,18 +754,29 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
747 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) | 754 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) |
748 | 755 | ||
749 | /* ----- LMP capabilities ----- */ | 756 | /* ----- LMP capabilities ----- */ |
750 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
751 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) | 757 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) |
758 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
759 | #define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD) | ||
752 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 760 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) |
753 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | 761 | #define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK) |
762 | #define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ) | ||
754 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | 763 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) |
764 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | ||
765 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | ||
766 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | ||
767 | #define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC) | ||
768 | #define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ) | ||
769 | #define lmp_le_br_capable(dev) ((dev)->features[6] & LMP_SIMUL_LE_BR) | ||
755 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | 770 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) |
756 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) | 771 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) |
757 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | 772 | #define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO) |
758 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | 773 | #define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR) |
774 | #define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES) | ||
759 | 775 | ||
760 | /* ----- Extended LMP capabilities ----- */ | 776 | /* ----- Extended LMP capabilities ----- */ |
777 | #define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP) | ||
761 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) | 778 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) |
779 | #define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR) | ||
762 | 780 | ||
763 | /* ----- HCI protocols ----- */ | 781 | /* ----- HCI protocols ----- */ |
764 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, | 782 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, |
@@ -877,7 +895,7 @@ struct hci_cb { | |||
877 | 895 | ||
878 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | 896 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) |
879 | { | 897 | { |
880 | struct list_head *p; | 898 | struct hci_cb *cb; |
881 | __u8 encrypt; | 899 | __u8 encrypt; |
882 | 900 | ||
883 | hci_proto_auth_cfm(conn, status); | 901 | hci_proto_auth_cfm(conn, status); |
@@ -888,8 +906,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
888 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; | 906 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; |
889 | 907 | ||
890 | read_lock(&hci_cb_list_lock); | 908 | read_lock(&hci_cb_list_lock); |
891 | list_for_each(p, &hci_cb_list) { | 909 | list_for_each_entry(cb, &hci_cb_list, list) { |
892 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
893 | if (cb->security_cfm) | 910 | if (cb->security_cfm) |
894 | cb->security_cfm(conn, status, encrypt); | 911 | cb->security_cfm(conn, status, encrypt); |
895 | } | 912 | } |
@@ -899,7 +916,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
899 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | 916 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, |
900 | __u8 encrypt) | 917 | __u8 encrypt) |
901 | { | 918 | { |
902 | struct list_head *p; | 919 | struct hci_cb *cb; |
903 | 920 | ||
904 | if (conn->sec_level == BT_SECURITY_SDP) | 921 | if (conn->sec_level == BT_SECURITY_SDP) |
905 | conn->sec_level = BT_SECURITY_LOW; | 922 | conn->sec_level = BT_SECURITY_LOW; |
@@ -910,8 +927,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
910 | hci_proto_encrypt_cfm(conn, status, encrypt); | 927 | hci_proto_encrypt_cfm(conn, status, encrypt); |
911 | 928 | ||
912 | read_lock(&hci_cb_list_lock); | 929 | read_lock(&hci_cb_list_lock); |
913 | list_for_each(p, &hci_cb_list) { | 930 | list_for_each_entry(cb, &hci_cb_list, list) { |
914 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
915 | if (cb->security_cfm) | 931 | if (cb->security_cfm) |
916 | cb->security_cfm(conn, status, encrypt); | 932 | cb->security_cfm(conn, status, encrypt); |
917 | } | 933 | } |
@@ -920,11 +936,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
920 | 936 | ||
921 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | 937 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) |
922 | { | 938 | { |
923 | struct list_head *p; | 939 | struct hci_cb *cb; |
924 | 940 | ||
925 | read_lock(&hci_cb_list_lock); | 941 | read_lock(&hci_cb_list_lock); |
926 | list_for_each(p, &hci_cb_list) { | 942 | list_for_each_entry(cb, &hci_cb_list, list) { |
927 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
928 | if (cb->key_change_cfm) | 943 | if (cb->key_change_cfm) |
929 | cb->key_change_cfm(conn, status); | 944 | cb->key_change_cfm(conn, status); |
930 | } | 945 | } |
@@ -934,11 +949,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | |||
934 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, | 949 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, |
935 | __u8 role) | 950 | __u8 role) |
936 | { | 951 | { |
937 | struct list_head *p; | 952 | struct hci_cb *cb; |
938 | 953 | ||
939 | read_lock(&hci_cb_list_lock); | 954 | read_lock(&hci_cb_list_lock); |
940 | list_for_each(p, &hci_cb_list) { | 955 | list_for_each_entry(cb, &hci_cb_list, list) { |
941 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
942 | if (cb->role_switch_cfm) | 956 | if (cb->role_switch_cfm) |
943 | cb->role_switch_cfm(conn, status, role); | 957 | cb->role_switch_cfm(conn, status, role); |
944 | } | 958 | } |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 6e23afdf65c..f57fab04e7c 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -52,6 +52,8 @@ | |||
52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) | 52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) |
53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
54 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) | 54 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) |
55 | #define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000) | ||
56 | #define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000) | ||
55 | 57 | ||
56 | #define L2CAP_A2MP_DEFAULT_MTU 670 | 58 | #define L2CAP_A2MP_DEFAULT_MTU 670 |
57 | 59 | ||
@@ -434,6 +436,8 @@ struct l2cap_chan { | |||
434 | struct sock *sk; | 436 | struct sock *sk; |
435 | 437 | ||
436 | struct l2cap_conn *conn; | 438 | struct l2cap_conn *conn; |
439 | struct hci_conn *hs_hcon; | ||
440 | struct hci_chan *hs_hchan; | ||
437 | struct kref kref; | 441 | struct kref kref; |
438 | 442 | ||
439 | __u8 state; | 443 | __u8 state; |
@@ -477,6 +481,12 @@ struct l2cap_chan { | |||
477 | unsigned long conn_state; | 481 | unsigned long conn_state; |
478 | unsigned long flags; | 482 | unsigned long flags; |
479 | 483 | ||
484 | __u8 remote_amp_id; | ||
485 | __u8 local_amp_id; | ||
486 | __u8 move_id; | ||
487 | __u8 move_state; | ||
488 | __u8 move_role; | ||
489 | |||
480 | __u16 next_tx_seq; | 490 | __u16 next_tx_seq; |
481 | __u16 expected_ack_seq; | 491 | __u16 expected_ack_seq; |
482 | __u16 expected_tx_seq; | 492 | __u16 expected_tx_seq; |
@@ -509,8 +519,6 @@ struct l2cap_chan { | |||
509 | __u32 remote_acc_lat; | 519 | __u32 remote_acc_lat; |
510 | __u32 remote_flush_to; | 520 | __u32 remote_flush_to; |
511 | 521 | ||
512 | __u8 ctrl_id; | ||
513 | |||
514 | struct delayed_work chan_timer; | 522 | struct delayed_work chan_timer; |
515 | struct delayed_work retrans_timer; | 523 | struct delayed_work retrans_timer; |
516 | struct delayed_work monitor_timer; | 524 | struct delayed_work monitor_timer; |
@@ -644,6 +652,9 @@ enum { | |||
644 | enum { | 652 | enum { |
645 | L2CAP_RX_STATE_RECV, | 653 | L2CAP_RX_STATE_RECV, |
646 | L2CAP_RX_STATE_SREJ_SENT, | 654 | L2CAP_RX_STATE_SREJ_SENT, |
655 | L2CAP_RX_STATE_MOVE, | ||
656 | L2CAP_RX_STATE_WAIT_P, | ||
657 | L2CAP_RX_STATE_WAIT_F, | ||
647 | }; | 658 | }; |
648 | 659 | ||
649 | enum { | 660 | enum { |
@@ -674,6 +685,25 @@ enum { | |||
674 | L2CAP_EV_RECV_FRAME, | 685 | L2CAP_EV_RECV_FRAME, |
675 | }; | 686 | }; |
676 | 687 | ||
688 | enum { | ||
689 | L2CAP_MOVE_ROLE_NONE, | ||
690 | L2CAP_MOVE_ROLE_INITIATOR, | ||
691 | L2CAP_MOVE_ROLE_RESPONDER, | ||
692 | }; | ||
693 | |||
694 | enum { | ||
695 | L2CAP_MOVE_STABLE, | ||
696 | L2CAP_MOVE_WAIT_REQ, | ||
697 | L2CAP_MOVE_WAIT_RSP, | ||
698 | L2CAP_MOVE_WAIT_RSP_SUCCESS, | ||
699 | L2CAP_MOVE_WAIT_CONFIRM, | ||
700 | L2CAP_MOVE_WAIT_CONFIRM_RSP, | ||
701 | L2CAP_MOVE_WAIT_LOGICAL_COMP, | ||
702 | L2CAP_MOVE_WAIT_LOGICAL_CFM, | ||
703 | L2CAP_MOVE_WAIT_LOCAL_BUSY, | ||
704 | L2CAP_MOVE_WAIT_PREPARE, | ||
705 | }; | ||
706 | |||
677 | void l2cap_chan_hold(struct l2cap_chan *c); | 707 | void l2cap_chan_hold(struct l2cap_chan *c); |
678 | void l2cap_chan_put(struct l2cap_chan *c); | 708 | void l2cap_chan_put(struct l2cap_chan *c); |
679 | 709 | ||
@@ -778,5 +808,9 @@ void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | |||
778 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | 808 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); |
779 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | 809 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
780 | void l2cap_send_conn_req(struct l2cap_chan *chan); | 810 | void l2cap_send_conn_req(struct l2cap_chan *chan); |
811 | void l2cap_move_start(struct l2cap_chan *chan); | ||
812 | void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, | ||
813 | u8 status); | ||
814 | void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); | ||
781 | 815 | ||
782 | #endif /* __L2CAP_H */ | 816 | #endif /* __L2CAP_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index c6964572890..e78db2cf3d1 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -306,6 +306,88 @@ struct key_params { | |||
306 | }; | 306 | }; |
307 | 307 | ||
308 | /** | 308 | /** |
309 | * struct cfg80211_chan_def - channel definition | ||
310 | * @chan: the (control) channel | ||
311 | * @width: channel width | ||
312 | * @center_freq1: center frequency of first segment | ||
313 | * @center_freq2: center frequency of second segment | ||
314 | * (only with 80+80 MHz) | ||
315 | */ | ||
316 | struct cfg80211_chan_def { | ||
317 | struct ieee80211_channel *chan; | ||
318 | enum nl80211_chan_width width; | ||
319 | u32 center_freq1; | ||
320 | u32 center_freq2; | ||
321 | }; | ||
322 | |||
323 | /** | ||
324 | * cfg80211_get_chandef_type - return old channel type from chandef | ||
325 | * @chandef: the channel definition | ||
326 | * | ||
327 | * Returns the old channel type (NOHT, HT20, HT40+/-) from a given | ||
328 | * chandef, which must have a bandwidth allowing this conversion. | ||
329 | */ | ||
330 | static inline enum nl80211_channel_type | ||
331 | cfg80211_get_chandef_type(const struct cfg80211_chan_def *chandef) | ||
332 | { | ||
333 | switch (chandef->width) { | ||
334 | case NL80211_CHAN_WIDTH_20_NOHT: | ||
335 | return NL80211_CHAN_NO_HT; | ||
336 | case NL80211_CHAN_WIDTH_20: | ||
337 | return NL80211_CHAN_HT20; | ||
338 | case NL80211_CHAN_WIDTH_40: | ||
339 | if (chandef->center_freq1 > chandef->chan->center_freq) | ||
340 | return NL80211_CHAN_HT40PLUS; | ||
341 | return NL80211_CHAN_HT40MINUS; | ||
342 | default: | ||
343 | WARN_ON(1); | ||
344 | return NL80211_CHAN_NO_HT; | ||
345 | } | ||
346 | } | ||
347 | |||
348 | /** | ||
349 | * cfg80211_chandef_create - create channel definition using channel type | ||
350 | * @chandef: the channel definition struct to fill | ||
351 | * @channel: the control channel | ||
352 | * @chantype: the channel type | ||
353 | * | ||
354 | * Given a channel type, create a channel definition. | ||
355 | */ | ||
356 | void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, | ||
357 | struct ieee80211_channel *channel, | ||
358 | enum nl80211_channel_type chantype); | ||
359 | |||
360 | /** | ||
361 | * cfg80211_chandef_identical - check if two channel definitions are identical | ||
362 | * @chandef1: first channel definition | ||
363 | * @chandef2: second channel definition | ||
364 | * | ||
365 | * Returns %true if the channels defined by the channel definitions are | ||
366 | * identical, %false otherwise. | ||
367 | */ | ||
368 | static inline bool | ||
369 | cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1, | ||
370 | const struct cfg80211_chan_def *chandef2) | ||
371 | { | ||
372 | return (chandef1->chan == chandef2->chan && | ||
373 | chandef1->width == chandef2->width && | ||
374 | chandef1->center_freq1 == chandef2->center_freq1 && | ||
375 | chandef1->center_freq2 == chandef2->center_freq2); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * cfg80211_chandef_compatible - check if two channel definitions are compatible | ||
380 | * @chandef1: first channel definition | ||
381 | * @chandef2: second channel definition | ||
382 | * | ||
383 | * Returns %NULL if the given channel definitions are incompatible, | ||
384 | * chandef1 or chandef2 otherwise. | ||
385 | */ | ||
386 | const struct cfg80211_chan_def * | ||
387 | cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, | ||
388 | const struct cfg80211_chan_def *chandef2); | ||
389 | |||
390 | /** | ||
309 | * enum survey_info_flags - survey information flags | 391 | * enum survey_info_flags - survey information flags |
310 | * | 392 | * |
311 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | 393 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in |
@@ -426,8 +508,7 @@ struct cfg80211_beacon_data { | |||
426 | * | 508 | * |
427 | * Used to configure an AP interface. | 509 | * Used to configure an AP interface. |
428 | * | 510 | * |
429 | * @channel: the channel to start the AP on | 511 | * @chandef: defines the channel to use |
430 | * @channel_type: the channel type to use | ||
431 | * @beacon: beacon data | 512 | * @beacon: beacon data |
432 | * @beacon_interval: beacon interval | 513 | * @beacon_interval: beacon interval |
433 | * @dtim_period: DTIM period | 514 | * @dtim_period: DTIM period |
@@ -441,8 +522,7 @@ struct cfg80211_beacon_data { | |||
441 | * @inactivity_timeout: time in seconds to determine station's inactivity. | 522 | * @inactivity_timeout: time in seconds to determine station's inactivity. |
442 | */ | 523 | */ |
443 | struct cfg80211_ap_settings { | 524 | struct cfg80211_ap_settings { |
444 | struct ieee80211_channel *channel; | 525 | struct cfg80211_chan_def chandef; |
445 | enum nl80211_channel_type channel_type; | ||
446 | 526 | ||
447 | struct cfg80211_beacon_data beacon; | 527 | struct cfg80211_beacon_data beacon; |
448 | 528 | ||
@@ -582,16 +662,24 @@ enum station_info_flags { | |||
582 | * Used by the driver to indicate the specific rate transmission | 662 | * Used by the driver to indicate the specific rate transmission |
583 | * type for 802.11n transmissions. | 663 | * type for 802.11n transmissions. |
584 | * | 664 | * |
585 | * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled | 665 | * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS |
586 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission | 666 | * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS |
667 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission | ||
668 | * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission | ||
669 | * @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission | ||
670 | * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission | ||
587 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval | 671 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval |
588 | * @RATE_INFO_FLAGS_60G: 60gHz MCS | 672 | * @RATE_INFO_FLAGS_60G: 60GHz MCS |
589 | */ | 673 | */ |
590 | enum rate_info_flags { | 674 | enum rate_info_flags { |
591 | RATE_INFO_FLAGS_MCS = 1<<0, | 675 | RATE_INFO_FLAGS_MCS = BIT(0), |
592 | RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, | 676 | RATE_INFO_FLAGS_VHT_MCS = BIT(1), |
593 | RATE_INFO_FLAGS_SHORT_GI = 1<<2, | 677 | RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2), |
594 | RATE_INFO_FLAGS_60G = 1<<3, | 678 | RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3), |
679 | RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4), | ||
680 | RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5), | ||
681 | RATE_INFO_FLAGS_SHORT_GI = BIT(6), | ||
682 | RATE_INFO_FLAGS_60G = BIT(7), | ||
595 | }; | 683 | }; |
596 | 684 | ||
597 | /** | 685 | /** |
@@ -602,11 +690,13 @@ enum rate_info_flags { | |||
602 | * @flags: bitflag of flags from &enum rate_info_flags | 690 | * @flags: bitflag of flags from &enum rate_info_flags |
603 | * @mcs: mcs index if struct describes a 802.11n bitrate | 691 | * @mcs: mcs index if struct describes a 802.11n bitrate |
604 | * @legacy: bitrate in 100kbit/s for 802.11abg | 692 | * @legacy: bitrate in 100kbit/s for 802.11abg |
693 | * @nss: number of streams (VHT only) | ||
605 | */ | 694 | */ |
606 | struct rate_info { | 695 | struct rate_info { |
607 | u8 flags; | 696 | u8 flags; |
608 | u8 mcs; | 697 | u8 mcs; |
609 | u16 legacy; | 698 | u16 legacy; |
699 | u8 nss; | ||
610 | }; | 700 | }; |
611 | 701 | ||
612 | /** | 702 | /** |
@@ -909,8 +999,7 @@ struct mesh_config { | |||
909 | 999 | ||
910 | /** | 1000 | /** |
911 | * struct mesh_setup - 802.11s mesh setup configuration | 1001 | * struct mesh_setup - 802.11s mesh setup configuration |
912 | * @channel: the channel to start the mesh network on | 1002 | * @chandef: defines the channel to use |
913 | * @channel_type: the channel type to use | ||
914 | * @mesh_id: the mesh ID | 1003 | * @mesh_id: the mesh ID |
915 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 1004 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
916 | * @sync_method: which synchronization method to use | 1005 | * @sync_method: which synchronization method to use |
@@ -925,8 +1014,7 @@ struct mesh_config { | |||
925 | * These parameters are fixed when the mesh is created. | 1014 | * These parameters are fixed when the mesh is created. |
926 | */ | 1015 | */ |
927 | struct mesh_setup { | 1016 | struct mesh_setup { |
928 | struct ieee80211_channel *channel; | 1017 | struct cfg80211_chan_def chandef; |
929 | enum nl80211_channel_type channel_type; | ||
930 | const u8 *mesh_id; | 1018 | const u8 *mesh_id; |
931 | u8 mesh_id_len; | 1019 | u8 mesh_id_len; |
932 | u8 sync_method; | 1020 | u8 sync_method; |
@@ -1266,8 +1354,7 @@ struct cfg80211_disassoc_request { | |||
1266 | * @ssid_len: The length of the SSID, will always be non-zero. | 1354 | * @ssid_len: The length of the SSID, will always be non-zero. |
1267 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not | 1355 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not |
1268 | * search for IBSSs with a different BSSID. | 1356 | * search for IBSSs with a different BSSID. |
1269 | * @channel: The channel to use if no IBSS can be found to join. | 1357 | * @chandef: defines the channel to use if no other IBSS to join can be found |
1270 | * @channel_type: channel type (HT mode) | ||
1271 | * @channel_fixed: The channel should be fixed -- do not search for | 1358 | * @channel_fixed: The channel should be fixed -- do not search for |
1272 | * IBSSs to join on other channels. | 1359 | * IBSSs to join on other channels. |
1273 | * @ie: information element(s) to include in the beacon | 1360 | * @ie: information element(s) to include in the beacon |
@@ -1285,8 +1372,7 @@ struct cfg80211_disassoc_request { | |||
1285 | struct cfg80211_ibss_params { | 1372 | struct cfg80211_ibss_params { |
1286 | u8 *ssid; | 1373 | u8 *ssid; |
1287 | u8 *bssid; | 1374 | u8 *bssid; |
1288 | struct ieee80211_channel *channel; | 1375 | struct cfg80211_chan_def chandef; |
1289 | enum nl80211_channel_type channel_type; | ||
1290 | u8 *ie; | 1376 | u8 *ie; |
1291 | u8 ssid_len, ie_len; | 1377 | u8 ssid_len, ie_len; |
1292 | u16 beacon_interval; | 1378 | u16 beacon_interval; |
@@ -1545,13 +1631,19 @@ struct cfg80211_gtk_rekey_data { | |||
1545 | * to a merge. | 1631 | * to a merge. |
1546 | * @leave_ibss: Leave the IBSS. | 1632 | * @leave_ibss: Leave the IBSS. |
1547 | * | 1633 | * |
1634 | * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or | ||
1635 | * MESH mode) | ||
1636 | * | ||
1548 | * @set_wiphy_params: Notify that wiphy parameters have changed; | 1637 | * @set_wiphy_params: Notify that wiphy parameters have changed; |
1549 | * @changed bitfield (see &enum wiphy_params_flags) describes which values | 1638 | * @changed bitfield (see &enum wiphy_params_flags) describes which values |
1550 | * have changed. The actual parameter values are available in | 1639 | * have changed. The actual parameter values are available in |
1551 | * struct wiphy. If returning an error, no value should be changed. | 1640 | * struct wiphy. If returning an error, no value should be changed. |
1552 | * | 1641 | * |
1553 | * @set_tx_power: set the transmit power according to the parameters, | 1642 | * @set_tx_power: set the transmit power according to the parameters, |
1554 | * the power passed is in mBm, to get dBm use MBM_TO_DBM(). | 1643 | * the power passed is in mBm, to get dBm use MBM_TO_DBM(). The |
1644 | * wdev may be %NULL if power was set for the wiphy, and will | ||
1645 | * always be %NULL unless the driver supports per-vif TX power | ||
1646 | * (as advertised by the nl80211 feature flag.) | ||
1555 | * @get_tx_power: store the current TX power into the dbm variable; | 1647 | * @get_tx_power: store the current TX power into the dbm variable; |
1556 | * return 0 if successful | 1648 | * return 0 if successful |
1557 | * | 1649 | * |
@@ -1722,8 +1814,7 @@ struct cfg80211_ops { | |||
1722 | struct ieee80211_channel *chan); | 1814 | struct ieee80211_channel *chan); |
1723 | 1815 | ||
1724 | int (*set_monitor_channel)(struct wiphy *wiphy, | 1816 | int (*set_monitor_channel)(struct wiphy *wiphy, |
1725 | struct ieee80211_channel *chan, | 1817 | struct cfg80211_chan_def *chandef); |
1726 | enum nl80211_channel_type channel_type); | ||
1727 | 1818 | ||
1728 | int (*scan)(struct wiphy *wiphy, | 1819 | int (*scan)(struct wiphy *wiphy, |
1729 | struct cfg80211_scan_request *request); | 1820 | struct cfg80211_scan_request *request); |
@@ -1746,11 +1837,15 @@ struct cfg80211_ops { | |||
1746 | struct cfg80211_ibss_params *params); | 1837 | struct cfg80211_ibss_params *params); |
1747 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); | 1838 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); |
1748 | 1839 | ||
1840 | int (*set_mcast_rate)(struct wiphy *wiphy, struct net_device *dev, | ||
1841 | int rate[IEEE80211_NUM_BANDS]); | ||
1842 | |||
1749 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); | 1843 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); |
1750 | 1844 | ||
1751 | int (*set_tx_power)(struct wiphy *wiphy, | 1845 | int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1752 | enum nl80211_tx_power_setting type, int mbm); | 1846 | enum nl80211_tx_power_setting type, int mbm); |
1753 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1847 | int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1848 | int *dbm); | ||
1754 | 1849 | ||
1755 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | 1850 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, |
1756 | const u8 *addr); | 1851 | const u8 *addr); |
@@ -1781,7 +1876,6 @@ struct cfg80211_ops { | |||
1781 | int (*remain_on_channel)(struct wiphy *wiphy, | 1876 | int (*remain_on_channel)(struct wiphy *wiphy, |
1782 | struct wireless_dev *wdev, | 1877 | struct wireless_dev *wdev, |
1783 | struct ieee80211_channel *chan, | 1878 | struct ieee80211_channel *chan, |
1784 | enum nl80211_channel_type channel_type, | ||
1785 | unsigned int duration, | 1879 | unsigned int duration, |
1786 | u64 *cookie); | 1880 | u64 *cookie); |
1787 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, | 1881 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, |
@@ -1790,10 +1884,8 @@ struct cfg80211_ops { | |||
1790 | 1884 | ||
1791 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, | 1885 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1792 | struct ieee80211_channel *chan, bool offchan, | 1886 | struct ieee80211_channel *chan, bool offchan, |
1793 | enum nl80211_channel_type channel_type, | 1887 | unsigned int wait, const u8 *buf, size_t len, |
1794 | bool channel_type_valid, unsigned int wait, | 1888 | bool no_cck, bool dont_wait_for_ack, u64 *cookie); |
1795 | const u8 *buf, size_t len, bool no_cck, | ||
1796 | bool dont_wait_for_ack, u64 *cookie); | ||
1797 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1889 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
1798 | struct wireless_dev *wdev, | 1890 | struct wireless_dev *wdev, |
1799 | u64 cookie); | 1891 | u64 cookie); |
@@ -1848,10 +1940,9 @@ struct cfg80211_ops { | |||
1848 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | 1940 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, |
1849 | u32 sset, u8 *data); | 1941 | u32 sset, u8 *data); |
1850 | 1942 | ||
1851 | struct ieee80211_channel * | 1943 | int (*get_channel)(struct wiphy *wiphy, |
1852 | (*get_channel)(struct wiphy *wiphy, | ||
1853 | struct wireless_dev *wdev, | 1944 | struct wireless_dev *wdev, |
1854 | enum nl80211_channel_type *type); | 1945 | struct cfg80211_chan_def *chandef); |
1855 | 1946 | ||
1856 | int (*start_p2p_device)(struct wiphy *wiphy, | 1947 | int (*start_p2p_device)(struct wiphy *wiphy, |
1857 | struct wireless_dev *wdev); | 1948 | struct wireless_dev *wdev); |
@@ -2459,8 +2550,7 @@ struct wireless_dev { | |||
2459 | spinlock_t event_lock; | 2550 | spinlock_t event_lock; |
2460 | 2551 | ||
2461 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2552 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
2462 | struct ieee80211_channel *preset_chan; | 2553 | struct cfg80211_chan_def preset_chandef; |
2463 | enum nl80211_channel_type preset_chantype; | ||
2464 | 2554 | ||
2465 | /* for AP and mesh channel tracking */ | 2555 | /* for AP and mesh channel tracking */ |
2466 | struct ieee80211_channel *channel; | 2556 | struct ieee80211_channel *channel; |
@@ -3340,14 +3430,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
3340 | * @wdev: wireless device | 3430 | * @wdev: wireless device |
3341 | * @cookie: the request cookie | 3431 | * @cookie: the request cookie |
3342 | * @chan: The current channel (from remain_on_channel request) | 3432 | * @chan: The current channel (from remain_on_channel request) |
3343 | * @channel_type: Channel type | ||
3344 | * @duration: Duration in milliseconds that the driver intents to remain on the | 3433 | * @duration: Duration in milliseconds that the driver intents to remain on the |
3345 | * channel | 3434 | * channel |
3346 | * @gfp: allocation flags | 3435 | * @gfp: allocation flags |
3347 | */ | 3436 | */ |
3348 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | 3437 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
3349 | struct ieee80211_channel *chan, | 3438 | struct ieee80211_channel *chan, |
3350 | enum nl80211_channel_type channel_type, | ||
3351 | unsigned int duration, gfp_t gfp); | 3439 | unsigned int duration, gfp_t gfp); |
3352 | 3440 | ||
3353 | /** | 3441 | /** |
@@ -3355,12 +3443,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | |||
3355 | * @wdev: wireless device | 3443 | * @wdev: wireless device |
3356 | * @cookie: the request cookie | 3444 | * @cookie: the request cookie |
3357 | * @chan: The current channel (from remain_on_channel request) | 3445 | * @chan: The current channel (from remain_on_channel request) |
3358 | * @channel_type: Channel type | ||
3359 | * @gfp: allocation flags | 3446 | * @gfp: allocation flags |
3360 | */ | 3447 | */ |
3361 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, | 3448 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, |
3362 | struct ieee80211_channel *chan, | 3449 | struct ieee80211_channel *chan, |
3363 | enum nl80211_channel_type channel_type, | ||
3364 | gfp_t gfp); | 3450 | gfp_t gfp); |
3365 | 3451 | ||
3366 | 3452 | ||
@@ -3550,7 +3636,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3550 | * @len: length of the frame | 3636 | * @len: length of the frame |
3551 | * @freq: frequency the frame was received on | 3637 | * @freq: frequency the frame was received on |
3552 | * @sig_dbm: signal strength in mBm, or 0 if unknown | 3638 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
3553 | * @gfp: allocation flags | ||
3554 | * | 3639 | * |
3555 | * Use this function to report to userspace when a beacon was | 3640 | * Use this function to report to userspace when a beacon was |
3556 | * received. It is not useful to call this when there is no | 3641 | * received. It is not useful to call this when there is no |
@@ -3558,31 +3643,47 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3558 | */ | 3643 | */ |
3559 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, | 3644 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
3560 | const u8 *frame, size_t len, | 3645 | const u8 *frame, size_t len, |
3561 | int freq, int sig_dbm, gfp_t gfp); | 3646 | int freq, int sig_dbm); |
3562 | 3647 | ||
3563 | /** | 3648 | /** |
3564 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3649 | * cfg80211_reg_can_beacon - check if beaconing is allowed |
3565 | * @wiphy: the wiphy | 3650 | * @wiphy: the wiphy |
3566 | * @chan: main channel | 3651 | * @chandef: the channel definition |
3567 | * @channel_type: HT mode | ||
3568 | * | 3652 | * |
3569 | * This function returns true if there is no secondary channel or the secondary | 3653 | * This function returns true if there is no secondary channel or the secondary |
3570 | * channel can be used for beaconing (i.e. is not a radar channel etc.) | 3654 | * channel(s) can be used for beaconing (i.e. is not a radar channel etc.) |
3571 | */ | 3655 | */ |
3572 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3656 | bool cfg80211_reg_can_beacon(struct wiphy *wiphy, |
3573 | struct ieee80211_channel *chan, | 3657 | struct cfg80211_chan_def *chandef); |
3574 | enum nl80211_channel_type channel_type); | ||
3575 | 3658 | ||
3576 | /* | 3659 | /* |
3577 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace | 3660 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace |
3578 | * @dev: the device which switched channels | 3661 | * @dev: the device which switched channels |
3579 | * @freq: new channel frequency (in MHz) | 3662 | * @chandef: the new channel definition |
3580 | * @type: channel type | ||
3581 | * | 3663 | * |
3582 | * Acquires wdev_lock, so must only be called from sleepable driver context! | 3664 | * Acquires wdev_lock, so must only be called from sleepable driver context! |
3583 | */ | 3665 | */ |
3584 | void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | 3666 | void cfg80211_ch_switch_notify(struct net_device *dev, |
3585 | enum nl80211_channel_type type); | 3667 | struct cfg80211_chan_def *chandef); |
3668 | |||
3669 | /* | ||
3670 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation | ||
3671 | * @dev: the device on which the operation is requested | ||
3672 | * @peer: the MAC address of the peer device | ||
3673 | * @oper: the requested TDLS operation (NL80211_TDLS_SETUP or | ||
3674 | * NL80211_TDLS_TEARDOWN) | ||
3675 | * @reason_code: the reason code for teardown request | ||
3676 | * @gfp: allocation flags | ||
3677 | * | ||
3678 | * This function is used to request userspace to perform TDLS operation that | ||
3679 | * requires knowledge of keys, i.e., link setup or teardown when the AP | ||
3680 | * connection uses encryption. This is optional mechanism for the driver to use | ||
3681 | * if it can automatically determine when a TDLS link could be useful (e.g., | ||
3682 | * based on traffic and signal strength for a peer). | ||
3683 | */ | ||
3684 | void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, | ||
3685 | enum nl80211_tdls_operation oper, | ||
3686 | u16 reason_code, gfp_t gfp); | ||
3586 | 3687 | ||
3587 | /* | 3688 | /* |
3588 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) | 3689 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) |
@@ -3608,6 +3709,26 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate); | |||
3608 | */ | 3709 | */ |
3609 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); | 3710 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); |
3610 | 3711 | ||
3712 | /** | ||
3713 | * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer | ||
3714 | * @ies: the input IE buffer | ||
3715 | * @len: the input length | ||
3716 | * @attr: the attribute ID to find | ||
3717 | * @buf: output buffer, can be %NULL if the data isn't needed, e.g. | ||
3718 | * if the function is only called to get the needed buffer size | ||
3719 | * @bufsize: size of the output buffer | ||
3720 | * | ||
3721 | * The function finds a given P2P attribute in the (vendor) IEs and | ||
3722 | * copies its contents to the given buffer. | ||
3723 | * | ||
3724 | * The return value is a negative error code (-%EILSEQ or -%ENOENT) if | ||
3725 | * the data is malformed or the attribute can't be found (respectively), | ||
3726 | * or the length of the found attribute (which can be zero). | ||
3727 | */ | ||
3728 | int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, | ||
3729 | enum ieee80211_p2p_attr_id attr, | ||
3730 | u8 *buf, unsigned int bufsize); | ||
3731 | |||
3611 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3732 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
3612 | 3733 | ||
3613 | /* wiphy_printk helpers, similar to dev_printk */ | 3734 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 00b7204708b..db7680acd0d 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -145,11 +145,11 @@ struct ieee80211_low_level_stats { | |||
145 | 145 | ||
146 | /** | 146 | /** |
147 | * enum ieee80211_chanctx_change - change flag for channel context | 147 | * enum ieee80211_chanctx_change - change flag for channel context |
148 | * @IEEE80211_CHANCTX_CHANGE_CHANNEL_TYPE: The channel type was changed | 148 | * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed |
149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed | 149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed |
150 | */ | 150 | */ |
151 | enum ieee80211_chanctx_change { | 151 | enum ieee80211_chanctx_change { |
152 | IEEE80211_CHANCTX_CHANGE_CHANNEL_TYPE = BIT(0), | 152 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), |
153 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), | 153 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), |
154 | }; | 154 | }; |
155 | 155 | ||
@@ -159,8 +159,7 @@ enum ieee80211_chanctx_change { | |||
159 | * This is the driver-visible part. The ieee80211_chanctx | 159 | * This is the driver-visible part. The ieee80211_chanctx |
160 | * that contains it is visible in mac80211 only. | 160 | * that contains it is visible in mac80211 only. |
161 | * | 161 | * |
162 | * @channel: the channel to tune to | 162 | * @def: the channel definition |
163 | * @channel_type: the channel (HT) type | ||
164 | * @rx_chains_static: The number of RX chains that must always be | 163 | * @rx_chains_static: The number of RX chains that must always be |
165 | * active on the channel to receive MIMO transmissions | 164 | * active on the channel to receive MIMO transmissions |
166 | * @rx_chains_dynamic: The number of RX chains that must be enabled | 165 | * @rx_chains_dynamic: The number of RX chains that must be enabled |
@@ -170,8 +169,7 @@ enum ieee80211_chanctx_change { | |||
170 | * sizeof(void *), size is determined in hw information. | 169 | * sizeof(void *), size is determined in hw information. |
171 | */ | 170 | */ |
172 | struct ieee80211_chanctx_conf { | 171 | struct ieee80211_chanctx_conf { |
173 | struct ieee80211_channel *channel; | 172 | struct cfg80211_chan_def def; |
174 | enum nl80211_channel_type channel_type; | ||
175 | 173 | ||
176 | u8 rx_chains_static, rx_chains_dynamic; | 174 | u8 rx_chains_static, rx_chains_dynamic; |
177 | 175 | ||
@@ -207,6 +205,9 @@ struct ieee80211_chanctx_conf { | |||
207 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | 205 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) |
208 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) | 206 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) |
209 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) | 207 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) |
208 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface | ||
209 | * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) | ||
210 | * changed (currently only in P2P client mode, GO mode will be later) | ||
210 | */ | 211 | */ |
211 | enum ieee80211_bss_change { | 212 | enum ieee80211_bss_change { |
212 | BSS_CHANGED_ASSOC = 1<<0, | 213 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -227,6 +228,8 @@ enum ieee80211_bss_change { | |||
227 | BSS_CHANGED_SSID = 1<<15, | 228 | BSS_CHANGED_SSID = 1<<15, |
228 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, | 229 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, |
229 | BSS_CHANGED_PS = 1<<17, | 230 | BSS_CHANGED_PS = 1<<17, |
231 | BSS_CHANGED_TXPOWER = 1<<18, | ||
232 | BSS_CHANGED_P2P_PS = 1<<19, | ||
230 | 233 | ||
231 | /* when adding here, make sure to change ieee80211_reconfig */ | 234 | /* when adding here, make sure to change ieee80211_reconfig */ |
232 | }; | 235 | }; |
@@ -283,9 +286,8 @@ enum ieee80211_rssi_event { | |||
283 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | 286 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) |
284 | * @bssid: The BSSID for this BSS | 287 | * @bssid: The BSSID for this BSS |
285 | * @enable_beacon: whether beaconing should be enabled or not | 288 | * @enable_beacon: whether beaconing should be enabled or not |
286 | * @channel_type: Channel type for this BSS -- the hardware might be | 289 | * @chandef: Channel definition for this BSS -- the hardware might be |
287 | * configured for HT40+ while this BSS only uses no-HT, for | 290 | * configured a higher bandwidth than this BSS uses, for example. |
288 | * example. | ||
289 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. | 291 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. |
290 | * This field is only valid when the channel type is one of the HT types. | 292 | * This field is only valid when the channel type is one of the HT types. |
291 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | 293 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value |
@@ -309,6 +311,9 @@ enum ieee80211_rssi_event { | |||
309 | * @ssid: The SSID of the current vif. Only valid in AP-mode. | 311 | * @ssid: The SSID of the current vif. Only valid in AP-mode. |
310 | * @ssid_len: Length of SSID given in @ssid. | 312 | * @ssid_len: Length of SSID given in @ssid. |
311 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | 313 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
314 | * @txpower: TX power in dBm | ||
315 | * @p2p_ctwindow: P2P CTWindow, only for P2P client interfaces | ||
316 | * @p2p_oppps: P2P opportunistic PS is enabled | ||
312 | */ | 317 | */ |
313 | struct ieee80211_bss_conf { | 318 | struct ieee80211_bss_conf { |
314 | const u8 *bssid; | 319 | const u8 *bssid; |
@@ -331,7 +336,7 @@ struct ieee80211_bss_conf { | |||
331 | u16 ht_operation_mode; | 336 | u16 ht_operation_mode; |
332 | s32 cqm_rssi_thold; | 337 | s32 cqm_rssi_thold; |
333 | u32 cqm_rssi_hyst; | 338 | u32 cqm_rssi_hyst; |
334 | enum nl80211_channel_type channel_type; | 339 | struct cfg80211_chan_def chandef; |
335 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | 340 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; |
336 | u8 arp_addr_cnt; | 341 | u8 arp_addr_cnt; |
337 | bool arp_filter_enabled; | 342 | bool arp_filter_enabled; |
@@ -341,6 +346,9 @@ struct ieee80211_bss_conf { | |||
341 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 346 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
342 | size_t ssid_len; | 347 | size_t ssid_len; |
343 | bool hidden_ssid; | 348 | bool hidden_ssid; |
349 | int txpower; | ||
350 | u8 p2p_ctwindow; | ||
351 | bool p2p_oppps; | ||
344 | }; | 352 | }; |
345 | 353 | ||
346 | /** | 354 | /** |
@@ -491,9 +499,14 @@ enum mac80211_tx_control_flags { | |||
491 | * This is set if the current BSS requires ERP protection. | 499 | * This is set if the current BSS requires ERP protection. |
492 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. | 500 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. |
493 | * @IEEE80211_TX_RC_MCS: HT rate. | 501 | * @IEEE80211_TX_RC_MCS: HT rate. |
502 | * @IEEE80211_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is split | ||
503 | * into a higher 4 bits (Nss) and lower 4 bits (MCS number) | ||
494 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in | 504 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in |
495 | * Greenfield mode. | 505 | * Greenfield mode. |
496 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. | 506 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. |
507 | * @IEEE80211_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission | ||
508 | * @IEEE80211_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission | ||
509 | * (80+80 isn't supported yet) | ||
497 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the | 510 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the |
498 | * adjacent 20 MHz channels, if the current channel type is | 511 | * adjacent 20 MHz channels, if the current channel type is |
499 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. | 512 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. |
@@ -504,12 +517,15 @@ enum mac80211_rate_control_flags { | |||
504 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), | 517 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), |
505 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), | 518 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), |
506 | 519 | ||
507 | /* rate index is an MCS rate number instead of an index */ | 520 | /* rate index is an HT/VHT MCS instead of an index */ |
508 | IEEE80211_TX_RC_MCS = BIT(3), | 521 | IEEE80211_TX_RC_MCS = BIT(3), |
509 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), | 522 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), |
510 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), | 523 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), |
511 | IEEE80211_TX_RC_DUP_DATA = BIT(6), | 524 | IEEE80211_TX_RC_DUP_DATA = BIT(6), |
512 | IEEE80211_TX_RC_SHORT_GI = BIT(7), | 525 | IEEE80211_TX_RC_SHORT_GI = BIT(7), |
526 | IEEE80211_TX_RC_VHT_MCS = BIT(8), | ||
527 | IEEE80211_TX_RC_80_MHZ_WIDTH = BIT(9), | ||
528 | IEEE80211_TX_RC_160_MHZ_WIDTH = BIT(10), | ||
513 | }; | 529 | }; |
514 | 530 | ||
515 | 531 | ||
@@ -552,10 +568,32 @@ enum mac80211_rate_control_flags { | |||
552 | */ | 568 | */ |
553 | struct ieee80211_tx_rate { | 569 | struct ieee80211_tx_rate { |
554 | s8 idx; | 570 | s8 idx; |
555 | u8 count; | 571 | u16 count:5, |
556 | u8 flags; | 572 | flags:11; |
557 | } __packed; | 573 | } __packed; |
558 | 574 | ||
575 | #define IEEE80211_MAX_TX_RETRY 31 | ||
576 | |||
577 | static inline void ieee80211_rate_set_vht(struct ieee80211_tx_rate *rate, | ||
578 | u8 mcs, u8 nss) | ||
579 | { | ||
580 | WARN_ON(mcs & ~0xF); | ||
581 | WARN_ON(nss & ~0x7); | ||
582 | rate->idx = (nss << 4) | mcs; | ||
583 | } | ||
584 | |||
585 | static inline u8 | ||
586 | ieee80211_rate_get_vht_mcs(const struct ieee80211_tx_rate *rate) | ||
587 | { | ||
588 | return rate->idx & 0xF; | ||
589 | } | ||
590 | |||
591 | static inline u8 | ||
592 | ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate) | ||
593 | { | ||
594 | return rate->idx >> 4; | ||
595 | } | ||
596 | |||
559 | /** | 597 | /** |
560 | * struct ieee80211_tx_info - skb transmit information | 598 | * struct ieee80211_tx_info - skb transmit information |
561 | * | 599 | * |
@@ -700,13 +738,20 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
700 | * the frame. | 738 | * the frame. |
701 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on | 739 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on |
702 | * the frame. | 740 | * the frame. |
703 | * @RX_FLAG_MACTIME_MPDU: The timestamp passed in the RX status (@mactime | 741 | * @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime |
704 | * field) is valid and contains the time the first symbol of the MPDU | 742 | * field) is valid and contains the time the first symbol of the MPDU |
705 | * was received. This is useful in monitor mode and for proper IBSS | 743 | * was received. This is useful in monitor mode and for proper IBSS |
706 | * merging. | 744 | * merging. |
745 | * @RX_FLAG_MACTIME_END: The timestamp passed in the RX status (@mactime | ||
746 | * field) is valid and contains the time the last symbol of the MPDU | ||
747 | * (including FCS) was received. | ||
707 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame | 748 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame |
708 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 749 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
750 | * @RX_FLAG_VHT: VHT MCS was used and rate_index is MCS index | ||
709 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 751 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
752 | * @RX_FLAG_80MHZ: 80 MHz was used | ||
753 | * @RX_FLAG_80P80MHZ: 80+80 MHz was used | ||
754 | * @RX_FLAG_160MHZ: 160 MHz was used | ||
710 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 755 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
711 | * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. | 756 | * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. |
712 | * Valid only for data frames (mainly A-MPDU) | 757 | * Valid only for data frames (mainly A-MPDU) |
@@ -734,7 +779,7 @@ enum mac80211_rx_flags { | |||
734 | RX_FLAG_IV_STRIPPED = BIT(4), | 779 | RX_FLAG_IV_STRIPPED = BIT(4), |
735 | RX_FLAG_FAILED_FCS_CRC = BIT(5), | 780 | RX_FLAG_FAILED_FCS_CRC = BIT(5), |
736 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), | 781 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), |
737 | RX_FLAG_MACTIME_MPDU = BIT(7), | 782 | RX_FLAG_MACTIME_START = BIT(7), |
738 | RX_FLAG_SHORTPRE = BIT(8), | 783 | RX_FLAG_SHORTPRE = BIT(8), |
739 | RX_FLAG_HT = BIT(9), | 784 | RX_FLAG_HT = BIT(9), |
740 | RX_FLAG_40MHZ = BIT(10), | 785 | RX_FLAG_40MHZ = BIT(10), |
@@ -748,6 +793,11 @@ enum mac80211_rx_flags { | |||
748 | RX_FLAG_AMPDU_IS_LAST = BIT(18), | 793 | RX_FLAG_AMPDU_IS_LAST = BIT(18), |
749 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), | 794 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), |
750 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), | 795 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), |
796 | RX_FLAG_MACTIME_END = BIT(21), | ||
797 | RX_FLAG_VHT = BIT(22), | ||
798 | RX_FLAG_80MHZ = BIT(23), | ||
799 | RX_FLAG_80P80MHZ = BIT(24), | ||
800 | RX_FLAG_160MHZ = BIT(25), | ||
751 | }; | 801 | }; |
752 | 802 | ||
753 | /** | 803 | /** |
@@ -768,25 +818,39 @@ enum mac80211_rx_flags { | |||
768 | * @IEEE80211_HW_SIGNAL_* | 818 | * @IEEE80211_HW_SIGNAL_* |
769 | * @antenna: antenna used | 819 | * @antenna: antenna used |
770 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 820 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
771 | * HT rates are use (RX_FLAG_HT) | 821 | * HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT) |
822 | * @vht_nss: number of streams (VHT only) | ||
772 | * @flag: %RX_FLAG_* | 823 | * @flag: %RX_FLAG_* |
773 | * @rx_flags: internal RX flags for mac80211 | 824 | * @rx_flags: internal RX flags for mac80211 |
774 | * @ampdu_reference: A-MPDU reference number, must be a different value for | 825 | * @ampdu_reference: A-MPDU reference number, must be a different value for |
775 | * each A-MPDU but the same for each subframe within one A-MPDU | 826 | * each A-MPDU but the same for each subframe within one A-MPDU |
776 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC | 827 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC |
828 | * @vendor_radiotap_bitmap: radiotap vendor namespace presence bitmap | ||
829 | * @vendor_radiotap_len: radiotap vendor namespace length | ||
830 | * @vendor_radiotap_align: radiotap vendor namespace alignment. Note | ||
831 | * that the actual data must be at the start of the SKB data | ||
832 | * already. | ||
833 | * @vendor_radiotap_oui: radiotap vendor namespace OUI | ||
834 | * @vendor_radiotap_subns: radiotap vendor sub namespace | ||
777 | */ | 835 | */ |
778 | struct ieee80211_rx_status { | 836 | struct ieee80211_rx_status { |
779 | u64 mactime; | 837 | u64 mactime; |
780 | u32 device_timestamp; | 838 | u32 device_timestamp; |
781 | u32 ampdu_reference; | 839 | u32 ampdu_reference; |
782 | u32 flag; | 840 | u32 flag; |
841 | u32 vendor_radiotap_bitmap; | ||
842 | u16 vendor_radiotap_len; | ||
783 | u16 freq; | 843 | u16 freq; |
784 | u8 rate_idx; | 844 | u8 rate_idx; |
845 | u8 vht_nss; | ||
785 | u8 rx_flags; | 846 | u8 rx_flags; |
786 | u8 band; | 847 | u8 band; |
787 | u8 antenna; | 848 | u8 antenna; |
788 | s8 signal; | 849 | s8 signal; |
789 | u8 ampdu_delimiter_crc; | 850 | u8 ampdu_delimiter_crc; |
851 | u8 vendor_radiotap_align; | ||
852 | u8 vendor_radiotap_oui[3]; | ||
853 | u8 vendor_radiotap_subns; | ||
790 | }; | 854 | }; |
791 | 855 | ||
792 | /** | 856 | /** |
@@ -884,7 +948,8 @@ enum ieee80211_smps_mode { | |||
884 | * powersave documentation below. This variable is valid only when | 948 | * powersave documentation below. This variable is valid only when |
885 | * the CONF_PS flag is set. | 949 | * the CONF_PS flag is set. |
886 | * | 950 | * |
887 | * @power_level: requested transmit power (in dBm) | 951 | * @power_level: requested transmit power (in dBm), backward compatibility |
952 | * value only that is set to the minimum of all interfaces | ||
888 | * | 953 | * |
889 | * @channel: the channel to tune to | 954 | * @channel: the channel to tune to |
890 | * @channel_type: the channel (HT) type | 955 | * @channel_type: the channel (HT) type |
@@ -2180,6 +2245,14 @@ enum ieee80211_rate_control_changed { | |||
2180 | * @sta_remove: Notifies low level driver about removal of an associated | 2245 | * @sta_remove: Notifies low level driver about removal of an associated |
2181 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2246 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
2182 | * | 2247 | * |
2248 | * @sta_add_debugfs: Drivers can use this callback to add debugfs files | ||
2249 | * when a station is added to mac80211's station list. This callback | ||
2250 | * and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS | ||
2251 | * conditional. This callback can sleep. | ||
2252 | * | ||
2253 | * @sta_remove_debugfs: Remove the debugfs files which were added using | ||
2254 | * @sta_add_debugfs. This callback can sleep. | ||
2255 | * | ||
2183 | * @sta_notify: Notifies low level driver about power state transition of an | 2256 | * @sta_notify: Notifies low level driver about power state transition of an |
2184 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating | 2257 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating |
2185 | * in AP mode, this callback will not be called when the flag | 2258 | * in AP mode, this callback will not be called when the flag |
@@ -2381,6 +2454,17 @@ enum ieee80211_rate_control_changed { | |||
2381 | * to vif. Possible use is for hw queue remapping. | 2454 | * to vif. Possible use is for hw queue remapping. |
2382 | * @unassign_vif_chanctx: Notifies device driver about channel context being | 2455 | * @unassign_vif_chanctx: Notifies device driver about channel context being |
2383 | * unbound from vif. | 2456 | * unbound from vif. |
2457 | * @start_ap: Start operation on the AP interface, this is called after all the | ||
2458 | * information in bss_conf is set and beacon can be retrieved. A channel | ||
2459 | * context is bound before this is called. Note that if the driver uses | ||
2460 | * software scan or ROC, this (and @stop_ap) isn't called when the AP is | ||
2461 | * just "paused" for scanning/ROC, which is indicated by the beacon being | ||
2462 | * disabled/enabled via @bss_info_changed. | ||
2463 | * @stop_ap: Stop operation on the AP interface. | ||
2464 | * | ||
2465 | * @restart_complete: Called after a call to ieee80211_restart_hw(), when the | ||
2466 | * reconfiguration has completed. This can help the driver implement the | ||
2467 | * reconfiguration step. This callback may sleep. | ||
2384 | */ | 2468 | */ |
2385 | struct ieee80211_ops { | 2469 | struct ieee80211_ops { |
2386 | void (*tx)(struct ieee80211_hw *hw, | 2470 | void (*tx)(struct ieee80211_hw *hw, |
@@ -2406,6 +2490,9 @@ struct ieee80211_ops { | |||
2406 | struct ieee80211_bss_conf *info, | 2490 | struct ieee80211_bss_conf *info, |
2407 | u32 changed); | 2491 | u32 changed); |
2408 | 2492 | ||
2493 | int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
2494 | void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
2495 | |||
2409 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, | 2496 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, |
2410 | struct netdev_hw_addr_list *mc_list); | 2497 | struct netdev_hw_addr_list *mc_list); |
2411 | void (*configure_filter)(struct ieee80211_hw *hw, | 2498 | void (*configure_filter)(struct ieee80211_hw *hw, |
@@ -2447,6 +2534,16 @@ struct ieee80211_ops { | |||
2447 | struct ieee80211_sta *sta); | 2534 | struct ieee80211_sta *sta); |
2448 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2535 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2449 | struct ieee80211_sta *sta); | 2536 | struct ieee80211_sta *sta); |
2537 | #ifdef CONFIG_MAC80211_DEBUGFS | ||
2538 | void (*sta_add_debugfs)(struct ieee80211_hw *hw, | ||
2539 | struct ieee80211_vif *vif, | ||
2540 | struct ieee80211_sta *sta, | ||
2541 | struct dentry *dir); | ||
2542 | void (*sta_remove_debugfs)(struct ieee80211_hw *hw, | ||
2543 | struct ieee80211_vif *vif, | ||
2544 | struct ieee80211_sta *sta, | ||
2545 | struct dentry *dir); | ||
2546 | #endif | ||
2450 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2547 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2451 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 2548 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
2452 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2549 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
@@ -2488,8 +2585,8 @@ struct ieee80211_ops { | |||
2488 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); | 2585 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); |
2489 | 2586 | ||
2490 | int (*remain_on_channel)(struct ieee80211_hw *hw, | 2587 | int (*remain_on_channel)(struct ieee80211_hw *hw, |
2588 | struct ieee80211_vif *vif, | ||
2491 | struct ieee80211_channel *chan, | 2589 | struct ieee80211_channel *chan, |
2492 | enum nl80211_channel_type channel_type, | ||
2493 | int duration); | 2590 | int duration); |
2494 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | 2591 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
2495 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | 2592 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |
@@ -2539,6 +2636,8 @@ struct ieee80211_ops { | |||
2539 | void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, | 2636 | void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, |
2540 | struct ieee80211_vif *vif, | 2637 | struct ieee80211_vif *vif, |
2541 | struct ieee80211_chanctx_conf *ctx); | 2638 | struct ieee80211_chanctx_conf *ctx); |
2639 | |||
2640 | void (*restart_complete)(struct ieee80211_hw *hw); | ||
2542 | }; | 2641 | }; |
2543 | 2642 | ||
2544 | /** | 2643 | /** |
@@ -3385,6 +3484,21 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw); | |||
3385 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | 3484 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); |
3386 | 3485 | ||
3387 | /** | 3486 | /** |
3487 | * enum ieee80211_interface_iteration_flags - interface iteration flags | ||
3488 | * @IEEE80211_IFACE_ITER_NORMAL: Iterate over all interfaces that have | ||
3489 | * been added to the driver; However, note that during hardware | ||
3490 | * reconfiguration (after restart_hw) it will iterate over a new | ||
3491 | * interface and over all the existing interfaces even if they | ||
3492 | * haven't been re-added to the driver yet. | ||
3493 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all | ||
3494 | * interfaces, even if they haven't been re-added to the driver yet. | ||
3495 | */ | ||
3496 | enum ieee80211_interface_iteration_flags { | ||
3497 | IEEE80211_IFACE_ITER_NORMAL = 0, | ||
3498 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), | ||
3499 | }; | ||
3500 | |||
3501 | /** | ||
3388 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 3502 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
3389 | * | 3503 | * |
3390 | * This function iterates over the interfaces associated with a given | 3504 | * This function iterates over the interfaces associated with a given |
@@ -3392,13 +3506,15 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | |||
3392 | * This function allows the iterator function to sleep, when the iterator | 3506 | * This function allows the iterator function to sleep, when the iterator |
3393 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 3507 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
3394 | * be used. | 3508 | * be used. |
3395 | * Does not iterate over a new interface during add_interface() | 3509 | * Does not iterate over a new interface during add_interface(). |
3396 | * | 3510 | * |
3397 | * @hw: the hardware struct of which the interfaces should be iterated over | 3511 | * @hw: the hardware struct of which the interfaces should be iterated over |
3512 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3398 | * @iterator: the iterator function to call | 3513 | * @iterator: the iterator function to call |
3399 | * @data: first argument of the iterator function | 3514 | * @data: first argument of the iterator function |
3400 | */ | 3515 | */ |
3401 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | 3516 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, |
3517 | u32 iter_flags, | ||
3402 | void (*iterator)(void *data, u8 *mac, | 3518 | void (*iterator)(void *data, u8 *mac, |
3403 | struct ieee80211_vif *vif), | 3519 | struct ieee80211_vif *vif), |
3404 | void *data); | 3520 | void *data); |
@@ -3410,13 +3526,15 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
3410 | * hardware that are currently active and calls the callback for them. | 3526 | * hardware that are currently active and calls the callback for them. |
3411 | * This function requires the iterator callback function to be atomic, | 3527 | * This function requires the iterator callback function to be atomic, |
3412 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 3528 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
3413 | * Does not iterate over a new interface during add_interface() | 3529 | * Does not iterate over a new interface during add_interface(). |
3414 | * | 3530 | * |
3415 | * @hw: the hardware struct of which the interfaces should be iterated over | 3531 | * @hw: the hardware struct of which the interfaces should be iterated over |
3532 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3416 | * @iterator: the iterator function to call, cannot sleep | 3533 | * @iterator: the iterator function to call, cannot sleep |
3417 | * @data: first argument of the iterator function | 3534 | * @data: first argument of the iterator function |
3418 | */ | 3535 | */ |
3419 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, | 3536 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, |
3537 | u32 iter_flags, | ||
3420 | void (*iterator)(void *data, | 3538 | void (*iterator)(void *data, |
3421 | u8 *mac, | 3539 | u8 *mac, |
3422 | struct ieee80211_vif *vif), | 3540 | struct ieee80211_vif *vif), |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 639f50af42d..671953e1157 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -149,6 +149,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | |||
149 | 149 | ||
150 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); | 150 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); |
151 | 151 | ||
152 | int nfc_hci_result_to_errno(u8 result); | ||
153 | |||
152 | /* Host IDs */ | 154 | /* Host IDs */ |
153 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | 155 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 |
154 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 | 156 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 |
@@ -235,5 +237,6 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | |||
235 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 237 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
236 | const u8 *param, size_t param_len); | 238 | const u8 *param, size_t param_len); |
237 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | 239 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); |
240 | u32 nfc_hci_sak_to_protocol(u8 sak); | ||
238 | 241 | ||
239 | #endif /* __NET_HCI_H */ | 242 | #endif /* __NET_HCI_H */ |