Changeset 8a64320e in mainline for uspace/drv/nic/ar9271/wmi.h
- Timestamp:
- 2015-04-23T23:40:14Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dcba819
- Parents:
- 09044cb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ar9271/wmi.h
r09044cb r8a64320e 35 35 36 36 #ifndef ATHEROS_WMI_H 37 #define 37 #define ATHEROS_WMI_H 38 38 39 39 #include "htc.h" 40 40 41 41 /* Macros for creating service identificators. */ 42 #define WMI_SERVICE_GROUP 1 43 #define CREATE_SERVICE_ID(group, i) (int) (((int) group << 8) | (int) (i)) 42 #define WMI_SERVICE_GROUP 1 44 43 45 #define WMI_MGMT_CMD_MASK 0x1000 44 #define CREATE_SERVICE_ID(group, i) \ 45 (unsigned int) (((unsigned int) group << 8) | (unsigned int) (i)) 46 46 47 /** 48 * WMI header structure. 47 #define WMI_MGMT_CMD_MASK 0x1000 48 49 /** WMI header structure. 50 * 49 51 */ 50 52 typedef struct { 51 uint16_t command_id;/**< Big Endian value! */52 uint16_t sequence_number;/**< Big Endian value! */53 uint16_t command_id; /**< Big Endian value! */ 54 uint16_t sequence_number; /**< Big Endian value! */ 53 55 } __attribute__((packed)) wmi_command_header_t; 54 56 55 /** 56 * WMI services IDs57 /** WMI services IDs 58 * 57 59 */ 58 60 typedef enum { … … 68 70 } wmi_services_t; 69 71 70 /** 71 * List of WMI commands72 /** List of WMI commands 73 * 72 74 */ 73 75 typedef enum { 74 76 WMI_ECHO = 0x0001, 75 77 WMI_ACCESS_MEMORY, 76 78 77 79 /* Commands used for HOST -> DEVICE communication */ 78 80 WMI_GET_FW_VERSION, … … 107 109 } wmi_command_t; 108 110 109 /** 110 * Structure used when sending registry buffer111 /**Structure used when sending registry buffer 112 * 111 113 */ 112 114 typedef struct { 113 uint32_t offset; 114 uint32_t value; 115 uint32_t offset; /**< Big Endian value! */ 116 uint32_t value; /**< Big Endian value! */ 115 117 } wmi_reg_t; 116 118 117 extern int wmi_reg_read(htc_device_t *htc_device, uint32_t reg_offset, 118 uint32_t *res); 119 extern int wmi_reg_write(htc_device_t *htc_device, uint32_t reg_offset, 120 uint32_t val); 121 extern int wmi_reg_set_clear_bit(htc_device_t *htc_device, 122 uint32_t reg_offset, uint32_t set_bit, uint32_t clear_bit); 123 extern int wmi_reg_set_bit(htc_device_t *htc_device, uint32_t reg_offset, 124 uint32_t set_bit); 125 extern int wmi_reg_clear_bit(htc_device_t *htc_device, uint32_t reg_offset, 126 uint32_t clear_bit); 127 extern int wmi_reg_buffer_write(htc_device_t *htc_device, 128 wmi_reg_t *reg_buffer, size_t elements); 129 extern int wmi_send_command(htc_device_t *htc_device, 130 wmi_command_t command_id, 131 uint8_t *command_buffer, uint32_t command_length, 132 void *response_buffer); 119 extern int wmi_reg_read(htc_device_t *, uint32_t, uint32_t *); 120 extern int wmi_reg_write(htc_device_t *, uint32_t, uint32_t); 121 extern int wmi_reg_set_clear_bit(htc_device_t *, uint32_t, uint32_t, uint32_t); 122 extern int wmi_reg_set_bit(htc_device_t *, uint32_t, uint32_t); 123 extern int wmi_reg_clear_bit(htc_device_t *, uint32_t, uint32_t); 124 extern int wmi_reg_buffer_write(htc_device_t *, wmi_reg_t *, size_t); 125 extern int wmi_send_command(htc_device_t *, wmi_command_t, uint8_t *, uint32_t, 126 void *); 133 127 134 #endif /* ATHEROS_WMI_H */ 135 128 #endif /* ATHEROS_WMI_H */
Note:
See TracChangeset
for help on using the changeset viewer.