/* Intel 7265D/3165 firmware command layer ("mvm"): see iwl_mvm.c. * * One station interface: MAC context 0, PHY context 0 (= binding 0), the aux * station 1 for scan probes and the AP station 0 on TX queue 4. */ #ifndef IWL_MVM_H #define IWL_MVM_H /* Station IDs follow iwlmvm's iwl_mvm_find_free_sta_id(): the aux station * (added first, NL80211_IFTYPE_UNSPECIFIED) reserves ID 0, so it gets 1, * and the BSS/AP station gets 0. The firmware's RX/decrypt path expects * the BSS station there. */ #define IWL_STA_AUX 1 #define IWL_STA_AP 0 /* RX MPDU status bits (fw/api/rx.h). */ #define IWL_RX_CRC_OK (1u << 0) #define IWL_RX_OVERRUN_OK (1u << 1) #define IWL_RX_MIC_OK (1u << 6) #define IWL_RX_SEC_MSK (7u << 8) #define IWL_RX_SEC_CCM (2u << 8) /* Upcalls into wifi.c. */ void wifi_rx_frame(const unsigned char *frame, unsigned int len, int rssi, unsigned int status, unsigned int channel); void wifi_scan_done(int ok); /* Bring the card up (INIT image + calibration + NVM, then the runtime * image). Fills the NVM MAC address. 0 on success. */ int iwl_mvm_up(unsigned char mac[6]); int iwl_mvm_is_up(void); void iwl_mvm_down(void); const char *iwl_mvm_state(void); /* short status for `wifi` */ /* Poll the firmware RX ring (notifications, frames, TX responses). */ int iwl_mvm_poll(void); int iwl_mvm_scan_start(void); /* wildcard active scan, all channels */ int iwl_mvm_scan_running(void); /* Connection: PHY context to `chan`, binding + quota, MAC with the BSSID, * AP station + queue, session protection. Then the 802.11 frames go out * with iwl_mvm_tx_mgmt(). */ int iwl_mvm_prepare_connect(const unsigned char bssid[6], unsigned int chan, unsigned int beacon_int); int iwl_mvm_set_assoc(unsigned short aid, unsigned int beacon_int, unsigned int dtim); void iwl_mvm_disconnect(void); /* Raw 802.11 frames (header included). Management frames go at the * lowest rate; data at a fixed OFDM rate. `protect`: CCMP with the * pairwise key (the frame must already carry the 8-byte CCMP header). */ int iwl_mvm_tx_mgmt(const unsigned char *frame, unsigned int len); int iwl_mvm_tx_data(const unsigned char *frame, unsigned int len, int protect); /* Install a CCMP key: pairwise (key index 0) or group (`keyidx`, with the * 6-byte receive sequence counter from the EAPOL frame). */ int iwl_mvm_set_key(int pairwise, int keyidx, const unsigned char key[16], const unsigned char rsc[6]); void iwl_mvm_clear_keys(void); #endif