13d2a2544SEmmanuel Grumbach /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 23d2a2544SEmmanuel Grumbach /* 33d2a2544SEmmanuel Grumbach * Copyright (C) 2012-2014, 2018-2021 Intel Corporation 43d2a2544SEmmanuel Grumbach * Copyright (C) 2013-2015 Intel Mobile Communications GmbH 53d2a2544SEmmanuel Grumbach * Copyright (C) 2016-2017 Intel Deutschland GmbH 63d2a2544SEmmanuel Grumbach */ 73d2a2544SEmmanuel Grumbach #ifndef __VENDOR_CMD_INTEL_H__ 83d2a2544SEmmanuel Grumbach #define __VENDOR_CMD_INTEL_H__ 93d2a2544SEmmanuel Grumbach 103d2a2544SEmmanuel Grumbach #define INTEL_OUI 0x001735 113d2a2544SEmmanuel Grumbach 123d2a2544SEmmanuel Grumbach /** 133d2a2544SEmmanuel Grumbach * enum iwl_mvm_vendor_cmd - supported vendor commands 143d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO: reports CSME connection info. 153d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP: asks for ownership on the device. 16*1add667dSEmmanuel Grumbach * This is useful when the CSME firmware owns the device and the kernel 17*1add667dSEmmanuel Grumbach * wants to use it. In case the CSME firmware has no connection active the 18*1add667dSEmmanuel Grumbach * kernel will manage on its own to get ownership of the device. 19*1add667dSEmmanuel Grumbach * When the CSME firmware has an active connection, the user space 20*1add667dSEmmanuel Grumbach * involvement is required. The kernel will assert the RFKILL signal with 21*1add667dSEmmanuel Grumbach * the "device not owned" reason so that nobody can touch the device. Then 22*1add667dSEmmanuel Grumbach * the user space can run the following flow to be able to get connected 23*1add667dSEmmanuel Grumbach * to the very same AP the CSME firmware is currently connected to: 24*1add667dSEmmanuel Grumbach * 25*1add667dSEmmanuel Grumbach * 1) The user space (NetworkManager) boots and sees that the device is 26*1add667dSEmmanuel Grumbach * in RFKILL because the host doesn't own the device 27*1add667dSEmmanuel Grumbach * 2) The user space asks the kernel what AP the CSME firmware is 28*1add667dSEmmanuel Grumbach * connected to (with %IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO) 29*1add667dSEmmanuel Grumbach * 3) The user space checks if it has a profile that matches the reply 30*1add667dSEmmanuel Grumbach * from the CSME firmware 31*1add667dSEmmanuel Grumbach * 4) The user space installs a network to the wpa_supplicant with a 32*1add667dSEmmanuel Grumbach * specific BSSID and a specific frequency 33*1add667dSEmmanuel Grumbach * 5) The user space prevents any type of full scan 34*1add667dSEmmanuel Grumbach * 6) The user space asks iwlmei to request ownership on the device (with 35*1add667dSEmmanuel Grumbach * this command) 36*1add667dSEmmanuel Grumbach * 7) iwlmei requests ownership from the CSME firmware 37*1add667dSEmmanuel Grumbach * 8) The CSME firmware grants ownership 38*1add667dSEmmanuel Grumbach * 9) iwlmei tells iwlwifi to lift the RFKILL 39*1add667dSEmmanuel Grumbach * 10) RFKILL OFF is reported to user space 40*1add667dSEmmanuel Grumbach * 11) The host boots the device, loads the firwmare, and connects to a 41*1add667dSEmmanuel Grumbach * specific BSSID without scanning including IP as fast as it can 42*1add667dSEmmanuel Grumbach * 12) The host reports to the CSME firmware that there is a connection 43*1add667dSEmmanuel Grumbach * 13) The TCP connection is preserved and the host has connectivity 44*1add667dSEmmanuel Grumbach * 453d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT: notifies if roaming is allowed. 463d2a2544SEmmanuel Grumbach * It contains a &IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN and a 473d2a2544SEmmanuel Grumbach * &IWL_MVM_VENDOR_ATTR_VIF_ADDR attributes. 483d2a2544SEmmanuel Grumbach */ 493d2a2544SEmmanuel Grumbach 503d2a2544SEmmanuel Grumbach enum iwl_mvm_vendor_cmd { 513d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO = 0x2d, 523d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP = 0x30, 533d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT = 0x32, 543d2a2544SEmmanuel Grumbach }; 553d2a2544SEmmanuel Grumbach 563d2a2544SEmmanuel Grumbach enum iwl_vendor_auth_akm_mode { 573d2a2544SEmmanuel Grumbach IWL_VENDOR_AUTH_OPEN, 583d2a2544SEmmanuel Grumbach IWL_VENDOR_AUTH_RSNA = 0x6, 593d2a2544SEmmanuel Grumbach IWL_VENDOR_AUTH_RSNA_PSK, 603d2a2544SEmmanuel Grumbach IWL_VENDOR_AUTH_SAE = 0x9, 613d2a2544SEmmanuel Grumbach IWL_VENDOR_AUTH_MAX, 623d2a2544SEmmanuel Grumbach }; 633d2a2544SEmmanuel Grumbach 643d2a2544SEmmanuel Grumbach /** 653d2a2544SEmmanuel Grumbach * enum iwl_mvm_vendor_attr - attributes used in vendor commands 663d2a2544SEmmanuel Grumbach * @__IWL_MVM_VENDOR_ATTR_INVALID: attribute 0 is invalid 673d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_VIF_ADDR: interface MAC address 683d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_ADDR: MAC address 693d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_SSID: SSID (binary attribute, 0..32 octets) 703d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_STA_CIPHER: the cipher to use for the station with the 713d2a2544SEmmanuel Grumbach * mac address specified in &IWL_MVM_VENDOR_ATTR_ADDR. 723d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN: u8 attribute. Indicates whether 733d2a2544SEmmanuel Grumbach * roaming is forbidden or not. Value 1 means roaming is forbidden, 743d2a2544SEmmanuel Grumbach * 0 mean roaming is allowed. 753d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_AUTH_MODE: u32 attribute. Authentication mode type 763d2a2544SEmmanuel Grumbach * as specified in &enum iwl_vendor_auth_akm_mode. 773d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_CHANNEL_NUM: u8 attribute. Contains channel number. 783d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_BAND: u8 attribute. 793d2a2544SEmmanuel Grumbach * 0 for 2.4 GHz band, 1 for 5.2GHz band and 2 for 6GHz band. 803d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL: u32 attribute. Channel number of 813d2a2544SEmmanuel Grumbach * collocated AP. Relevant for 6GHz AP info. 823d2a2544SEmmanuel Grumbach * @IWL_MVM_VENDOR_ATTR_COLLOC_ADDR: MAC address of a collocated AP. 833d2a2544SEmmanuel Grumbach * Relevant for 6GHz AP info. 843d2a2544SEmmanuel Grumbach * 853d2a2544SEmmanuel Grumbach * @NUM_IWL_MVM_VENDOR_ATTR: number of vendor attributes 863d2a2544SEmmanuel Grumbach * @MAX_IWL_MVM_VENDOR_ATTR: highest vendor attribute number 873d2a2544SEmmanuel Grumbach 883d2a2544SEmmanuel Grumbach */ 893d2a2544SEmmanuel Grumbach enum iwl_mvm_vendor_attr { 903d2a2544SEmmanuel Grumbach __IWL_MVM_VENDOR_ATTR_INVALID = 0x00, 913d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_VIF_ADDR = 0x02, 923d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_ADDR = 0x0a, 933d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_SSID = 0x3d, 943d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_STA_CIPHER = 0x51, 953d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN = 0x64, 963d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_AUTH_MODE = 0x65, 973d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_CHANNEL_NUM = 0x66, 983d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_BAND = 0x69, 993d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL = 0x70, 1003d2a2544SEmmanuel Grumbach IWL_MVM_VENDOR_ATTR_COLLOC_ADDR = 0x71, 1013d2a2544SEmmanuel Grumbach 1023d2a2544SEmmanuel Grumbach NUM_IWL_MVM_VENDOR_ATTR, 1033d2a2544SEmmanuel Grumbach MAX_IWL_MVM_VENDOR_ATTR = NUM_IWL_MVM_VENDOR_ATTR - 1, 1043d2a2544SEmmanuel Grumbach }; 1053d2a2544SEmmanuel Grumbach 1063d2a2544SEmmanuel Grumbach #endif /* __VENDOR_CMD_INTEL_H__ */ 107