Changeset 8a64320e in mainline for uspace/drv/nic/ar9271/wmi.h


Ignore:
Timestamp:
2015-04-23T23:40:14Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dcba819
Parents:
09044cb
Message:

pre-merge coding style cleanup and code review

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ar9271/wmi.h

    r09044cb r8a64320e  
    3535
    3636#ifndef ATHEROS_WMI_H
    37 #define ATHEROS_WMI_H
     37#define ATHEROS_WMI_H
    3838
    3939#include "htc.h"
    4040
    4141/* 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
    4443
    45 #define WMI_MGMT_CMD_MASK 0x1000
     44#define CREATE_SERVICE_ID(group, i) \
     45        (unsigned int) (((unsigned int) group << 8) | (unsigned int) (i))
    4646
    47 /**
    48  * WMI header structure.
     47#define WMI_MGMT_CMD_MASK  0x1000
     48
     49/** WMI header structure.
     50 *
    4951 */
    5052typedef 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! */
    5355} __attribute__((packed)) wmi_command_header_t;
    5456
    55 /**
    56  * WMI services IDs
     57/** WMI services IDs
     58 *
    5759 */
    5860typedef enum {
     
    6870} wmi_services_t;
    6971
    70 /**
    71  * List of WMI commands
     72/** List of WMI commands
     73 *
    7274 */
    7375typedef enum {
    7476        WMI_ECHO = 0x0001,
    7577        WMI_ACCESS_MEMORY,
    76 
     78       
    7779        /* Commands used for HOST -> DEVICE communication */
    7880        WMI_GET_FW_VERSION,
     
    107109} wmi_command_t;
    108110
    109 /**
    110  * Structure used when sending registry buffer
     111/**Structure used when sending registry buffer
     112 *
    111113 */
    112114typedef struct {
    113         uint32_t offset;                /**< Big Endian value! */
    114         uint32_t value;                 /**< Big Endian value! */
     115        uint32_t offset;  /**< Big Endian value! */
     116        uint32_t value;   /**< Big Endian value! */
    115117} wmi_reg_t;
    116118
    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);
     119extern int wmi_reg_read(htc_device_t *, uint32_t, uint32_t *);
     120extern int wmi_reg_write(htc_device_t *, uint32_t, uint32_t);
     121extern int wmi_reg_set_clear_bit(htc_device_t *, uint32_t, uint32_t, uint32_t);
     122extern int wmi_reg_set_bit(htc_device_t *, uint32_t, uint32_t);
     123extern int wmi_reg_clear_bit(htc_device_t *, uint32_t, uint32_t);
     124extern int wmi_reg_buffer_write(htc_device_t *, wmi_reg_t *, size_t);
     125extern int wmi_send_command(htc_device_t *, wmi_command_t, uint8_t *, uint32_t,
     126    void *);
    133127
    134 #endif  /* ATHEROS_WMI_H */
    135 
     128#endif  /* ATHEROS_WMI_H */
Note: See TracChangeset for help on using the changeset viewer.