Changeset 8a64320e in mainline for uspace/drv/nic/ar9271/ar9271.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/ar9271.h

    r09044cb r8a64320e  
    3737
    3838#include <usb/dev/driver.h>
    39 
    4039#include "htc.h"
    4140
    4241/** Number of transmission queues */
    43 #define AR9271_QUEUES_COUNT 10
     42#define AR9271_QUEUES_COUNT  10
    4443
    4544/** Number of GPIO pin used for handling led light */
    46 #define AR9271_LED_PIN 15
     45#define AR9271_LED_PIN  15
    4746
    4847/** Nominal value for AR9271 noise floor calibration. */
    49 #define AR9271_CALIB_NOMINAL_VALUE_2GHZ -118
     48#define AR9271_CALIB_NOMINAL_VALUE_2GHZ  -118
    5049
    5150/** RX errors values. */
    52 #define AR9271_RX_ERROR_CRC 0x01
    53 #define AR9271_RX_ERROR_PHY 0x02
     51#define AR9271_RX_ERROR_CRC  0x01
     52#define AR9271_RX_ERROR_PHY  0x02
    5453
    5554/** Key index used for device in station mode. */
    56 #define AR9271_STA_KEY_INDEX 4
     55#define AR9271_STA_KEY_INDEX  4
    5756
    5857/* HW encryption key indicator. */
     
    8382        AR9271_RC = 0x4000,
    8483        AR9271_RC_AHB = 0x00000001,
    85                
     84       
    8685        /* GPIO registers */
    87         AR9271_GPIO_IN_OUT = 0x4048,            /**< GPIO value read/set  */
    88         AR9271_GPIO_OE_OUT = 0x404C,            /**< GPIO set to output  */
    89         AR9271_GPIO_OE_OUT_ALWAYS = 0x3,        /**< GPIO always drive output */
     86        AR9271_GPIO_IN_OUT = 0x4048,       /**< GPIO value read/set  */
     87        AR9271_GPIO_OE_OUT = 0x404C,       /**< GPIO set to output  */
     88        AR9271_GPIO_OE_OUT_ALWAYS = 0x3,   /**< GPIO always drive output */
    9089        AR9271_GPIO_OUT_MUX1 = 0x4060,
    9190        AR9271_GPIO_OUT_MUX2 = 0x4064,
    9291        AR9271_GPIO_OUT_MUX3 = 0x4068,
    93         AR9271_GPIO_OUT_MUX_AS_OUT = 0x0,       /**< GPIO set mux as output */
    94    
     92        AR9271_GPIO_OUT_MUX_AS_OUT = 0x0,  /**< GPIO set mux as output */
     93       
    9594        /* RTC related registers */
    9695        AR9271_RTC_RC = 0x7000,
     
    109108        AR9271_RTC_FORCE_WAKE_ENABLE = 0x00000001,
    110109        AR9271_RTC_FORCE_WAKE_ON_INT = 0x00000002,
    111                
     110       
    112111        /* MAC Registers */
    113         AR9271_STATION_ID0 = 0x8000,    /**< STA Address Lower 32 Bits */
    114         AR9271_STATION_ID1 = 0x8004,    /**< STA Address Upper 16 Bits */
    115         AR9271_BSSID0 = 0x8008,         /**< BSSID Lower 32 Bits */
    116         AR9271_BSSID1 = 0x800C,         /**< BSSID Upper 16 Bits */
    117         AR9271_BSSID_MASK0 = 0x80E0,    /**< BSSID Mask Lower 32 Bits */
    118         AR9271_BSSID_MASK1 = 0x80E4,    /**< BSSID Mask Upper 16 Bits */
     112        AR9271_STATION_ID0 = 0x8000,  /**< STA Address Lower 32 Bits */
     113        AR9271_STATION_ID1 = 0x8004,  /**< STA Address Upper 16 Bits */
     114        AR9271_BSSID0 = 0x8008,       /**< BSSID Lower 32 Bits */
     115        AR9271_BSSID1 = 0x800C,       /**< BSSID Upper 16 Bits */
     116        AR9271_BSSID_MASK0 = 0x80E0,  /**< BSSID Mask Lower 32 Bits */
     117        AR9271_BSSID_MASK1 = 0x80E4,  /**< BSSID Mask Upper 16 Bits */
    119118        AR9271_STATION_ID1_MASK = 0x0000FFFF,
    120119        AR9271_STATION_ID1_POWER_SAVING = 0x00040000,
    121120        AR9271_MULTICAST_FILTER1 = 0x8040,
    122         AR9271_MULTICAST_FILTER2 = 0x8044,     
     121        AR9271_MULTICAST_FILTER2 = 0x8044,
    123122        AR9271_DIAG = 0x8048,
    124                
     123       
    125124        /* RX filtering register */
    126125        AR9271_RX_FILTER = 0x803C,
     
    134133        AR9271_RX_FILTER_MYBEACON = 0x00000200,
    135134        AR9271_RX_FILTER_MCAST_BCAST_ALL = 0x00008000,
    136                
     135       
    137136        /* Key related registers */
    138137        AR9271_KEY_TABLE_BASE = 0x8800,
     
    142141        AR9271_KEY_TABLE_TYPE_CCMP = 0x6,
    143142        AR9271_KEY_TABLE_TYPE_CLR = 0x7,
    144                
     143       
    145144        /* Physical layer registers */
    146145        AR9271_PHY_ACTIVE = 0x981C,
     
    168167        AR9271_PHY_TPCRG1_PD_CALIB = 0x00400000,
    169168        AR9271_CARRIER_LEAK_CALIB = 0x00000002,
    170                
     169       
    171170        AR9271_OPMODE_STATION_AP_MASK = 0x00010000,
    172171        AR9271_OPMODE_ADHOC_MASK = 0x00020000,
    173                
     172       
    174173        AR9271_CLOCK_CONTROL = 0x50040,
    175174        AR9271_MAX_CPU_CLOCK = 0x304,
    176                
     175       
    177176        AR9271_RESET_POWER_DOWN_CONTROL = 0x50044,
    178177        AR9271_RADIO_RF_RESET = 0x20,
    179178        AR9271_GATE_MAC_CONTROL = 0x4000,
    180    
     179       
    181180        /* FW Addresses */
    182181        AR9271_FW_ADDRESS = 0x501000,
     
    185184
    186185/** Compute key table base position for key by its id. */
    187 #define AR9271_KEY_TABLE(id) (AR9271_KEY_TABLE_BASE + (id)*32)
     186#define AR9271_KEY_TABLE(id)  (AR9271_KEY_TABLE_BASE + (id) * 32)
    188187
    189188/** AR9271 Requests */
     
    217216} ar9271_t;
    218217
    219 /**
    220  * AR9271 init values for 2GHz mode operation.
    221  *
     218/** AR9271 init values for 2GHz mode operation.
     219 *
    222220 * Including settings of noise floor limits.
    223  *
    224  * Taken from Linux sources.
     221 *
     222 * Taken from the Linux driver (drivers/net/wireless/ath/ath9k/)
     223 * Copyright (c) 2008-2011 Atheros Communications Inc.
     224 * Licensed under the terms of ISC
     225 *
    225226 */
    226227static const uint32_t ar9271_2g_mode_array[][2] = {
     
    232233        {0x0000801c, 0x12e0002b},
    233234        {0x00008318, 0x00003440},
    234         {0x00009804, 0x000003c0},/*< note: overridden */
     235        {0x00009804, 0x000003c0},  /*< Note: overridden */
    235236        {0x00009820, 0x02020200},
    236237        {0x00009824, 0x01000e0e},
    237         {0x00009828, 0x0a020001},/*< note: overridden */
     238        {0x00009828, 0x0a020001},  /*< Note: overridden */
    238239        {0x00009834, 0x00000e0e},
    239240        {0x00009838, 0x00000007},
     
    530531};
    531532
    532 /**
    533  * AR9271 TX init values for 2GHz mode operation.
    534  *
    535  * Taken from Linux sources.
     533/** AR9271 TX init values for 2GHz mode operation.
     534 *
     535 * Taken from the Linux driver (drivers/net/wireless/ath/ath9k/)
     536 * Copyright (c) 2008-2011 Atheros Communications Inc.
     537 * Licensed under the terms of ISC
     538 *
    536539 */
    537540static const uint32_t ar9271_2g_tx_array[][2] = {
     
    571574};
    572575
    573 /**
    574  * AR9271 hardware init values.
    575  *
    576  * Taken from Linux sources, some values omitted.
     576/** AR9271 hardware init values.
     577 *
     578 * Taken from the Linux driver (drivers/net/wireless/ath/ath9k/)
     579 * Copyright (c) 2008-2011 Atheros Communications Inc.
     580 * Licensed under the terms of ISC
     581 *
    577582 */
    578583static const uint32_t ar9271_init_array[][2] = {
     
    766771        {0x0000833c, 0x00000000},
    767772        {0x00008340, 0x00010380},
    768         {0x00008344, 0x00481083},/*< note: disabled ADHOC_MCAST_KEYID feature */
     773        {0x00008344, 0x00481083},  /**< Note: disabled ADHOC_MCAST_KEYID feature */
    769774        {0x00007010, 0x00000030},
    770775        {0x00007034, 0x00000002},
Note: See TracChangeset for help on using the changeset viewer.