linux/drivers/staging/gdm72xx/hci.h
<<
>>
Prefs
   1/*
   2 * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved.
   3 *
   4 * This software is licensed under the terms of the GNU General Public
   5 * License version 2, as published by the Free Software Foundation, and
   6 * may be copied, distributed, and modified under those terms.
   7 *
   8 * This program is distributed in the hope that it will be useful,
   9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11 * GNU General Public License for more details.
  12 */
  13
  14#ifndef HCI_H_20080801
  15#define HCI_H_20080801
  16
  17#define HCI_HEADER_SIZE         4
  18#define HCI_VALUE_OFFS          (HCI_HEADER_SIZE)
  19#define HCI_MAX_PACKET          2048
  20#define HCI_MAX_PARAM           (HCI_MAX_PACKET-HCI_HEADER_SIZE)
  21#define HCI_MAX_TLV                     32
  22
  23/* CMD-EVT */
  24
  25/* Category 0 */
  26#define WIMAX_RESET                             0x0000
  27#define WIMAX_SET_INFO                  0x0001
  28#define WIMAX_GET_INFO                  0x0002
  29#define WIMAX_GET_INFO_RESULT   0x8003
  30#define WIMAX_RADIO_OFF                 0x0004
  31#define WIMAX_RADIO_ON                  0x0006
  32#define WIMAX_WIMAX_RESET               0x0007  /* Is this still here */
  33
  34/* Category 1 */
  35#define WIMAX_NET_ENTRY                 0x0100
  36#define WIMAX_NET_DISCONN               0x0102
  37#define WIMAX_ENTER_SLEEP               0x0103
  38#define WIMAX_EXIT_SLEEP                0x0104
  39#define WIMAX_ENTER_IDLE                0x0105
  40#define WIMAX_EXIT_IDLE                 0x0106
  41#define WIMAX_MODE_CHANGE               0x8108
  42#define WIMAX_HANDOVER                  0x8109  /* obsolete */
  43
  44#define WIMAX_SCAN                              0x010d
  45#define WIMAX_SCAN_COMPLETE             0x810e
  46#define WIMAX_SCAN_RESULT               0x810f
  47
  48#define WIMAX_CONNECT                   0x0110
  49#define WIMAX_CONNECT_START             0x8111
  50#define WIMAX_CONNECT_COMPLETE  0x8112
  51#define WIMAX_ASSOC_START               0x8113
  52#define WIMAX_ASSOC_COMPLETE    0x8114
  53#define WIMAX_DISCONN_IND               0x8115
  54#define WIMAX_ENTRY_IND                 0x8116
  55#define WIMAX_HO_START                  0x8117
  56#define WIMAX_HO_COMPLETE               0x8118
  57#define WIMAX_RADIO_STATE_IND   0x8119
  58#define WIMAX_IP_RENEW_IND              0x811a
  59
  60#define WIMAX_DISCOVER_NSP                      0x011d
  61#define WIMAX_DISCOVER_NSP_RESULT       0x811e
  62
  63#define WIMAX_SDU_TX_FLOW               0x8125
  64
  65/* Category 2 */
  66#define WIMAX_TX_EAP            0x0200
  67#define WIMAX_RX_EAP            0x8201
  68#define WIMAX_TX_SDU            0x0202
  69#define WIMAX_RX_SDU            0x8203
  70#define WIMAX_RX_SDU_AGGR       0x8204
  71#define WIMAX_TX_SDU_AGGR       0x0205
  72
  73/* Category 3 */
  74#define WIMAX_DM_CMD                            0x030a
  75#define WIMAX_DM_RSP                            0x830b
  76
  77#define WIMAX_CLI_CMD                           0x030c
  78#define WIMAX_CLI_RSP                           0x830d
  79
  80#define WIMAX_DL_IMAGE                          0x0310
  81#define WIMAX_DL_IMAGE_STATUS           0x8311
  82#define WIMAX_UL_IMAGE                          0x0312
  83#define WIMAX_UL_IMAGE_RESULT           0x8313
  84#define WIMAX_UL_IMAGE_STATUS           0x0314
  85
  86#define WIMAX_EVT_MODEM_REPORT          0x8325
  87
  88/* Category 0xF */
  89#define WIMAX_FSM_UPDATE                        0x8F01
  90#define WIMAX_IF_UPDOWN                         0x8F02
  91        #define WIMAX_IF_UP                             1
  92        #define WIMAX_IF_DOWN                   2
  93
  94/* WIMAX mode */
  95#define W_NULL                          0
  96#define W_STANDBY                       1
  97#define W_OOZ                           2
  98#define W_AWAKE                         3
  99#define W_IDLE                          4
 100#define W_SLEEP                         5
 101#define W_WAIT                          6
 102
 103#define W_NET_ENTRY_RNG         0x80
 104#define W_NET_ENTRY_SBC         0x81
 105#define W_NET_ENTRY_PKM         0x82
 106#define W_NET_ENTRY_REG         0x83
 107#define W_NET_ENTRY_DSX         0x84
 108
 109#define W_NET_ENTRY_RNG_FAIL    0x1100100
 110#define W_NET_ENTRY_SBC_FAIL    0x1100200
 111#define W_NET_ENTRY_PKM_FAIL    0x1102000
 112#define W_NET_ENTRY_REG_FAIL    0x1103000
 113#define W_NET_ENTRY_DSX_FAIL    0x1104000
 114
 115/* Scan Type */
 116#define W_SCAN_ALL_CHANNEL                              0
 117#define W_SCAN_ALL_SUBSCRIPTION                 1
 118#define W_SCAN_SPECIFIED_SUBSCRIPTION   2
 119
 120/*
 121 * TLV
 122 *
 123 * [31:31] indicates the type is composite.
 124 * [30:16] is the length of the type. 0 length means length is variable.
 125 * [15:0] is the actual type.
 126 *
 127 */
 128#define TLV_L(x)                (((x) >> 16) & 0xff)
 129#define TLV_T(x)                        ((x) & 0xff)
 130#define TLV_COMPOSITE(x)        ((x) >> 31)
 131
 132/* GENERAL */
 133#define T_MAC_ADDRESS                   (0x00   | (6 << 16))
 134#define T_BSID                          (0x01   | (6 << 16))
 135#define T_MSK                           (0x02   | (64 << 16))
 136#define T_RSSI_THRSHLD                  (0x03   | (1 << 16))
 137#define T_FREQUENCY                     (0x04   | (4 << 16))
 138#define T_CONN_CS_TYPE                  (0x05   | (1 << 16))
 139#define T_HOST_IP_VER                   (0x06   | (1 << 16))
 140#define T_STBY_SCAN_INTERVAL            (0x07   | (4  << 16))
 141#define T_OOZ_SCAN_INTERVAL             (0x08   | (4 << 16))
 142#define T_IMEI                          (0x09   | (8 << 16))
 143#define T_PID                           (0x0a   | (12 << 16))
 144
 145#define T_CAPABILITY                    (0x1a   | (4 << 16))
 146#define T_RELEASE_NUMBER                (0x1b   | (4 << 16))
 147#define T_DRIVER_REVISION               (0x1c   | (4 << 16))
 148#define T_FW_REVISION                   (0x1d   | (4 << 16))
 149#define T_MAC_HW_REVISION               (0x1e   | (4 << 16))
 150#define T_PHY_HW_REVISION               (0x1f   | (4 << 16))
 151
 152/* HANDOVER */
 153#define T_SCAN_INTERVAL         (0x20   | (1 << 16))
 154
 155#define T_RSC_RETAIN_TIME               (0x2f   | (2 << 16))
 156
 157/* SLEEP */
 158#define T_TYPE1_ISW                     (0x40   | (1 << 16))
 159
 160#define T_SLP_START_TO                  (0x4a   | (2 << 16))
 161
 162/* IDLE */
 163#define T_IDLE_MODE_TO                  (0x50   | (2 << 16))
 164
 165#define T_IDLE_START_TO         (0x54   | (2 << 16))
 166
 167/* MONITOR */
 168#define T_RSSI                          (0x60   | (1 << 16))
 169#define T_CINR                          (0x61   | (1 << 16))
 170#define T_TX_POWER                      (0x6a   | (1 << 16))
 171#define T_CUR_FREQ                      (0x7f   | (4 << 16))
 172
 173
 174/* WIMAX */
 175#define T_MAX_SUBSCRIPTION              (0xa1   | (1 << 16))
 176#define T_MAX_SF                        (0xa2   | (1 << 16))
 177#define T_PHY_TYPE                      (0xa3   | (1 << 16))
 178#define T_PKM                           (0xa4   | (1 << 16))
 179#define T_AUTH_POLICY                   (0xa5   | (1 << 16))
 180#define T_CS_TYPE                       (0xa6   | (2 << 16))
 181#define T_VENDOR_NAME                   (0xa7   | (0 << 16))
 182#define T_MOD_NAME                      (0xa8   | (0 << 16))
 183#define T_PACKET_FILTER         (0xa9   | (1 << 16))
 184#define T_NSP_CHANGE_COUNT              (0xaa   | (4 << 16))
 185#define T_RADIO_STATE                   (0xab   | (1 << 16))
 186#define T_URI_CONTACT_TYPE              (0xac   | (1 << 16))
 187#define T_URI_TEXT                      (0xad   | (0 << 16))
 188#define T_URI                           (0xae   | (0 << 16))
 189#define T_ENABLE_AUTH                   (0xaf   | (1 << 16))
 190#define T_TIMEOUT                       (0xb0   | (2 << 16))
 191#define T_RUN_MODE                      (0xb1   | (1 << 16))
 192#define T_OMADMT_VER                    (0xb2   | (4 << 16))
 193/* This is measured in seconds from 00:00:00 GMT January 1, 1970. */
 194#define T_RTC_TIME                      (0xb3   | (4 << 16))
 195#define T_CERT_STATUS                   (0xb4   | (4 << 16))
 196#define T_CERT_MASK                     (0xb5   | (4 << 16))
 197#define T_EMSK                          (0xb6   | (64 << 16))
 198
 199/* Subscription TLV */
 200#define T_SUBSCRIPTION_LIST             (0xd1   | (0 << 16) | (1 << 31))
 201#define T_H_NSPID                       (0xd2   | (3 << 16))
 202#define T_NSP_NAME                      (0xd3   | (0 << 16))
 203#define T_SUBSCRIPTION_NAME             (0xd4   | (0 << 16))
 204#define T_SUBSCRIPTION_FLAG             (0xd5   | (2 << 16))
 205#define T_V_NSPID                       (0xd6   | (3 << 16))
 206#define T_NAP_ID                        (0xd7   | (3 << 16))
 207#define T_PREAMBLES                     (0xd8   | (15 << 16))
 208#define T_BW                            (0xd9   | (4 << 16))
 209#define T_FFTSIZE                       (0xda   | (4 << 16))
 210#define T_DUPLEX_MODE                   (0xdb   | (4 << 16))
 211
 212struct hci_s {
 213        unsigned short cmd_evt;
 214        unsigned short length;
 215        unsigned char  data[0];
 216} __packed;
 217
 218#endif
 219