iwl_mvm.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* Intel 7265D/3165 firmware command layer ("mvm"): see iwl_mvm.c.
  2. *
  3. * One station interface: MAC context 0, PHY context 0 (= binding 0), the aux
  4. * station 0 for scan probes and the AP station 1 on TX queue 4. */
  5. #ifndef IWL_MVM_H
  6. #define IWL_MVM_H
  7. #define IWL_STA_AUX 0
  8. #define IWL_STA_AP 1
  9. /* RX MPDU status bits (fw/api/rx.h). */
  10. #define IWL_RX_CRC_OK (1u << 0)
  11. #define IWL_RX_OVERRUN_OK (1u << 1)
  12. #define IWL_RX_MIC_OK (1u << 6)
  13. #define IWL_RX_SEC_MSK (7u << 8)
  14. #define IWL_RX_SEC_CCM (2u << 8)
  15. /* Upcalls into wifi.c. */
  16. void wifi_rx_frame(const unsigned char *frame, unsigned int len, int rssi,
  17. unsigned int status, unsigned int channel);
  18. void wifi_scan_done(int ok);
  19. /* Bring the card up (INIT image + calibration + NVM, then the runtime
  20. * image). Fills the NVM MAC address. 0 on success. */
  21. int iwl_mvm_up(unsigned char mac[6]);
  22. int iwl_mvm_is_up(void);
  23. void iwl_mvm_down(void);
  24. const char *iwl_mvm_state(void); /* short status for `wifi` */
  25. /* Poll the firmware RX ring (notifications, frames, TX responses). */
  26. int iwl_mvm_poll(void);
  27. int iwl_mvm_scan_start(void); /* wildcard active scan, all channels */
  28. int iwl_mvm_scan_running(void);
  29. /* Connection: PHY context to `chan`, binding + quota, MAC with the BSSID,
  30. * AP station + queue, session protection. Then the 802.11 frames go out
  31. * with iwl_mvm_tx_mgmt(). */
  32. int iwl_mvm_prepare_connect(const unsigned char bssid[6], unsigned int chan,
  33. unsigned int beacon_int);
  34. int iwl_mvm_set_assoc(unsigned short aid, unsigned int beacon_int,
  35. unsigned int dtim);
  36. void iwl_mvm_disconnect(void);
  37. /* Raw 802.11 frames (header included). Management frames go at the
  38. * lowest rate; data at a fixed OFDM rate. `protect`: CCMP with the
  39. * pairwise key (the frame must already carry the 8-byte CCMP header). */
  40. int iwl_mvm_tx_mgmt(const unsigned char *frame, unsigned int len);
  41. int iwl_mvm_tx_data(const unsigned char *frame, unsigned int len,
  42. int protect);
  43. /* Install a CCMP key: pairwise (key index 0) or group (`keyidx`, with the
  44. * 6-byte receive sequence counter from the EAPOL frame). */
  45. int iwl_mvm_set_key(int pairwise, int keyidx, const unsigned char key[16],
  46. const unsigned char rsc[6]);
  47. void iwl_mvm_clear_keys(void);
  48. #endif